Geant4 11.1.1
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 64 of file G4GSPWACorrections.cc.

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

◆ ~G4GSPWACorrections()

G4GSPWACorrections::~G4GSPWACorrections ( )

Definition at line 75 of file G4GSPWACorrections.cc.

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

Member Function Documentation

◆ GetPWACorrectionFactors()

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

Definition at line 81 of file G4GSPWACorrections.cc.

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

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

◆ Initialise()

void G4GSPWACorrections::Initialise ( )

Definition at line 111 of file G4GSPWACorrections.cc.

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

Referenced by G4GoudsmitSaundersonMscModel::Initialise().


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