Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4BraggModel Class Reference

#include <G4BraggModel.hh>

Inheritance diagram for G4BraggModel:
G4VEmModel G4BraggIonGasModel

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 InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
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 *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector
< G4EmElementSelector * > * 
GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
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)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=0)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
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
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
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 SetForceBuildTable (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
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 ()
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Additional Inherited Members

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

Detailed Description

Definition at line 71 of file G4BraggModel.hh.

Constructor & Destructor Documentation

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

Definition at line 84 of file G4BraggModel.cc.

References python.hepunit::cm2, G4Electron::Electron(), G4LossTableManager::EmCorrections(), python.hepunit::eV, G4LossTableManager::Instance(), python.hepunit::keV, python.hepunit::MeV, and G4VEmModel::SetHighEnergyLimit().

85  : G4VEmModel(nam),
86  particle(0),
87  currentMaterial(0),
88  protonMassAMU(1.007276),
89  iMolecula(-1),
90  iPSTAR(-1),
91  isIon(false),
92  isInitialised(false)
93 {
94  fParticleChange = 0;
96 
97  lowestKinEnergy = 1.0*keV;
98  theZieglerFactor = eV*cm2*1.0e-15;
99  theElectron = G4Electron::Electron();
100  expStopPower125 = 0.0;
101 
103  if(p) { SetParticle(p); }
104  else { SetParticle(theElectron); }
105 }
static G4LossTableManager * Instance()
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:65
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:683
G4EmCorrections * EmCorrections()
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4BraggModel::~G4BraggModel ( )
virtual

Definition at line 109 of file G4BraggModel.cc.

110 {}

Member Function Documentation

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

Reimplemented from G4VEmModel.

Definition at line 188 of file G4BraggModel.cc.

References ComputeCrossSectionPerElectron().

194 {
196  (p,kineticEnergy,cutEnergy,maxEnergy);
197  return cross;
198 }
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
double G4double
Definition: G4Types.hh:76
G4double G4BraggModel::ComputeCrossSectionPerElectron ( const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Definition at line 162 of file G4BraggModel.cc.

References energy(), G4Log(), MaxSecondaryEnergy(), G4INCL::Math::min(), and python.hepunit::twopi_mc2_rcl2.

Referenced by ComputeCrossSectionPerAtom(), and CrossSectionPerVolume().

167 {
168  G4double cross = 0.0;
169  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
170  G4double maxEnergy = std::min(tmax,maxKinEnergy);
171  if(cutEnergy < maxEnergy) {
172 
173  G4double energy = kineticEnergy + mass;
174  G4double energy2 = energy*energy;
175  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
176  cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*G4Log(maxEnergy/cutEnergy)/tmax;
177 
178  cross *= twopi_mc2_rcl2*chargeSquare/beta2;
179  }
180  // G4cout << "BR: e= " << kineticEnergy << " tmin= " << cutEnergy
181  // << " tmax= " << tmax << " cross= " << cross << G4endl;
182 
183  return cross;
184 }
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
G4double G4Log(G4double x)
Definition: G4Log.hh:227
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
G4double G4BraggModel::ComputeDEDXPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 217 of file G4BraggModel.cc.

References G4Log(), G4InuclParticleNames::gam, G4Material::GetElectronDensity(), MaxSecondaryEnergy(), python.hepunit::twopi_mc2_rcl2, and test::x.

221 {
222  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
223  G4double tkin = kineticEnergy/massRate;
224  G4double dedx = 0.0;
225 
226  if(tkin < lowestKinEnergy) {
227  dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
228  } else {
229  dedx = DEDX(material, tkin);
230  }
231 
232  if (cutEnergy < tmax) {
233 
234  G4double tau = kineticEnergy/mass;
235  G4double gam = tau + 1.0;
236  G4double bg2 = tau * (tau+2.0);
237  G4double beta2 = bg2/(gam*gam);
238  G4double x = cutEnergy/tmax;
239 
240  dedx += (G4Log(x) + (1.0 - x)*beta2) * twopi_mc2_rcl2
241  * (material->GetElectronDensity())/beta2;
242  }
243 
244  // now compute the total ionization loss
245 
246  if (dedx < 0.0) { dedx = 0.0; }
247 
248  dedx *= chargeSquare;
249 
250  //G4cout << "E(MeV)= " << tkin/MeV << " dedx= " << dedx
251  // << " " << material->GetName() << G4endl;
252 
253  return dedx;
254 }
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
G4double GetElectronDensity() const
Definition: G4Material.hh:215
G4double G4Log(G4double x)
Definition: G4Log.hh:227
double G4double
Definition: G4Types.hh:76
G4double G4BraggModel::CrossSectionPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 202 of file G4BraggModel.cc.

References ComputeCrossSectionPerElectron(), and G4Material::GetElectronDensity().

208 {
209  G4double eDensity = material->GetElectronDensity();
211  (p,kineticEnergy,cutEnergy,maxEnergy);
212  return cross;
213 }
G4double GetElectronDensity() const
Definition: G4Material.hh:215
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
double G4double
Definition: G4Types.hh:76
G4double G4BraggModel::GetChargeSquareRatio ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 140 of file G4BraggModel.cc.

References G4EmCorrections::EffectiveChargeCorrection(), G4EmCorrections::EffectiveChargeSquareRatio(), G4VEmModel::GetModelOfFluctuations(), and G4VEmFluctuationModel::SetParticleAndCharge().

143 {
144  // this method is called only for ions
145  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
147  return q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
148 }
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:571
double G4double
Definition: G4Types.hh:76
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
G4double G4BraggModel::GetChargeSquareRatio ( ) const
inlineprotected

Definition at line 193 of file G4BraggModel.hh.

194 {
195  return chargeSquare;
196 }
G4double G4BraggModel::GetParticleCharge ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Reimplemented in G4BraggIonGasModel.

Definition at line 152 of file G4BraggModel.cc.

References G4EmCorrections::GetParticleCharge().

155 {
156  // this method is called only for ions, so no check if it is an ion
157  return corr->GetParticleCharge(p,mat,kineticEnergy);
158 }
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
void G4BraggModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector  
)
virtual

Implements G4VEmModel.

Definition at line 114 of file G4BraggModel.cc.

References G4VEmModel::GetAngularDistribution(), G4VEmModel::GetParticleChangeForLoss(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetParticleType(), eplot::pname, G4VEmModel::SetAngularDistribution(), G4VEmModel::SetDeexcitationFlag(), and G4VEmModel::UseAngularGeneratorFlag().

116 {
117  if(p != particle) { SetParticle(p); }
118 
119  // always false before the run
120  SetDeexcitationFlag(false);
121 
122  if(!isInitialised) {
123  isInitialised = true;
124 
127  }
128  G4String pname = particle->GetParticleName();
129  if(particle->GetParticleType() == "nucleus" &&
130  pname != "deuteron" && pname != "triton" &&
131  pname != "alpha+" && pname != "helium" &&
132  pname != "hydrogen") { isIon = true; }
133 
134  fParticleChange = GetParticleChangeForLoss();
135  }
136 }
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:107
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:578
const G4String & GetParticleName() const
G4bool UseAngularGeneratorFlag() const
Definition: G4VEmModel.hh:655
const G4String & GetParticleType() const
string pname
Definition: eplot.py:33
void SetAngularDistribution(G4VEmAngularDistribution *)
Definition: G4VEmModel.hh:585
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:739
G4double G4BraggModel::MaxSecondaryEnergy ( const G4ParticleDefinition pd,
G4double  kinEnergy 
)
protectedvirtual

Reimplemented from G4VEmModel.

Definition at line 332 of file G4BraggModel.cc.

References python.hepunit::electron_mass_c2.

Referenced by ComputeCrossSectionPerElectron(), and ComputeDEDXPerVolume().

334 {
335  if(pd != particle) { SetParticle(pd); }
336  G4double tau = kinEnergy/mass;
337  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
338  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
339  return tmax;
340 }
float electron_mass_c2
Definition: hepunit.py:274
double G4double
Definition: G4Types.hh:76
void G4BraggModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  vdp,
const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 258 of file G4BraggModel.cc.

References python.hepunit::electron_mass_c2, energy(), G4cout, G4endl, G4UniformRand, G4VEmModel::GetAngularDistribution(), G4DynamicParticle::GetKineticEnergy(), G4MaterialCutsCouple::GetMaterial(), G4DynamicParticle::GetMomentum(), G4DynamicParticle::GetMomentumDirection(), G4DynamicParticle::GetTotalMomentum(), G4VEmModel::MaxSecondaryKinEnergy(), G4INCL::Math::min(), CLHEP::Hep3Vector::rotateUz(), G4VEmAngularDistribution::SampleDirection(), G4VEmModel::SelectRandomAtomNumber(), CLHEP::Hep3Vector::set(), G4ParticleChangeForLoss::SetProposedKineticEnergy(), G4ParticleChangeForLoss::SetProposedMomentumDirection(), python.hepunit::twopi, CLHEP::Hep3Vector::unit(), and G4VEmModel::UseAngularGeneratorFlag().

263 {
264  G4double tmax = MaxSecondaryKinEnergy(dp);
265  G4double xmax = std::min(tmax, maxEnergy);
266  if(xmin >= xmax) { return; }
267 
268  G4double kineticEnergy = dp->GetKineticEnergy();
269  G4double energy = kineticEnergy + mass;
270  G4double energy2 = energy*energy;
271  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
272  G4double grej = 1.0;
273  G4double deltaKinEnergy, f;
274 
275  // sampling follows ...
276  do {
277  G4double q = G4UniformRand();
278  deltaKinEnergy = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
279 
280  f = 1.0 - beta2*deltaKinEnergy/tmax;
281 
282  if(f > grej) {
283  G4cout << "G4BraggModel::SampleSecondary Warning! "
284  << "Majorant " << grej << " < "
285  << f << " for e= " << deltaKinEnergy
286  << G4endl;
287  }
288 
289  } while( grej*G4UniformRand() >= f );
290 
291  G4ThreeVector deltaDirection;
292 
294  const G4Material* mat = couple->GetMaterial();
295  G4int Z = SelectRandomAtomNumber(mat);
296 
297  deltaDirection =
298  GetAngularDistribution()->SampleDirection(dp, deltaKinEnergy, Z, mat);
299 
300  } else {
301 
302  G4double deltaMomentum =
303  sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
304  G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
305  (deltaMomentum * dp->GetTotalMomentum());
306  if(cost > 1.0) { cost = 1.0; }
307  G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
308 
309  G4double phi = twopi * G4UniformRand() ;
310 
311  deltaDirection.set(sint*cos(phi),sint*sin(phi), cost) ;
312  deltaDirection.rotateUz(dp->GetMomentumDirection());
313  }
314 
315  // create G4DynamicParticle object for delta ray
316  G4DynamicParticle* delta =
317  new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
318 
319  // Change kinematics of primary particle
320  kineticEnergy -= deltaKinEnergy;
321  G4ThreeVector finalP = dp->GetMomentum() - delta->GetMomentum();
322  finalP = finalP.unit();
323 
324  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
325  fParticleChange->SetProposedMomentumDirection(finalP);
326 
327  vdp->push_back(delta);
328 }
void set(double x, double y, double z)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:448
G4double GetKineticEnergy() const
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:578
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4bool UseAngularGeneratorFlag() const
Definition: G4VEmModel.hh:655
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:72
void SetProposedKineticEnergy(G4double proposedKinEnergy)
float electron_mass_c2
Definition: hepunit.py:274
void SetProposedMomentumDirection(const G4ThreeVector &dir)
Hep3Vector unit() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4ThreeVector GetMomentum() const
const G4Material * GetMaterial() const
G4int SelectRandomAtomNumber(const G4Material *)
Definition: G4VEmModel.hh:529
void G4BraggModel::SetChargeSquareRatio ( G4double  val)
inlineprotected

Definition at line 198 of file G4BraggModel.hh.

Referenced by G4BraggIonGasModel::ChargeSquareRatio().

199 {
200  chargeSquare = val;
201 }

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