61 #ifdef G4MULTITHREADED
71 nShellLimit(100),fDeexcitationActive(
false),isInitialised(
false),
72 fAtomDeexcitation(nullptr)
89 G4cout <<
"Livermore PhotoElectric is constructed "
126 G4cout <<
"Calling G4LivermorePhotoElectricModel::Initialise() " <<
G4endl;
142 for(
G4int i=0; i<numOfCouples; ++i) {
149 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 >=
maxZ) {
return cs; }
247 else if(energy >= (*(
fParamLow[Z]))[0]) {
266 G4cout <<
"G4LivermorePhotoElectricModel: E(keV)= " << energy/
keV
267 <<
" Z= " << Z <<
" cross(barn)= " << cs/
barn <<
G4endl;
276 std::vector<G4DynamicParticle*>* fvect,
283 G4cout <<
"G4LivermorePhotoElectricModel::SampleSecondaries() Egamma(keV)= "
345 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
347 idx = shellIdx*7 + 2;
358 if(cs >= cs0) {
break; }
361 if(shellIdx >= nn) { shellIdx = nn-1; }
363 else if(gammaEnergy >= (*(
fParamLow[Z]))[0])
379 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
381 idx = shellIdx*7 + 2;
382 if(gammaEnergy > (*(
fParamLow[Z]))[idx-1])
387 if(cs >= cs0) {
break; }
390 if(shellIdx >= nn) {shellIdx = nn-1;}
408 for(
size_t j=0; j<
nn; ++j) {
411 if(gammaEnergy > (*(
fParamLow[Z]))[7*shellIdx+1]) {
414 if(cs <= 0.0 || j+1 == nn) {
break;}
436 if(gammaEnergy < bindingEnergy) {
456 fvect->push_back(electron);
462 G4int nbefore = fvect->size();
465 G4int nafter = fvect->size();
466 if(nafter > nbefore) {
468 for (
G4int j=nbefore; j<nafter; ++j) {
470 G4double e = ((*fvect)[j])->GetKineticEnergy();
471 if(esec + e > edep) {
474 ((*fvect)[j])->SetKineticEnergy(e);
477 for (
G4int jj=nafter-1; jj>j; --jj) {
502 const char* path = std::getenv(
"G4LEDATA");
504 std::ostringstream ost;
505 ost << path <<
"/livermore/phot_epics2014/";
508 G4Exception(
"G4SeltzerBergerModel::FindDirectoryPath()",
"em0006",
510 "Environment variable G4LEDATA not defined");
522 G4cout <<
"Calling ReadData() of G4LivermorePhotoElectricModel"
532 std::ostringstream ost;
534 std::ifstream
fin(ost.str().c_str());
535 if( !
fin.is_open()) {
537 ed <<
"G4LivermorePhotoElectricModel data file <" << ost.str().c_str()
538 <<
"> is not opened!" <<
G4endl;
539 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
541 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
545 G4cout <<
"File " << ost.str().c_str()
546 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
557 std::ostringstream ost1;
559 std::ifstream fin1(ost1.str().c_str());
560 if( !fin1.is_open()) {
562 ed <<
"G4LivermorePhotoElectricModel data file <" << ost1.str().c_str()
563 <<
"> is not opened!" <<
G4endl;
564 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
566 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
570 G4cout <<
"File " << ost1.str().c_str()
571 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
574 if(fin1.fail()) {
return; }
575 if(0 > n1 || n1 >=
INT_MAX) { n1 = 0; }
578 if(fin1.fail()) {
return; }
579 if(0 > n2 || n2 >=
INT_MAX) { n2 = 0; }
582 if(fin1.fail()) {
return; }
588 for(
G4int j=0; j<7; ++j) {
590 if(0 == j) { x *=
MeV; }
602 std::ostringstream ost1_low;
604 std::ifstream fin1_low(ost1_low.str().c_str());
605 if( !fin1_low.is_open()) {
607 ed <<
"G4LivermorePhotoElectricModel data file <" << ost1_low.str().c_str()
608 <<
"> is not opened!" <<
G4endl;
609 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
611 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
615 G4cout <<
"File " << ost1_low.str().c_str()
616 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
619 if(fin1_low.fail()) {
return; }
620 if(0 > n1_low || n1_low >=
INT_MAX) { n1_low = 0; }
623 if(fin1_low.fail()) {
return; }
624 if(0 > n2_low || n2_low >=
INT_MAX) { n2_low = 0; }
627 if(fin1_low.fail()) {
return; }
632 for(
G4int i=0; i<n1_low; ++i) {
633 for(
G4int j=0; j<7; ++j) {
635 if(0 == j) { x_low *=
MeV; }
636 else { x_low *=
barn; }
648 std::ostringstream ost2;
650 std::ifstream fin2(ost2.str().c_str());
651 if( !fin2.is_open()) {
653 ed <<
"G4LivermorePhotoElectricModel data file <" << ost2.str().c_str()
654 <<
"> is not opened!" <<
G4endl;
655 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
657 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
661 G4cout <<
"File " << ost2.str().c_str()
662 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
667 for(
G4int i=0; i<n2; ++i) {
668 fin2 >> x >> y >> n3 >> n4;
670 for(
G4int j=0; j<n3; ++j) {
682 std::ostringstream ost3;
684 std::ifstream fin3(ost3.str().c_str());
685 if( !fin3.is_open()) {
687 ed <<
"G4LivermorePhotoElectricModel data file <" << ost3.str().c_str()
688 <<
"> is not opened!" <<
G4endl;
689 G4Exception(
"G4LivermorePhotoElectricModel::ReadData()",
691 ed,
"G4LEDATA version should be G4EMLOW7.2 or later.");
695 G4cout <<
"File " << ost3.str().c_str()
696 <<
" is opened by G4LivermorePhotoElectricModel" <<
G4endl;
708 if(Z < 1 || Z >=
maxZ) {
return -1;}
725 #ifdef G4MULTITHREADED
730 #ifdef G4MULTITHREADED