65 "C" ,
"N" ,
"O" ,
"F" ,
"Ne",
"Na",
"Mg",
"Al",
"Si",
"P" ,
"S",
"Cl",
"Ar",
"K" ,
"Ca",
"Sc",
66 "Ti",
"V" ,
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
"Rb",
67 "Sr",
"Y" ,
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I" ,
68 "Xe",
"Cs",
"Ba",
"La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
69 "Yb",
"Lu",
"Hf",
"Ta",
"W" ,
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
70 "Rn",
"Fr",
"Ra",
"Ac",
"Th",
"Pa",
"U" ,
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf"};
93 G4int ekinIndxLow = 0;
100 ekinIndxLow = (
G4int)remRfaction;
101 remRfaction -= ekinIndxLow;
105 ekinIndxLow = (
G4int)remRfaction;
106 remRfaction -= ekinIndxLow;
113 if (remRfaction>0.) {
134 G4int ekinIndxLow = 0;
141 ekinIndxLow = (
G4int)probIndxHigh;
142 probIndxHigh -= ekinIndxLow;
146 ekinIndxLow = (
G4int)probIndxHigh;
147 probIndxHigh -= ekinIndxLow;
155 ekindx = ekinIndxLow;
163 probIndxHigh -= deltIndxLow;
169 deltindx = deltIndxLow;
176 G4double ang = std::sqrt(0.5*(1.-cost));
179 remRfaction -= angIndx;
184 val = perDelta->
fSA + dum*(perDelta->
fSB + dum*(perDelta->
fSC + dum*perDelta->
fSD));
209 for (
size_t imc=0; imc<numMatCuts; ++imc) {
217 size_t numElems = elemVect->size();
218 for (
size_t ielem=0; ielem<numElems; ++ielem) {
219 const G4Element *elem = (*elemVect)[ielem];
241 for (
size_t imc=0; imc<numMatCuts; ++imc) {
266 char* tmppath = getenv(
"G4LEDATA");
268 G4Exception(
"G4GSMottCorrection::LoadMCDataElement()",
"em0006",
270 "Environment variable G4LEDATA not defined");
273 std::string path(tmppath);
275 path +=
"/msc_GS/MottCor/el/";
277 path +=
"/msc_GS/MottCor/pos/";
297 infile >> perDelta->
fSA;
298 infile >> perDelta->
fSB;
299 infile >> perDelta->
fSC;
300 infile >> perDelta->
fSD;
307 std::string *dataString =
nullptr;
308 std::string compfilename(fname+
".z");
310 std::ifstream
in(compfilename, std::ios::binary | std::ios::ate);
313 int fileSize = in.tellg();
315 in.seekg(0,std::ios::beg);
317 Bytef *compdata =
new Bytef[fileSize];
319 in.read((
char*)compdata, fileSize);
322 uLongf complen = (uLongf)(fileSize*4);
323 Bytef *uncompdata =
new Bytef[complen];
324 while (
Z_OK!=uncompress(uncompdata, &complen, compdata, fileSize)) {
328 uncompdata =
new Bytef[complen];
333 dataString =
new std::string((
char*)uncompdata, (
long)complen);
335 delete [] uncompdata;
337 std::string msg =
" Problem while trying to read " + compfilename +
" data file.\n";
343 iss.str(*dataString);
353 constexpr
G4double finstrc2 = 5.325135453E-5;
356 constFactor *= constFactor;
376 for (
G4int ielem=0; ielem<numElems; ++ielem) {
377 G4double zet = (*elemVect)[ielem]->GetZ();
381 G4double iwa = (*elemVect)[ielem]->GetN();
382 G4double ipz = nbAtomsPerVolVect[ielem]/totNbAtomsPerVol;
385 ze += dum*(-2.0/3.0)*
G4Log(zet);
386 zx += dum*
G4Log(1.0+3.34*finstrc2*zet*zet);
391 moliereBc = const1*density*zs/sa*
G4Exp(ze/zs)/
G4Exp(zx/zs);
392 moliereXc2 = const2*density*zs/sa;
408 for (
G4int ielem=0; ielem<numElems; ++ielem) {
409 const G4Element *elem = (*elemVect)[ielem];
416 G4double nZZPlus1 = nbAtomsPerVolVect[ielem]*zet*(zet+1.0)/totNbAtomsPerVol;
431 mcScrCF *= constFactor*Z23/(4.*pt2);
458 perMatPerDelta->
fSA += nZZPlus1*perElemPerDelta->
fSA;
459 perMatPerDelta->
fSB += nZZPlus1*perElemPerDelta->
fSB;
460 perMatPerDelta->
fSC += nZZPlus1*perElemPerDelta->
fSC;
461 perMatPerDelta->
fSD += nZZPlus1*perElemPerDelta->
fSD;
465 if (ielem==numElems-1) {
470 perMatPerEkin->
fMCScreening = constFactor*dumScr*moliereBc/moliereXc2;
474 G4double scrCorTed = constFactor*dumScr/(4.*pt2);
480 G4double G2PerG1 = 3.*(1.+scrCorTed)*((1.+2.*scrCorTed)*dum0-2.)/((1.+scrCorTed)*dum0-1.);
496 perMatPerDelta->
fSA /= maxVal;
497 perMatPerDelta->
fSB /= maxVal;
498 perMatPerDelta->
fSC /= maxVal;
499 perMatPerDelta->
fSD /= maxVal;
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static constexpr G4int gNumDelta
std::vector< DataPerMaterial * > fMCDataPerElement
static size_t GetNumberOfMaterials()
static constexpr double cm3
void ClearMCDataPerElement()
static constexpr double g
static constexpr G4int gNumBeta2
static constexpr G4double gMaxBeta2
static constexpr G4int gNumEkin
const G4ElementVector * GetElementVector() const
void LoadMCDataElement(const G4Element *)
void InitMCDataPerElement()
const G4double * GetVecNbOfAtomsPerVolume() const
DataPerEkin ** fDataPerEkin
static constexpr G4double gMaxDelta
void ClearMCDataPerMaterial()
static constexpr G4int gNumAngle
G4double G4Log(G4double x)
const XML_Char const XML_Char * data
static constexpr double cm
static constexpr G4int gMaxZet
static constexpr G4double gMinEkin
void GetMottCorrectionFactors(G4double logekin, G4double beta2, G4int matindx, G4double &mcToScr, G4double &mcToQ1, G4double &mcToG2PerG1)
static constexpr double electron_mass_c2
void InitMCDataMaterial(const G4Material *)
static constexpr double MeV
static const std::string gElemSymbols[]
G4double GetMottRejectionValue(G4double logekin, G4double G4beta2, G4double q1, G4double cost, G4int matindx, G4int &ekindx, G4int &deltindx)
void AllocateDataPerMaterial(DataPerMaterial *)
size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
static constexpr G4double gMidEkin
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
DataPerDelta ** fDataPerDelta
std::vector< G4Element * > G4ElementVector
void DeAllocateDataPerMaterial(DataPerMaterial *)
void ReadCompressedFile(std::string fname, std::istringstream &iss)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4GSMottCorrection(G4bool iselectron=true)
const G4Material * GetMaterial() const
G4double GetTotNbOfAtomsPerVolume() const
static constexpr double fine_structure_const
std::vector< DataPerMaterial * > fMCDataPerMaterial
size_t GetNumberOfElements() const
G4double GetDensity() const
void InitMCDataPerMaterials()