Geant4 10.7.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 ()
 
virtual G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmax, G4double length, G4double meanLoss) override
 
virtual G4double Dispersion (const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length) override
 
virtual void InitialiseMe (const G4ParticleDefinition *) override
 
virtual void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2) override
 
- Public Member Functions inherited from G4VEmFluctuationModel
 G4VEmFluctuationModel (const G4String &nam)
 
virtual ~G4VEmFluctuationModel ()
 
virtual G4double SampleFluctuations (const G4MaterialCutsCouple *, 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)
 
const G4StringGetName () const
 
G4VEmFluctuationModeloperator= (const G4VEmFluctuationModel &right)=delete
 
 G4VEmFluctuationModel (const G4VEmFluctuationModel &)=delete
 

Detailed Description

Definition at line 60 of file G4IonFluctuations.hh.

Constructor & Destructor Documentation

◆ G4IonFluctuations()

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

Definition at line 72 of file G4IonFluctuations.cc.

74 particle(0),
75 particleMass(CLHEP::proton_mass_c2),
76 charge(1.0),
77 chargeSquare(1.0),
78 effChargeSquare(1.0),
79 parameter(10.0*CLHEP::MeV/CLHEP::proton_mass_c2),
80 theBohrBeta2(50.0*keV/CLHEP::proton_mass_c2),
81 minFraction(0.2),
82 xmin(0.2),
83 minLoss(0.001*CLHEP::eV)
84{
85 kineticEnergy = 0.0;
86 beta2 = 0.0;
87 g4calc = G4Pow::GetInstance();
88}
static G4Pow * GetInstance()
Definition: G4Pow.cc:41

◆ ~G4IonFluctuations()

G4IonFluctuations::~G4IonFluctuations ( )
virtual

Definition at line 92 of file G4IonFluctuations.cc.

93{}

Member Function Documentation

◆ Dispersion()

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

Implements G4VEmFluctuationModel.

Definition at line 177 of file G4IonFluctuations.cc.

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

Referenced by SampleFluctuations().

◆ InitialiseMe()

void G4IonFluctuations::InitialiseMe ( const G4ParticleDefinition part)
overridevirtual

Reimplemented from G4VEmFluctuationModel.

Definition at line 97 of file G4IonFluctuations.cc.

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

◆ SampleFluctuations()

G4double G4IonFluctuations::SampleFluctuations ( const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double  tmax,
G4double  length,
G4double  meanLoss 
)
overridevirtual

Implements G4VEmFluctuationModel.

Definition at line 110 of file G4IonFluctuations.cc.

115{
116 // G4cout << "### meanLoss= " << meanLoss << G4endl;
117 if(meanLoss <= minLoss) return meanLoss;
118
119 //G4cout << "G4IonFluctuations::SampleFluctuations E(MeV)= "
120 // << dp->GetKineticEnergy()
121 // << " Elim(MeV)= " << parameter*charge*particleMass << G4endl;
122
123 // Vavilov fluctuations
124 if(dp->GetKineticEnergy() > parameter*charge*particleMass) {
125 return uniFluct.SampleFluctuations(couple,dp,tmax,length,meanLoss);
126 }
127
128 const G4Material* material = couple->GetMaterial();
129 G4double siga = Dispersion(material,dp,tmax,length);
130 G4double loss = meanLoss;
131
132 //G4cout << "### siga= " << sqrt(siga) << " navr= " << navr << G4endl;
133
134 // Gaussian fluctuation
135
136 // Increase fluctuations for big fractional energy loss
137 //G4cout << "siga= " << siga << G4endl;
138 if ( meanLoss > minFraction*kineticEnergy ) {
139 G4double gam = (kineticEnergy - meanLoss)/particleMass + 1.0;
140 G4double b2 = 1.0 - 1.0/(gam*gam);
141 if(b2 < xmin*beta2) b2 = xmin*beta2;
142 G4double x = b2/beta2;
143 G4double x3 = 1.0/(x*x*x);
144 siga *= 0.25*(1.0 + x)*(x3 + (1.0/b2 - 0.5)/(1.0/beta2 - 0.5) );
145 }
146 siga = sqrt(siga);
147 G4double sn = meanLoss/siga;
148 G4double twomeanLoss = meanLoss + meanLoss;
149 // G4cout << "siga= " << siga << " sn= " << sn << G4endl;
150
151 CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
152 // thick target case
153 if (sn >= 2.0) {
154
155 do {
156 loss = G4RandGauss::shoot(rndmEngine,meanLoss,siga);
157 // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
158 } while (0.0 > loss || twomeanLoss < loss);
159
160 // Gamma distribution
161 } else if(sn > 0.1) {
162
163 G4double neff = sn*sn;
164 loss = meanLoss*G4RandGamma::shoot(rndmEngine,neff,1.0)/neff;
165
166 // uniform distribution for very small steps
167 } else {
168 loss = twomeanLoss*rndmEngine->flat();
169 }
170
171 //G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
172 return loss;
173}
virtual double flat()=0
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length) override
const G4Material * GetMaterial() const
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) override

◆ SetParticleAndCharge()

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

Reimplemented from G4VEmFluctuationModel.

Definition at line 441 of file G4IonFluctuations.cc.

443{
444 if(part != particle) {
445 particle = part;
446 particleMass = part->GetPDGMass();
447 charge = part->GetPDGCharge()/eplus;
448 chargeSquare = charge*charge;
449 }
450 effChargeSquare = q2;
451 uniFluct.SetParticleAndCharge(part, q2);
452}
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2) final

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