77 fParticleChange(nullptr),fParticle(nullptr),fLogFormFactorTable(nullptr),fPMaxTable(nullptr),
78 fSamplingTable(nullptr),fMolInterferenceData(nullptr),fAngularFunction(nullptr), fKnownMaterials(nullptr),
79 fIsInitialised(false),fLocalTable(false),fIsMIActive(true)
102 G4double logfactor2 = logfactor1*10;
105 if (logenergy < logtransitionenergy)
106 logenergy += logfactor1;
108 logenergy += logfactor2;
110 }
while (logenergy < logmaxenergy);
134 if (item.second)
delete item.second;
158 if (item.second)
delete item.second;
165 if (item.second)
delete item.second;
172 if (item.second)
delete item.second;
186 G4cout <<
"Calling G4PenelopeRayleighModelMI::Initialise()" <<
G4endl;
205 " from G4EmParameters()" <<
G4endl;
208 G4cout <<
"Calling G4PenelopeRayleighModelMI::Initialise() [master]" <<
G4endl;
229 fPMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
231 fSamplingTable =
new std::map<const G4Material*,G4PenelopeSamplingData*>;
241 for (
size_t j=0;j<
material->GetNumberOfElements();j++) {
242 G4int iZ = theElementVector->at(j)->GetZasInt();
286 G4cout <<
"Calling G4PenelopeRayleighModelMI::InitialiseLocal()" <<
G4endl;
333 G4cout <<
"Calling CrossSectionPerAtom() of G4PenelopeRayleighModelMI" <<
G4endl;
342 ed <<
"Unable to retrieve the cross section table for Z=" << iZ <<
G4endl;
343 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
344 G4Exception(
"G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom()",
358 ed <<
"Unable to find Z=" << iZ <<
" in the atomic cross section table" <<
G4endl;
359 G4Exception(
"G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom()",
366 cross =
G4Exp(logXS);
382 G4double value = (1+std::cos(theta)*std::cos(theta))*std::sin(theta);
386 <<
", angFun[" << k <<
"]: " << (*fAngularFunction)[k] <<
G4endl;
402 <<
", x: " << x*
nm <<
", q: " << q <<
G4endl;
418 static G4bool amInAUnitTest =
false;
421 amInAUnitTest =
true;
423 ed <<
"The ProductionCuts table is empty " <<
G4endl;
424 ed <<
"This should happen only in Unit Tests" <<
G4endl;
425 G4Exception(
"G4PenelopeRayleighModelMI::CrossSectionPerVolume()",
435 for (
size_t j=0;j<
material->GetNumberOfElements();j++) {
436 G4int iZ = theElementVector->at(j)->GetZasInt();
454 G4cout <<
"Rayleigh CS of: " << matname <<
" calculated through CSperAtom!" <<
G4endl;
460 G4cout <<
"Rayleigh CS of: " << matname
461 <<
" calculated through integration of the DCS" <<
G4endl;
473 if (crystalExtension != 0) {
474 G4cout <<
"The material has a crystalline structure, a dedicated diffraction model is used!" <<
G4endl;
486 std::vector<G4double> *StoichiometricFactors =
new std::vector<G4double>;
487 for (
G4int i=0;i<nElements;i++) {
488 G4double fraction = fractionVector[i];
489 G4double atomicWeigth = (*elementVector)[i]->GetA()/(
g/
mole);
490 StoichiometricFactors->push_back(fraction/atomicWeigth);
492 G4double MaxStoichiometricFactor = 0.;
493 for (
G4int i=0;i<nElements;i++) {
494 if ((*StoichiometricFactors)[i] > MaxStoichiometricFactor)
495 MaxStoichiometricFactor = (*StoichiometricFactors)[i];
497 for (
G4int i=0;i<nElements;i++) {
498 (*StoichiometricFactors)[i] /= MaxStoichiometricFactor;
503 for (
G4int i=0;i<nElements;i++)
504 atPerMol += (*StoichiometricFactors)[i];
506 if (atPerMol) moleculeDensity = atomDensity/atPerMol;
509 G4cout <<
"Material " <<
material->GetName() <<
" has " << atPerMol <<
" atoms "
510 <<
"per molecule and " << moleculeDensity/(
cm*
cm*
cm) <<
" molecule/cm3" <<
G4endl;
514 for (
G4int i=0;i<nElements;i++)
515 MolWeight += (*StoichiometricFactors)[i]*(*elementVector)[i]->GetA()/(
g/
mole);
518 G4cout <<
"Molecular weight of " << matname <<
": " << MolWeight <<
" g/mol" <<
G4endl;
524 IntegrandFun[k] = (*fAngularFunction)[k]*F2;
531 G4double csvolume = cs*moleculeDensity;
536 <<
" keV: " << cs/
barn <<
" barn"
537 <<
", mean free path: " << 1./csvolume/
mm <<
" mm" <<
G4endl;
539 delete StoichiometricFactors;
549 G4cout <<
"Calling BuildFormFactorTable() of G4PenelopeRayleighModelMI" <<
G4endl;
557 std::vector<G4double> *StoichiometricFactors =
new std::vector<G4double>;
558 for (
G4int i=0;i<nElements;i++) {
559 G4double fraction = fractionVector[i];
560 G4double atomicWeigth = (*elementVector)[i]->GetA()/(
g/
mole);
561 StoichiometricFactors->push_back(fraction/atomicWeigth);
563 G4double MaxStoichiometricFactor = 0.;
564 for (
G4int i=0;i<nElements;i++) {
565 if ((*StoichiometricFactors)[i] > MaxStoichiometricFactor)
566 MaxStoichiometricFactor = (*StoichiometricFactors)[i];
568 if (MaxStoichiometricFactor<1e-16) {
570 ed <<
"Inconsistent data of atomic composition for " <<
material->GetName() <<
G4endl;
571 G4Exception(
"G4PenelopeRayleighModelMI::BuildFormFactorTable()",
574 for (
G4int i=0;i<nElements;i++)
575 (*StoichiometricFactors)[i] /= MaxStoichiometricFactor;
579 for (
G4int i=0;i<nElements;i++)
580 MolWeight += (*StoichiometricFactors)[i]*(*elementVector)[i]->GetA()/(
g/
mole);
600 G4cout <<
"Read MIFF for " << matname <<
" from custom file: " << aFileNameFF <<
G4endl;
616 if (
fIsMIActive && matname.find(
"MedMat") != std::string::npos) {
618 G4cout <<
"Build MIFF from components for " << matname <<
G4endl;
621 G4int ki, kf=6, ktot=19;
623 G4String compstring = matname.substr(kf+1, ktot);
624 for (
size_t j=0; j<4; j++) {
627 compstring = matname.substr(ki, 4);
628 comp[j] = atof(compstring.c_str());
630 G4cout <<
" -- MedMat comp[" << j+1 <<
"]: " << comp[j] <<
G4endl;
633 char* path = std::getenv(
"G4LEDATA");
635 G4String excep =
"G4LEDATA environment variable not set!";
636 G4Exception(
"G4PenelopeRayleighModelMI::BuildFormFactorTable()",
664 ff2 = comp[0]*ffat*ffat+comp[1]*fwater*fwater+
665 comp[2]*fbonematrix*fbonematrix+comp[3]*fmineral*fmineral;
673 G4cout <<
"Read MIFF from database " << matname <<
G4endl;
686 G4cout <<
"FF of " << matname <<
" calculated according to the IAM" <<
G4endl;
689 for (
G4int i=0;i<nElements;i++) {
690 G4int iZ = (*elementVector)[i]->GetZasInt();
694 ff2 += f*f*(*StoichiometricFactors)[i];
705 delete StoichiometricFactors;
732 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeRayleighModelMI" <<
G4endl;
756 fPMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
758 fSamplingTable =
new std::map<const G4Material*,G4PenelopeSamplingData*>;
769 ed <<
"Unable to find the fSamplingTable data for " <<
771 ed <<
"This can happen only in Unit Tests" <<
G4endl;
772 G4Exception(
"G4PenelopeRayleighModelMI::SampleSecondaries()",
779 G4int iZ = theElementVector->at(j)->GetZasInt();
816 G4double G = 0.5*(1+cosTheta*cosTheta);
823 G4double LastQ2inTheTable = theDataTable->
GetX(nData-1);
841 cosTheta = 1.0-2.0*xx/q2max;
842 G4double G = 0.5*(1+cosTheta*cosTheta);
848 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
852 G4double dirX = sinTheta*std::cos(phi);
853 G4double dirY = sinTheta*std::sin(phi);
859 photonDirection1.
rotateUz(photonDirection0);
871 G4cout <<
"G4PenelopeRayleighModelMI::ReadDataFile()" <<
G4endl;
872 G4cout <<
"Going to read Rayleigh data files for Z=" <<
Z <<
G4endl;
875 char* path = std::getenv(
"G4LEDATA");
877 G4String excep =
"G4LEDATA environment variable not set!";
878 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
884 std::ostringstream ost;
886 ost << path <<
"/penelope/rayleigh/pdgra" <<
Z <<
".p08";
888 ost << path <<
"/penelope/rayleigh/pdgra0" <<
Z <<
".p08";
889 std::ifstream
file(ost.str().c_str());
891 if (!
file.is_open()) {
893 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
899 file >> readZ >> nPoints;
901 if (readZ !=
Z || nPoints <= 0 || nPoints >= 5000) {
903 ed <<
"Corrupted data file for Z=" <<
Z <<
G4endl;
904 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
911 for (
size_t i=0;i<nPoints;i++) {
912 file >> ene >> f1 >> f2 >> xs;
917 if (
file.eof() && i != (nPoints-1)) {
919 ed <<
"Corrupted data file for Z=" <<
Z <<
G4endl;
920 ed <<
"Found less than " << nPoints <<
" entries" <<
G4endl;
921 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
928 std::ostringstream ost2;
929 ost2 << path <<
"/penelope/rayleigh/MIFF/qext.dat";
930 file.open(ost2.str().c_str());
932 if (!
file.is_open()) {
934 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
944 for (
size_t i=0;i<nPoints;i++) {
952 std::ostringstream ost3;
954 ost3 << path <<
"/penelope/rayleigh/pdaff" <<
Z <<
".p08";
956 ost3 << path <<
"/penelope/rayleigh/pdaff0" <<
Z <<
".p08";
957 file.open(ost3.str().c_str());
959 if (!
file.is_open()) {
961 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
965 file >> readZ >> nPoints;
967 if (readZ !=
Z || nPoints <= 0 || nPoints >= 5000) {
969 ed <<
"Corrupted data file for Z=" <<
Z <<
G4endl;
970 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
977 for (
size_t i=0;i<nPoints;i++) {
978 file >> q >> ff >> incoh;
980 if (
file.eof() && i != (nPoints-1)) {
982 ed <<
"Corrupted data file for Z=" <<
Z <<
G4endl;
983 ed <<
"Found less than " << nPoints <<
" entries" <<
G4endl;
984 G4Exception(
"G4PenelopeRayleighModelMI::ReadDataFile()",
998 G4cout <<
"G4PenelopeRayleighModelMI::ReadMolInterferenceData() for material " <<
1001 G4bool isLocalFile = (FFfilename !=
"NULL");
1003 char* path = std::getenv(
"G4LEDATA");
1005 G4String excep =
"G4LEDATA environment variable not set!";
1006 G4Exception(
"G4PenelopeRayleighModelMI::ReadMolInterferenceData()",
1017 if (aFileName !=
"") {
1019 G4cout <<
"ReadMolInterferenceData(). Read material: " << matname <<
", filename: " <<
1021 (isLocalFile ?
"(local)" :
"(database)") <<
G4endl;
1023 std::ostringstream ostIMFF;
1025 ostIMFF << aFileName;
1027 ostIMFF << path <<
"/penelope/rayleigh/MIFF/" << aFileName;
1028 file.open(ostIMFF.str().c_str());
1030 if (!
file.is_open()) {
1032 G4Exception(
"G4PenelopeRayleighModelMI::ReadMolInterferenceData()",
1040 while (
file.good()) {
1050 file.open(ostIMFF.str().c_str());
1053 for (
size_t i=0; i<nPoints; i++) {
1060 if (
file.eof() && i != (nPoints-1)) {
1062 ed <<
"Corrupted data file" <<
G4endl;
1063 ed <<
"Found less than " << nPoints <<
" entries" <<
G4endl;
1064 G4Exception(
"G4PenelopeRayleighModelMI::ReadMolInterferenceData()",
1069 G4Exception(
"G4PenelopeRayleighModelMI::ReadMolInterferenceData()",
1071 "Unable to allocate the Molecular Interference data table");
1090 G4double logQSquared = (QSquared>1e-10) ?
G4Log(QSquared) : -23.;
1099 ed <<
"Unable to retrieve F squared table for " << mat->
GetName() <<
G4endl;
1100 G4Exception(
"G4PenelopeRayleighModelMI::GetFSquared()",
1105 if (logQSquared < -20) {
1109 else if (logQSquared > maxlogQ2)
1119 G4cout <<
"Q^2 = " << QSquared <<
" (units of 1/(m_e*c)); F^2 = " << f2 <<
G4endl;
1130 const size_t np = 150;
1139 size_t nReducedPoints = np/4;
1144 G4Exception(
"G4PenelopeRayleighModelMI::InitializeSamplingAlgorithm()",
1146 "Too few points to initialize the sampling algorithm");
1148 if (q2min > (q2max-1e-10))
1150 G4cout <<
"q2min= " << q2min <<
" q2max= " << q2max <<
G4endl;
1151 G4Exception(
"G4PenelopeRayleighModelMI::InitializeSamplingAlgorithm()",
1153 "Too narrow grid to initialize the sampling algorithm");
1166 const G4int nip = 51;
1169 x->push_back(q2min);
1170 for (
size_t i=1;i<NUNIF-1;i++)
1175 x->push_back(q2max);
1178 G4cout <<
"Vector x has " << x->size() <<
" points, while NUNIF = " << NUNIF <<
G4endl;
1187 for (
size_t i=0;i<NUNIF-1;i++)
1196 for (
G4int k=0;k<nip;k++)
1200 pdfi->push_back(pdfk);
1206 pdfih->push_back(pdfIK);
1213 sumi->push_back(0.);
1214 for (
G4int k=1;k<nip;k++)
1217 G4double next = previous + cons*((*pdfi)[k-1]+4.0*(*pdfih)[k-1]+(*pdfi)[k]);
1218 sumi->push_back(next);
1221 G4double lastIntegral = (*sumi)[sumi->size()-1];
1222 area->push_back(lastIntegral);
1224 G4double factor = 1.0/lastIntegral;
1225 for (
size_t k=0;k<sumi->size();k++)
1226 (*sumi)[k] *= factor;
1229 if ((*pdfi)[0] < 1e-35)
1230 (*pdfi)[0] = 1e-5*pdfmax;
1231 if ((*pdfi)[pdfi->size()-1] < 1e-35)
1232 (*pdfi)[pdfi->size()-1] = 1e-5*pdfmax;
1235 G4double pui = (*pdfi)[pdfi->size()-1]*factor;
1236 G4double B_temp = 1.0-1.0/(pli*pui*dx*dx);
1237 G4double A_temp = (1.0/(pli*dx))-1.0-B_temp;
1238 G4double C_temp = 1.0+A_temp+B_temp;
1247 a->push_back(A_temp);
1248 b->push_back(B_temp);
1249 c->push_back(C_temp);
1261 for (
G4int k=0;k<nip;k++)
1264 G4double pap = (*area)[i]*(1.0+((*a)[i]+(*b)[i]*rr)*rr)*(1.0+((*a)[i]+(*b)[i]*rr)*rr)/
1265 ((1.0-(*b)[i]*rr*rr)*(*c)[i]*((*x)[i+1]-(*x)[i]));
1266 if (k == 0 || k == nip-1)
1267 (*err)[i] += 0.5*std::fabs(pap-(*pdfi)[k]);
1269 (*err)[i] += std::fabs(pap-(*pdfi)[k]);
1274 if ((*err)[i] > 0.1*(*area)[i] && icase == 1)
1290 (*x)[x->size()-1] = q2max;
1295 area->push_back(0.);
1297 if (x->size() != NUNIF || a->size() != NUNIF ||
1298 err->size() != NUNIF || area->size() != NUNIF)
1301 ed <<
"Problem in building the Table for Sampling: array dimensions do not match" <<
G4endl;
1302 G4Exception(
"G4PenelopeRayleighModelMI::InitializeSamplingAlgorithm()",
1314 for (
size_t i=0;i<err->size()-2;i++)
1317 if ((*err)[i] > maxError)
1319 maxError = (*err)[i];
1325 G4double newx = 0.5*((*x)[iErrMax]+(*x)[iErrMax+1]);
1327 x->insert(x->begin()+iErrMax+1,newx);
1329 area->insert(area->begin()+iErrMax+1,0.);
1330 a->insert(a->begin()+iErrMax+1,0.);
1331 b->insert(b->begin()+iErrMax+1,0.);
1332 c->insert(c->begin()+iErrMax+1,0.);
1333 err->insert(err->begin()+iErrMax+1,0.);
1336 for (
size_t i=iErrMax;i<=iErrMax+1;i++)
1343 G4double dxLocal = (*x)[i+1]-(*x)[i];
1346 for (
G4int k=0;k<nip;k++)
1350 pdfi->push_back(pdfk);
1356 pdfih->push_back(pdfIK);
1363 sumi->push_back(0.);
1364 for (
G4int k=1;k<nip;k++)
1367 G4double next = previous + cons*((*pdfi)[k-1]+4.0*(*pdfih)[k-1]+(*pdfi)[k]);
1368 sumi->push_back(next);
1370 G4double lastIntegral = (*sumi)[sumi->size()-1];
1371 (*area)[i] = lastIntegral;
1374 G4double factor = 1.0/lastIntegral;
1375 for (
size_t k=0;k<sumi->size();k++)
1376 (*sumi)[k] *= factor;
1379 if ((*pdfi)[0] < 1e-35)
1380 (*pdfi)[0] = 1e-5*pdfmax;
1381 if ((*pdfi)[pdfi->size()-1] < 1e-35)
1382 (*pdfi)[pdfi->size()-1] = 1e-5*pdfmax;
1385 G4double pui = (*pdfi)[pdfi->size()-1]*factor;
1386 G4double B_temp = 1.0-1.0/(pli*pui*dxLocal*dxLocal);
1387 G4double A_temp = (1.0/(pli*dxLocal))-1.0-B_temp;
1388 G4double C_temp = 1.0+A_temp+B_temp;
1409 for (
G4int k=0;k<nip;k++)
1412 G4double pap = (*area)[i]*(1.0+((*a)[i]+(*b)[i]*rr)*rr)*(1.0+((*a)[i]+(*b)[i]*rr)*rr)/
1413 ((1.0-(*b)[i]*rr*rr)*(*c)[i]*((*x)[i+1]-(*x)[i]));
1414 if (k == 0 || k == nip-1)
1415 (*err)[i] += 0.5*std::fabs(pap-(*pdfi)[k]);
1417 (*err)[i] += std::fabs(pap-(*pdfi)[k]);
1422 if ((*err)[i] > 0.1*(*area)[i] && icase == 1)
1435 }
while(x->size() < np);
1437 if (x->size() != np || a->size() != np ||
1438 err->size() != np || area->size() != np)
1440 G4Exception(
"G4PenelopeRayleighModelMI::InitializeSamplingAlgorithm()",
1442 "Problem in building the extended Table for Sampling: array dimensions do not match ");
1449 for (
size_t i=0;i<np-1;i++)
1453 for (
size_t i=0;i<np-1;i++)
1457 errMax =
std::max(errMax,(*err)[i]);
1463 for (
size_t i=0;i<np-1;i++)
1466 PAC->push_back(previous+(*area)[i]);
1468 (*PAC)[PAC->size()-1] = 1.;
1473 std::vector<size_t> *ITTL =
new std::vector<size_t>;
1474 std::vector<size_t> *ITTU =
new std::vector<size_t>;
1477 for (
size_t i=0;i<np;i++)
1485 for (
size_t i=1;i<(np-1);i++)
1489 for (
size_t j=(*ITTL)[i-1];j<np && !found;j++)
1491 if ((*PAC)[j] > ptst)
1499 (*ITTU)[ITTU->size()-2] = ITTU->size()-1;
1500 (*ITTU)[ITTU->size()-1] = ITTU->size()-1;
1501 (*ITTL)[ITTL->size()-1] = ITTU->size()-2;
1503 if (ITTU->size() != np || ITTU->size() != np)
1505 G4Exception(
"G4PenelopeRayleighModelMI::InitializeSamplingAlgorithm()",
1507 "Problem in building the Limit Tables for Sampling: array dimensions do not match");
1514 for (
size_t i=0;i<np;i++)
1516 theTable->
AddPoint((*x)[i],(*PAC)[i],(*a)[i],(*b)[i],(*ITTL)[i],(*ITTU)[i]);
1520 G4cout <<
"*************************************************************************" <<
1522 G4cout <<
"Sampling table for Penelope Rayleigh scattering in " << mat->
GetName() <<
G4endl;
1548 G4cout <<
"G4PenelopeRayleighModelMI::BuildPMaxTable" <<
G4endl;
1549 G4cout <<
"Going to instanziate the fPMaxTable !" <<
G4endl;
1551 fPMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
1560 G4Exception(
"G4PenelopeRayleighModelMI::GetPMaxTable()",
1562 "SamplingTable is not properly instantiated");
1570 ed <<
"Sampling table for material " << mat->
GetName() <<
" not found";
1571 G4Exception(
"G4PenelopeRayleighModelMI::GetPMaxTable()",
1582 const size_t nip = 51;
1598 size_t lowerBound = 0;
1599 size_t upperBound = tablePoints-1;
1600 while (lowerBound <= upperBound)
1602 size_t midBin = (lowerBound + upperBound)/2;
1603 if( Qm2 < theTable->GetX(midBin))
1604 { upperBound = midBin-1; }
1606 { lowerBound = midBin+1; }
1616 for (
size_t k=0;k<nip;k++)
1620 (theTable->
GetX(upperBound+1)-Q1);
1625 if (std::fabs(con1) > 1.0e-16*std::fabs(con2))
1626 etap = con2*(1.0-std::sqrt(1.0-2.0*tau*con1/(con2*con2)))/con1;
1630 (1.0+(theA+theB*etap)*etap)*(1.0+(theA+theB*etap)*etap)/
1631 ((1.0-theB*etap*etap)*ci*(theTable->
GetX(upperBound+1)-Q1));
1632 fun->push_back(theFun);
1640 (5.0*(*fun)[0]+8.0*(*fun)[1]-(*fun)[2])*CONS;
1641 sum->push_back(secondPoint);
1642 for (
size_t hh=2;hh<nip-1;hh++)
1645 G4double next = previous+(13.0*((*fun)[hh-1]+(*fun)[hh])-
1646 (*fun)[hh+1]-(*fun)[hh-2])*HCONS;
1647 sum->push_back(next);
1649 G4double last = (*sum)[nip-2]+(5.0*(*fun)[nip-1]+8.0*(*fun)[nip-2]-
1650 (*fun)[nip-3])*CONS;
1651 sum->push_back(last);
1652 thePMax = thePAC + (*sum)[sum->size()-1];
1663 thePMax = theTable->
GetPAC(0);
1670 fPMaxTable->insert(std::make_pair(mat,theVec));
1678 G4cout <<
"*****************************************************************" <<
G4endl;
1679 G4cout <<
"G4PenelopeRayleighModelMI: Form Factor Table for " << mat->
GetName() <<
G4endl;
1682 G4cout <<
"*****************************************************************" <<
G4endl;
1711 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Fat_MI",
"FF_fat_Tartari2002.dat"));
1712 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Water_MI",
"FF_water_Tartari2002.dat"));
1713 fKnownMaterials->insert(std::pair<G4String,G4String>(
"BoneMatrix_MI",
"FF_bonematrix_Tartari2002.dat"));
1714 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Mineral_MI",
"FF_mineral_Tartari2002.dat"));
1715 fKnownMaterials->insert(std::pair<G4String,G4String>(
"adipose_MI",
"FF_adipose_Poletti2002.dat"));
1716 fKnownMaterials->insert(std::pair<G4String,G4String>(
"glandular_MI",
"FF_glandular_Poletti2002.dat"));
1717 fKnownMaterials->insert(std::pair<G4String,G4String>(
"breast5050_MI",
"FF_human_breast_Peplow1998.dat"));
1718 fKnownMaterials->insert(std::pair<G4String,G4String>(
"carcinoma_MI",
"FF_carcinoma_Kidane1999.dat"));
1719 fKnownMaterials->insert(std::pair<G4String,G4String>(
"muscle_MI",
"FF_pork_muscle_Peplow1998.dat"));
1720 fKnownMaterials->insert(std::pair<G4String,G4String>(
"kidney_MI",
"FF_pork_kidney_Peplow1998.dat"));
1721 fKnownMaterials->insert(std::pair<G4String,G4String>(
"liver_MI",
"FF_pork_liver_Peplow1998.dat"));
1722 fKnownMaterials->insert(std::pair<G4String,G4String>(
"heart_MI",
"FF_pork_heart_Peplow1998.dat"));
1723 fKnownMaterials->insert(std::pair<G4String,G4String>(
"blood_MI",
"FF_beef_blood_Peplow1998.dat"));
1724 fKnownMaterials->insert(std::pair<G4String,G4String>(
"grayMatter_MI",
"FF_gbrain_DeFelici2008.dat"));
1725 fKnownMaterials->insert(std::pair<G4String,G4String>(
"whiteMatter_MI",
"FF_wbrain_DeFelici2008.dat"));
1726 fKnownMaterials->insert(std::pair<G4String,G4String>(
"bone_MI",
"FF_bone_King2011.dat"));
1727 fKnownMaterials->insert(std::pair<G4String,G4String>(
"FatLowX_MI",
"FF_fat_Tartari2002_joint_lowXdata_ESRF2003.dat"));
1728 fKnownMaterials->insert(std::pair<G4String,G4String>(
"BoneMatrixLowX_MI",
"FF_bonematrix_Tartari2002_joint_lowXdata.dat"));
1729 fKnownMaterials->insert(std::pair<G4String,G4String>(
"PMMALowX_MI",
"FF_PMMA_Tartari2002_joint_lowXdata_ESRF2003.dat"));
1730 fKnownMaterials->insert(std::pair<G4String,G4String>(
"dryBoneLowX_MI",
"FF_drybone_Tartari2002_joint_lowXdata_ESRF2003.dat"));
1731 fKnownMaterials->insert(std::pair<G4String,G4String>(
"CIRS30-70_MI",
"FF_CIRS30-70_Poletti2002.dat"));
1732 fKnownMaterials->insert(std::pair<G4String,G4String>(
"CIRS50-50_MI",
"FF_CIRS50-50_Poletti2002.dat"));
1733 fKnownMaterials->insert(std::pair<G4String,G4String>(
"CIRS70-30_MI",
"FF_CIRS70-30_Poletti2002.dat"));
1734 fKnownMaterials->insert(std::pair<G4String,G4String>(
"RMI454_MI",
"FF_RMI454_Poletti2002.dat"));
1735 fKnownMaterials->insert(std::pair<G4String,G4String>(
"PMMA_MI",
"FF_PMMA_Tartari2002.dat"));
1736 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Lexan_MI",
"FF_lexan_Peplow1998.dat"));
1737 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Kapton_MI",
"FF_kapton_Peplow1998.dat"));
1738 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Nylon_MI",
"FF_nylon_Kosanetzky1987.dat"));
1739 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Polyethylene_MI",
"FF_polyethylene_Kosanetzky1987.dat"));
1740 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Polystyrene_MI",
"FF_polystyrene_Kosanetzky1987.dat"));
1741 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Formaline_MI",
"FF_formaline_Peplow1998.dat"));
1742 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Acetone_MI",
"FF_acetone_Cozzini2010.dat"));
1743 fKnownMaterials->insert(std::pair<G4String,G4String>(
"Hperoxide_MI",
"FF_Hperoxide_Cozzini2010.dat"));
1751 for (
G4int k=0; k<
n-1; k++) {
1752 integral += (y[k]+y[k+1]);
1754 integral *= dTheta*0.5;
std::vector< const G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static constexpr double mole
static constexpr double twopi
static constexpr double nm
static constexpr double barn
static constexpr double cm2
static constexpr double mm
static constexpr double keV
static constexpr double eV
static constexpr double g
static constexpr double GeV
static constexpr double pi
static constexpr double cm
static const G4double angle[DIMMOTT]
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4EmParameters * Instance()
G4VMaterialExtension * RetrieveExtension(const G4String &name)
const G4String & GetFilenameFF()
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4String & GetName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void SetParticle(const G4ParticleDefinition *)
G4double fIntrinsicHighEnergyLimit
std::map< const G4Material *, G4PhysicsFreeVector * > * fLogFormFactorTable
G4double IntegrateFun(G4double y[], G4int n, G4double dTheta)
std::map< G4String, G4String > * fKnownMaterials
void BuildFormFactorTable(const G4Material *)
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
G4ParticleChangeForGamma * fParticleChange
Data members.
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
G4DataVector fLogEnergyGridPMax
G4double CalculateQSquared(G4double angle, G4double energy)
void LoadKnownMIFFMaterials()
const G4ParticleDefinition * fParticle
G4DataVector fLogQSquareGrid
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
void ReadMolInterferenceData(const G4String &, const G4String &filename="NULL")
void InitializeSamplingAlgorithm(const G4Material *)
static G4PhysicsFreeVector * fAtomicFormFactor[fMaxZ+1]
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0., G4double maxEnergy=DBL_MAX) override
G4double fIntrinsicLowEnergyLimit
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4double GetFSquared(const G4Material *, const G4double)
static const G4int fNtheta
void GetPMaxTable(const G4Material *)
void CalculateThetaAndAngFun()
void DumpFormFactorTable(const G4Material *)
G4PhysicsFreeVector * fAngularFunction
G4PenelopeRayleighModelMI(const G4ParticleDefinition *p=nullptr, const G4String &processName="PenRayleighMI")
std::map< const G4Material *, G4PenelopeSamplingData * > * fSamplingTable
G4MIData * GetMIData(const G4Material *)
std::map< G4String, G4PhysicsFreeVector * > * fMolInterferenceData
std::map< const G4Material *, G4PhysicsFreeVector * > * fPMaxTable
virtual ~G4PenelopeRayleighModelMI()
static G4PhysicsFreeVector * fLogAtomicCrossSection[fMaxZ+1]
G4double GetA(size_t index)
G4double GetPAC(size_t index)
size_t GetNumberOfStoredPoints()
void AddPoint(G4double x0, G4double pac0, G4double a0, G4double b0, size_t ITTL0, size_t ITTU0)
G4double GetX(size_t index)
G4double SampleValue(G4double rndm)
G4double GetB(size_t index)
void PutValue(const std::size_t index, const G4double e, const G4double value)
G4double GetLowEdgeEnergy(const std::size_t index) const
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double HighEnergyLimit() const
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
G4Mutex PenelopeRayleighModelMutex
int classic_electr_radius