67 nShellLimit(100),fDeexcitationActive(false),isInitialised(false),
68 fAtomDeexcitation(nullptr)
86 G4cout <<
"Livermore PhotoElectric is constructed "
121 G4cout <<
"Calling G4LivermorePolarizedPhotoElectricModel::Initialise()" <<
G4endl;
133 char* path = getenv(
"G4LEDATA");
139 for(
G4int i=0; i<numOfCouples; ++i) {
146 for (
G4int j=0; j<nelm; ++j) {
156 G4cout <<
"Loaded cross section files for LivermorePolarizedPhotoElectric model"
171 G4cout <<
"LivermorePolarizedPhotoElectric model is initialized " <<
G4endl
214 G4cout <<
"G4LivermorePolarizedPhotoElectricModel::ComputeCrossSectionPerAtom():"
215 <<
" Z= " << ZZ <<
" R(keV)= " << energy/
keV <<
G4endl;
219 if(Z < 1 || Z >=
maxZ) {
return cs; }
229 if (energy < (*(
fParam[Z]))[idx-1]) { energy = (*(
fParam[
Z]))[idx-1]; }
236 if(energy >= (*(
fParam[Z]))[0]) {
242 }
else if(energy >= (*(
fParam[Z]))[1]) {
250 G4cout <<
"LivermorePolarizedPhotoElectricModel: E(keV)= " << energy/
keV
251 <<
" Z= " << Z <<
" cross(barn)= " << cs/
barn <<
G4endl;
260 std::vector<G4DynamicParticle*>* fvect,
268 G4cout <<
"G4LivermorePolarizedPhotoElectricModel::SampleSecondaries() Egamma(keV)= "
311 if(gammaEnergy >= (*(
fParam[Z]))[0]) {
316 G4int idx = nn*6 - 4;
324 for(shellIdx=0; shellIdx<
nn; ++shellIdx) {
325 idx = shellIdx*6 + 2;
326 if(gammaEnergy > (*(
fParam[Z]))[idx-1]) {
330 if(cs >= cs0) {
break; }
333 if(shellIdx >= nn) { shellIdx = nn-1; }
341 if(gammaEnergy >= (*(
fParam[Z]))[1]) {
347 for(
size_t j=0; j<
nn; ++j) {
349 if(gammaEnergy > (*(
fParam[Z]))[6*shellIdx+1]) {
352 if(cs <= 0.0 || j+1 == nn) {
break; }
373 if(gammaEnergy < bindingEnergy) {
393 fvect->push_back(electron);
399 G4int nbefore = fvect->size();
402 G4int nafter = fvect->size();
403 if(nafter > nbefore) {
405 for (
G4int j=nbefore; j<nafter; ++j) {
407 G4double e = ((*fvect)[j])->GetKineticEnergy();
408 if(esec + e > edep) {
411 ((*fvect)[j])->SetKineticEnergy(e);
414 for (
G4int jj=nafter-1; jj>j; --jj) {
439 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel"
445 const char* datadir = path;
449 datadir = getenv(
"G4LEDATA");
452 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
454 "Environment variable G4LEDATA not defined");
463 std::ostringstream ost;
464 ost << datadir <<
"/livermore/phot/pe-cs-" << Z <<
".dat";
465 std::ifstream
fin(ost.str().c_str());
466 if( !
fin.is_open()) {
468 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost.str().c_str()
469 <<
"> is not opened!" <<
G4endl;
470 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
472 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
476 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;}
482 fParam[
Z] =
new std::vector<G4double>;
488 std::ostringstream ost1;
489 ost1 << datadir <<
"/livermore/phot/pe-" << Z <<
".dat";
490 std::ifstream fin1(ost1.str().c_str());
491 if( !fin1.is_open()) {
493 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost1.str().c_str()
494 <<
"> is not opened!" <<
G4endl;
495 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
497 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
501 G4cout <<
"File " << ost1.str().c_str()
502 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
505 if(fin1.fail()) {
return; }
506 if(0 > n1 || n1 >=
INT_MAX) { n1 = 0; }
509 if(fin1.fail()) {
return; }
510 if(0 > n2 || n2 >=
INT_MAX) { n2 = 0; }
513 if(fin1.fail()) {
return; }
518 for(
G4int i=0; i<n1; ++i) {
519 for(
G4int j=0; j<6; ++j) {
521 if(0 == j) { x *=
MeV; }
534 std::ostringstream ost2;
535 ost2 << datadir <<
"/livermore/phot/pe-ss-cs-" << Z <<
".dat";
536 std::ifstream fin2(ost2.str().c_str());
537 if( !fin2.is_open()) {
539 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost2.str().c_str()
540 <<
"> is not opened!" <<
G4endl;
541 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
543 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
547 G4cout <<
"File " << ost2.str().c_str()
548 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
553 for(
G4int i=0; i<n2; ++i) {
554 fin2 >> x >> y >> n3 >> n4;
556 for(
G4int j=0; j<n3; ++j) {
570 std::ostringstream ost3;
571 ost3 << datadir <<
"/livermore/phot/pe-le-cs-" << Z <<
".dat";
572 std::ifstream fin3(ost3.str().c_str());
573 if( !fin3.is_open()) {
575 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost3.str().c_str()
576 <<
"> is not opened!" <<
G4endl;
577 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
579 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
583 G4cout <<
"File " << ost3.str().c_str()
584 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
601 G4AutoLock l(&LivermorePolarizedPhotoElectricModelMutex);
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
std::ostringstream G4ExceptionDescription
static G4int fNShellsUsed[99]
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4VAtomDeexcitation * AtomDeexcitation()
static constexpr double MeV
static constexpr double keV
Float_t x1[n_points_granero]
static G4LPhysicsFreeVector * fCrossSection[99]
virtual void ScaleVector(G4double factorE, G4double factorV)
const G4ThreeVector & GetMomentumDirection() const
G4VAtomDeexcitation * fAtomDeexcitation
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
const G4ElementVector * GetElementVector() const
void ReadData(G4int Z, const char *path=0)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double energy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4ParticleDefinition * theElectron
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
static G4int fNShells[99]
void PutValues(size_t index, G4double e, G4double dataValue)
std::vector< G4double > fSandiaCof
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
void SetDeexcitationFlag(G4bool val)
#define G4MUTEX_INITIALIZER
G4int GetComponentID(G4int Z, size_t idx)
G4ParticleChangeForGamma * fParticleChange
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
static G4ElementData * fShellCrossSection
static G4double fWaterEnergyLimit
static G4LPhysicsFreeVector * fCrossSectionLE[99]
G4bool IsFluoActive() const
static constexpr double eV
void SetAngularDistribution(G4VEmAngularDistribution *)
static G4Material * fWater
static G4Electron * Electron()
size_t GetTableSize() const
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
G4LivermorePolarizedPhotoElectricModel(const G4String &nam="LivermorePolarizedPhotoElectric")
G4double GetValueForComponent(G4int Z, size_t idx, G4double kinEnergy)
void InitialiseForComponent(G4int Z, G4int nComponents=0)
static constexpr double barn
virtual ~G4LivermorePolarizedPhotoElectricModel()
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4bool fDeexcitationActive
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
static G4LossTableManager * Instance()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static std::vector< G4double > * fParam[99]
G4SandiaTable * GetSandiaTable() const
G4VEmAngularDistribution * GetAngularDistribution()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
Float_t x2[n_points_geant4]
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double energy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
G4double bindingEnergy(G4int A, G4int Z)
void ProposeTrackStatus(G4TrackStatus status)
G4ParticleDefinition * theGamma
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Material * GetBaseMaterial() const
size_t GetNumberOfElements() const
G4double GetDensity() const