66 nShellLimit(100),fDeexcitationActive(
false),isInitialised(
false),
67 fAtomDeexcitation(nullptr)
85 G4cout <<
"Livermore PhotoElectric is constructed "
120 G4cout <<
"Calling G4LivermorePolarizedPhotoElectricModel::Initialise()" <<
G4endl;
132 char* path = std::getenv(
"G4LEDATA");
138 for(
G4int i=0; i<numOfCouples; ++i) {
145 for (
G4int j=0; j<nelm; ++j) {
155 G4cout <<
"Loaded cross section files for LivermorePolarizedPhotoElectric model"
170 G4cout <<
"LivermorePolarizedPhotoElectric model is initialized " <<
G4endl
213 G4cout <<
"G4LivermorePolarizedPhotoElectricModel::ComputeCrossSectionPerAtom():"
214 <<
" Z= " << ZZ <<
" R(keV)= " << energy/
keV <<
G4endl;
218 if(Z < 1 || Z >=
maxZ) {
return cs; }
228 if (energy < (*(
fParam[Z]))[idx-1]) { energy = (*(
fParam[
Z]))[idx-1]; }
235 if(energy >= (*(
fParam[Z]))[0]) {
241 }
else if(energy >= (*(
fParam[Z]))[1]) {
249 G4cout <<
"LivermorePolarizedPhotoElectricModel: E(keV)= " << energy/
keV
250 <<
" Z= " << Z <<
" cross(barn)= " << cs/
barn <<
G4endl;
259 std::vector<G4DynamicParticle*>* fvect,
267 G4cout <<
"G4LivermorePolarizedPhotoElectricModel::SampleSecondaries() Egamma(keV)= "
310 if(gammaEnergy >= (*(
fParam[Z]))[0]) {
323 for(shellIdx=0; shellIdx<
nn; ++shellIdx) {
324 idx = shellIdx*6 + 2;
325 if(gammaEnergy > (*(
fParam[Z]))[idx-1]) {
329 if(cs >= cs0) {
break; }
332 if(shellIdx >= nn) { shellIdx = nn-1; }
340 if(gammaEnergy >= (*(
fParam[Z]))[1]) {
346 for(
size_t j=0; j<
nn; ++j) {
348 if(gammaEnergy > (*(
fParam[Z]))[6*shellIdx+1]) {
351 if(cs <= 0.0 || j+1 == nn) {
break; }
372 if(gammaEnergy < bindingEnergy) {
392 fvect->push_back(electron);
398 G4int nbefore = fvect->size();
401 G4int nafter = fvect->size();
402 if(nafter > nbefore) {
404 for (
G4int j=nbefore; j<nafter; ++j) {
406 G4double e = ((*fvect)[j])->GetKineticEnergy();
407 if(esec + e > edep) {
410 ((*fvect)[j])->SetKineticEnergy(e);
413 for (
G4int jj=nafter-1; jj>j; --jj) {
438 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel"
444 const char* datadir = path;
448 datadir = std::getenv(
"G4LEDATA");
451 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
453 "Environment variable G4LEDATA not defined");
462 std::ostringstream ost;
463 ost << datadir <<
"/livermore/phot/pe-cs-" << Z <<
".dat";
464 std::ifstream
fin(ost.str().c_str());
465 if( !
fin.is_open()) {
467 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost.str().c_str()
468 <<
"> is not opened!" <<
G4endl;
469 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
471 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
475 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;}
481 fParam[
Z] =
new std::vector<G4double>;
487 std::ostringstream ost1;
488 ost1 << datadir <<
"/livermore/phot/pe-" << Z <<
".dat";
489 std::ifstream fin1(ost1.str().c_str());
490 if( !fin1.is_open()) {
492 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost1.str().c_str()
493 <<
"> is not opened!" <<
G4endl;
494 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
496 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
500 G4cout <<
"File " << ost1.str().c_str()
501 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
504 if(fin1.fail()) {
return; }
505 if(0 > n1 || n1 >=
INT_MAX) { n1 = 0; }
508 if(fin1.fail()) {
return; }
509 if(0 > n2 || n2 >=
INT_MAX) { n2 = 0; }
512 if(fin1.fail()) {
return; }
518 for(
G4int j=0; j<6; ++j) {
520 if(0 == j) { x *=
MeV; }
533 std::ostringstream ost2;
534 ost2 << datadir <<
"/livermore/phot/pe-ss-cs-" << Z <<
".dat";
535 std::ifstream fin2(ost2.str().c_str());
536 if( !fin2.is_open()) {
538 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost2.str().c_str()
539 <<
"> is not opened!" <<
G4endl;
540 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
542 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
546 G4cout <<
"File " << ost2.str().c_str()
547 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
552 for(
G4int i=0; i<n2; ++i) {
553 fin2 >> x >> y >> n3 >> n4;
555 for(
G4int j=0; j<n3; ++j) {
569 std::ostringstream ost3;
570 ost3 << datadir <<
"/livermore/phot/pe-le-cs-" << Z <<
".dat";
571 std::ifstream fin3(ost3.str().c_str());
572 if( !fin3.is_open()) {
574 ed <<
"G4LivermorePolarizedPhotoElectricModel data file <" << ost3.str().c_str()
575 <<
"> is not opened!" <<
G4endl;
576 G4Exception(
"G4LivermorePolarizedPhotoElectricModel::ReadData()",
578 ed,
"G4LEDATA version should be G4EMLOW6.32 or later.");
582 G4cout <<
"File " << ost3.str().c_str()
583 <<
" is opened by G4LivermorePolarizedPhotoElectricModel" <<
G4endl;
600 G4AutoLock l(&LivermorePolarizedPhotoElectricModelMutex);