Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IonFluctuations Class Reference

#include <G4IonFluctuations.hh>

Inheritance diagram for G4IonFluctuations:
Collaboration 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 ()
 
const G4StringGetName () const
 

Detailed Description

Definition at line 61 of file G4IonFluctuations.hh.

Constructor & Destructor Documentation

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

Definition at line 73 of file G4IonFluctuations.cc.

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

Here is the call graph for this function:

G4IonFluctuations::~G4IonFluctuations ( )
virtual

Definition at line 93 of file G4IonFluctuations.cc.

94 {}

Member Function Documentation

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

Implements G4VEmFluctuationModel.

Definition at line 178 of file G4IonFluctuations.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4IonFluctuations::InitialiseMe ( const G4ParticleDefinition part)
overridevirtual

Reimplemented from G4VEmFluctuationModel.

Definition at line 98 of file G4IonFluctuations.cc.

99 {
100  particle = part;
101  particleMass = part->GetPDGMass();
102  charge = part->GetPDGCharge()/eplus;
103  chargeSquare = charge*charge;
104  effChargeSquare= chargeSquare;
105  uniFluct.InitialiseMe(part);
106 }
static constexpr double eplus
Definition: G4SIunits.hh:199
virtual void InitialiseMe(const G4ParticleDefinition *) final
G4double GetPDGMass() const
G4double GetPDGCharge() const

Here is the call graph for this function:

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

Implements G4VEmFluctuationModel.

Definition at line 111 of file G4IonFluctuations.cc.

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

Here is the call graph for this function:

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

Reimplemented from G4VEmFluctuationModel.

Definition at line 442 of file G4IonFluctuations.cc.

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

Here is the call graph for this function:


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