66 G4cout <<
"G4LivermoreGammaConversionModel is constructed " <<
G4endl;
96 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversionModel."
118 char* path = getenv(
"G4LEDATA");
125 for(
G4int i=0; i<numOfCouples; ++i)
133 for (
G4int j=0; j<nelm; ++j)
167 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel"
171 if(
data[Z]) {
return; }
173 const char* datadir = path;
177 datadir = getenv(
"G4LEDATA");
180 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
182 "Environment variable G4LEDATA not defined");
187 std::ostringstream ost;
188 ost << datadir <<
"/livermore/pair/pp-cs-" << Z <<
".dat";
189 std::ifstream
fin(ost.str().c_str());
194 ed <<
"G4LivermoreGammaConversionModel data file <" << ost.str().c_str()
195 <<
"> is not opened!" <<
G4endl;
196 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
198 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
205 <<
" is opened by G4LivermoreGammaConversionModel" <<
G4endl;}
210 data[
Z] ->SetSpline(
true);
221 G4cout <<
"G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom() Z= "
239 if(!pv) {
return xs; }
242 xs = pv->
Value(GammaEnergy);
246 G4cout <<
"*** Gamma conversion xs for Z=" << Z <<
" at energy E(MeV)="
257 std::vector<G4DynamicParticle*>* fvect,
274 G4cout <<
"Calling SampleSecondaries() of G4LivermoreGammaConversionModel"
288 if (photonEnergy < smallEnergy )
290 epsilon = epsilon0Local + (0.5 - epsilon0Local) * rndmEngine->
flat();
320 if (photonEnergy > midEnergy) { fZ += 8. * (element->
GetfCoulomb()); }
328 G4double epsilon1 = 0.5 - 0.5 * std::sqrt(1. - screenMin / screenMax) ;
330 G4double epsilonRange = 0.5 - epsilonMin ;
343 if (normF1 > (normF1 + normF2)*rndmEngine->
flat() )
345 epsilon = 0.5 - epsilonRange *
G4Exp(
G4Log(rndmEngine->
flat())/3.);
346 screen = screenFactor / (epsilon * (1. -
epsilon));
351 epsilon = epsilonMin + epsilonRange * rndmEngine->
flat();
352 screen = screenFactor / (epsilon * (1 -
epsilon));
355 }
while ( gReject < rndmEngine->
flat() );
364 if (rndmEngine->
flat() > 0.5)
366 electronTotEnergy = (1. -
epsilon) * photonEnergy;
367 positronTotEnergy = epsilon * photonEnergy;
371 positronTotEnergy = (1. -
epsilon) * photonEnergy;
372 electronTotEnergy = epsilon * photonEnergy;
380 static const G4double a2 = 0.5333333333;
382 G4double u = (0.25 > rndmEngine->
flat()) ? uu*a1 : uu*a2;
385 G4double sinte = std::sin(thetaEle);
386 G4double coste = std::cos(thetaEle);
389 G4double sintp = std::sin(thetaPos);
390 G4double costp = std::cos(thetaPos);
402 G4ThreeVector electronDirection (sinte*cosp, sinte*sinp, coste);
403 electronDirection.
rotateUz(photonDirection);
412 G4ThreeVector positronDirection (-sintp*cosp, -sintp*sinp, costp);
413 positronDirection.
rotateUz(photonDirection);
420 fvect->push_back(particle1);
421 fvect->push_back(particle2);
439 G4AutoLock l(&LivermoreGammaConversionModelMutex);
480 tcross = (0.0 < cross) ? tcross/cross : 0.0;
void ReadData(size_t Z, const char *path=nullptr)
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double ScreenFunction2(G4double screenVariable)
G4int NumberOfBinsPerDecade() const
std::ostringstream G4ExceptionDescription
static constexpr double MeV
const G4ThreeVector & GetMomentumDirection() const
const G4ElementVector * GetElementVector() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
Hep3Vector & rotateUz(const Hep3Vector &)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double Value(G4double theEnergy, size_t &lastidx) const
std::vector< G4EmElementSelector * > * GetElementSelectors()
void SetCurrentCouple(const G4MaterialCutsCouple *)
G4double G4Log(G4double x)
G4double LowEnergyLimit() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0.0, G4double cut=0.0, G4double emax=DBL_MAX)
const XML_Char const XML_Char * data
void InitialiseProbability(const G4ParticleDefinition *, G4int Z)
#define G4MUTEX_INITIALIZER
static constexpr double millibarn
G4ParticleDefinition * GetDefinition() const
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double MinPrimaryEnergy(const G4Material *, const G4ParticleDefinition *, G4double)
G4VEmModel * GetTripletModel()
static constexpr double electron_mass_c2
static constexpr double MeV
static constexpr double twopi
static G4double tripletLowEnergy
static G4double lowEnergyLimit
static G4Positron * Positron()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
static G4int verboseLevel
static G4Electron * Electron()
size_t GetTableSize() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)=0
static G4int nbinsTriplet
const G4MaterialCutsCouple * CurrentCouple() const
double epsilon(double density, double temperature)
virtual ~G4LivermoreGammaConversionModel()
static G4ProductionCutsTable * GetProductionCutsTable()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Element * > G4ElementVector
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4LivermoreGammaConversionModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="LivermoreConversion")
G4IonisParamElm * GetIonisation() const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4LPhysicsFreeVector * data[100]
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
virtual G4double MinPrimaryEnergy(const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
G4double ScreenFunction1(G4double screenVariable)
G4double GetfCoulomb() const
G4double GetlogZ3() const
G4double HighEnergyLimit() const
void ProposeTrackStatus(G4TrackStatus status)
static constexpr double GeV
static constexpr double GeV
static G4double tripletHighEnergy
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
static G4EmParameters * Instance()
static G4PhysicsLogVector * probTriplet[100]
size_t GetNumberOfElements() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ParticleChangeForGamma * fParticleChange