Geant4 11.2.2
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")
 
 ~G4IonFluctuations () override
 
G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length, const G4double meanLoss) override
 
G4double Dispersion (const G4Material *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length) override
 
void InitialiseMe (const G4ParticleDefinition *) override
 
void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2) override
 
G4IonFluctuationsoperator= (const G4IonFluctuations &right)=delete
 
 G4IonFluctuations (const G4IonFluctuations &)=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
 

Detailed Description

Definition at line 59 of file G4IonFluctuations.hh.

Constructor & Destructor Documentation

◆ G4IonFluctuations() [1/2]

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

Definition at line 73 of file G4IonFluctuations.cc.

75 particleMass(CLHEP::proton_mass_c2),
76 parameter(10.0*CLHEP::MeV/CLHEP::proton_mass_c2),
77 theBohrBeta2(50.0*keV/CLHEP::proton_mass_c2),
78 minLoss(0.001*CLHEP::eV)
79{
80 uniFluct = new G4UniversalFluctuation();
81 g4calc = G4Pow::GetInstance();
82}
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4VEmFluctuationModel(const G4String &nam)

◆ ~G4IonFluctuations()

G4IonFluctuations::~G4IonFluctuations ( )
overridedefault

◆ G4IonFluctuations() [2/2]

G4IonFluctuations::G4IonFluctuations ( const G4IonFluctuations & )
delete

Member Function Documentation

◆ Dispersion()

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

Implements G4VEmFluctuationModel.

Definition at line 170 of file G4IonFluctuations.cc.

175{
176 if(dp->GetDefinition() != particle) { InitialiseMe(dp->GetDefinition()); }
177
178 const G4double beta = dp->GetBeta();
179 kineticEnergy = dp->GetKineticEnergy();
180 beta2 = beta*beta;
181
182 G4double siga = (tmax/beta2 - 0.5*tcut)*CLHEP::twopi_mc2_rcl2*length*
183 material->GetElectronDensity()*effChargeSquare;
184
185 // Low velocity - additional ion charge fluctuations according to
186 // Q.Yang et al., NIM B61(1991)149-155.
187 //G4cout << "sigE= " << sqrt(siga) << " charge= " << charge <<G4endl;
188
189 G4double Z = material->GetIonisation()->GetZeffective();
190 G4double fac = Factor(material, Z);
191
192 // heavy ion correction
193 // G4double f1 = 1.065e-4*chargeSquare;
194 // if(beta2 > theBohrBeta2) f1/= beta2;
195 // else f1/= theBohrBeta2;
196 // if(f1 > 2.5) f1 = 2.5;
197 // fac *= (1.0 + f1);
198
199 // taking into account the cutg
200 G4double fac_cut = 1.0 + (fac - 1.0)*2.0*CLHEP::electron_mass_c2*beta2
201 /(tmax*(1.0 - beta2));
202 if(fac_cut > 0.01 && fac > 0.01) {
203 siga *= fac_cut;
204 }
205 /*
206 G4cout << "siga(keV)= " << sqrt(siga)/keV << " fac= " << fac
207 << " f1= " << fac_cut << G4endl;
208 */
209 return siga;
210}
double G4double
Definition G4Types.hh:83
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetBeta() const
void InitialiseMe(const G4ParticleDefinition *) override
G4double GetZeffective() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const

Referenced by SampleFluctuations().

◆ InitialiseMe()

void G4IonFluctuations::InitialiseMe ( const G4ParticleDefinition * part)
overridevirtual

Reimplemented from G4VEmFluctuationModel.

Definition at line 90 of file G4IonFluctuations.cc.

91{
92 particle = part;
93 particleMass = part->GetPDGMass();
94 charge = part->GetPDGCharge()/eplus;
95 effChargeSquare = chargeSquare = charge*charge;
96 uniFluct->InitialiseMe(part);
97}
void InitialiseMe(const G4ParticleDefinition *) override

Referenced by Dispersion().

◆ operator=()

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

◆ SampleFluctuations()

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

Implements G4VEmFluctuationModel.

Definition at line 102 of file G4IonFluctuations.cc.

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

◆ SetParticleAndCharge()

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

Reimplemented from G4VEmFluctuationModel.

Definition at line 426 of file G4IonFluctuations.cc.

428{
429 if(part != particle) {
430 particle = part;
431 particleMass = part->GetPDGMass();
432 charge = part->GetPDGCharge()/eplus;
433 chargeSquare = charge*charge;
434 }
435 effChargeSquare = q2;
436 uniFluct->SetParticleAndCharge(part, q2);
437}
void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2) override

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