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

#include <G4DynamicParticleFluctuation.hh>

+ Inheritance diagram for G4DynamicParticleFluctuation:

Public Member Functions

 G4DynamicParticleFluctuation (const G4String &nam="dynPartFluc")
 
 ~G4DynamicParticleFluctuation () override=default
 
G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double, const G4double, const G4double, const G4double) override
 
G4double Dispersion (const G4Material *, const G4DynamicParticle *, const G4double, const G4double, const G4double) override
 
G4DynamicParticleFluctuationoperator= (const G4DynamicParticleFluctuation &right)=delete
 
 G4DynamicParticleFluctuation (const G4DynamicParticleFluctuation &)=delete
 
- Public Member Functions inherited from G4UniversalFluctuation
 G4UniversalFluctuation (const G4String &nam="UniFluc")
 
 ~G4UniversalFluctuation () override
 
G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double, const G4double, const G4double, const G4double) override
 
G4double Dispersion (const G4Material *, const G4DynamicParticle *, const G4double, const G4double, const G4double) override
 
void InitialiseMe (const G4ParticleDefinition *) override
 
void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2) override
 
G4UniversalFluctuationoperator= (const G4UniversalFluctuation &right)=delete
 
 G4UniversalFluctuation (const G4UniversalFluctuation &)=delete
 
- Public Member Functions inherited from G4VEmFluctuationModel
 G4VEmFluctuationModel (const G4String &nam)
 
virtual ~G4VEmFluctuationModel ()
 
const G4StringGetName () const
 
G4VEmFluctuationModeloperator= (const G4VEmFluctuationModel &right)=delete
 
 G4VEmFluctuationModel (const G4VEmFluctuationModel &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4UniversalFluctuation
virtual G4double SampleGlandz (CLHEP::HepRandomEngine *rndm, const G4Material *, const G4double tcut)
 
void AddExcitation (CLHEP::HepRandomEngine *rndm, const G4double ax, const G4double ex, G4double &eav, G4double &eloss, G4double &esig2)
 
void SampleGauss (CLHEP::HepRandomEngine *rndm, const G4double eav, const G4double esig2, G4double &eloss)
 
- Protected Attributes inherited from G4UniversalFluctuation
G4double particleMass = 0.0
 
G4double m_Inv_particleMass = DBL_MAX
 
G4double m_massrate = DBL_MAX
 
G4double chargeSquare = 1.0
 
G4double ipotFluct = 0.0
 
G4double ipotLogFluct = 0.0
 
G4double e0 = 0.0
 
G4double minNumberInteractionsBohr = 10.0
 
G4double minLoss
 
G4double nmaxCont = 8.0
 
G4double rate = 0.56
 
G4double fw = 4.0
 
G4double a0 = 42.0
 
G4double w2 = 0.0
 
G4double meanLoss = 0.0
 
const G4ParticleDefinitionparticle = nullptr
 
G4doublerndmarray = nullptr
 
G4int sizearray = 30
 

Detailed Description

Definition at line 54 of file G4DynamicParticleFluctuation.hh.

Constructor & Destructor Documentation

◆ G4DynamicParticleFluctuation() [1/2]

G4DynamicParticleFluctuation::G4DynamicParticleFluctuation ( const G4String & nam = "dynPartFluc")

Definition at line 55 of file G4DynamicParticleFluctuation.cc.

57{}
G4UniversalFluctuation(const G4String &nam="UniFluc")

Referenced by G4DynamicParticleFluctuation(), and operator=().

◆ ~G4DynamicParticleFluctuation()

G4DynamicParticleFluctuation::~G4DynamicParticleFluctuation ( )
overridedefault

◆ G4DynamicParticleFluctuation() [2/2]

G4DynamicParticleFluctuation::G4DynamicParticleFluctuation ( const G4DynamicParticleFluctuation & )
delete

Member Function Documentation

◆ Dispersion()

G4double G4DynamicParticleFluctuation::Dispersion ( const G4Material * material,
const G4DynamicParticle * dp,
const G4double tcut,
const G4double tmax,
const G4double length )
overridevirtual

Implements G4VEmFluctuationModel.

Definition at line 158 of file G4DynamicParticleFluctuation.cc.

164{
165 InitialiseLocal(dp);
166 const G4double beta = dp->GetBeta();
167 return (tmax/(beta*beta) - 0.5*tcut) * CLHEP::twopi_mc2_rcl2 * length
168 * material->GetElectronDensity() * chargeSquare;
169}
double G4double
Definition G4Types.hh:83
G4double GetBeta() const
G4double GetElectronDensity() const

◆ operator=()

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

◆ SampleFluctuations()

G4double G4DynamicParticleFluctuation::SampleFluctuations ( const G4MaterialCutsCouple * couple,
const G4DynamicParticle * dp,
const G4double tcut,
const G4double tmax,
const G4double length,
const G4double averageLoss )
overridevirtual

Implements G4VEmFluctuationModel.

Definition at line 74 of file G4DynamicParticleFluctuation.cc.

81{
82 // Calculate actual loss from the mean loss.
83 // The model used to get the fluctuations is essentially the same
84 // as in Glandz in Geant3 (Cern program library W5013, phys332).
85 // L. Urban et al. NIM A362, p.416 (1995) and Geant4 Physics Reference Manual
86
87 // shortcut for very small loss or from a step nearly equal to the range
88 // (out of validity of the model)
89 //
90 if (averageLoss < minLoss) { return averageLoss; }
91 meanLoss = averageLoss;
92 const G4double tkin = dp->GetKineticEnergy();
93 //G4cout<< "Emean= "<< meanLoss<< " tmax= "<< tmax<< " L= "<<length<<G4endl;
94
95 CLHEP::HepRandomEngine* rndmEngineF = G4Random::getTheEngine();
96
97 InitialiseLocal(dp);
98 const G4double gam = tkin * m_Inv_particleMass + 1.0;
99 const G4double gam2 = gam*gam;
100 const G4double beta = dp->GetBeta();
101 const G4double beta2 = beta*beta;
102
103 G4double loss(0.), siga(0.);
104
105 const G4Material* material = couple->GetMaterial();
106
107 // Gaussian regime
108 // for heavy particles only and conditions
109 // for Gauusian fluct. has been changed
110 //
111 if (particleMass > CLHEP::electron_mass_c2 &&
112 meanLoss >= minNumberInteractionsBohr*tcut && tmax <= 2.*tcut) {
113
114 siga = std::sqrt((tmax/beta2 - 0.5*tcut)*CLHEP::twopi_mc2_rcl2*
115 length*chargeSquare*material->GetElectronDensity());
116 const G4double sn = meanLoss/siga;
117
118 // thick target case
119 if (sn >= 2.0) {
120
121 const G4double twomeanLoss = meanLoss + meanLoss;
122 do {
123 loss = G4RandGauss::shoot(rndmEngineF, meanLoss, siga);
124 // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
125 } while (0.0 > loss || twomeanLoss < loss);
126
127 // Gamma distribution
128 } else {
129
130 const G4double neff = sn*sn;
131 loss = meanLoss*G4RandGamma::shoot(rndmEngineF, neff, 1.0)/neff;
132 }
133 //G4cout << "Gauss: " << loss << G4endl;
134 return loss;
135 }
136
137 auto ioni = material->GetIonisation();
138 e0 = ioni->GetEnergy0fluct();
139
140 // very small step or low-density material
141 if(tcut <= e0) { return meanLoss; }
142
143 ipotFluct = ioni->GetMeanExcitationEnergy();
144 ipotLogFluct = ioni->GetLogMeanExcEnergy();
145
146 // width correction for small cuts
147 const G4double scaling = std::min(1.+0.5*CLHEP::keV/tcut, 1.50);
148 meanLoss /= scaling;
149
150 w2 = (tcut > ipotFluct) ?
151 G4Log(2.*CLHEP::electron_mass_c2*beta2*gam2) - beta2 : 0.0;
152 return SampleGlandz(rndmEngineF, material, tcut)*scaling;
153}
G4double G4Log(G4double x)
Definition G4Log.hh:227
G4double GetKineticEnergy() const
const G4Material * GetMaterial() const
G4IonisParamMat * GetIonisation() const
virtual G4double SampleGlandz(CLHEP::HepRandomEngine *rndm, const G4Material *, const G4double tcut)

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