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

#include <G4BraggIonModel.hh>

Inheritance diagram for G4BraggIonModel:
G4VEmModel G4BraggNoDeltaModel

Public Member Functions

 G4BraggIonModel (const G4ParticleDefinition *p=0, const G4String &nam="BraggIon")
 
virtual ~G4BraggIonModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *couple)
 
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 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 G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
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)
 
- 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 68 of file G4BraggIonModel.hh.

Constructor & Destructor Documentation

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

Definition at line 76 of file G4BraggIonModel.cc.

References python.hepunit::amu_c2, python.hepunit::cm2, G4Electron::Electron(), python.hepunit::eV, python.hepunit::GeV, python.hepunit::keV, python.hepunit::MeV, python.hepunit::proton_mass_c2, and G4VEmModel::SetHighEnergyLimit().

78  : G4VEmModel(nam),
79  corr(0),
80  particle(0),
81  fParticleChange(0),
82  currentMaterial(0),
83  iMolecula(-1),
84  iASTAR(-1),
85  isIon(false),
86  isInitialised(false)
87 {
89 
90  HeMass = 3.727417*GeV;
91  rateMassHe2p = HeMass/proton_mass_c2;
92  lowestKinEnergy = 1.0*keV/rateMassHe2p;
93  massFactor = 1000.*amu_c2/HeMass;
94  theZieglerFactor = eV*cm2*1.0e-15;
95  theElectron = G4Electron::Electron();
96  corrFactor = 1.0;
97  if(p) { SetParticle(p); }
98  else { SetParticle(theElectron); }
99 }
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:65
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:683
float proton_mass_c2
Definition: hepunit.py:275
static G4Electron * Electron()
Definition: G4Electron.cc:94
float amu_c2
Definition: hepunit.py:277
G4BraggIonModel::~G4BraggIonModel ( )
virtual

Definition at line 103 of file G4BraggIonModel.cc.

104 {}

Member Function Documentation

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

Reimplemented from G4VEmModel.

Definition at line 197 of file G4BraggIonModel.cc.

References ComputeCrossSectionPerElectron().

203 {
205  (p,kineticEnergy,cutEnergy,maxEnergy);
206  return cross;
207 }
double G4double
Definition: G4Types.hh:76
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
G4double G4BraggIonModel::ComputeCrossSectionPerElectron ( const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Definition at line 171 of file G4BraggIonModel.cc.

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

Referenced by ComputeCrossSectionPerAtom(), and CrossSectionPerVolume().

176 {
177  G4double cross = 0.0;
178  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
179  G4double maxEnergy = std::min(tmax,maxKinEnergy);
180  if(cutEnergy < tmax) {
181 
182  G4double energy = kineticEnergy + mass;
183  G4double energy2 = energy*energy;
184  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
185  cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*G4Log(maxEnergy/cutEnergy)/tmax;
186 
187  cross *= twopi_mc2_rcl2*chargeSquare/beta2;
188  }
189  // G4cout << "BR: e= " << kineticEnergy << " tmin= " << cutEnergy
190  // << " tmax= " << tmax << " cross= " << cross << G4endl;
191 
192  return cross;
193 }
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
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
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
G4double G4BraggIonModel::ComputeDEDXPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy 
)
virtual

Reimplemented from G4VEmModel.

Reimplemented in G4BraggNoDeltaModel.

Definition at line 226 of file G4BraggIonModel.cc.

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

Referenced by G4BraggNoDeltaModel::ComputeDEDXPerVolume().

230 {
231  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
232  G4double tmin = min(cutEnergy, tmax);
233  G4double tkin = kineticEnergy/massRate;
234  G4double dedx = 0.0;
235 
236  if(tkin < lowestKinEnergy) {
237  dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
238  } else {
239  dedx = DEDX(material, tkin);
240  }
241 
242  if (cutEnergy < tmax) {
243 
244  G4double tau = kineticEnergy/mass;
245  G4double gam = tau + 1.0;
246  G4double bg2 = tau * (tau+2.0);
247  G4double beta2 = bg2/(gam*gam);
248  G4double x = tmin/tmax;
249 
250  dedx += (G4Log(x) + (1.0 - x)*beta2) * twopi_mc2_rcl2
251  * (material->GetElectronDensity())/beta2;
252  }
253 
254  // now compute the total ionization loss
255 
256  if (dedx < 0.0) dedx = 0.0 ;
257 
258  dedx *= chargeSquare;
259 
260  //G4cout << " tkin(MeV) = " << tkin/MeV << " dedx(MeVxcm^2/g) = "
261  // << dedx*gram/(MeV*cm2*material->GetDensity())
262  // << " q2 = " << chargeSquare << G4endl;
263 
264  return dedx;
265 }
G4double GetElectronDensity() const
Definition: G4Material.hh:215
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
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
void G4BraggIonModel::CorrectionsAlongStep ( const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double eloss,
G4double niel,
G4double  length 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 269 of file G4BraggIonModel.cc.

References G4EmCorrections::EffectiveChargeCorrection(), G4EmCorrections::EffectiveChargeSquareRatio(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4MaterialCutsCouple::GetMaterial(), G4VEmModel::GetModelOfFluctuations(), and G4VEmFluctuationModel::SetParticleAndCharge().

274 {
275  // this method is called only for ions
276  const G4ParticleDefinition* p = dp->GetDefinition();
277  const G4Material* mat = couple->GetMaterial();
278  G4double preKinEnergy = dp->GetKineticEnergy();
279  G4double e = preKinEnergy - eloss*0.5;
280  if(e < 0.0) { e = preKinEnergy*0.5; }
281 
282  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
284  G4double qfactor = q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor;
285  eloss *= qfactor;
286 
287  //G4cout << "G4BraggIonModel::CorrectionsAlongStep e= " << e
288  // << " qfactor= " << qfactor << " " << p->GetParticleName() <<G4endl;
289 }
G4double GetKineticEnergy() const
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const char * p
Definition: xmltok.h:285
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4ParticleDefinition * GetDefinition() const
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:571
double G4double
Definition: G4Types.hh:76
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
const G4Material * GetMaterial() const
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 211 of file G4BraggIonModel.cc.

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

217 {
218  G4double eDensity = material->GetElectronDensity();
220  (p,kineticEnergy,cutEnergy,maxEnergy);
221  return cross;
222 }
G4double GetElectronDensity() const
Definition: G4Material.hh:215
double G4double
Definition: G4Types.hh:76
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
G4double G4BraggIonModel::GetChargeSquareRatio ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 146 of file G4BraggIonModel.cc.

References G4EmCorrections::EffectiveChargeCorrection(), and G4EmCorrections::EffectiveChargeSquareRatio().

149 {
150  //G4cout<<"G4BraggIonModel::GetChargeSquareRatio e= "<<kineticEnergy<<G4endl;
151  // this method is called only for ions
152  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
153  corrFactor = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
154  return corrFactor;
155 }
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
double G4double
Definition: G4Types.hh:76
G4double G4BraggIonModel::GetParticleCharge ( const G4ParticleDefinition p,
const G4Material mat,
G4double  kineticEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 159 of file G4BraggIonModel.cc.

References G4EmCorrections::GetParticleCharge().

162 {
163  //G4cout<<"G4BraggIonModel::GetParticleCharge e= "<<kineticEnergy <<
164  // " q= " << corr->GetParticleCharge(p,mat,kineticEnergy) <<G4endl;
165  // this method is called only for ions
166  return corr->GetParticleCharge(p,mat,kineticEnergy);
167 }
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
void G4BraggIonModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector  
)
virtual

Implements G4VEmModel.

Definition at line 108 of file G4BraggIonModel.cc.

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

110 {
111  if(p != particle) { SetParticle(p); }
112 
113  corrFactor = chargeSquare;
114 
115  // always false before the run
116  SetDeexcitationFlag(false);
117 
118  if(!isInitialised) {
119  isInitialised = true;
120 
123  }
124  G4String pname = particle->GetParticleName();
125  if(particle->GetParticleType() == "nucleus" &&
126  pname != "deuteron" && pname != "triton" &&
127  pname != "alpha+" && pname != "helium" &&
128  pname != "hydrogen") { isIon = true; }
129 
131 
132  fParticleChange = GetParticleChangeForLoss();
133  }
134 }
static G4LossTableManager * Instance()
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:107
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:578
const G4String & GetParticleName() const
G4bool UseAngularGeneratorFlag() const
Definition: G4VEmModel.hh:655
G4EmCorrections * EmCorrections()
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 G4BraggIonModel::MaxSecondaryEnergy ( const G4ParticleDefinition pd,
G4double  kinEnergy 
)
protectedvirtual

Reimplemented from G4VEmModel.

Definition at line 367 of file G4BraggIonModel.cc.

References python.hepunit::electron_mass_c2.

Referenced by ComputeCrossSectionPerElectron(), and ComputeDEDXPerVolume().

369 {
370  if(pd != particle) { SetParticle(pd); }
371  G4double tau = kinEnergy/mass;
372  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
373  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
374  return tmax;
375 }
float electron_mass_c2
Definition: hepunit.py:274
double G4double
Definition: G4Types.hh:76
G4double G4BraggIonModel::MinEnergyCut ( const G4ParticleDefinition ,
const G4MaterialCutsCouple couple 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 138 of file G4BraggIonModel.cc.

References G4Material::GetIonisation(), G4MaterialCutsCouple::GetMaterial(), and G4IonisParamMat::GetMeanExcitationEnergy().

140 {
141  return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
142 }
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:224
G4double GetMeanExcitationEnergy() const
const G4Material * GetMaterial() const
void G4BraggIonModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  vdp,
const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 293 of file G4BraggIonModel.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().

298 {
299  G4double tmax = MaxSecondaryKinEnergy(dp);
300  G4double xmax = std::min(tmax, maxEnergy);
301  if(xmin >= xmax) { return; }
302 
303  G4double kineticEnergy = dp->GetKineticEnergy();
304  G4double energy = kineticEnergy + mass;
305  G4double energy2 = energy*energy;
306  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
307  G4double grej = 1.0;
308  G4double deltaKinEnergy, f;
309 
310  // sampling follows ...
311  do {
312  G4double q = G4UniformRand();
313  deltaKinEnergy = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
314 
315  f = 1.0 - beta2*deltaKinEnergy/tmax;
316 
317  if(f > grej) {
318  G4cout << "G4BraggIonModel::SampleSecondary Warning! "
319  << "Majorant " << grej << " < "
320  << f << " for e= " << deltaKinEnergy
321  << G4endl;
322  }
323 
324  } while( grej*G4UniformRand() >= f );
325 
326  G4ThreeVector deltaDirection;
327 
329  const G4Material* mat = couple->GetMaterial();
330  G4int Z = SelectRandomAtomNumber(mat);
331 
332  deltaDirection =
333  GetAngularDistribution()->SampleDirection(dp, deltaKinEnergy, Z, mat);
334 
335  } else {
336 
337  G4double deltaMomentum =
338  sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
339  G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
340  (deltaMomentum * dp->GetTotalMomentum());
341  if(cost > 1.0) { cost = 1.0; }
342  G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
343 
344  G4double phi = twopi * G4UniformRand() ;
345 
346  deltaDirection.set(sint*cos(phi),sint*sin(phi), cost) ;
347  deltaDirection.rotateUz(dp->GetMomentumDirection());
348  }
349 
350  // create G4DynamicParticle object for delta ray
351  G4DynamicParticle* delta =
352  new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
353 
354  vdp->push_back(delta);
355 
356  // Change kinematics of primary particle
357  kineticEnergy -= deltaKinEnergy;
358  G4ThreeVector finalP = dp->GetMomentum() - delta->GetMomentum();
359  finalP = finalP.unit();
360 
361  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
362  fParticleChange->SetProposedMomentumDirection(finalP);
363 }
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

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