68 nShellLimit(100),fDeexcitationActive(false),isInitialised(false),
69 fAtomDeexcitation(nullptr)
86 G4cout <<
"Livermore PhotoElectric is constructed "
123 G4cout <<
"Calling G4LivermorePhotoElectricModel::Initialise() " <<
G4endl;
135 char* path = getenv(
"G4LEDATA");
141 for(
G4int i=0; i<numOfCouples; ++i) {
148 for (
G4int j=0; j<nelm; ++j) {
157 G4cout <<
"Loaded cross section files for new LivermorePhotoElectric model"
172 G4cout <<
"LivermorePhotoElectric model is initialized " <<
G4endl
215 G4cout <<
"\n G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom():"
216 <<
" Z= " << ZZ <<
" R(keV)= " << energy/
keV <<
G4endl;
220 if(Z < 1 || Z >=
maxZ) {
return cs; }
251 else if(energy >= (*(
fParamLow[Z]))[0]) {
270 G4cout <<
"G4LivermorePhotoElectricModel: E(keV)= " << energy/
keV
271 <<
" Z= " << Z <<
" cross(barn)= " << cs/
barn <<
G4endl;
280 std::vector<G4DynamicParticle*>* fvect,
287 G4cout <<
"G4LivermorePhotoElectricModel::SampleSecondaries() Egamma(keV)= "
339 G4int idx = nn*7 - 5;
351 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
353 idx = shellIdx*7 + 2;
364 if(cs >= cs0) {
break; }
367 if(shellIdx >= nn) { shellIdx = nn-1; }
370 else if(gammaEnergy >= (*(
fParamLow[Z]))[0])
377 G4int idx = nn*7 - 5;
386 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
388 idx = shellIdx*7 + 2;
389 if(gammaEnergy > (*(
fParamLow[Z]))[idx-1])
394 if(cs >= cs0) {
break; }
397 if(shellIdx >= nn) {shellIdx = nn-1;}
415 for(
size_t j=0; j<
nn; ++j) {
418 if(gammaEnergy > (*(
fParamLow[Z]))[7*shellIdx+1]) {
421 if(cs <= 0.0 || j+1 == nn) {
break;}
444 if(gammaEnergy < bindingEnergy) {
465 fvect->push_back(electron);
471 G4int nbefore = fvect->size();
474 G4int nafter = fvect->size();
475 if(nafter > nbefore) {
477 for (
G4int j=nbefore; j<nafter; ++j) {
479 G4double e = ((*fvect)[j])->GetKineticEnergy();
480 if(esec + e > edep) {
483 ((*fvect)[j])->SetKineticEnergy(e);
486 for (
G4int jj=nafter-1; jj>j; --jj) {
511 G4cout <<
"Calling ReadData() of G4LivermorePhotoElectricModel"
517 const char* datadir = path;
521 datadir = getenv(
"G4LEDATA");
524 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
526 "Environment variable G4LEDATA not defined");
535 std::ostringstream ost;
536 ost << datadir <<
"/livermore/phot_epics2014/pe-cs-" << Z <<
".dat";
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 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;}
560 std::ostringstream ost1;
561 ost1 << datadir <<
"/livermore/phot_epics2014/pe-high-" << Z <<
".dat";
562 std::ifstream fin1(ost1.str().c_str());
563 if( !fin1.is_open()) {
565 ed <<
"G4LivermorePhotoElectricModel data file <" << ost1.str().c_str()
566 <<
"> is not opened!" <<
G4endl;
567 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
569 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
573 G4cout <<
"File " << ost1.str().c_str()
574 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
577 if(fin1.fail()) {
return; }
578 if(0 > n1 || n1 >=
INT_MAX) { n1 = 0; }
581 if(fin1.fail()) {
return; }
582 if(0 > n2 || n2 >=
INT_MAX) { n2 = 0; }
585 if(fin1.fail()) {
return; }
590 for(
G4int i=0; i<n1; ++i) {
591 for(
G4int j=0; j<7; ++j) {
593 if(0 == j) { x *=
MeV; }
606 std::ostringstream ost1_low;
607 ost1_low << datadir <<
"/livermore/phot_epics2014/pe-low-" << Z <<
".dat";
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; }
656 std::ostringstream ost2;
657 ost2 << datadir <<
"/livermore/phot_epics2014/pe-ss-cs-" << Z <<
".dat";
658 std::ifstream fin2(ost2.str().c_str());
659 if( !fin2.is_open()) {
661 ed <<
"G4LivermorePhotoElectricModel data file <" << ost2.str().c_str()
662 <<
"> is not opened!" <<
G4endl;
663 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
665 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
669 G4cout <<
"File " << ost2.str().c_str()
670 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
675 for(
G4int i=0; i<n2; ++i) {
676 fin2 >> x >> y >> n3 >> n4;
678 for(
G4int j=0; j<n3; ++j) {
691 std::ostringstream ost3;
692 ost3 << datadir <<
"/livermore/phot_epics2014/pe-le-cs-" << Z <<
".dat";
693 std::ifstream fin3(ost3.str().c_str());
694 if( !fin3.is_open()) {
696 ed <<
"G4LivermorePhotoElectricModel data file <" << ost3.str().c_str()
697 <<
"> is not opened!" <<
G4endl;
698 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
700 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
704 G4cout <<
"File " << ost3.str().c_str()
705 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
720 if(Z < 1 || Z >=
maxZ) {
return -1;}
741 G4AutoLock l(&LivermorePhotoElectricModelMutex);
G4double Energy(size_t index) const
static G4LPhysicsFreeVector * fCrossSection[99]
virtual ~G4LivermorePhotoElectricModel()
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
std::vector< G4double > fSandiaCof
std::ostringstream G4ExceptionDescription
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4VAtomDeexcitation * AtomDeexcitation()
static constexpr double MeV
G4ParticleChangeForGamma * fParticleChange
static constexpr double keV
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
Float_t x1[n_points_granero]
virtual void ScaleVector(G4double factorE, G4double factorV)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * theElectron
void ReadData(G4int Z, const char *path=nullptr)
const G4ElementVector * GetElementVector() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4LivermorePhotoElectricModel(const G4String &nam="LivermorePhElectric")
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double energy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void PutValues(size_t index, G4double e, G4double dataValue)
static std::vector< G4double > * fParamLow[99]
static G4double fWaterEnergyLimit
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
static G4int fNShellsUsed[99]
void SetDeexcitationFlag(G4bool val)
#define G4MUTEX_INITIALIZER
G4int GetComponentID(G4int Z, size_t idx)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4ParticleDefinition * theGamma
static G4int fNShells[99]
G4bool IsFluoActive() const
static constexpr double eV
void SetAngularDistribution(G4VEmAngularDistribution *)
G4PhysicsVector * GetComponentDataByIndex(G4int Z, size_t idx)
G4VAtomDeexcitation * fAtomDeexcitation
static G4Electron * Electron()
size_t GetTableSize() const
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double energy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
static G4ProductionCutsTable * GetProductionCutsTable()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
std::vector< G4Element * > G4ElementVector
G4double GetBindingEnergy(G4double ZZ, G4int shell)
static G4Material * fWater
G4double GetValueForComponent(G4int Z, size_t idx, G4double kinEnergy)
void InitialiseForComponent(G4int Z, G4int nComponents=0)
static constexpr double barn
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
static G4LossTableManager * Instance()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4SandiaTable * GetSandiaTable() const
G4VEmAngularDistribution * GetAngularDistribution()
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
static std::vector< G4double > * fParamHigh[99]
static G4ElementData * fShellCrossSection
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
Float_t x2[n_points_geant4]
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4double bindingEnergy(G4int A, G4int Z)
void ProposeTrackStatus(G4TrackStatus status)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Material * GetBaseMaterial() const
static G4LPhysicsFreeVector * fCrossSectionLE[99]
size_t GetNumberOfElements() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetDensity() const
G4bool fDeexcitationActive