56 :
G4VEmModel(nam),fParticleChange(0),fParticle(0),isInitialised(false),
57 logAtomicCrossSection(0),atomicFormFactor(0),logFormFactorTable(0),
58 pMaxTable(0),samplingTable(0),fLocalTable(false)
60 fIntrinsicLowEnergyLimit = 100.0*
eV;
61 fIntrinsicHighEnergyLimit = 100.0*
GeV;
78 G4double logenergy = std::log(fIntrinsicLowEnergyLimit/2.);
79 G4double logmaxenergy = std::log(1.5*fIntrinsicHighEnergyLimit);
82 G4double logfactor1 = std::log(10.)/250.;
84 logEnergyGridPMax.push_back(logenergy);
86 if (logenergy < logtransitionenergy)
87 logenergy += logfactor1;
89 logenergy += logfactor2;
90 logEnergyGridPMax.push_back(logenergy);
91 }
while (logenergy < logmaxenergy);
100 if (logAtomicCrossSection)
102 for (
auto& item : (*logAtomicCrossSection))
103 if (item.second)
delete item.second;
104 delete logAtomicCrossSection;
105 logAtomicCrossSection =
nullptr;
107 if (atomicFormFactor)
109 for (
auto& item : (*atomicFormFactor))
110 if (item.second)
delete item.second;
111 delete atomicFormFactor;
112 atomicFormFactor =
nullptr;
119 void G4PenelopeRayleighModel::ClearTables()
128 if (logFormFactorTable)
130 for (
auto& item : (*logFormFactorTable))
131 if (item.second)
delete item.second;
132 delete logFormFactorTable;
133 logFormFactorTable =
nullptr;
138 for (
auto& item : (*pMaxTable))
139 if (item.second)
delete item.second;
146 for (
auto& item : (*samplingTable))
147 if (item.second)
delete item.second;
148 delete samplingTable;
149 samplingTable =
nullptr;
160 if (verboseLevel > 3)
161 G4cout <<
"Calling G4PenelopeRayleighModel::Initialise()" <<
G4endl;
171 if (verboseLevel > 3)
172 G4cout <<
"Calling G4PenelopeRayleighModel::Initialise() [master]" <<
G4endl;
178 if (!logAtomicCrossSection)
179 logAtomicCrossSection =
new std::map<G4int,G4PhysicsFreeVector*>;
180 if (!atomicFormFactor)
181 atomicFormFactor =
new std::map<G4int,G4PhysicsFreeVector*>;
183 if (!logFormFactorTable)
184 logFormFactorTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
186 pMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
188 samplingTable =
new std::map<const G4Material*,G4PenelopeSamplingData*>;
202 G4int iZ = (
G4int) theElementVector->at(j)->GetZ();
204 if (!logAtomicCrossSection->count(iZ))
209 if (!logFormFactorTable->count(material))
210 BuildFormFactorTable(material);
213 if (!(samplingTable->count(material)))
214 InitializeSamplingAlgorithm(material);
217 if (!pMaxTable->count(material))
218 GetPMaxTable(material);
222 if (verboseLevel > 1) {
223 G4cout <<
"Penelope Rayleigh model v2008 is initialized " << G4endl
231 if(isInitialised)
return;
233 isInitialised =
true;
241 if (verboseLevel > 3)
242 G4cout <<
"Calling G4PenelopeRayleighModel::InitialiseLocal()" <<
G4endl;
255 logAtomicCrossSection = theModel->logAtomicCrossSection;
256 atomicFormFactor = theModel->atomicFormFactor;
257 logFormFactorTable = theModel->logFormFactorTable;
258 pMaxTable = theModel->pMaxTable;
259 samplingTable = theModel->samplingTable;
262 logQSquareGrid = theModel->logQSquareGrid;
265 verboseLevel = theModel->verboseLevel;
285 if (verboseLevel > 3)
286 G4cout <<
"Calling CrossSectionPerAtom() of G4PenelopeRayleighModel" <<
G4endl;
292 if (!logAtomicCrossSection)
297 logAtomicCrossSection =
new std::map<G4int,G4PhysicsFreeVector*>;
300 if (!logAtomicCrossSection->count(iZ))
304 if (verboseLevel > 0)
308 ed <<
"Unable to retrieve the cross section table for Z=" << iZ <<
G4endl;
309 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
310 G4Exception(
"G4PenelopeRayleighModel::ComputeCrossSectionPerAtom()",
325 ed <<
"Unable to find Z=" << iZ <<
" in the atomic cross section table" <<
G4endl;
326 G4Exception(
"G4PenelopeRayleighModel::ComputeCrossSectionPerAtom()",
332 cross =
G4Exp(logXS);
334 if (verboseLevel > 2)
336 G4cout <<
"Rayleigh cross section at " << energy/
keV <<
" keV for Z=" << Z <<
356 std::vector<G4double> *StechiometricFactors =
new std::vector<G4double>;
357 for (
G4int i=0;i<nElements;i++)
359 G4double fraction = fractionVector[i];
360 G4double atomicWeigth = (*elementVector)[i]->GetA()/(
g/
mole);
361 StechiometricFactors->push_back(fraction/atomicWeigth);
364 G4double MaxStechiometricFactor = 0.;
365 for (
G4int i=0;i<nElements;i++)
367 if ((*StechiometricFactors)[i] > MaxStechiometricFactor)
368 MaxStechiometricFactor = (*StechiometricFactors)[i];
370 if (MaxStechiometricFactor<1e-16)
373 ed <<
"Inconsistent data of atomic composition for " <<
375 G4Exception(
"G4PenelopeRayleighModel::BuildFormFactorTable()",
379 for (
G4int i=0;i<nElements;i++)
380 (*StechiometricFactors)[i] /= MaxStechiometricFactor;
384 for (
G4int i=0;i<nElements;i++)
385 atomsPerMolecule += (*StechiometricFactors)[i];
393 for (
size_t k=0;k<logQSquareGrid.size();k++)
396 for (
G4int i=0;i<nElements;i++)
398 G4int iZ = (
G4int) (*elementVector)[i]->GetZ();
401 ff2 += f*f*(*StechiometricFactors)[i];
404 theFFVec->
PutValue(k,logQSquareGrid[k],std::log(ff2));
406 logFormFactorTable->insert(std::make_pair(material,theFFVec));
408 delete StechiometricFactors;
435 if (verboseLevel > 3)
436 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeRayleighModel" <<
G4endl;
440 if (photonEnergy0 <= fIntrinsicLowEnergyLimit)
456 if (!pMaxTable || !samplingTable || !logAtomicCrossSection || !atomicFormFactor ||
462 if (!logAtomicCrossSection)
463 logAtomicCrossSection =
new std::map<G4int,G4PhysicsFreeVector*>;
464 if (!atomicFormFactor)
465 atomicFormFactor =
new std::map<G4int,G4PhysicsFreeVector*>;
466 if (!logFormFactorTable)
467 logFormFactorTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
469 pMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
471 samplingTable =
new std::map<const G4Material*,G4PenelopeSamplingData*>;
474 if (!samplingTable->count(theMat))
478 if (verboseLevel > 0)
482 ed <<
"Unable to find the samplingTable data for " <<
484 ed <<
"This can happen only in Unit Tests" <<
G4endl;
485 G4Exception(
"G4PenelopeRayleighModel::SampleSecondaries()",
493 G4int iZ = (
G4int) theElementVector->at(j)->GetZ();
494 if (!logAtomicCrossSection->count(iZ))
503 if (!logFormFactorTable->count(theMat))
504 BuildFormFactorTable(theMat);
507 if (!(samplingTable->count(theMat)))
508 InitializeSamplingAlgorithm(theMat);
511 if (!pMaxTable->count(theMat))
512 GetPMaxTable(theMat);
533 G4double G = 0.5*(1+cosTheta*cosTheta);
541 G4double LastQ2inTheTable = theDataTable->
GetX(nData-1);
559 cosTheta = 1.0-2.0*xx/q2max;
560 G4double G = 0.5*(1+cosTheta*cosTheta);
566 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
570 G4double dirX = sinTheta*std::cos(phi);
571 G4double dirY = sinTheta*std::sin(phi);
577 photonDirection1.
rotateUz(photonDirection0);
587 void G4PenelopeRayleighModel::ReadDataFile(
const G4int Z)
590 if (verboseLevel > 2)
592 G4cout <<
"G4PenelopeRayleighModel::ReadDataFile()" <<
G4endl;
593 G4cout <<
"Going to read Rayleigh data files for Z=" << Z <<
G4endl;
596 char* path = getenv(
"G4LEDATA");
599 G4String excep =
"G4LEDATA environment variable not set!";
600 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
608 std::ostringstream ost;
610 ost << path <<
"/penelope/rayleigh/pdgra" << Z <<
".p08";
612 ost << path <<
"/penelope/rayleigh/pdgra0" << Z <<
".p08";
613 std::ifstream file(ost.str().c_str());
617 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
622 file >> readZ >> nPoints;
624 if (readZ != Z || nPoints <= 0 || nPoints >= 5000)
627 ed <<
"Corrupted data file for Z=" << Z <<
G4endl;
628 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
634 for (
size_t i=0;i<nPoints;i++)
636 file >> ene >> f1 >> f2 >> xs;
640 theVec->
PutValue(i,std::log(ene),std::log(xs));
641 if (file.eof() && i != (nPoints-1))
644 ed <<
"Corrupted data file for Z=" << Z <<
G4endl;
645 ed <<
"Found less than " << nPoints <<
"entries " <<
G4endl;
646 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
650 if (!logAtomicCrossSection)
652 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
653 "em2044",
FatalException,
"Unable to allocate the atomic cross section table");
657 logAtomicCrossSection->insert(std::make_pair(Z,theVec));
663 std::ostringstream ost2;
665 ost2 << path <<
"/penelope/rayleigh/pdaff" << Z <<
".p08";
667 ost2 << path <<
"/penelope/rayleigh/pdaff0" << Z <<
".p08";
668 file.open(ost2.str().c_str());
672 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
675 file >> readZ >> nPoints;
677 if (readZ != Z || nPoints <= 0 || nPoints >= 5000)
680 ed <<
"Corrupted data file for Z=" << Z <<
G4endl;
681 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
689 if (!logQSquareGrid.size())
691 for (
size_t i=0;i<nPoints;i++)
693 file >> q >> ff >> incoh;
698 logQSquareGrid.push_back(2.0*std::log(q));
700 if (file.eof() && i != (nPoints-1))
703 ed <<
"Corrupted data file for Z=" << Z <<
G4endl;
704 ed <<
"Found less than " << nPoints <<
"entries " <<
G4endl;
705 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
709 if (!atomicFormFactor)
711 G4Exception(
"G4PenelopeRayleighModel::ReadDataFile()",
713 "Unable to allocate the atomicFormFactor data table");
717 atomicFormFactor->insert(std::make_pair(Z,theFFVec));
730 G4double logQSquared = (QSquared>1e-10) ? std::log(QSquared) : -23.;
732 G4double maxlogQ2 = logQSquareGrid[logQSquareGrid.size()-1];
741 ed <<
"Unable to retrieve F squared table for " << mat->
GetName() <<
G4endl;
742 G4Exception(
"G4PenelopeRayleighModel::GetFSquared()",
746 if (logQSquared < -20)
751 else if (logQSquared > maxlogQ2)
760 if (verboseLevel > 3)
763 G4cout <<
"Q^2 = " << QSquared <<
" (units of 1/(m_e*c); F^2 = " << f2 <<
G4endl;
770 void G4PenelopeRayleighModel::InitializeSamplingAlgorithm(
const G4Material* mat)
775 const size_t np = 150;
777 for (
size_t i=1;i<logQSquareGrid.size();i++)
780 if (GetFSquared(mat,Q2) > 1e-35)
782 q2max =
G4Exp(logQSquareGrid[i-1]);
787 size_t nReducedPoints = np/4;
792 G4Exception(
"G4PenelopeRayleighModel::InitializeSamplingAlgorithm()",
794 "Too few points to initialize the sampling algorithm");
796 if (q2min > (q2max-1e-10))
798 G4cout <<
"q2min= " << q2min <<
" q2max= " << q2max <<
G4endl;
799 G4Exception(
"G4PenelopeRayleighModel::InitializeSamplingAlgorithm()",
801 "Too narrow grid to initialize the sampling algorithm");
814 const G4int nip = 51;
818 for (
size_t i=1;i<NUNIF-1;i++)
826 G4cout <<
"Vector x has " << x->size() <<
" points, while NUNIF = " << NUNIF <<
G4endl;
835 for (
size_t i=0;i<NUNIF-1;i++)
844 for (
G4int k=0;k<nip;k++)
848 pdfi->push_back(pdfk);
854 pdfih->push_back(pdfIK);
862 for (
G4int k=1;k<nip;k++)
865 G4double next = previous + cons*((*pdfi)[k-1]+4.0*(*pdfih)[k-1]+(*pdfi)[k]);
866 sumi->push_back(next);
869 G4double lastIntegral = (*sumi)[sumi->size()-1];
870 area->push_back(lastIntegral);
873 for (
size_t k=0;k<sumi->size();k++)
874 (*sumi)[k] *= factor;
877 if ((*pdfi)[0] < 1e-35)
878 (*pdfi)[0] = 1e-5*pdfmax;
879 if ((*pdfi)[pdfi->size()-1] < 1e-35)
880 (*pdfi)[pdfi->size()-1] = 1e-5*pdfmax;
883 G4double pui = (*pdfi)[pdfi->size()-1]*factor;
884 G4double B_temp = 1.0-1.0/(pli*pui*dx*dx);
885 G4double A_temp = (1.0/(pli*dx))-1.0-B_temp;
886 G4double C_temp = 1.0+A_temp+B_temp;
895 a->push_back(A_temp);
896 b->push_back(B_temp);
897 c->push_back(C_temp);
909 for (
G4int k=0;k<nip;k++)
912 G4double pap = (*area)[i]*(1.0+((*a)[i]+(*b)[i]*rr)*rr)*(1.0+((*a)[i]+(*b)[i]*rr)*rr)/
913 ((1.0-(*b)[i]*rr*rr)*(*c)[i]*((*x)[i+1]-(*x)[i]));
914 if (k == 0 || k == nip-1)
915 (*err)[i] += 0.5*std::fabs(pap-(*pdfi)[k]);
917 (*err)[i] += std::fabs(pap-(*pdfi)[k]);
922 if ((*err)[i] > 0.1*(*area)[i] && icase == 1)
938 (*x)[x->size()-1] = q2max;
945 if (x->size() != NUNIF || a->size() != NUNIF ||
946 err->size() != NUNIF || area->size() != NUNIF)
949 ed <<
"Problem in building the Table for Sampling: array dimensions do not match" <<
G4endl;
950 G4Exception(
"G4PenelopeRayleighModel::InitializeSamplingAlgorithm()",
962 for (
size_t i=0;i<err->size()-2;i++)
965 if ((*err)[i] > maxError)
967 maxError = (*err)[i];
973 G4double newx = 0.5*((*x)[iErrMax]+(*x)[iErrMax+1]);
975 x->insert(x->begin()+iErrMax+1,newx);
977 area->insert(area->begin()+iErrMax+1,0.);
978 a->insert(a->begin()+iErrMax+1,0.);
979 b->insert(b->begin()+iErrMax+1,0.);
980 c->insert(c->begin()+iErrMax+1,0.);
981 err->insert(err->begin()+iErrMax+1,0.);
984 for (
size_t i=iErrMax;i<=iErrMax+1;i++)
991 G4double dxLocal = (*x)[i+1]-(*x)[i];
994 for (
G4int k=0;k<nip;k++)
998 pdfi->push_back(pdfk);
1004 pdfih->push_back(pdfIK);
1011 sumi->push_back(0.);
1012 for (
G4int k=1;k<nip;k++)
1015 G4double next = previous + cons*((*pdfi)[k-1]+4.0*(*pdfih)[k-1]+(*pdfi)[k]);
1016 sumi->push_back(next);
1018 G4double lastIntegral = (*sumi)[sumi->size()-1];
1019 (*area)[i] = lastIntegral;
1022 G4double factor = 1.0/lastIntegral;
1023 for (
size_t k=0;k<sumi->size();k++)
1024 (*sumi)[k] *= factor;
1027 if ((*pdfi)[0] < 1e-35)
1028 (*pdfi)[0] = 1e-5*pdfmax;
1029 if ((*pdfi)[pdfi->size()-1] < 1e-35)
1030 (*pdfi)[pdfi->size()-1] = 1e-5*pdfmax;
1033 G4double pui = (*pdfi)[pdfi->size()-1]*factor;
1034 G4double B_temp = 1.0-1.0/(pli*pui*dxLocal*dxLocal);
1035 G4double A_temp = (1.0/(pli*dxLocal))-1.0-B_temp;
1036 G4double C_temp = 1.0+A_temp+B_temp;
1057 for (
G4int k=0;k<nip;k++)
1060 G4double pap = (*area)[i]*(1.0+((*a)[i]+(*b)[i]*rr)*rr)*(1.0+((*a)[i]+(*b)[i]*rr)*rr)/
1061 ((1.0-(*b)[i]*rr*rr)*(*c)[i]*((*x)[i+1]-(*x)[i]));
1062 if (k == 0 || k == nip-1)
1063 (*err)[i] += 0.5*std::fabs(pap-(*pdfi)[k]);
1065 (*err)[i] += std::fabs(pap-(*pdfi)[k]);
1070 if ((*err)[i] > 0.1*(*area)[i] && icase == 1)
1083 }
while(x->size() < np);
1085 if (x->size() != np || a->size() != np ||
1086 err->size() != np || area->size() != np)
1088 G4Exception(
"G4PenelopeRayleighModel::InitializeSamplingAlgorithm()",
1090 "Problem in building the extended Table for Sampling: array dimensions do not match ");
1097 for (
size_t i=0;i<np-1;i++)
1101 for (
size_t i=0;i<np-1;i++)
1105 errMax =
std::max(errMax,(*err)[i]);
1111 for (
size_t i=0;i<np-1;i++)
1114 PAC->push_back(previous+(*area)[i]);
1116 (*PAC)[PAC->size()-1] = 1.;
1123 std::vector<size_t> *ITTL =
new std::vector<size_t>;
1124 std::vector<size_t> *ITTU =
new std::vector<size_t>;
1127 for (
size_t i=0;i<np;i++)
1135 for (
size_t i=1;i<(np-1);i++)
1139 for (
size_t j=(*ITTL)[i-1];j<np && !found;j++)
1141 if ((*PAC)[j] > ptst)
1149 (*ITTU)[ITTU->size()-2] = ITTU->size()-1;
1150 (*ITTU)[ITTU->size()-1] = ITTU->size()-1;
1151 (*ITTL)[ITTL->size()-1] = ITTU->size()-2;
1153 if (ITTU->size() != np || ITTU->size() != np)
1155 G4Exception(
"G4PenelopeRayleighModel::InitializeSamplingAlgorithm()",
1157 "Problem in building the Limit Tables for Sampling: array dimensions do not match");
1165 for (
size_t i=0;i<np;i++)
1167 theTable->
AddPoint((*x)[i],(*PAC)[i],(*a)[i],(*b)[i],(*ITTL)[i],(*ITTU)[i]);
1170 if (verboseLevel > 2)
1172 G4cout <<
"*************************************************************************" <<
1174 G4cout <<
"Sampling table for Penelope Rayleigh scattering in " << mat->
GetName() <<
G4endl;
1177 samplingTable->insert(std::make_pair(mat,theTable));
1198 void G4PenelopeRayleighModel::GetPMaxTable(
const G4Material* mat)
1203 G4cout <<
"G4PenelopeRayleighModel::BuildPMaxTable" <<
G4endl;
1204 G4cout <<
"Going to instanziate the pMaxTable !" <<
G4endl;
1206 pMaxTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
1209 if (pMaxTable->count(mat))
1215 G4Exception(
"G4PenelopeRayleighModel::GetPMaxTable()",
1217 "SamplingTable is not properly instantiated");
1222 if (!samplingTable->count(mat))
1225 ed <<
"Sampling table for material " << mat->
GetName() <<
" not found";
1226 G4Exception(
"G4PenelopeRayleighModel::GetPMaxTable()",
1235 size_t nOfEnergyPoints = logEnergyGridPMax.size();
1238 const size_t nip = 51;
1240 for (
size_t ie=0;ie<logEnergyGridPMax.size();ie++)
1254 size_t lowerBound = 0;
1255 size_t upperBound = tablePoints-1;
1256 while (lowerBound <= upperBound)
1258 size_t midBin = (lowerBound + upperBound)/2;
1259 if( Qm2 < theTable->GetX(midBin))
1260 { upperBound = midBin-1; }
1262 { lowerBound = midBin+1; }
1272 for (
size_t k=0;k<nip;k++)
1276 (theTable->
GetX(upperBound+1)-Q1);
1281 if (std::fabs(con1) > 1.0e-16*std::fabs(con2))
1282 etap = con2*(1.0-std::sqrt(1.0-2.0*tau*con1/(con2*con2)))/con1;
1286 (1.0+(theA+theB*etap)*etap)*(1.0+(theA+theB*etap)*etap)/
1287 ((1.0-theB*etap*etap)*ci*(theTable->
GetX(upperBound+1)-Q1));
1288 fun->push_back(theFun);
1296 (5.0*(*fun)[0]+8.0*(*fun)[1]-(*fun)[2])*CONS;
1297 sum->push_back(secondPoint);
1298 for (
size_t hh=2;hh<nip-1;hh++)
1301 G4double next = previous+(13.0*((*fun)[hh-1]+(*fun)[hh])-
1302 (*fun)[hh+1]-(*fun)[hh-2])*HCONS;
1303 sum->push_back(next);
1305 G4double last = (*sum)[nip-2]+(5.0*(*fun)[nip-1]+8.0*(*fun)[nip-2]-
1306 (*fun)[nip-3])*CONS;
1307 sum->push_back(last);
1308 thePMax = thePAC + (*sum)[sum->size()-1];
1319 thePMax = theTable->
GetPAC(0);
1323 theVec->
PutValue(ie,energy,thePMax);
1326 pMaxTable->insert(std::make_pair(mat,theVec));
1335 G4cout <<
"*****************************************************************" <<
G4endl;
1339 G4cout <<
"*****************************************************************" <<
G4endl;
1340 if (!logFormFactorTable->count(mat))
1341 BuildFormFactorTable(mat);
G4double LowEnergyLimit() const
std::vector< G4Element * > G4ElementVector
std::ostringstream G4ExceptionDescription
virtual ~G4PenelopeRayleighModel()
G4double GetKineticEnergy() const
static constexpr double cm2
G4double HighEnergyLimit() const
std::vector< ExP01TrackerHit * > a
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4double GetB(size_t index)
const G4String & GetName() const
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
void PutValue(size_t index, G4double energy, G4double dataValue)
G4double GetPAC(size_t index)
size_t GetVectorLength() const
G4double GetLowEdgeEnergy(size_t binNumber) const
const G4ElementVector * GetElementVector() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
#define G4MUTEX_INITIALIZER
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
void SetHighEnergyLimit(G4double)
size_t GetNumberOfStoredPoints()
G4GLOB_DLL std::ostream G4cout
size_t GetTableSize() const
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector & rotateUz(const Hep3Vector &)
void DumpFormFactorTable(const G4Material *)
static constexpr double eV
G4double Value(G4double theEnergy, size_t &lastidx) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static G4ProductionCutsTable * GetProductionCutsTable()
G4double SampleValue(G4double rndm)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
G4double GetA(size_t index)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetX(size_t index)
static constexpr double GeV
G4ParticleChangeForGamma * fParticleChange
void SetProposedKineticEnergy(G4double proposedKinEnergy)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
size_t GetNumberOfElements() const
void ProposeTrackStatus(G4TrackStatus status)
G4PenelopeRayleighModel(const G4ParticleDefinition *p=0, const G4String &processName="PenRayleigh")
void AddPoint(G4double x0, G4double pac0, G4double a0, G4double b0, size_t ITTL0, size_t ITTU0)
static constexpr double barn
const G4double * GetFractionVector() const
static constexpr double keV
static constexpr double mole
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
const G4ParticleDefinition * fParticle
G4ParticleChangeForGamma * GetParticleChangeForGamma()
const G4Material * GetMaterial() const