Geant4 10.7.0
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 ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double energy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double energy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
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 *, G4double &eloss, G4double &niel, G4double length)
 
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 ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
virtual 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)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
G4int SelectIsotopeNumber (const G4Element *)
 
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 *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Attributes

G4ParticleChangeForGammafParticleChange
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const G4MaterialpBaseMaterial
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 
G4bool lossFlucFlag
 
G4double inveplus
 
G4double pFactor
 

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")

Definition at line 69 of file G4LivermorePhotoElectricModel.cc.

70 : G4VEmModel(nam),fParticleChange(nullptr),maxZ(99),
71 nShellLimit(100),fDeexcitationActive(false),isInitialised(false),
72 fAtomDeexcitation(nullptr)
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 fSandiaCof.resize(4,0.0);
96 fCurrSection = 0.0;
97}
#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:813
void SetAngularDistribution(G4VEmAngularDistribution *)
Definition: G4VEmModel.hh:618

◆ ~G4LivermorePhotoElectricModel()

G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel ( )
virtual

Definition at line 101 of file G4LivermorePhotoElectricModel.cc.

102{
103 if(IsMaster()) {
104 delete fShellCrossSection;
105 fShellCrossSection = nullptr;
106 for(G4int i=0; i<maxZ; ++i) {
107 delete fParamHigh[i];
108 fParamHigh[i] = nullptr;
109 delete fParamLow[i];
110 fParamLow[i] = nullptr;
111 delete fCrossSection[i];
112 fCrossSection[i] = nullptr;
113 delete fCrossSectionLE[i];
114 fCrossSectionLE[i] = nullptr;
115 }
116 }
117}
int G4int
Definition: G4Types.hh:85
G4bool IsMaster() const
Definition: G4VEmModel.hh:736

◆ 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 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 209 of file G4LivermorePhotoElectricModel.cc.

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

Reimplemented from G4VEmModel.

Definition at line 180 of file G4LivermorePhotoElectricModel.cc.

185{
186 fCurrSection = 0.0;
187 if(fWater && (material == fWater ||
188 material->GetBaseMaterial() == fWater)) {
189 if(energy <= fWaterEnergyLimit) {
190 fWater->GetSandiaTable()->GetSandiaCofWater(energy, fSandiaCof);
191
192 G4double energy2 = energy*energy;
193 G4double energy3 = energy*energy2;
194 G4double energy4 = energy2*energy2;
195
196 fCurrSection = material->GetDensity()*
197 (fSandiaCof[0]/energy + fSandiaCof[1]/energy2 +
198 fSandiaCof[2]/energy3 + fSandiaCof[3]/energy4);
199 }
200 }
201 if(0.0 == fCurrSection) {
202 fCurrSection = G4VEmModel::CrossSectionPerVolume(material, p, energy);
203 }
204 return fCurrSection;
205}
G4double GetDensity() const
Definition: G4Material.hh:178
const G4Material * GetBaseMaterial() const
Definition: G4Material.hh:231
G4SandiaTable * GetSandiaTable() const
Definition: G4Material.hh:227
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:254

◆ GetBindingEnergy()

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

Definition at line 707 of file G4LivermorePhotoElectricModel.cc.

708{
709 if(Z < 1 || Z >= maxZ) { return -1;} //If Z is out of the supported return 0
710 //If necessary load data for Z
711 InitialiseForElement(theGamma, Z);
712 if(!fCrossSection[Z] || shell < 0 || shell >= fNShellsUsed[Z]) { return -1; }
713
714 if(Z>2)
715 return fShellCrossSection->GetComponentDataByIndex(Z, shell)->Energy(0);
716 else
717 return fCrossSection[Z]->Energy(0);
718}
G4PhysicsVector * GetComponentDataByIndex(G4int Z, size_t idx)
G4double Energy(std::size_t index) const

◆ Initialise()

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

Implements G4VEmModel.

Definition at line 122 of file G4LivermorePhotoElectricModel.cc.

124{
125 if (verboseLevel > 2) {
126 G4cout << "Calling G4LivermorePhotoElectricModel::Initialise() " << G4endl;
127 }
128
129 if(IsMaster()) {
130
131 if(!fWater) {
132 fWater = G4Material::GetMaterial("G4_WATER", false);
133 if(!fWater) { fWater = G4Material::GetMaterial("Water", false); }
134 if(fWater) { fWaterEnergyLimit = 13.6*eV; }
135 }
136
137 if(!fShellCrossSection) { fShellCrossSection = new G4ElementData(); }
138
139 G4ProductionCutsTable* theCoupleTable =
141 G4int numOfCouples = theCoupleTable->GetTableSize();
142
143 for(G4int i=0; i<numOfCouples; ++i) {
144 const G4MaterialCutsCouple* couple =
145 theCoupleTable->GetMaterialCutsCouple(i);
146 const G4Material* material = couple->GetMaterial();
147 const G4ElementVector* theElementVector = material->GetElementVector();
148 G4int nelm = material->GetNumberOfElements();
149
150 for (G4int j=0; j<nelm; ++j) {
151 G4int Z = std::min(maxZ, (*theElementVector)[j]->GetZasInt());
152 if(!fCrossSection[Z]) { ReadData(Z); }
153 }
154 }
155 }
156
157 if (verboseLevel > 2) {
158 G4cout << "Loaded cross section files for new LivermorePhotoElectric model"
159 << G4endl;
160 }
161 if(!isInitialised) {
162 isInitialised = true;
164
165 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
166 }
167 fDeexcitationActive = false;
168 if(fAtomDeexcitation) {
169 fDeexcitationActive = fAtomDeexcitation->IsFluoActive();
170 }
171
172 if (verboseLevel > 0) {
173 G4cout << "LivermorePhotoElectric model is initialized " << G4endl
174 << G4endl;
175 }
176}
std::vector< G4Element * > G4ElementVector
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:651
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:133

◆ InitialiseForElement()

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

Reimplemented from G4VEmModel.

Definition at line 722 of file G4LivermorePhotoElectricModel.cc.

724{
725 if (!fCrossSection[Z]) {
726#ifdef G4MULTITHREADED
727 G4MUTEXLOCK(&livPhotoeffMutex);
728 if (!fCrossSection[Z]) {
729#endif
730 ReadData(Z);
731#ifdef G4MULTITHREADED
732 }
733 G4MUTEXUNLOCK(&livPhotoeffMutex);
734#endif
735 }
736}
#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 
)
virtual

Implements G4VEmModel.

Definition at line 276 of file G4LivermorePhotoElectricModel.cc.

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

◆ SetLimitNumberOfShells()

void G4LivermorePhotoElectricModel::SetLimitNumberOfShells ( G4int  n)
inline

Definition at line 132 of file G4LivermorePhotoElectricModel.hh.

133{
134 nShellLimit = n;
135}

Member Data Documentation

◆ fParticleChange

G4ParticleChangeForGamma* G4LivermorePhotoElectricModel::fParticleChange
protected

Definition at line 93 of file G4LivermorePhotoElectricModel.hh.

Referenced by Initialise(), and SampleSecondaries().


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