Geant4 11.1.1
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")
 
virtual ~G4LivermorePhotoElectricModel ()
 
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)
 
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 Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
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 LPMFlag () 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 SetLPMFlag (G4bool val)
 
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)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Attributes

G4ParticleChangeForGammafParticleChange
 
- 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
 
size_t currentCoupleIndex = 0
 
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 50 of file G4LivermorePhotoElectricModel.hh.

Constructor & Destructor Documentation

◆ G4LivermorePhotoElectricModel() [1/2]

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

Definition at line 69 of file G4LivermorePhotoElectricModel.cc.

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

◆ ~G4LivermorePhotoElectricModel()

G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel ( )
virtual

Definition at line 100 of file G4LivermorePhotoElectricModel.cc.

101{
102 if(IsMaster())
103 {
104 delete fShellCrossSection;
105 fShellCrossSection = nullptr;
106 for(G4int i = 0; i <= maxZ; ++i)
107 {
108 if(fParamHigh[i]){
109 delete fParamHigh[i];
110 fParamHigh[i] = nullptr;
111 }
112 if(fParamLow[i]){
113 delete fParamLow[i];
114 fParamLow[i] = nullptr;
115 }
116 if(fCrossSection[i]){
117 delete fCrossSection[i];
118 fCrossSection[i] = nullptr;
119 }
120 if(fCrossSectionLE[i]){
121 delete fCrossSectionLE[i];
122 fCrossSectionLE[i] = nullptr;
123 }
124
125 }
126 }
127}
int G4int
Definition: G4Types.hh:85
G4bool IsMaster() const
Definition: G4VEmModel.hh:725

◆ 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 214 of file G4LivermorePhotoElectricModel.cc.

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

190{
191 fCurrSection = 0.0;
192 if(fWater && (material == fWater ||
193 material->GetBaseMaterial() == fWater)) {
194 if(energy <= fWaterEnergyLimit) {
195 fWater->GetSandiaTable()->GetSandiaCofWater(energy, fSandiaCof);
196
197 G4double energy2 = energy*energy;
198 G4double energy3 = energy*energy2;
199 G4double energy4 = energy2*energy2;
200
201 fCurrSection = material->GetDensity()*
202 (fSandiaCof[0]/energy + fSandiaCof[1]/energy2 +
203 fSandiaCof[2]/energy3 + fSandiaCof[3]/energy4);
204 }
205 }
206 if(0.0 == fCurrSection) {
207 fCurrSection = G4VEmModel::CrossSectionPerVolume(material, p, energy);
208 }
209 return fCurrSection;
210}
G4double GetDensity() const
Definition: G4Material.hh:175
const G4Material * GetBaseMaterial() const
Definition: G4Material.hh:228
G4SandiaTable * GetSandiaTable() const
Definition: G4Material.hh:224
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)
Definition: G4VEmModel.cc:181

◆ GetBindingEnergy()

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

Definition at line 715 of file G4LivermorePhotoElectricModel.cc.

716{
717 if(Z < 1 || Z > maxZ) { return -1;} //If Z is out of the supported return 0
718 //If necessary load data for Z
719 InitialiseForElement(theGamma, Z);
720 if(fCrossSection[Z] == nullptr || shell < 0 || shell >= fNShellsUsed[Z]) { return -1; }
721
722 if(Z>2)
723 return fShellCrossSection->GetComponentDataByIndex(Z, shell)->Energy(0);
724 else
725 return fCrossSection[Z]->Energy(0);
726}
G4PhysicsVector * GetComponentDataByIndex(G4int Z, G4int idx)
G4double Energy(const std::size_t index) const

◆ Initialise()

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

Implements G4VEmModel.

Definition at line 132 of file G4LivermorePhotoElectricModel.cc.

134{
135 if (verboseLevel > 2) {
136 G4cout << "Calling G4LivermorePhotoElectricModel::Initialise() " << G4endl;
137 }
138
139 if(IsMaster()) {
140
141 if(fWater == nullptr) {
142 fWater = G4Material::GetMaterial("G4_WATER", false);
143 if(fWater == nullptr) { fWater = G4Material::GetMaterial("Water", false); }
144 if(fWater) { fWaterEnergyLimit = 13.6*eV; }
145 }
146
147 if(fShellCrossSection == nullptr) { fShellCrossSection = new G4ElementData(); }
148
149 const G4ElementTable* elemTable = G4Element::GetElementTable();
150 std::size_t numElems = (*elemTable).size();
151 for(std::size_t ie = 0; ie < numElems; ++ie)
152 {
153 const G4Element* elem = (*elemTable)[ie];
154 const G4int Z = std::min(maxZ, elem->GetZasInt());
155 if(fCrossSection[Z] == nullptr)
156 {
157 ReadData(Z);
158 }
159 }
160 }
161
162 if (verboseLevel > 2) {
163 G4cout << "Loaded cross section files for new LivermorePhotoElectric model"
164 << G4endl;
165 }
166 if(!isInitialised) {
167 isInitialised = true;
169 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
170 }
171
172 fDeexcitationActive = false;
173 if(fAtomDeexcitation) {
174 fDeexcitationActive = fAtomDeexcitation->IsFluoActive();
175 }
176
177 if (verboseLevel > 0) {
178 G4cout << "LivermorePhotoElectric model is initialized " << G4endl
179 << G4endl;
180 }
181}
std::vector< G4Element * > G4ElementTable
#define elem(i, j)
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:403
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:691
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:124

◆ InitialiseForElement()

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

Reimplemented from G4VEmModel.

Definition at line 730 of file G4LivermorePhotoElectricModel.cc.

732{
733 if (fCrossSection[Z] == nullptr) {
734#ifdef G4MULTITHREADED
735 G4MUTEXLOCK(&livPhotoeffMutex);
736 if (fCrossSection[Z] == nullptr) {
737#endif
738 ReadData(Z);
739#ifdef G4MULTITHREADED
740 }
741 G4MUTEXUNLOCK(&livPhotoeffMutex);
742#endif
743 }
744}
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254

Referenced by ComputeCrossSectionPerAtom(), and GetBindingEnergy().

◆ 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 281 of file G4LivermorePhotoElectricModel.cc.

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

◆ SetLimitNumberOfShells()

void G4LivermorePhotoElectricModel::SetLimitNumberOfShells ( G4int  n)
inline

Definition at line 127 of file G4LivermorePhotoElectricModel.hh.

128{
129 nShellLimit = n;
130}

Member Data Documentation

◆ fParticleChange

G4ParticleChangeForGamma* G4LivermorePhotoElectricModel::fParticleChange
protected

Definition at line 90 of file G4LivermorePhotoElectricModel.hh.

Referenced by Initialise(), and SampleSecondaries().


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