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

#include <G4IonFluctuations.hh>

+ Inheritance diagram for G4IonFluctuations:

Public Member Functions

 G4IonFluctuations (const G4String &nam="IonFluc")
 
virtual ~G4IonFluctuations ()
 
G4double SampleFluctuations (const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length, G4double &meanLoss)
 
G4double Dispersion (const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length)
 
void InitialiseMe (const G4ParticleDefinition *)
 
void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2)
 
- Public Member Functions inherited from G4VEmFluctuationModel
 G4VEmFluctuationModel (const G4String &nam)
 
virtual ~G4VEmFluctuationModel ()
 
virtual G4double SampleFluctuations (const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length, G4double &meanLoss)=0
 
virtual G4double Dispersion (const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length)=0
 
virtual void InitialiseMe (const G4ParticleDefinition *)
 
virtual void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2)
 
G4String GetName () const
 

Detailed Description

Definition at line 59 of file G4IonFluctuations.hh.

Constructor & Destructor Documentation

◆ G4IonFluctuations()

G4IonFluctuations::G4IonFluctuations ( const G4String nam = "IonFluc")

Definition at line 70 of file G4IonFluctuations.cc.

72 particle(0),
73 particleMass(proton_mass_c2),
74 charge(1.0),
75 chargeSquare(1.0),
76 effChargeSquare(1.0),
77 parameter(10.0*CLHEP::MeV/CLHEP::proton_mass_c2),
78 minNumberInteractionsBohr(0.0),
79 theBohrBeta2(50.0*keV/CLHEP::proton_mass_c2),
80 minFraction(0.2),
81 xmin(0.2),
82 minLoss(0.001*eV)
83{
84 kineticEnergy = 0.0;
85 beta2 = 0.0;
86}

◆ ~G4IonFluctuations()

G4IonFluctuations::~G4IonFluctuations ( )
virtual

Definition at line 90 of file G4IonFluctuations.cc.

91{}

Member Function Documentation

◆ Dispersion()

G4double G4IonFluctuations::Dispersion ( const G4Material material,
const G4DynamicParticle dp,
G4double tmax,
G4double length 
)
virtual

Implements G4VEmFluctuationModel.

Definition at line 170 of file G4IonFluctuations.cc.

174{
175 kineticEnergy = dp->GetKineticEnergy();
176 G4double etot = kineticEnergy + particleMass;
177 beta2 = kineticEnergy*(kineticEnergy + 2.*particleMass)/(etot*etot);
178
179 G4double electronDensity = material->GetElectronDensity();
180
181 /*
182 G4cout << "e= " << kineticEnergy << " m= " << particleMass
183 << " tmax= " << tmax << " l= " << length
184 << " q^2= " << effChargeSquare << " beta2=" << beta2<< G4endl;
185 */
186 G4double siga = (1. - beta2*0.5)*tmax*length*electronDensity*
187 twopi_mc2_rcl2*chargeSquare/beta2;
188
189 // Low velocity - additional ion charge fluctuations according to
190 // Q.Yang et al., NIM B61(1991)149-155.
191 //G4cout << "sigE= " << sqrt(siga) << " charge= " << charge <<G4endl;
192
193 G4double Z = electronDensity/material->GetTotNbOfAtomsPerVolume();
194
195 G4double fac = Factor(material, Z);
196
197 // heavy ion correction
198// G4double f1 = 1.065e-4*chargeSquare;
199// if(beta2 > theBohrBeta2) f1/= beta2;
200// else f1/= theBohrBeta2;
201// if(f1 > 2.5) f1 = 2.5;
202// fac *= (1.0 + f1);
203
204 // taking into account the cut
205 G4double fac_cut = 1.0 + (fac - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2));
206 if(fac_cut > 0.01 && fac > 0.01) {
207 siga *= fac_cut;
208 }
209
210 //G4cout << "siga(keV)= " << sqrt(siga)/keV << " fac= " << fac
211 // << " f1= " << f1 << G4endl;
212
213 return siga;
214}
double G4double
Definition: G4Types.hh:64
G4double GetKineticEnergy() const
G4double GetTotNbOfAtomsPerVolume() const
Definition: G4Material.hh:208
G4double GetElectronDensity() const
Definition: G4Material.hh:216

Referenced by SampleFluctuations().

◆ InitialiseMe()

void G4IonFluctuations::InitialiseMe ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VEmFluctuationModel.

Definition at line 95 of file G4IonFluctuations.cc.

96{
97 particle = part;
98 particleMass = part->GetPDGMass();
99 charge = part->GetPDGCharge()/eplus;
100 chargeSquare = charge*charge;
101 effChargeSquare= chargeSquare;
102 uniFluct.InitialiseMe(part);
103}
G4double GetPDGCharge() const
virtual void InitialiseMe(const G4ParticleDefinition *)

◆ SampleFluctuations()

G4double G4IonFluctuations::SampleFluctuations ( const G4Material material,
const G4DynamicParticle dp,
G4double tmax,
G4double length,
G4double meanLoss 
)
virtual

Implements G4VEmFluctuationModel.

Definition at line 107 of file G4IonFluctuations.cc.

112{
113 // G4cout << "### meanLoss= " << meanLoss << G4endl;
114 if(meanLoss <= minLoss) return meanLoss;
115
116 //G4cout << "G4IonFluctuations::SampleFluctuations E(MeV)= " << dp->GetKineticEnergy()
117 // << " Elim(MeV)= " << parameter*charge*particleMass << G4endl;
118
119 // Vavilov fluctuations
120 if(dp->GetKineticEnergy() > parameter*charge*particleMass) {
121 return uniFluct.SampleFluctuations(material,dp,tmax,length,meanLoss);
122 }
123
124 G4double siga = Dispersion(material,dp,tmax,length);
125 G4double loss = meanLoss;
126
127 //G4cout << "### siga= " << sqrt(siga) << " navr= " << navr << G4endl;
128
129 // Gaussian fluctuation
130
131 // Increase fluctuations for big fractional energy loss
132 //G4cout << "siga= " << siga << G4endl;
133 if ( meanLoss > minFraction*kineticEnergy ) {
134 G4double gam = (kineticEnergy - meanLoss)/particleMass + 1.0;
135 G4double b2 = 1.0 - 1.0/(gam*gam);
136 if(b2 < xmin*beta2) b2 = xmin*beta2;
137 G4double x = b2/beta2;
138 G4double x3 = 1.0/(x*x*x);
139 siga *= 0.25*(1.0 + x)*(x3 + (1.0/b2 - 0.5)/(1.0/beta2 - 0.5) );
140 }
141 siga = sqrt(siga);
142 G4double sn = meanLoss/siga;
143 G4double twomeanLoss = meanLoss + meanLoss;
144 // G4cout << "siga= " << siga << " sn= " << sn << G4endl;
145
146 // thick target case
147 if (sn >= 2.0) {
148
149 do {
150 loss = G4RandGauss::shoot(meanLoss,siga);
151 } while (0.0 > loss || twomeanLoss < loss);
152
153 // Gamma distribution
154 } else if(sn > 0.1) {
155
156 G4double neff = sn*sn;
157 loss = meanLoss*CLHEP::RandGamma::shoot(neff,1.0)/neff;
158
159 // uniform distribution for very small steps
160 } else {
161 loss = twomeanLoss*G4UniformRand();
162 }
163
164 //G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
165 return loss;
166}
#define G4UniformRand()
Definition: Randomize.hh:53
static double shoot()
G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length)
virtual G4double SampleFluctuations(const G4Material *, const G4DynamicParticle *, G4double &, G4double &, G4double &)

◆ SetParticleAndCharge()

void G4IonFluctuations::SetParticleAndCharge ( const G4ParticleDefinition part,
G4double  q2 
)
virtual

Reimplemented from G4VEmFluctuationModel.

Definition at line 431 of file G4IonFluctuations.cc.

433{
434 if(part != particle) {
435 particle = part;
436 particleMass = part->GetPDGMass();
437 charge = part->GetPDGCharge()/eplus;
438 chargeSquare = charge*charge;
439 }
440 effChargeSquare = q2;
441 uniFluct.SetParticleAndCharge(part, q2);
442}
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)

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