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

#include <G4BraggModel.hh>

+ Inheritance diagram for G4BraggModel:

Public Member Functions

 G4BraggModel (const G4ParticleDefinition *p=0, const G4String &nam="Bragg")
 
virtual ~G4BraggModel ()
 
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)
 
- 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)
 
G4double GetChargeSquareRatio () const
 
void SetChargeSquareRatio (G4double val)
 
- 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 71 of file G4BraggModel.hh.

Constructor & Destructor Documentation

◆ G4BraggModel()

G4BraggModel::G4BraggModel ( const G4ParticleDefinition p = 0,
const G4String nam = "Bragg" 
)

Definition at line 79 of file G4BraggModel.cc.

80 : G4VEmModel(nam),
81 particle(0),
82 currentMaterial(0),
83 protonMassAMU(1.007276),
84 iMolecula(-1),
85 iPSTAR(-1),
86 isIon(false),
87 isInitialised(false)
88{
89 fParticleChange = 0;
90 SetHighEnergyLimit(2.0*MeV);
91
92 lowestKinEnergy = 1.0*keV;
93 theZieglerFactor = eV*cm2*1.0e-15;
94 theElectron = G4Electron::Electron();
95 expStopPower125 = 0.0;
96
98 if(p) { SetParticle(p); }
99 else { SetParticle(theElectron); }
100}
static G4Electron * Electron()
Definition: G4Electron.cc:94
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:585

◆ ~G4BraggModel()

G4BraggModel::~G4BraggModel ( )
virtual

Definition at line 104 of file G4BraggModel.cc.

105{}

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

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

Reimplemented from G4VEmModel.

Definition at line 180 of file G4BraggModel.cc.

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

◆ ComputeCrossSectionPerElectron()

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

Definition at line 154 of file G4BraggModel.cc.

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

Referenced by ComputeCrossSectionPerAtom(), and CrossSectionPerVolume().

◆ ComputeDEDXPerVolume()

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

Reimplemented from G4VEmModel.

Definition at line 209 of file G4BraggModel.cc.

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

◆ CrossSectionPerVolume()

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

Reimplemented from G4VEmModel.

Definition at line 194 of file G4BraggModel.cc.

200{
201 G4double eDensity = material->GetElectronDensity();
203 (p,kineticEnergy,cutEnergy,maxEnergy);
204 return cross;
205}

◆ GetChargeSquareRatio() [1/2]

G4double G4BraggModel::GetChargeSquareRatio ( ) const
inlineprotected

Definition at line 194 of file G4BraggModel.hh.

195{
196 return chargeSquare;
197}

◆ GetChargeSquareRatio() [2/2]

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

Reimplemented from G4VEmModel.

Definition at line 132 of file G4BraggModel.cc.

135{
136 // this method is called only for ions
137 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
139 return q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
140}
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:501

◆ GetParticleCharge()

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

Reimplemented from G4VEmModel.

Reimplemented in G4BraggIonGasModel.

Definition at line 144 of file G4BraggModel.cc.

147{
148 // this method is called only for ions, so no check if it is an ion
149 return corr->GetParticleCharge(p,mat,kineticEnergy);
150}
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)

◆ Initialise()

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

Implements G4VEmModel.

Definition at line 109 of file G4BraggModel.cc.

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

◆ MaxSecondaryEnergy()

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

Reimplemented from G4VEmModel.

Definition at line 315 of file G4BraggModel.cc.

317{
318 if(pd != particle) { SetParticle(pd); }
319 G4double tau = kinEnergy/mass;
320 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
321 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
322 return tmax;
323}

Referenced by ComputeCrossSectionPerElectron(), and ComputeDEDXPerVolume().

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 250 of file G4BraggModel.cc.

255{
257 G4double xmax = std::min(tmax, maxEnergy);
258 if(xmin >= xmax) { return; }
259
260 G4double kineticEnergy = dp->GetKineticEnergy();
261 G4double energy = kineticEnergy + mass;
262 G4double energy2 = energy*energy;
263 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
264 G4double grej = 1.0;
265 G4double deltaKinEnergy, f;
266
267 G4ThreeVector direction = dp->GetMomentumDirection();
268
269 // sampling follows ...
270 do {
272 deltaKinEnergy = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
273
274 f = 1.0 - beta2*deltaKinEnergy/tmax;
275
276 if(f > grej) {
277 G4cout << "G4BraggModel::SampleSecondary Warning! "
278 << "Majorant " << grej << " < "
279 << f << " for e= " << deltaKinEnergy
280 << G4endl;
281 }
282
283 } while( grej*G4UniformRand() >= f );
284
285 G4double deltaMomentum =
286 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
287 G4double totMomentum = energy*sqrt(beta2);
288 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
289 (deltaMomentum * totMomentum);
290 if(cost > 1.0) cost = 1.0;
291 G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
292
293 G4double phi = twopi * G4UniformRand() ;
294
295 G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
296 deltaDirection.rotateUz(direction);
297
298 // Change kinematics of primary particle
299 kineticEnergy -= deltaKinEnergy;
300 G4ThreeVector finalP = direction*totMomentum - deltaDirection*deltaMomentum;
301 finalP = finalP.unit();
302
303 fParticleChange->SetProposedKineticEnergy(kineticEnergy);
304 fParticleChange->SetProposedMomentumDirection(finalP);
305
306 // create G4DynamicParticle object for delta ray
307 G4DynamicParticle* delta = new G4DynamicParticle(theElectron,deltaDirection,
308 deltaKinEnergy);
309
310 vdp->push_back(delta);
311}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
Hep3Vector unit() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:399

◆ SetChargeSquareRatio()

void G4BraggModel::SetChargeSquareRatio ( G4double  val)
inlineprotected

Definition at line 199 of file G4BraggModel.hh.

200{
201 chargeSquare = val;
202}

Referenced by G4BraggIonGasModel::ChargeSquareRatio().


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