61 :
G4VEmModel(nam),fParticleChange(0),isInitialised(false)
77 G4cout <<
"Livermore Polarized Rayleigh is constructed " <<
G4endl
115 G4cout <<
"Calling G4LivermorePolarizedRayleighModel::Initialise()" <<
G4endl;
123 G4String formFactorFile =
"rayl/re-ff-";
131 char* path = getenv(
"G4LEDATA");
136 for(
G4int i=0; i<numOfCouples; ++i)
144 for (
G4int j=0; j<nelm; ++j)
175 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
181 const char* datadir = path;
185 datadir = getenv(
"G4LEDATA");
188 G4Exception(
"G4LivermoreRayleighModelModel::ReadData()",
"em0006",
190 "Environment variable G4LEDATA not defined");
202 std::ostringstream ostCS;
203 ostCS << datadir <<
"/livermore/rayl/re-cs-" << Z <<
".dat";
204 std::ifstream finCS(ostCS.str().c_str());
206 if( !finCS .is_open() )
209 ed <<
"G4LivermorePolarizedRayleighModel data file <" << ostCS.str().c_str()
210 <<
"> is not opened!" <<
G4endl;
212 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
218 G4cout <<
"File " << ostCS.str()
219 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
235 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
245 if(intZ < 1 || intZ >
maxZ) {
return xs; }
254 if(!pv) {
return xs; }
261 }
else if(e >= pv->
Energy(0)) {
291 G4cout <<
"Calling SampleSecondaries() of G4LivermorePolarizedRayleighModel" <<
G4endl;
333 zDir=outcomingPhotonCosTheta;
334 xDir=std::sqrt(1-outcomingPhotonCosTheta*outcomingPhotonCosTheta);
336 xDir*=std::cos(outcomingPhotonPhi);
337 yDir*=std::sin(outcomingPhotonPhi);
344 G4ThreeVector outcomingPhotonPolarization(xPrime*std::cos(beta) + yPrime*std::sin(beta));
382 if (incomingPhotonEnergy > 5.*
MeV)
393 fCosTheta = (1.+cosTheta*cosTheta)/2.;
397 x = xFactor*std::sqrt((1.-cosTheta)/2.);
428 sin2Theta=1.-cosTheta*cosTheta;
433 cosPhi = std::cos(phi);
434 phiProbability= 1. - sin2Theta*cosPhi*cosPhi;
463 if ((!photonPolarization.
isOrthogonal(photonMomentumDirection, 1
e-6)) || photonPolarization.
mag()==0.)
476 photonPolarization=e1+e2;
478 else if (photonPolarization.
howOrthogonal(photonMomentumDirection) != 0.)
483 photonPolarization=photonPolarization.
perpPart(photonMomentumDirection);
486 return photonPolarization.
unit();
497 G4AutoLock l(&LivermorePolarizedRayleighModelMutex);
G4double Energy(size_t index) const
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
std::ostringstream G4ExceptionDescription
Hep3Vector perpPart() const
static constexpr double MeV
G4LivermorePolarizedRayleighModel(const G4ParticleDefinition *p=0, const G4String &nam="LivermorePolarizedRayleigh")
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
const G4ThreeVector & GetMomentumDirection() const
G4double GeneratePhi(G4double cosTheta) const
const G4ElementVector * GetElementVector() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ReadData(size_t Z, const char *path=0)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposePolarization(const G4ThreeVector &dir)
G4double Value(G4double theEnergy, size_t &lastidx) const
std::vector< G4EmElementSelector * > * GetElementSelectors()
static constexpr double h_Planck
bool isOrthogonal(const Hep3Vector &v, double epsilon=tolerance) const
G4double LowEnergyLimit() const
G4ParticleChangeForGamma * fParticleChange
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
#define G4MUTEX_INITIALIZER
G4ParticleDefinition * GetDefinition() const
G4double GeneratePolarizationAngle(void) const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4ThreeVector GetPhotonPolarization(const G4DynamicParticle &photon)
static constexpr double twopi
static constexpr double eV
double howOrthogonal(const Hep3Vector &v) const
size_t GetTableSize() const
static G4VEMDataSet * formFactorData
Hep3Vector cross(const Hep3Vector &) const
static G4LPhysicsFreeVector * dataCS[101]
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
static G4ProductionCutsTable * GetProductionCutsTable()
virtual ~G4LivermorePolarizedRayleighModel()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual G4bool LoadData(const G4String &fileName)=0
const G4ThreeVector & GetPolarization() const
std::vector< G4Element * > G4ElementVector
static constexpr double c_light
G4double GetKineticEnergy() const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
Hep3Vector orthogonal() const
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double GenerateCosTheta(G4double incomingPhotonEnergy, G4int zAtom) const
G4double HighEnergyLimit() const
void ProposeTrackStatus(G4TrackStatus status)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static constexpr double GeV
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
size_t GetNumberOfElements() const
size_t GetVectorLength() const