Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GSPWACorrections Class Reference

#include <G4GSPWACorrections.hh>

Public Member Functions

 G4GSPWACorrections (G4bool iselectron=true)
 
 ~G4GSPWACorrections ()
 
void Initialise ()
 
void GetPWACorrectionFactors (G4double logekin, G4double beta2, G4int matindx, G4double &corToScr, G4double &corToQ1, G4double &corToG2PerG1)
 

Detailed Description

Definition at line 61 of file G4GSPWACorrections.hh.

Constructor & Destructor Documentation

◆ G4GSPWACorrections()

G4GSPWACorrections::G4GSPWACorrections ( G4bool iselectron = true)

Definition at line 65 of file G4GSPWACorrections.cc.

65 : fIsElectron(iselectron) {
66 // init grids related data member values
67 fMaxEkin = CLHEP::electron_mass_c2*(1./std::sqrt(1.-gMaxBeta2)-1.);
68 fLogMinEkin = G4Log(gMinEkin);
69 fInvLogDelEkin = (gNumEkin-gNumBeta2)/G4Log(gMidEkin/gMinEkin);
70 G4double pt2 = gMidEkin*(gMidEkin+2.0*CLHEP::electron_mass_c2);
71 fMinBeta2 = pt2/(pt2+CLHEP::electron_mass_c2*CLHEP::electron_mass_c2);
72 fInvDelBeta2 = (gNumBeta2-1.)/(gMaxBeta2-fMinBeta2);
73}
G4double G4Log(G4double x)
Definition G4Log.hh:227
double G4double
Definition G4Types.hh:83

◆ ~G4GSPWACorrections()

G4GSPWACorrections::~G4GSPWACorrections ( )

Definition at line 76 of file G4GSPWACorrections.cc.

76 {
77 ClearDataPerElement();
78 ClearDataPerMaterial();
79}

Member Function Documentation

◆ GetPWACorrectionFactors()

void G4GSPWACorrections::GetPWACorrectionFactors ( G4double logekin,
G4double beta2,
G4int matindx,
G4double & corToScr,
G4double & corToQ1,
G4double & corToG2PerG1 )

Definition at line 82 of file G4GSPWACorrections.cc.

83 {
84 G4int ekinIndxLow = 0;
85 G4double remRfaction = 0.;
86 if (beta2>=gMaxBeta2) {
87 ekinIndxLow = gNumEkin - 1;
88 // remRfaction = -1.
89 } else if (beta2>=fMinBeta2) { // linear interpolation on \beta^2
90 remRfaction = (beta2 - fMinBeta2) * fInvDelBeta2;
91 ekinIndxLow = (G4int)remRfaction;
92 remRfaction -= ekinIndxLow;
93 ekinIndxLow += (gNumEkin - gNumBeta2);
94 } else if (logekin>=fLogMinEkin) {
95 remRfaction = (logekin - fLogMinEkin) * fInvLogDelEkin;
96 ekinIndxLow = (G4int)remRfaction;
97 remRfaction -= ekinIndxLow;
98 } // the defaults otherwise i.e. use the lowest energy values when ekin is smaller than the minum ekin
99 //
100 DataPerMaterial *data = fDataPerMaterial[matindx];
101 corToScr = data->fCorScreening[ekinIndxLow];
102 corToQ1 = data->fCorFirstMoment[ekinIndxLow];
103 corToG2PerG1 = data->fCorSecondMoment[ekinIndxLow];
104 if (remRfaction>0.) {
105 corToScr += remRfaction*(data->fCorScreening[ekinIndxLow+1] - data->fCorScreening[ekinIndxLow]);
106 corToQ1 += remRfaction*(data->fCorFirstMoment[ekinIndxLow+1] - data->fCorFirstMoment[ekinIndxLow]);
107 corToG2PerG1 += remRfaction*(data->fCorSecondMoment[ekinIndxLow+1] - data->fCorSecondMoment[ekinIndxLow]);
108 }
109}
int G4int
Definition G4Types.hh:85

Referenced by G4GoudsmitSaundersonMscModel::CrossSectionPerVolume(), and G4GoudsmitSaundersonMscModel::GetTransportMeanFreePath().

◆ Initialise()

void G4GSPWACorrections::Initialise ( )

Definition at line 112 of file G4GSPWACorrections.cc.

112 {
113 // load PWA correction data for each elements that belongs to materials that are used in the detector
114 InitDataPerElement();
115 // clear PWA correction data per material
116 ClearDataPerMaterial();
117 // initialise PWA correction data for the materials that are used in the detector
118 InitDataPerMaterials();
119}

Referenced by G4GoudsmitSaundersonMscModel::Initialise().


The documentation for this class was generated from the following files: