65 minNumberInteractionsBohr(10.0),
72 lastMaterial =
nullptr;
73 particleMass = chargeSquare = ipotFluct = electronDensity = f1Fluct = f2Fluct
74 = e1Fluct = e2Fluct = e1LogFluct = e2LogFluct = ipotLogFluct = e0 = esmall
76 m_Inv_particleMass = m_massrate =
DBL_MAX;
97 m_Inv_particleMass = 1.0 / particleMass;
98 m_massrate = electron_mass_c2 * m_Inv_particleMass ;
119 if (averageLoss < minLoss) {
return averageLoss; }
128 const G4double gam = tkin * m_Inv_particleMass + 1.0;
141 if ((particleMass > electron_mass_c2) &&
142 (meanLoss >= minNumberInteractionsBohr*tmax))
144 G4double tmaxkine = 2.*electron_mass_c2*beta2*gam2/
145 (1.+m_massrate*(2.*gam+m_massrate)) ;
146 if (tmaxkine <= 2.*tmax)
149 siga = sqrt((1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
150 * electronDensity * chargeSquare);
157 const G4double twomeanLoss = meanLoss + meanLoss;
159 loss = G4RandGauss::shoot(rndmEngineF,meanLoss,siga);
161 }
while (0.0 > loss || twomeanLoss < loss);
167 loss = meanLoss*G4RandGamma::shoot(rndmEngineF,neff,1.0)/neff;
176 if (material != lastMaterial) {
186 esmall = 0.5*sqrt(e0*ipotFluct);
187 lastMaterial = material;
191 if(tmax <= e0) {
return meanLoss; }
194 const G4double scaling = std::min(1.+0.5*CLHEP::keV/tmax,1.50);
204 if(tmax > ipotFluct) {
207 if(w2 > ipotLogFluct) {
208 if(w2 > e2LogFluct) {
209 const G4double C = meanLoss*(1.-rate)/(w2-ipotLogFluct);
210 a1 =
C*f1Fluct*(w2-e1LogFluct)/e1Fluct;
211 a2 =
C*f2Fluct*(w2-e2LogFluct)/e2Fluct;
213 a1 = meanLoss*(1.-rate)/e1;
216 const G4double fwnow = 0.5+(fw-0.5)*sqrt(a1/a0);
228 a3 = rate*meanLoss*(tmax-e0)/(e0*tmax*
G4Log(w1));
238 if(a1 > 0.0) { AddExcitation(rndmEngineF, a1, e1, emean, loss, sig2e); }
241 if(a2 > 0.0) { AddExcitation(rndmEngineF, a2, e2, emean, loss, sig2e); }
243 if(sig2e > 0.0) { SampleGauss(rndmEngineF, emean, sig2e, loss); }
253 alfa = w1*(nmaxCont+a3)/(w1*nmaxCont+a3);
255 const G4double namean = a3*w1*(alfa-1.)/((w1-1.)*alfa);
256 emean += namean*e0*alfa1;
257 sig2e += e0*e0*namean*(alfa-alfa1*alfa1);
266 if(nnb > sizearray) {
272 for (
G4int k=0; k<nnb; ++k) { loss += w2/(1.-w*rndmarray[k]); }
275 if(sig2e > 0.0) { SampleGauss(rndmEngineF, emean, sig2e, loss); }
300 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
301 * electronDensity * chargeSquare;
312 if(part != particle) {
317 m_Inv_particleMass = 1.0 / particleMass;
318 m_massrate = electron_mass_c2 * m_Inv_particleMass;
G4double G4Log(G4double x)
G4long G4Poisson(G4double mean)
virtual void flatArray(const int size, double *vect)=0
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetF2fluct() const
G4double GetLogEnergy1fluct() const
G4double GetLogEnergy2fluct() const
G4double GetMeanExcitationEnergy() const
G4double GetF1fluct() const
G4double GetEnergy2fluct() const
G4double GetEnergy1fluct() const
G4double GetEnergy0fluct() const
G4double GetLogMeanExcEnergy() const
const G4Material * GetMaterial() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2) final
G4UniversalFluctuation(const G4String &nam="UniFluc")
virtual ~G4UniversalFluctuation()
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double, G4double) override
virtual void InitialiseMe(const G4ParticleDefinition *) final
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) override