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

#include <G4LivermoreComptonModel.hh>

+ Inheritance diagram for G4LivermoreComptonModel:

Public Member Functions

 G4LivermoreComptonModel (const G4ParticleDefinition *p=nullptr, const G4String &nam="LivermoreCompton")
 
virtual ~G4LivermoreComptonModel ()
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel) override
 
void InitialiseForElement (const G4ParticleDefinition *, G4int Z) override
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, 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
 
G4LivermoreComptonModeloperator= (const G4LivermoreComptonModel &right)=delete
 
 G4LivermoreComptonModel (const G4LivermoreComptonModel &)=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
 

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

Detailed Description

Definition at line 46 of file G4LivermoreComptonModel.hh.

Constructor & Destructor Documentation

◆ G4LivermoreComptonModel() [1/2]

G4LivermoreComptonModel::G4LivermoreComptonModel ( const G4ParticleDefinition p = nullptr,
const G4String nam = "LivermoreCompton" 
)
explicit

Definition at line 68 of file G4LivermoreComptonModel.cc.

70 : G4VEmModel(nam),maxZ(100),isInitialised(false)
71{
72 verboseLevel=1 ;
73 // Verbosity scale:
74 // 0 = nothing
75 // 1 = warning for energy non-conservation
76 // 2 = details of energy budget
77 // 3 = calculation of cross sections, file openings, sampling of atoms
78 // 4 = entering in methods
79
80 if( verboseLevel>1 ) {
81 G4cout << "Livermore Compton model is constructed " << G4endl;
82 }
83
84 //Mark this model as "applicable" for atomic deexcitation
86
87 fParticleChange = 0;
88 fAtomDeexcitation = 0;
89}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:802

◆ ~G4LivermoreComptonModel()

G4LivermoreComptonModel::~G4LivermoreComptonModel ( )
virtual

Definition at line 93 of file G4LivermoreComptonModel.cc.

94{
95 if(IsMaster())
96 {
97 delete shellData;
98 shellData = nullptr;
99 delete profileData;
100 profileData = nullptr;
101 for(G4int i = 0; i <= maxZ; ++i)
102 {
103 if(data[i])
104 {
105 delete data[i];
106 data[i] = nullptr;
107 }
108 }
109 }
110}
int G4int
Definition: G4Types.hh:85
G4bool IsMaster() const
Definition: G4VEmModel.hh:725

◆ G4LivermoreComptonModel() [2/2]

G4LivermoreComptonModel::G4LivermoreComptonModel ( const G4LivermoreComptonModel )
delete

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4LivermoreComptonModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition ,
G4double  kinEnergy,
G4double  Z,
G4double  A = 0,
G4double  cut = 0,
G4double  emax = DBL_MAX 
)
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 235 of file G4LivermoreComptonModel.cc.

239{
240 if (verboseLevel > 3) {
241 G4cout << "G4LivermoreComptonModel::ComputeCrossSectionPerAtom()"
242 << G4endl;
243 }
244 G4double cs = 0.0;
245
246 if (GammaEnergy < LowEnergyLimit()) { return 0.0; }
247
248 G4int intZ = G4lrint(Z);
249 if(intZ < 1 || intZ > maxZ) { return cs; }
250
251 G4PhysicsFreeVector* pv = data[intZ];
252
253 // if element was not initialised
254 // do initialisation safely for MT mode
255 if(pv == nullptr)
256 {
257 InitialiseForElement(0, intZ);
258 pv = data[intZ];
259 if(pv == nullptr) { return cs; }
260 }
261
262 G4int n = G4int(pv->GetVectorLength() - 1);
263 G4double e1 = pv->Energy(0);
264 G4double e2 = pv->Energy(n);
265
266 if(GammaEnergy <= e1) { cs = GammaEnergy/(e1*e1)*pv->Value(e1); }
267 else if(GammaEnergy <= e2) { cs = pv->Value(GammaEnergy)/GammaEnergy; }
268 else if(GammaEnergy > e2) { cs = pv->Value(e2)/GammaEnergy; }
269
270 return cs;
271}
double G4double
Definition: G4Types.hh:83
const G4int Z[17]
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
int G4lrint(double ad)
Definition: templates.hh:134

◆ Initialise()

void G4LivermoreComptonModel::Initialise ( const G4ParticleDefinition particle,
const G4DataVector cuts 
)
overridevirtual

Implements G4VEmModel.

Definition at line 114 of file G4LivermoreComptonModel.cc.

116{
117 if (verboseLevel > 1) {
118 G4cout << "Calling G4LivermoreComptonModel::Initialise()" << G4endl;
119 }
120
121 // Initialise element selector
122 if(IsMaster()) {
123 // Access to elements
124 const char* path = G4FindDataDir("G4LEDATA");
125
126 const G4ElementTable* elemTable = G4Element::GetElementTable();
127 size_t numElems = (*elemTable).size();
128 for(size_t ie = 0; ie < numElems; ++ie)
129 {
130 const G4Element* elem = (*elemTable)[ie];
131 const G4int Z = std::min(maxZ, elem->GetZasInt());
132
133 if(data[Z] == nullptr)
134 {
135 ReadData(Z, path);
136 }
137 }
138
139 // For Doppler broadening
140 if(shellData == nullptr) {
141 shellData = new G4ShellData();
142 shellData->SetOccupancyData();
143 G4String file = "/doppler/shell-doppler";
144 shellData->LoadData(file);
145 }
146 if(profileData == nullptr) { profileData = new G4DopplerProfile(); }
147
148 InitialiseElementSelectors(particle, cuts);
149 }
150
151 if (verboseLevel > 2) {
152 G4cout << "Loaded cross section files" << G4endl;
153 }
154
155 if( verboseLevel>1 ) {
156 G4cout << "G4LivermoreComptonModel is initialized " << G4endl
157 << "Energy range: "
158 << LowEnergyLimit() / eV << " eV - "
159 << HighEnergyLimit() / GeV << " GeV"
160 << G4endl;
161 }
162 //
163 if(isInitialised) { return; }
164
165 fParticleChange = GetParticleChangeForGamma();
166 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
167 isInitialised = true;
168}
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
#define elem(i, j)
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:403
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
void SetOccupancyData()
Definition: G4ShellData.hh:62
void LoadData(const G4String &fileName)
Definition: G4ShellData.cc:228
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:124
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:139

◆ InitialiseForElement()

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

Reimplemented from G4VEmModel.

Definition at line 560 of file G4LivermoreComptonModel.cc.

562{
563 G4AutoLock l(&LivermoreComptonModelMutex);
564 if(data[Z] == nullptr) { ReadData(Z); }
565 l.unlock();
566}

Referenced by ComputeCrossSectionPerAtom().

◆ InitialiseLocal()

void G4LivermoreComptonModel::InitialiseLocal ( const G4ParticleDefinition ,
G4VEmModel masterModel 
)
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 172 of file G4LivermoreComptonModel.cc.

174{
176}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
Definition: G4VEmModel.hh:831
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:823

◆ operator=()

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

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 276 of file G4LivermoreComptonModel.cc.

281{
282
283 // The scattered gamma energy is sampled according to Klein - Nishina
284 // formula then accepted or rejected depending on the Scattering Function
285 // multiplied by factor from Klein - Nishina formula.
286 // Expression of the angular distribution as Klein Nishina
287 // angular and energy distribution and Scattering fuctions is taken from
288 // D. E. Cullen "A simple model of photon transport" Nucl. Instr. Meth.
289 // Phys. Res. B 101 (1995). Method of sampling with form factors is different
290 // data are interpolated while in the article they are fitted.
291 // Reference to the article is from J. Stepanek New Photon, Positron
292 // and Electron Interaction Data for GEANT in Energy Range from 1 eV to 10
293 // TeV (draft).
294 // The random number techniques of Butcher & Messel are used
295 // (Nucl Phys 20(1960),15).
296
297 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
298
299 if (verboseLevel > 3) {
300 G4cout << "G4LivermoreComptonModel::SampleSecondaries() E(MeV)= "
301 << photonEnergy0/MeV << " in " << couple->GetMaterial()->GetName()
302 << G4endl;
303 }
304
305 // do nothing below the threshold
306 // should never get here because the XS is zero below the limit
307 if (photonEnergy0 < LowEnergyLimit())
308 return ;
309
310 G4double e0m = photonEnergy0 / electron_mass_c2 ;
311 G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection();
312
313 // Select randomly one element in the current material
314 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
315 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
316
317 G4int Z = elm->GetZasInt();
318
319 G4double epsilon0Local = 1. / (1. + 2. * e0m);
320 G4double epsilon0Sq = epsilon0Local * epsilon0Local;
321 G4double alpha1 = -G4Log(epsilon0Local);
322 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
323
324 G4double wlPhoton = h_Planck*c_light/photonEnergy0;
325
326 // Sample the energy of the scattered photon
328 G4double epsilonSq;
329 G4double oneCosT;
330 G4double sinT2;
331 G4double gReject;
332
333 if (verboseLevel > 3) {
334 G4cout << "Started loop to sample gamma energy" << G4endl;
335 }
336
337 do {
338 if ( alpha1/(alpha1+alpha2) > G4UniformRand())
339 {
340 epsilon = G4Exp(-alpha1 * G4UniformRand());
341 epsilonSq = epsilon * epsilon;
342 }
343 else
344 {
345 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) * G4UniformRand();
346 epsilon = std::sqrt(epsilonSq);
347 }
348
349 oneCosT = (1. - epsilon) / ( epsilon * e0m);
350 sinT2 = oneCosT * (2. - oneCosT);
351 G4double x = std::sqrt(oneCosT/2.) * cm / wlPhoton;
352 G4double scatteringFunction = ComputeScatteringFunction(x, Z);
353 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
354
355 } while(gReject < G4UniformRand()*Z);
356
357 G4double cosTheta = 1. - oneCosT;
358 G4double sinTheta = std::sqrt (sinT2);
359 G4double phi = twopi * G4UniformRand() ;
360 G4double dirx = sinTheta * std::cos(phi);
361 G4double diry = sinTheta * std::sin(phi);
362 G4double dirz = cosTheta ;
363
364 // Doppler broadening - Method based on:
365 // Y. Namito, S. Ban and H. Hirayama,
366 // "Implementation of the Doppler Broadening of a Compton-Scattered Photon
367 // into the EGS4 Code", NIM A 349, pp. 489-494, 1994
368
369 // Maximum number of sampling iterations
370 static G4int maxDopplerIterations = 1000;
371 G4double bindingE = 0.;
372 G4double photonEoriginal = epsilon * photonEnergy0;
373 G4double photonE = -1.;
374 G4int iteration = 0;
375 G4double eMax = photonEnergy0;
376
377 G4int shellIdx = 0;
378
379 if (verboseLevel > 3) {
380 G4cout << "Started loop to sample broading" << G4endl;
381 }
382
383 do
384 {
385 ++iteration;
386 // Select shell based on shell occupancy
387 shellIdx = shellData->SelectRandomShell(Z);
388 bindingE = shellData->BindingEnergy(Z,shellIdx);
389
390 if (verboseLevel > 3) {
391 G4cout << "Shell ID= " << shellIdx
392 << " Ebind(keV)= " << bindingE/keV << G4endl;
393 }
394
395 eMax = photonEnergy0 - bindingE;
396
397 // Randomly sample bound electron momentum
398 // (memento: the data set is in Atomic Units)
399 G4double pSample = profileData->RandomSelectMomentum(Z,shellIdx);
400 if (verboseLevel > 3) {
401 G4cout << "pSample= " << pSample << G4endl;
402 }
403 // Rescale from atomic units
404 G4double pDoppler = pSample * fine_structure_const;
405 G4double pDoppler2 = pDoppler * pDoppler;
406 G4double var2 = 1. + oneCosT * e0m;
407 G4double var3 = var2*var2 - pDoppler2;
408 G4double var4 = var2 - pDoppler2 * cosTheta;
409 G4double var = var4*var4 - var3 + pDoppler2 * var3;
410 if (var > 0.)
411 {
412 G4double varSqrt = std::sqrt(var);
413 G4double scale = photonEnergy0 / var3;
414 // Random select either root
415 if (G4UniformRand() < 0.5) { photonE = (var4 - varSqrt) * scale; }
416 else { photonE = (var4 + varSqrt) * scale; }
417 }
418 else
419 {
420 photonE = -1.;
421 }
422 } while (iteration <= maxDopplerIterations && photonE > eMax);
423
424 // End of recalculation of photon energy with Doppler broadening
425 // Revert to original if maximum number of iterations threshold
426 // has been reached
427 if (iteration >= maxDopplerIterations)
428 {
429 photonE = photonEoriginal;
430 bindingE = 0.;
431 }
432
433 // Update G4VParticleChange for the scattered photon
434 G4ThreeVector photonDirection1(dirx,diry,dirz);
435 photonDirection1.rotateUz(photonDirection0);
436 fParticleChange->ProposeMomentumDirection(photonDirection1) ;
437
438 G4double photonEnergy1 = photonE;
439
440 if (photonEnergy1 > 0.) {
441 fParticleChange->SetProposedKineticEnergy(photonEnergy1) ;
442
443 } else {
444 // photon absorbed
445 photonEnergy1 = 0.;
446 fParticleChange->SetProposedKineticEnergy(0.) ;
447 fParticleChange->ProposeTrackStatus(fStopAndKill);
448 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
449 return;
450 }
451
452 // Kinematics of the scattered electron
453 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
454
455 // protection against negative final energy: no e- is created
456 if(eKineticEnergy < 0.0) {
457 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0 - photonEnergy1);
458 return;
459 }
460
461 G4double eTotalEnergy = eKineticEnergy + electron_mass_c2;
462
463 G4double electronE = photonEnergy0 * (1. - epsilon) + electron_mass_c2;
464 G4double electronP2 =
465 electronE*electronE - electron_mass_c2*electron_mass_c2;
466 G4double sinThetaE = -1.;
467 G4double cosThetaE = 0.;
468 if (electronP2 > 0.)
469 {
470 cosThetaE = (eTotalEnergy + photonEnergy1 )*
471 (1. - epsilon) / std::sqrt(electronP2);
472 sinThetaE = -1. * sqrt(1. - cosThetaE * cosThetaE);
473 }
474
475 G4double eDirX = sinThetaE * std::cos(phi);
476 G4double eDirY = sinThetaE * std::sin(phi);
477 G4double eDirZ = cosThetaE;
478
479 G4ThreeVector eDirection(eDirX,eDirY,eDirZ);
480 eDirection.rotateUz(photonDirection0);
482 eDirection,eKineticEnergy) ;
483 fvect->push_back(dp);
484
485 // sample deexcitation
486 if (verboseLevel > 3) {
487 G4cout << "Started atomic de-excitation " << fAtomDeexcitation << G4endl;
488 }
489
490 if(nullptr != fAtomDeexcitation && iteration < maxDopplerIterations) {
491 G4int index = couple->GetIndex();
492 if(fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
493 size_t nbefore = fvect->size();
495 const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
496 fAtomDeexcitation->GenerateParticles(fvect, shell, Z, index);
497 size_t nafter = fvect->size();
498 if(nafter > nbefore) {
499 for (size_t i=nbefore; i<nafter; ++i) {
500 //Check if there is enough residual energy
501 if (bindingE >= ((*fvect)[i])->GetKineticEnergy())
502 {
503 //Ok, this is a valid secondary: keep it
504 bindingE -= ((*fvect)[i])->GetKineticEnergy();
505 }
506 else
507 {
508 //Invalid secondary: not enough energy to create it!
509 //Keep its energy in the local deposit
510 delete (*fvect)[i];
511 (*fvect)[i]=0;
512 }
513 }
514 }
515 }
516 }
517 bindingE = std::max(bindingE, 0.0);
518 fParticleChange->ProposeLocalEnergyDeposit(bindingE);
519}
G4AtomicShellEnumerator
G4double epsilon(G4double density, G4double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:180
G4double G4Log(G4double x)
Definition: G4Log.hh:227
@ fStopAndKill
const G4double alpha2
#define G4UniformRand()
Definition: Randomize.hh:52
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
Definition: G4Electron.cc:93
G4int GetZasInt() const
Definition: G4Element.hh:132
const G4Material * GetMaterial() const
const G4String & GetName() const
Definition: G4Material.hh:172
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4double BindingEnergy(G4int Z, G4int shellIndex) const
Definition: G4ShellData.cc:161
G4int SelectRandomShell(G4int Z) const
Definition: G4ShellData.cc:344
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)
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)

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