43G4int G4LivermoreNuclearGammaConversionModel::maxZ = 100;
48:
G4VEmModel(nam),isInitialised(false),smallEnergy(2.*MeV)
52 lowEnergyLimit = 2.0*electron_mass_c2;
62 G4cout <<
"G4LivermoreNuclearGammaConversionModel is constructed " <<
G4endl;
71 for(
G4int i=0; i<maxZ; ++i) {
89 G4cout <<
"Calling Initialise() of G4LivermoreNuclearGammaConversionModel."
106 char* path = std::getenv(
"G4LEDATA");
113 for(
G4int i=0; i<numOfCouples; ++i)
120 for (
G4int j=0; j<nelm; ++j)
122 G4int Z = (
G4int)(*theElementVector)[j]->GetZ();
124 else if(Z > maxZ) { Z = maxZ; }
125 if(!data[Z]) { ReadData(Z, path); }
129 if(isInitialised) {
return; }
131 isInitialised =
true;
149 return lowEnergyLimit;
154void G4LivermoreNuclearGammaConversionModel::ReadData(
size_t Z,
const char* path)
156 if (verboseLevel > 1)
158 G4cout <<
"Calling ReadData() of G4LivermoreNuclearGammaConversionModel"
163 if(data[Z]) {
return; }
165 const char* datadir = path;
169 datadir = std::getenv(
"G4LEDATA");
172 G4Exception(
"G4LivermoreNuclearGammaConversionModel::ReadData()",
174 "Environment variable G4LEDATA not defined");
185 std::ostringstream ost;
186 ost << datadir <<
"/livermore/pairdata/pp-pair-cs-" << Z <<
".dat";
187 std::ifstream fin(ost.str().c_str());
192 ed <<
"G4LivermoreNuclearGammaConversionModel data file <" << ost.str().c_str()
193 <<
"> is not opened!" <<
G4endl;
194 G4Exception(
"G4LivermoreNuclearGammaConversionModel::ReadData()",
196 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
203 if(verboseLevel > 3) {
G4cout <<
"File " << ost.str()
204 <<
" is opened by G4LivermoreNuclearGammaConversionModel" <<
G4endl;}
222 if (verboseLevel > 1)
224 G4cout <<
"Calling ComputeCrossSectionPerAtom() of G4LivermoreNuclearGammaConversionModel"
228 if (GammaEnergy < lowEnergyLimit) {
return 0.0; }
234 if(intZ < 1 || intZ > maxZ) {
return xs; }
244 if(!pv) {
return xs; }
247 xs = pv->
Value(GammaEnergy);
252 G4cout <<
"****** DEBUG: tcs value for Z=" << Z <<
" at energy (MeV)="
253 << GammaEnergy/MeV <<
G4endl;
254 G4cout <<
" cs (Geant4 internal unit)=" << xs <<
G4endl;
255 G4cout <<
" -> first cs value in EADL data file (iu) =" << (*pv)[0] <<
G4endl;
256 G4cout <<
" -> last cs value in EADL data file (iu) =" << (*pv)[n] <<
G4endl;
257 G4cout <<
"*********************************************************" <<
G4endl;
267 std::vector<G4DynamicParticle*>* fvect,
283 if (verboseLevel > 1) {
284 G4cout <<
"Calling SampleSecondaries() of G4LivermoreNuclearGammaConversionModel"
292 G4double epsilon0Local = electron_mass_c2 / photonEnergy ;
295 if (photonEnergy < smallEnergy )
308 G4cout <<
"G4LivermoreNuclearGammaConversionModel::SampleSecondaries - element = 0"
315 G4cout <<
"G4LivermoreNuclearGammaConversionModel::SampleSecondaries - ionisation = 0"
322 if (photonEnergy > 50. * MeV) fZ += 8. * (element->
GetfCoulomb());
327 G4double screenMin = std::min(4.*screenFactor,screenMax) ;
330 G4double epsilon1 = 0.5 - 0.5 * std::sqrt(1. - screenMin / screenMax) ;
331 G4double epsilonMin = std::max(epsilon0Local,epsilon1);
332 G4double epsilonRange = 0.5 - epsilonMin ;
338 G4double f10 = ScreenFunction1(screenMin) - fZ;
339 G4double f20 = ScreenFunction2(screenMin) - fZ;
340 G4double normF1 = std::max(f10 * epsilonRange * epsilonRange,0.);
341 G4double normF2 = std::max(1.5 * f20,0.);
349 gReject = (ScreenFunction1(screen) - fZ) / f10 ;
355 gReject = (ScreenFunction2(screen) - fZ) / f20 ;
368 electronTotEnergy = (1. -
epsilon) * photonEnergy;
369 positronTotEnergy =
epsilon * photonEnergy;
373 positronTotEnergy = (1. -
epsilon) * photonEnergy;
374 electronTotEnergy =
epsilon * photonEnergy;
396 G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
397 G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
400 G4double dxEle= std::sin(thetaEle)*std::cos(phi),dyEle= std::sin(thetaEle)*std::sin(phi),dzEle=std::cos(thetaEle);
401 G4double dxPos=-std::sin(thetaPos)*std::cos(phi),dyPos=-std::sin(thetaPos)*std::sin(phi),dzPos=std::cos(thetaPos);
408 G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
411 electronDirection.
rotateUz(photonDirection);
418 G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
421 positronDirection.
rotateUz(photonDirection);
428 fvect->push_back(particle1);
429 fvect->push_back(particle2);
440G4LivermoreNuclearGammaConversionModel::ScreenFunction1(
G4double screenVariable)
446 if (screenVariable > 1.)
447 value = 42.24 - 8.368 *
G4Log(screenVariable + 0.952);
449 value = 42.392 - screenVariable * (7.796 - 1.961 * screenVariable);
457G4LivermoreNuclearGammaConversionModel::ScreenFunction2(
G4double screenVariable)
463 if (screenVariable > 1.)
464 value = 42.24 - 8.368 *
G4Log(screenVariable + 0.952);
466 value = 41.405 - screenVariable * (5.828 - 0.8945 * screenVariable);
480 G4AutoLock l(&LivermoreNuclearGammaConversionModelMutex);
483 if(!data[Z]) { ReadData(Z); }
double epsilon(double density, double temperature)
std::vector< G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
G4double GetfCoulomb() const
G4IonisParamElm * GetIonisation() const
G4double GetlogZ3() const
virtual G4double MinPrimaryEnergy(const G4Material *, const G4ParticleDefinition *, G4double)
G4LivermoreNuclearGammaConversionModel(const G4ParticleDefinition *p=0, const G4String &nam="LivermoreNuclearConversion")
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
virtual ~G4LivermoreNuclearGammaConversionModel()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4double Value(G4double theEnergy, std::size_t &lastidx) const
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::size_t GetVectorLength() const
static G4Positron * Positron()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double HighEnergyLimit() const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
void ProposeTrackStatus(G4TrackStatus status)