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

#include <G4BraggIonModel.hh>

+ Inheritance diagram for G4BraggIonModel:

Public Member Functions

 G4BraggIonModel (const G4ParticleDefinition *p=0, const G4String &nam="BraggIon")
 
virtual ~G4BraggIonModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual G4double ComputeCrossSectionPerElectron (const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *p, const G4Material *mat, G4double kineticEnergy)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectIsotopeNumber (const G4Element *)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=0)
 
void SetCrossSectionTable (G4PhysicsTable *)
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy)
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void ForceBuildTable (G4bool val)
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 

Protected Member Functions

virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kinEnergy)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Additional Inherited Members

- Protected Attributes inherited from G4VEmModel
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 

Detailed Description

Definition at line 68 of file G4BraggIonModel.hh.

Constructor & Destructor Documentation

◆ G4BraggIonModel()

G4BraggIonModel::G4BraggIonModel ( const G4ParticleDefinition p = 0,
const G4String nam = "BraggIon" 
)

Definition at line 74 of file G4BraggIonModel.cc.

76 : G4VEmModel(nam),
77 corr(0),
78 particle(0),
79 fParticleChange(0),
80 currentMaterial(0),
81 iMolecula(-1),
82 iASTAR(-1),
83 isIon(false),
84 isInitialised(false)
85{
86 SetHighEnergyLimit(2.0*MeV);
87
88 HeMass = 3.727417*GeV;
89 rateMassHe2p = HeMass/proton_mass_c2;
90 lowestKinEnergy = 1.0*keV/rateMassHe2p;
91 massFactor = 1000.*amu_c2/HeMass;
92 theZieglerFactor = eV*cm2*1.0e-15;
93 theElectron = G4Electron::Electron();
94 corrFactor = 1.0;
95 if(p) { SetParticle(p); }
96 else { SetParticle(theElectron); }
97}
static G4Electron * Electron()
Definition: G4Electron.cc:94
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:585

◆ ~G4BraggIonModel()

G4BraggIonModel::~G4BraggIonModel ( )
virtual

Definition at line 101 of file G4BraggIonModel.cc.

102{}

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4BraggIonModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  Z,
G4double  A,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 183 of file G4BraggIonModel.cc.

189{
191 (p,kineticEnergy,cutEnergy,maxEnergy);
192 return cross;
193}
double G4double
Definition: G4Types.hh:64
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)

◆ ComputeCrossSectionPerElectron()

G4double G4BraggIonModel::ComputeCrossSectionPerElectron ( const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Definition at line 157 of file G4BraggIonModel.cc.

162{
163 G4double cross = 0.0;
164 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
165 G4double maxEnergy = std::min(tmax,maxKinEnergy);
166 if(cutEnergy < tmax) {
167
168 G4double energy = kineticEnergy + mass;
169 G4double energy2 = energy*energy;
170 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
171 cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*log(maxEnergy/cutEnergy)/tmax;
172
173 cross *= twopi_mc2_rcl2*chargeSquare/beta2;
174 }
175 // G4cout << "BR: e= " << kineticEnergy << " tmin= " << cutEnergy
176 // << " tmax= " << tmax << " cross= " << cross << G4endl;
177
178 return cross;
179}
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)

Referenced by ComputeCrossSectionPerAtom(), and CrossSectionPerVolume().

◆ ComputeDEDXPerVolume()

G4double G4BraggIonModel::ComputeDEDXPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy 
)
virtual

Reimplemented from G4VEmModel.

Reimplemented in G4BraggNoDeltaModel.

Definition at line 212 of file G4BraggIonModel.cc.

216{
217 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
218 G4double tmin = min(cutEnergy, tmax);
219 G4double tkin = kineticEnergy/massRate;
220 G4double dedx = 0.0;
221
222 if(tkin < lowestKinEnergy) {
223 dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
224 } else {
225 dedx = DEDX(material, tkin);
226 }
227
228 if (cutEnergy < tmax) {
229
230 G4double tau = kineticEnergy/mass;
231 G4double gam = tau + 1.0;
232 G4double bg2 = tau * (tau+2.0);
233 G4double beta2 = bg2/(gam*gam);
234 G4double x = tmin/tmax;
235
236 dedx += (log(x) + (1.0 - x)*beta2) * twopi_mc2_rcl2
237 * (material->GetElectronDensity())/beta2;
238 }
239
240 // now compute the total ionization loss
241
242 if (dedx < 0.0) dedx = 0.0 ;
243
244 dedx *= chargeSquare;
245
246 //G4cout << " tkin(MeV) = " << tkin/MeV << " dedx(MeVxcm^2/g) = "
247 // << dedx*gram/(MeV*cm2*material->GetDensity())
248 // << " q2 = " << chargeSquare << G4endl;
249
250 return dedx;
251}
G4double GetElectronDensity() const
Definition: G4Material.hh:216

Referenced by G4BraggNoDeltaModel::ComputeDEDXPerVolume().

◆ CorrectionsAlongStep()

void G4BraggIonModel::CorrectionsAlongStep ( const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double eloss,
G4double niel,
G4double  length 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 255 of file G4BraggIonModel.cc.

260{
261 // this method is called only for ions
262 const G4ParticleDefinition* p = dp->GetDefinition();
263 const G4Material* mat = couple->GetMaterial();
264 G4double preKinEnergy = dp->GetKineticEnergy();
265 G4double e = preKinEnergy - eloss*0.5;
266 if(e < 0.0) { e = preKinEnergy*0.5; }
267
268 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
270 G4double qfactor = q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor;
271 eloss *= qfactor;
272
273 //G4cout << "G4BraggIonModel::CorrectionsAlongStep e= " << e
274 // << " qfactor= " << qfactor << " " << p->GetParticleName() <<G4endl;
275}
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4Material * GetMaterial() const
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:501

◆ CrossSectionPerVolume()

G4double G4BraggIonModel::CrossSectionPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Reimplemented from G4VEmModel.

Reimplemented in G4BraggNoDeltaModel.

Definition at line 197 of file G4BraggIonModel.cc.

203{
204 G4double eDensity = material->GetElectronDensity();
206 (p,kineticEnergy,cutEnergy,maxEnergy);
207 return cross;
208}

◆ GetChargeSquareRatio()

G4double G4BraggIonModel::GetChargeSquareRatio ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 133 of file G4BraggIonModel.cc.

136{
137 //G4cout << "G4BraggIonModel::GetChargeSquareRatio e= " << kineticEnergy << G4endl;
138 // this method is called only for ions
139 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
140 corrFactor = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
141 return corrFactor;
142}

◆ GetParticleCharge()

G4double G4BraggIonModel::GetParticleCharge ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 146 of file G4BraggIonModel.cc.

149{
150 //G4cout << "G4BraggIonModel::GetParticleCharge e= " << kineticEnergy << G4endl;
151 // this method is called only for ions
152 return corr->GetParticleCharge(p,mat,kineticEnergy);
153}
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)

◆ Initialise()

void G4BraggIonModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector  
)
virtual

Implements G4VEmModel.

Definition at line 106 of file G4BraggIonModel.cc.

108{
109 if(p != particle) { SetParticle(p); }
110
111 corrFactor = chargeSquare;
112
113 // always false before the run
114 SetDeexcitationFlag(false);
115
116 if(!isInitialised) {
117 isInitialised = true;
118
119 G4String pname = particle->GetParticleName();
120 if(particle->GetParticleType() == "nucleus" &&
121 pname != "deuteron" && pname != "triton" &&
122 pname != "alpha+" && pname != "helium" &&
123 pname != "hydrogen") { isIon = true; }
124
126
127 fParticleChange = GetParticleChangeForLoss();
128 }
129}
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
const G4String & GetParticleType() const
const G4String & GetParticleName() const
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:641
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:95

◆ MaxSecondaryEnergy()

G4double G4BraggIonModel::MaxSecondaryEnergy ( const G4ParticleDefinition pd,
G4double  kinEnergy 
)
protectedvirtual

Reimplemented from G4VEmModel.

Definition at line 344 of file G4BraggIonModel.cc.

346{
347 if(pd != particle) { SetParticle(pd); }
348 G4double tau = kinEnergy/mass;
349 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
350 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
351 return tmax;
352}

Referenced by ComputeCrossSectionPerElectron(), and ComputeDEDXPerVolume().

◆ SampleSecondaries()

void G4BraggIonModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  vdp,
const G4MaterialCutsCouple ,
const G4DynamicParticle dp,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 279 of file G4BraggIonModel.cc.

284{
286 G4double xmax = std::min(tmax, maxEnergy);
287 if(xmin >= xmax) { return; }
288
289 G4double kineticEnergy = dp->GetKineticEnergy();
290 G4double energy = kineticEnergy + mass;
291 G4double energy2 = energy*energy;
292 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
293 G4double grej = 1.0;
294 G4double deltaKinEnergy, f;
295
296 G4ThreeVector direction = dp->GetMomentumDirection();
297
298 // sampling follows ...
299 do {
301 deltaKinEnergy = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
302
303 f = 1.0 - beta2*deltaKinEnergy/tmax;
304
305 if(f > grej) {
306 G4cout << "G4BraggIonModel::SampleSecondary Warning! "
307 << "Majorant " << grej << " < "
308 << f << " for e= " << deltaKinEnergy
309 << G4endl;
310 }
311
312 } while( grej*G4UniformRand() >= f );
313
314 G4double deltaMomentum =
315 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
316 G4double totMomentum = energy*sqrt(beta2);
317 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
318 (deltaMomentum * totMomentum);
319 if(cost > 1.0) { cost = 1.0; }
320 G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
321
322 G4double phi = twopi * G4UniformRand() ;
323
324 G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
325 deltaDirection.rotateUz(direction);
326
327 // create G4DynamicParticle object for delta ray
328 G4DynamicParticle* delta = new G4DynamicParticle(theElectron,deltaDirection,
329 deltaKinEnergy);
330
331 vdp->push_back(delta);
332
333 // Change kinematics of primary particle
334 kineticEnergy -= deltaKinEnergy;
335 G4ThreeVector finalP = direction*totMomentum - deltaDirection*deltaMomentum;
336 finalP = finalP.unit();
337
338 fParticleChange->SetProposedKineticEnergy(kineticEnergy);
339 fParticleChange->SetProposedMomentumDirection(finalP);
340}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
Hep3Vector unit() const
const G4ThreeVector & GetMomentumDirection() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:399

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