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

#include <G4LivermorePhotoElectricModel.hh>

+ Inheritance diagram for G4LivermorePhotoElectricModel:

Public Member Functions

 G4LivermorePhotoElectricModel (const G4String &nam="LivermorePhElectric")
 
 ~G4LivermorePhotoElectricModel () override
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double energy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX) override
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double energy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
 
void InitialiseForElement (const G4ParticleDefinition *, G4int Z) override
 
void SetLimitNumberOfShells (G4int n)
 
G4double GetBindingEnergy (G4int Z, G4int shell)
 
G4LivermorePhotoElectricModeloperator= (const G4LivermorePhotoElectricModel &right)=delete
 
 G4LivermorePhotoElectricModel (const G4LivermorePhotoElectricModel &)=delete
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void FillNumberOfSecondaries (G4int &numberOfTriplets, G4int &numberOfRecoil)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectTargetAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementGetCurrentElement (const G4Material *mat=nullptr) const
 
G4int SelectRandomAtomNumber (const G4Material *) const
 
const G4IsotopeGetCurrentIsotope (const G4Element *elm=nullptr) const
 
G4int SelectIsotopeNumber (const G4Element *) const
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
G4VEmModelGetTripletModel ()
 
void SetTripletModel (G4VEmModel *)
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy) const
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetFluctuationFlag (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
void SetUseBaseMaterials (G4bool val)
 
G4bool UseBaseMaterials () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
void SetLPMFlag (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Attributes

G4ParticleChangeForGammafParticleChange = nullptr
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4PhysicsTablexSectionTable = nullptr
 
const G4MaterialpBaseMaterial = nullptr
 
const std::vector< G4double > * theDensityFactor = nullptr
 
const std::vector< G4int > * theDensityIdx = nullptr
 
G4double inveplus
 
G4double pFactor = 1.0
 
std::size_t currentCoupleIndex = 0
 
std::size_t basedCoupleIndex = 0
 
G4bool lossFlucFlag = true
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Detailed Description

Definition at line 49 of file G4LivermorePhotoElectricModel.hh.

Constructor & Destructor Documentation

◆ G4LivermorePhotoElectricModel() [1/2]

G4LivermorePhotoElectricModel::G4LivermorePhotoElectricModel ( const G4String & nam = "LivermorePhElectric")
explicit

Definition at line 72 of file G4LivermorePhotoElectricModel.cc.

72 : G4VEmModel(nam)
73{
74 verboseLevel = 0;
75 // Verbosity scale:
76 // 0 = nothing
77 // 1 = warning for energy non-conservation
78 // 2 = details of energy budget
79 // 3 = calculation of cross sections, file openings, sampling of atoms
80 // 4 = entering in methods
81
82 theGamma = G4Gamma::Gamma();
83 theElectron = G4Electron::Electron();
84
85 // default generator
87
88 if (verboseLevel > 0) {
89 G4cout << "Livermore PhotoElectric is constructed "
90 << " nShellLimit= " << nShellLimit << G4endl;
91 }
92
93 // Mark this model as "applicable" for atomic deexcitation
95
96 // For water
97 fSandiaCof.resize(4, 0.0);
98}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4Electron * Electron()
Definition G4Electron.cc:91
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
void SetDeexcitationFlag(G4bool val)
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67
void SetAngularDistribution(G4VEmAngularDistribution *)

◆ ~G4LivermorePhotoElectricModel()

G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel ( )
override

Definition at line 102 of file G4LivermorePhotoElectricModel.cc.

103{
104 if (isInitializer) {
105 for (G4int i = 0; i < ZMAXPE; ++i) {
106 if (fParamHigh[i]) {
107 delete fParamHigh[i];
108 fParamHigh[i] = nullptr;
109 }
110 if (fParamLow[i]) {
111 delete fParamLow[i];
112 fParamLow[i] = nullptr;
113 }
114 }
115 }
116}
int G4int
Definition G4Types.hh:85

◆ G4LivermorePhotoElectricModel() [2/2]

G4LivermorePhotoElectricModel::G4LivermorePhotoElectricModel ( const G4LivermorePhotoElectricModel & )
delete

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition * ,
G4double energy,
G4double Z,
G4double A = 0,
G4double cut = 0,
G4double emax = DBL_MAX )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 213 of file G4LivermorePhotoElectricModel.cc.

217{
218 if (verboseLevel > 3) {
219 G4cout << "\n G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom():"
220 << " Z= " << ZZ << " R(keV)= " << energy / keV << G4endl;
221 }
222 G4double cs = 0.0;
223 G4int Z = G4lrint(ZZ);
224 if (Z >= ZMAXPE || Z <= 0) {
225 return cs;
226 }
227 // if element was not initialised
228
229 // do initialisation safely for MT mode
230 if (fCrossSection->GetElementData(Z) == nullptr) {
231 InitialiseOnFly(Z);
232 if (fCrossSection->GetElementData(Z) == nullptr) { return cs; }
233 }
234
235 // 7: rows in the parameterization file; 5: number of parameters
236 G4int idx = fNShells[Z] * 7 - 5;
237
238 energy = std::max(energy, (*(fParamHigh[Z]))[idx - 1]);
239
240 G4double x1 = 1.0 / energy;
241 G4double x2 = x1 * x1;
242 G4double x3 = x2 * x1;
243
244 // high energy parameterisation
245 if (energy >= (*(fParamHigh[Z]))[0]) {
246 G4double x4 = x2 * x2;
247 G4double x5 = x4 * x1;
248
249 cs = x1 *
250 ((*(fParamHigh[Z]))[idx] + x1 * (*(fParamHigh[Z]))[idx + 1]
251 + x2 * (*(fParamHigh[Z]))[idx + 2] + x3 * (*(fParamHigh[Z]))[idx + 3]
252 + x4 * (*(fParamHigh[Z]))[idx + 4] + x5 * (*(fParamHigh[Z]))[idx + 5]);
253 }
254 // low energy parameterisation
255 else if (energy >= (*(fParamLow[Z]))[0]) {
256 G4double x4 = x2 * x2;
257 G4double x5 = x4 * x1; // this variable usage can probably be optimized
258 cs = x1 *
259 ((*(fParamLow[Z]))[idx] + x1 * (*(fParamLow[Z]))[idx + 1]
260 + x2 * (*(fParamLow[Z]))[idx + 2] + x3 * (*(fParamLow[Z]))[idx + 3]
261 + x4 * (*(fParamLow[Z]))[idx + 4] + x5 * (*(fParamLow[Z]))[idx + 5]);
262 }
263 // Tabulated values above k-shell ionization energy
264 else if (energy >= (*(fParamHigh[Z]))[1]) {
265 cs = x3 * (fCrossSection->GetElementData(Z))->Value(energy);
266 }
267 // Tabulated values below k-shell ionization energy
268 else {
269 cs = x3 * (fCrossSectionLE->GetElementData(Z))->Value(energy);
270 }
271 if (verboseLevel > 1) {
272 G4cout << "G4LivermorePhotoElectricModel: E(keV)= " << energy / keV << " Z= " << Z
273 << " cross(barn)= " << cs / barn << G4endl;
274 }
275 return cs;
276}
double G4double
Definition G4Types.hh:83
G4PhysicsVector * GetElementData(G4int Z) const
G4double energy(const ThreeVector &p, const G4double m)
int G4lrint(double ad)
Definition templates.hh:134

◆ CrossSectionPerVolume()

G4double G4LivermorePhotoElectricModel::CrossSectionPerVolume ( const G4Material * material,
const G4ParticleDefinition * p,
G4double energy,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 185 of file G4LivermorePhotoElectricModel.cc.

189{
190 fCurrSection = 0.0;
191 if (fWater && (material == fWater || material->GetBaseMaterial() == fWater)) {
192 if (energy <= fWaterEnergyLimit) {
193 fWater->GetSandiaTable()->GetSandiaCofWater(energy, fSandiaCof);
194
195 G4double energy2 = energy * energy;
196 G4double energy3 = energy * energy2;
197 G4double energy4 = energy2 * energy2;
198
199 fCurrSection = material->GetDensity()
200 * (fSandiaCof[0] / energy + fSandiaCof[1] / energy2 +
201 fSandiaCof[2] / energy3 + fSandiaCof[3] / energy4);
202 }
203 }
204 if (0.0 == fCurrSection) {
205 fCurrSection = G4VEmModel::CrossSectionPerVolume(material, p, energy);
206 }
207 return fCurrSection;
208}
G4double GetDensity() const
const G4Material * GetBaseMaterial() const
G4SandiaTable * GetSandiaTable() const
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)

◆ GetBindingEnergy()

G4double G4LivermorePhotoElectricModel::GetBindingEnergy ( G4int Z,
G4int shell )

Definition at line 725 of file G4LivermorePhotoElectricModel.cc.

726{
727 if (Z < 1 || Z >= ZMAXPE) {
728 return -1;
729 } // If Z is out of the supported return 0
730
731 InitialiseOnFly(Z);
732 if (fCrossSection->GetElementData(Z) == nullptr ||
733 shell < 0 || shell >= fNShellsUsed[Z]) {
734 return -1;
735 }
736
737 if (Z > 2) {
738 return fCrossSection->GetComponentDataByIndex(Z, shell)->Energy(0);
739 }
740 else {
741 return fCrossSection->GetElementData(Z)->Energy(0);
742 }
743}
G4PhysicsVector * GetComponentDataByIndex(G4int Z, std::size_t idx) const
G4double Energy(const std::size_t index) const

◆ Initialise()

void G4LivermorePhotoElectricModel::Initialise ( const G4ParticleDefinition * ,
const G4DataVector &  )
overridevirtual

Implements G4VEmModel.

Definition at line 120 of file G4LivermorePhotoElectricModel.cc.

122{
123 if (verboseLevel > 1) {
124 G4cout << "Calling G4LivermorePhotoElectricModel::Initialise() " << G4endl;
125 }
126
127 // initialise static tables only once
128 std::call_once(applyOnce, [this]() { isInitializer = true; });
129
130 if (isInitializer) {
131 G4AutoLock l(&livPhotoeffMutex);
132 FindDirectoryPath();
133 if (fWater == nullptr) {
134 fWater = G4Material::GetMaterial("G4_WATER", false);
135 if (fWater == nullptr) {
136 fWater = G4Material::GetMaterial("Water", false);
137 }
138 if (fWater != nullptr) {
139 fWaterEnergyLimit = 13.6 * CLHEP::eV;
140 }
141 }
142
143 if (fCrossSection == nullptr) {
144 fCrossSection = new G4ElementData(ZMAXPE);
145 fCrossSection->SetName("PhotoEffXS");
146 fCrossSectionLE = new G4ElementData(ZMAXPE);
147 fCrossSectionLE->SetName("PhotoEffLowXS");
148 }
149
150 const G4ElementTable* elemTable = G4Element::GetElementTable();
151 std::size_t numElems = (*elemTable).size();
152 for (std::size_t ie = 0; ie < numElems; ++ie) {
153 const G4Element* elem = (*elemTable)[ie];
154 G4int Z = elem->GetZasInt();
155 if (Z < ZMAXPE) {
156 if (fCrossSection->GetElementData(Z) == nullptr) {
157 ReadData(Z);
158 }
159 }
160 }
161 l.unlock();
162 }
163
164 if (verboseLevel > 1) {
165 G4cout << "Loaded cross section files for new LivermorePhotoElectric model" << G4endl;
166 }
167 if (nullptr == fParticleChange) {
169 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
170 }
171
172 fDeexcitationActive = false;
173 if (nullptr != fAtomDeexcitation) {
174 fDeexcitationActive = fAtomDeexcitation->IsFluoActive();
175 }
176
177 if (verboseLevel > 1) {
178 G4cout << "LivermorePhotoElectric model is initialized " << G4endl;
179 }
180}
std::vector< G4Element * > G4ElementTable
#define elem(i, j)
void SetName(const G4String &nam)
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
G4int GetZasInt() const
Definition G4Element.hh:120
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4ParticleChangeForGamma * GetParticleChangeForGamma()

◆ InitialiseForElement()

void G4LivermorePhotoElectricModel::InitialiseForElement ( const G4ParticleDefinition * ,
G4int Z )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 748 of file G4LivermorePhotoElectricModel.cc.

749{
750 if (fCrossSection == nullptr) {
751 fCrossSection = new G4ElementData(ZMAXPE);
752 fCrossSection->SetName("PhotoEffXS");
753 fCrossSectionLE = new G4ElementData(ZMAXPE);
754 fCrossSectionLE->SetName("PhotoEffLowXS");
755 }
756 ReadData(Z);
757}

◆ operator=()

G4LivermorePhotoElectricModel & G4LivermorePhotoElectricModel::operator= ( const G4LivermorePhotoElectricModel & right)
delete

◆ SampleSecondaries()

void G4LivermorePhotoElectricModel::SampleSecondaries ( std::vector< G4DynamicParticle * > * fvect,
const G4MaterialCutsCouple * couple,
const G4DynamicParticle * aDynamicGamma,
G4double tmin,
G4double maxEnergy )
overridevirtual

Implements G4VEmModel.

Definition at line 280 of file G4LivermorePhotoElectricModel.cc.

284{
285 G4double gammaEnergy = aDynamicGamma->GetKineticEnergy();
286 if (verboseLevel > 3) {
287 G4cout << "G4LivermorePhotoElectricModel::SampleSecondaries() Egamma(keV)= "
288 << gammaEnergy / keV << G4endl;
289 }
290
291 // kill incident photon
294
295 // low-energy photo-effect in water - full absorption
296 const G4Material* material = couple->GetMaterial();
297 if (fWater && (material == fWater || material->GetBaseMaterial() == fWater)) {
298 if (gammaEnergy <= fWaterEnergyLimit) {
300 return;
301 }
302 }
303
304 // Returns the normalized direction of the momentum
305 G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection();
306
307 // Select randomly one element in the current material
308 const G4Element* elm = SelectRandomAtom(material, theGamma, gammaEnergy);
309 G4int Z = elm->GetZasInt();
310
311 // Select the ionised shell in the current atom according to shell
312 // cross sections
313
314 // If element was not initialised gamma should be absorbed
315 if (Z >= ZMAXPE || fCrossSection->GetElementData(Z) == nullptr) {
317 return;
318 }
319
320 // SAMPLING OF THE SHELL INDEX
321 std::size_t shellIdx = 0;
322 std::size_t nn = fNShellsUsed[Z];
323 if (nn > 1) {
324 if (gammaEnergy >= (*(fParamHigh[Z]))[0]) {
325 G4double x1 = 1.0 / gammaEnergy;
326 G4double x2 = x1 * x1;
327 G4double x3 = x2 * x1;
328 G4double x4 = x3 * x1;
329 G4double x5 = x4 * x1;
330 std::size_t idx = nn * 7 - 5;
331 // when do sampling common factors are not taken into account
332 // so cross section is not real
333
334 G4double rand = G4UniformRand();
335 G4double cs0 = rand *
336 ((*(fParamHigh[Z]))[idx] + x1 * (*(fParamHigh[Z]))[idx + 1]
337 + x2 * (*(fParamHigh[Z]))[idx + 2] + x3 * (*(fParamHigh[Z]))[idx + 3]
338 + x4 * (*(fParamHigh[Z]))[idx + 4] + x5 * (*(fParamHigh[Z]))[idx + 5]);
339
340 for (shellIdx = 0; shellIdx < nn; ++shellIdx) {
341 idx = shellIdx * 7 + 2;
342 if (gammaEnergy > (*(fParamHigh[Z]))[idx - 1]) {
343 G4double cs = (*(fParamHigh[Z]))[idx] + x1 * (*(fParamHigh[Z]))[idx + 1]
344 + x2 * (*(fParamHigh[Z]))[idx + 2] + x3 * (*(fParamHigh[Z]))[idx + 3]
345 + x4 * (*(fParamHigh[Z]))[idx + 4] + x5 * (*(fParamHigh[Z]))[idx + 5];
346
347 if (cs >= cs0) {
348 break;
349 }
350 }
351 }
352 if (shellIdx >= nn) {
353 shellIdx = nn - 1;
354 }
355 }
356 else if (gammaEnergy >= (*(fParamLow[Z]))[0]) {
357 G4double x1 = 1.0 / gammaEnergy;
358 G4double x2 = x1 * x1;
359 G4double x3 = x2 * x1;
360 G4double x4 = x3 * x1;
361 G4double x5 = x4 * x1;
362 std::size_t idx = nn * 7 - 5;
363 // when do sampling common factors are not taken into account
364 // so cross section is not real
365 G4double cs0 = G4UniformRand() *
366 ((*(fParamLow[Z]))[idx] + x1 * (*(fParamLow[Z]))[idx + 1]
367 + x2 * (*(fParamLow[Z]))[idx + 2] + x3 * (*(fParamLow[Z]))[idx + 3]
368 + x4 * (*(fParamLow[Z]))[idx + 4] + x5 * (*(fParamLow[Z]))[idx + 5]);
369 for (shellIdx = 0; shellIdx < nn; ++shellIdx) {
370 idx = shellIdx * 7 + 2;
371 if (gammaEnergy > (*(fParamLow[Z]))[idx - 1]) {
372 G4double cs = (*(fParamLow[Z]))[idx] + x1 * (*(fParamLow[Z]))[idx + 1]
373 + x2 * (*(fParamLow[Z]))[idx + 2] + x3 * (*(fParamLow[Z]))[idx + 3]
374 + x4 * (*(fParamLow[Z]))[idx + 4] + x5 * (*(fParamLow[Z]))[idx + 5];
375 if (cs >= cs0) {
376 break;
377 }
378 }
379 }
380 if (shellIdx >= nn) {
381 shellIdx = nn - 1;
382 }
383 }
384 else {
385 // when do sampling common factors are not taken into account
386 // so cross section is not real
387 G4double cs = G4UniformRand();
388
389 if (gammaEnergy >= (*(fParamHigh[Z]))[1]) {
390 // above K-shell binding energy
391 cs *= fCrossSection->GetElementData(Z)->Value(gammaEnergy);
392 }
393 else {
394 // below K-shell binding energy
395 cs *= fCrossSectionLE->GetElementData(Z)->Value(gammaEnergy);
396 }
397
398 for (G4int j = 0; j < (G4int)nn; ++j) {
399 shellIdx = (std::size_t)fCrossSection->GetComponentID(Z, j);
400 if (gammaEnergy > (*(fParamLow[Z]))[7 * shellIdx + 1]) {
401 cs -= fCrossSection->GetValueForComponent(Z, j, gammaEnergy);
402 }
403 if (cs <= 0.0 || j + 1 == (G4int)nn) {
404 break;
405 }
406 }
407 }
408 }
409 // END: SAMPLING OF THE SHELL
410
411 G4double bindingEnergy = (*(fParamHigh[Z]))[shellIdx * 7 + 1];
412 const G4AtomicShell* shell = nullptr;
413
414 // no de-excitation from the last shell
415 if (fDeexcitationActive && shellIdx + 1 < nn) {
416 auto as = G4AtomicShellEnumerator(shellIdx);
417 shell = fAtomDeexcitation->GetAtomicShell(Z, as);
418 }
419
420 // If binding energy of the selected shell is larger than photon energy
421 // do not generate secondaries
422 if (gammaEnergy < bindingEnergy) {
424 return;
425 }
426
427 // Primary outcoming electron
428 G4double eKineticEnergy = gammaEnergy - bindingEnergy;
429 G4double edep = bindingEnergy;
430
431 // Calculate direction of the photoelectron
433 aDynamicGamma, eKineticEnergy, (G4int)shellIdx, couple->GetMaterial());
434
435 // The electron is created
436 auto electron =
437 new G4DynamicParticle(theElectron, electronDirection, eKineticEnergy);
438 fvect->push_back(electron);
439
440 // Sample deexcitation
441 if (nullptr != shell) {
442 G4int index = couple->GetIndex();
443 if (fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
444 std::size_t nbefore = fvect->size();
445
446 fAtomDeexcitation->GenerateParticles(fvect, shell, Z, index);
447 std::size_t nafter = fvect->size();
448 if (nafter > nbefore) {
449 G4double esec = 0.0;
450 for (std::size_t j = nbefore; j < nafter; ++j) {
451 G4double e = ((*fvect)[j])->GetKineticEnergy();
452 if (esec + e > edep) {
453 // correct energy in order to have energy balance
454 e = edep - esec;
455 ((*fvect)[j])->SetKineticEnergy(e);
456 esec += e;
457 // delete the rest of secondaries (should not happens)
458 for (std::size_t jj = nafter - 1; jj > j; --jj) {
459 delete (*fvect)[jj];
460 fvect->pop_back();
461 }
462 break;
463 }
464 esec += e;
465 }
466 edep -= esec;
467 }
468 }
469 }
470 // energy balance - excitation energy left
471 if (edep > 0.0) {
473 }
474}
@ fStopAndKill
#define G4UniformRand()
Definition Randomize.hh:52
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4int GetComponentID(G4int Z, std::size_t idx) const
G4double GetValueForComponent(G4int Z, std::size_t idx, G4double kinEnergy) const
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4double Value(const G4double energy, std::size_t &lastidx) const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)

◆ SetLimitNumberOfShells()

void G4LivermorePhotoElectricModel::SetLimitNumberOfShells ( G4int n)
inline

Definition at line 72 of file G4LivermorePhotoElectricModel.hh.

72{ nShellLimit = n; };

Member Data Documentation

◆ fParticleChange

G4ParticleChangeForGamma* G4LivermorePhotoElectricModel::fParticleChange = nullptr
protected

Definition at line 80 of file G4LivermorePhotoElectricModel.hh.

Referenced by Initialise(), and SampleSecondaries().


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