70 :
G4VEmModel(nam),fParticleChange(nullptr), fAtomDeexcitation(nullptr),
71 maxZ(100),nShellLimit(100),fDeexcitationActive(false),isInitialised(false)
88 G4cout <<
"Livermore PhotoElectric is constructed "
136 G4cout <<
"Calling G4LivermorePhotoElectricModel::Initialise() " <<
G4endl;
150 size_t numElems = (*elemTable).size();
151 for(
size_t ie = 0; ie < numElems; ++ie)
163 G4cout <<
"Loaded cross section files for new LivermorePhotoElectric model"
178 G4cout <<
"LivermorePhotoElectric model is initialized " <<
G4endl
221 G4cout <<
"\n G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom():"
226 if(
Z >
maxZ) {
return cs; }
273 <<
" Z= " <<
Z <<
" cross(barn)= " << cs/
barn <<
G4endl;
282 std::vector<G4DynamicParticle*>* fvect,
289 G4cout <<
"G4LivermorePhotoElectricModel::SampleSecondaries() Egamma(keV)= "
349 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
351 idx = shellIdx*7 + 2;
362 if(cs >= cs0) {
break; }
365 if(shellIdx >=
nn) { shellIdx =
nn-1; }
383 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
385 idx = shellIdx*7 + 2;
391 if(cs >= cs0) {
break; }
394 if(shellIdx >=
nn) {shellIdx =
nn-1;}
412 for(
size_t j=0; j<
nn; ++j) {
415 if(gammaEnergy > (*(
fParamLow[
Z]))[7*shellIdx+1]) {
418 if(cs <= 0.0 || j+1 ==
nn) {
break;}
461 G4int nbefore = fvect->size();
464 G4int nafter = fvect->size();
465 if(nafter > nbefore) {
467 for (
G4int j=nbefore; j<nafter; ++j) {
469 G4double e = ((*fvect)[j])->GetKineticEnergy();
470 if(esec + e > edep) {
473 ((*fvect)[j])->SetKineticEnergy(e);
476 for (
G4int jj=nafter-1; jj>j; --jj) {
501 const char* path = std::getenv(
"G4LEDATA");
503 std::ostringstream ost;
505 ost << path <<
"/livermore/phot_epics2014/";
507 ost << path <<
"/epics2017/phot/";
512 G4Exception(
"G4SeltzerBergerModel::FindDirectoryPath()",
"em0006",
514 "Environment variable G4LEDATA not defined");
526 G4cout <<
"Calling ReadData() of G4LivermorePhotoElectricModel"
535 std::ostringstream ost;
537 std::ifstream fin(ost.str().c_str());
538 if( !fin.is_open()) {
540 ed <<
"G4LivermorePhotoElectricModel data file <" << ost.str().c_str()
541 <<
"> is not opened!" <<
G4endl;
542 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
544 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
548 G4cout <<
"File " << ost.str().c_str()
549 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
561 std::ostringstream ost1;
563 std::ifstream fin1(ost1.str().c_str());
564 if( !fin1.is_open()) {
566 ed <<
"G4LivermorePhotoElectricModel data file <" << ost1.str().c_str()
567 <<
"> is not opened!" <<
G4endl;
568 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
570 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
574 G4cout <<
"File " << ost1.str().c_str()
575 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
578 if(fin1.fail()) {
return; }
579 if(0 > n1 || n1 >=
INT_MAX) { n1 = 0; }
582 if(fin1.fail()) {
return; }
583 if(0 > n2 || n2 >=
INT_MAX) { n2 = 0; }
586 if(fin1.fail()) {
return; }
591 for(
G4int i=0; i<n1; ++i) {
592 for(
G4int j=0; j<7; ++j) {
594 if(0 == j) { x *=
MeV; }
606 std::ostringstream ost1_low;
608 std::ifstream fin1_low(ost1_low.str().c_str());
609 if( !fin1_low.is_open()) {
611 ed <<
"G4LivermorePhotoElectricModel data file <" << ost1_low.str().c_str()
612 <<
"> is not opened!" <<
G4endl;
613 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
615 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
619 G4cout <<
"File " << ost1_low.str().c_str()
620 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
623 if(fin1_low.fail()) {
return; }
624 if(0 > n1_low || n1_low >=
INT_MAX) { n1_low = 0; }
627 if(fin1_low.fail()) {
return; }
628 if(0 > n2_low || n2_low >=
INT_MAX) { n2_low = 0; }
631 if(fin1_low.fail()) {
return; }
636 for(
G4int i=0; i<n1_low; ++i) {
637 for(
G4int j=0; j<7; ++j) {
639 if(0 == j) { x_low *=
MeV; }
640 else { x_low *=
barn; }
652 std::ostringstream ost2;
654 std::ifstream fin2(ost2.str().c_str());
655 if( !fin2.is_open()) {
657 ed <<
"G4LivermorePhotoElectricModel data file <" << ost2.str().c_str()
658 <<
"> is not opened!" <<
G4endl;
659 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
661 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
665 G4cout <<
"File " << ost2.str().c_str()
666 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
671 for(
G4int i=0; i<n2; ++i) {
672 fin2 >> x >> y >> n3 >> n4;
674 for(
G4int j=0; j<n3; ++j) {
686 std::ostringstream ost3;
688 std::ifstream fin3(ost3.str().c_str());
689 if( !fin3.is_open()) {
691 ed <<
"G4LivermorePhotoElectricModel data file <" << ost3.str().c_str()
692 <<
"> is not opened!" <<
G4endl;
693 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
695 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
699 G4cout <<
"File " << ost3.str().c_str()
700 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
712 if(Z < 1 || Z >
maxZ) {
return -1;}
729#ifdef G4MULTITHREADED
734#ifdef G4MULTITHREADED
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static constexpr double barn
static constexpr double keV
static constexpr double eV
static constexpr double MeV
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
G4PhysicsVector * GetComponentDataByIndex(G4int Z, G4int idx)
void InitialiseForComponent(G4int Z, G4int nComponents=0)
G4double GetValueForComponent(G4int Z, G4int idx, G4double kinEnergy)
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)
G4int GetComponentID(G4int Z, G4int idx)
static G4ElementTable * GetElementTable()
static G4EmParameters * Instance()
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double energy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
static G4PhysicsFreeVector * fCrossSectionLE[101]
static G4int fNShells[101]
static G4String fDataDirectory
static G4Material * fWater
static G4double fWaterEnergyLimit
G4VAtomDeexcitation * fAtomDeexcitation
G4ParticleChangeForGamma * fParticleChange
std::vector< G4double > fSandiaCof
static G4int fNShellsUsed[101]
G4double GetBindingEnergy(G4int Z, G4int shell)
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
static G4PhysicsFreeVector * fCrossSection[101]
const G4String & FindDirectoryPath()
const G4ParticleDefinition * theElectron
G4bool fDeexcitationActive
virtual ~G4LivermorePhotoElectricModel()
static std::vector< G4double > * fParamHigh[101]
static std::vector< G4double > * fParamLow[101]
static G4ElementData * fShellCrossSection
G4LivermorePhotoElectricModel(const G4String &nam="LivermorePhElectric")
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double energy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX) override
const G4ParticleDefinition * theGamma
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
G4SandiaTable * GetSandiaTable() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void PutValues(const std::size_t index, const G4double energy, const G4double value)
void ScaleVector(const G4double factorE, const G4double factorV)
G4double Energy(const std::size_t index) const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4bool IsFluoActive() const
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetDeexcitationFlag(G4bool val)
void SetAngularDistribution(G4VEmAngularDistribution *)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double bindingEnergy(G4int A, G4int Z)