Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4EmCalculator Class Reference

#include <G4EmCalculator.hh>

Public Member Functions

 G4EmCalculator ()
 
 ~G4EmCalculator ()
 
G4double GetDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
 
G4double GetDEDX (G4double kinEnergy, const G4String &part, const G4String &mat, const G4String &s="world")
 
G4double GetRangeFromRestricteDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
 
G4double GetRangeFromRestricteDEDX (G4double kinEnergy, const G4String &part, const G4String &mat, const G4String &s="world")
 
G4double GetCSDARange (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
 
G4double GetCSDARange (G4double kinEnergy, const G4String &part, const G4String &mat, const G4String &s="world")
 
G4double GetRange (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
 
G4double GetRange (G4double kinEnergy, const G4String &part, const G4String &mat, const G4String &s="world")
 
G4double GetKinEnergy (G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
 
G4double GetKinEnergy (G4double range, const G4String &part, const G4String &mat, const G4String &s="world")
 
G4double GetCrossSectionPerVolume (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
 
G4double GetCrossSectionPerVolume (G4double kinEnergy, const G4String &part, const G4String &proc, const G4String &mat, const G4String &s="world")
 
G4double GetShellIonisationCrossSectionPerAtom (const G4String &part, G4int Z, G4AtomicShellEnumerator shell, G4double kinEnergy)
 
G4double GetMeanFreePath (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
 
G4double GetMeanFreePath (G4double kinEnergy, const G4String &part, const G4String &proc, const G4String &mat, const G4String &s="world")
 
void PrintDEDXTable (const G4ParticleDefinition *)
 
void PrintRangeTable (const G4ParticleDefinition *)
 
void PrintInverseRangeTable (const G4ParticleDefinition *)
 
G4double ComputeDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
 
G4double ComputeDEDX (G4double kinEnergy, const G4String &part, const G4String &proc, const G4String &mat, G4double cut=DBL_MAX)
 
G4double ComputeElectronicDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
 
G4double ComputeElectronicDEDX (G4double kinEnergy, const G4String &part, const G4String &mat, G4double cut=DBL_MAX)
 
G4double ComputeDEDXForCutInRange (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double rangecut=DBL_MAX)
 
G4double ComputeDEDXForCutInRange (G4double kinEnergy, const G4String &part, const G4String &mat, G4double rangecut=DBL_MAX)
 
G4double ComputeNuclearDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
 
G4double ComputeNuclearDEDX (G4double kinEnergy, const G4String &part, const G4String &mat)
 
G4double ComputeTotalDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)
 
G4double ComputeTotalDEDX (G4double kinEnergy, const G4String &part, const G4String &mat, G4double cut=DBL_MAX)
 
G4double ComputeCrossSectionPerVolume (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
 
G4double ComputeCrossSectionPerVolume (G4double kinEnergy, const G4String &part, const G4String &proc, const G4String &mat, G4double cut=0.0)
 
G4double ComputeCrossSectionPerAtom (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
 
G4double ComputeCrossSectionPerAtom (G4double kinEnergy, const G4String &part, const G4String &processName, const G4Element *, G4double cut=0.0)
 
G4double ComputeCrossSectionPerShell (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4int Z, G4int shellIdx, G4double cut=0.0)
 
G4double ComputeCrossSectionPerShell (G4double kinEnergy, const G4String &part, const G4String &processName, const G4Element *, G4int shellIdx, G4double cut=0.0)
 
G4double ComputeGammaAttenuationLength (G4double kinEnergy, const G4Material *)
 
G4double ComputeShellIonisationCrossSectionPerAtom (const G4String &part, G4int Z, G4AtomicShellEnumerator shell, G4double kinEnergy, const G4Material *mat=nullptr)
 
G4double ComputeMeanFreePath (G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
 
G4double ComputeMeanFreePath (G4double kinEnergy, const G4String &, const G4String &, const G4String &processName, G4double cut=0.0)
 
G4double ComputeEnergyCutFromRangeCut (G4double range, const G4ParticleDefinition *, const G4Material *)
 
G4double ComputeEnergyCutFromRangeCut (G4double range, const G4String &, const G4String &)
 
const G4ParticleDefinitionFindParticle (const G4String &)
 
const G4ParticleDefinitionFindIon (G4int Z, G4int A)
 
const G4MaterialFindMaterial (const G4String &)
 
const G4RegionFindRegion (const G4String &)
 
const G4MaterialCutsCoupleFindCouple (const G4Material *, const G4Region *r=nullptr)
 
G4VProcessFindProcess (const G4ParticleDefinition *part, const G4String &processName)
 
void SetupMaterial (const G4Material *)
 
void SetupMaterial (const G4String &)
 
void SetVerbose (G4int val)
 

Detailed Description

Definition at line 82 of file G4EmCalculator.hh.

Constructor & Destructor Documentation

G4EmCalculator::G4EmCalculator ( )

Definition at line 93 of file G4EmCalculator.cc.

94 {
95  manager = G4LossTableManager::Instance();
96  nist = G4NistManager::Instance();
97  theParameters = G4EmParameters::Instance();
98  corr = manager->EmCorrections();
99  nLocalMaterials = 0;
100  verbose = 0;
101  currentCoupleIndex = 0;
102  currentCouple = nullptr;
103  currentMaterial = cutMaterial = nullptr;
104  currentParticle = nullptr;
105  lambdaParticle = nullptr;
106  baseParticle = nullptr;
107  currentLambda = nullptr;
108  currentModel = nullptr;
109  currentProcess = nullptr;
110  loweModel = nullptr;
111  chargeSquare = 1.0;
112  massRatio = 1.0;
113  mass = 0.0;
114  currentCut = 0.0;
115  cutenergy[0] = cutenergy[1] = cutenergy[2] = DBL_MAX;
116  currentParticleName= "";
117  currentMaterialName= "";
118  currentName = "";
119  lambdaName = "";
120  theGenericIon = G4GenericIon::GenericIon();
121  ionEffCharge = new G4ionEffectiveCharge();
123  isIon = false;
124  isApplicable = false;
125 }
static G4LossTableManager * Instance()
static G4NistManager * Instance()
G4IonTable * GetIonTable() const
G4EmCorrections * EmCorrections()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
static G4ParticleTable * GetParticleTable()
static G4EmParameters * Instance()
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

G4EmCalculator::~G4EmCalculator ( )

Definition at line 129 of file G4EmCalculator.cc.

130 {
131  delete ionEffCharge;
132  for (G4int i=0; i<nLocalMaterials; ++i) {
133  delete localCouples[i];
134  }
135 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

G4double G4EmCalculator::ComputeCrossSectionPerAtom ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
G4double  Z,
G4double  A,
G4double  cut = 0.0 
)

Definition at line 635 of file G4EmCalculator.cc.

641 {
642  G4double res = 0.0;
643  if(UpdateParticle(p, kinEnergy)) {
644  G4int iz = G4lrint(Z);
645  CheckMaterial(iz);
646  if(FindEmModel(p, processName, kinEnergy)) {
647  G4double e = kinEnergy;
648  G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
649  if(baseParticle) {
650  e *= kinEnergy*massRatio;
651  currentModel->InitialiseForElement(baseParticle, iz);
652  res = currentModel->ComputeCrossSectionPerAtom(
653  baseParticle, e, Z, A, aCut) * chargeSquare;
654  } else {
655  currentModel->InitialiseForElement(p, iz);
656  res = currentModel->ComputeCrossSectionPerAtom(p, e, Z, A, aCut);
657  }
658  if(verbose>0) {
659  G4cout << "E(MeV)= " << kinEnergy/MeV
660  << " cross(barn)= " << res/barn
661  << " " << p->GetParticleName()
662  << " Z= " << Z << " A= " << A/(g/mole) << " g/mole"
663  << " cut(keV)= " << aCut/keV
664  << G4endl;
665  }
666  }
667  }
668  return res;
669 }
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:243
G4double LowestElectronEnergy() const
static constexpr double g
Definition: G4SIunits.hh:183
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:321
int G4lrint(double ad)
Definition: templates.hh:163
T max(const T t1, const T t2)
brief Return the largest of the two arguments
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
static constexpr double barn
Definition: G4SIunits.hh:105
static constexpr double keV
Definition: G4SIunits.hh:216
static constexpr double mole
Definition: G4SIunits.hh:286

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeCrossSectionPerAtom ( G4double  kinEnergy,
const G4String part,
const G4String processName,
const G4Element elm,
G4double  cut = 0.0 
)
inline

Definition at line 511 of file G4EmCalculator.hh.

516 {
517  return ComputeCrossSectionPerAtom(kinEnergy,FindParticle(particle),
518  processName,
519  elm->GetZ(),elm->GetN(),cut);
520 }
G4double GetN() const
Definition: G4Element.hh:135
G4double GetZ() const
Definition: G4Element.hh:131
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeCrossSectionPerShell ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
G4int  Z,
G4int  shellIdx,
G4double  cut = 0.0 
)

Definition at line 673 of file G4EmCalculator.cc.

678 {
679  G4double res = 0.0;
680  if(UpdateParticle(p, kinEnergy)) {
681  CheckMaterial(Z);
682  if(FindEmModel(p, processName, kinEnergy)) {
683  G4double e = kinEnergy;
684  G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
685  if(baseParticle) {
686  e *= kinEnergy*massRatio;
687  currentModel->InitialiseForElement(baseParticle, Z);
688  res = currentModel->ComputeCrossSectionPerShell(baseParticle, Z, shellIdx,
689  e, aCut) * chargeSquare;
690  } else {
691  currentModel->InitialiseForElement(p, Z);
692  res = currentModel->ComputeCrossSectionPerAtom(p, Z, shellIdx, e, aCut);
693  }
694  if(verbose>0) {
695  G4cout << "E(MeV)= " << kinEnergy/MeV
696  << " cross(barn)= " << res/barn
697  << " " << p->GetParticleName()
698  << " Z= " << Z << " shellIdx= " << shellIdx
699  << " cut(keV)= " << aCut/keV
700  << G4endl;
701  }
702  }
703  }
704  return res;
705 }
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:243
G4double LowestElectronEnergy() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:321
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual G4double ComputeCrossSectionPerShell(const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:331
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
static constexpr double barn
Definition: G4SIunits.hh:105
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeCrossSectionPerShell ( G4double  kinEnergy,
const G4String part,
const G4String processName,
const G4Element elm,
G4int  shellIdx,
G4double  cut = 0.0 
)
inline

Definition at line 524 of file G4EmCalculator.hh.

528 {
529  return ComputeCrossSectionPerShell(kinEnergy, FindParticle(part),
530  processName, elm->GetZasInt(),
531  shellIdx, cut);
532 }
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeCrossSectionPerShell(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4int Z, G4int shellIdx, G4double cut=0.0)
G4int GetZasInt() const
Definition: G4Element.hh:132

Here is the call graph for this function:

G4double G4EmCalculator::ComputeCrossSectionPerVolume ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
const G4Material mat,
G4double  cut = 0.0 
)

Definition at line 600 of file G4EmCalculator.cc.

606 {
607  SetupMaterial(mat);
608  G4double res = 0.0;
609  if(UpdateParticle(p, kinEnergy)) {
610  if(FindEmModel(p, processName, kinEnergy)) {
611  G4double e = kinEnergy;
612  G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
613  if(baseParticle) {
614  e *= kinEnergy*massRatio;
615  res = currentModel->CrossSectionPerVolume(
616  mat, baseParticle, e, aCut, e) * chargeSquare;
617  } else {
618  res = currentModel->CrossSectionPerVolume(mat, p, e, aCut, e);
619  }
620  if(verbose>0) {
621  G4cout << "G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/MeV
622  << " cross(cm-1)= " << res*cm
623  << " cut(keV)= " << aCut/keV
624  << " " << p->GetParticleName()
625  << " in " << mat->GetName()
626  << G4endl;
627  }
628  }
629  }
630  return res;
631 }
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:257
G4double LowestElectronEnergy() const
const G4String & GetName() const
Definition: G4Material.hh:178
void SetupMaterial(const G4Material *)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
T max(const T t1, const T t2)
brief Return the largest of the two arguments
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeCrossSectionPerVolume ( G4double  kinEnergy,
const G4String part,
const G4String proc,
const G4String mat,
G4double  cut = 0.0 
)
inline

Definition at line 496 of file G4EmCalculator.hh.

502 {
503  return ComputeCrossSectionPerVolume(kinEnergy,FindParticle(particle),
504  processName,
505  FindMaterial(material),cut);
506 }
const G4Material * FindMaterial(const G4String &)
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeDEDX ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
const G4Material mat,
G4double  cut = DBL_MAX 
)

Definition at line 375 of file G4EmCalculator.cc.

380 {
381  SetupMaterial(mat);
382  G4double res = 0.0;
383  if(verbose > 1) {
384  G4cout << "### G4EmCalculator::ComputeDEDX: " << p->GetParticleName()
385  << " in " << currentMaterialName
386  << " e(MeV)= " << kinEnergy/MeV << " cut(MeV)= " << cut/MeV
387  << G4endl;
388  }
389  if(UpdateParticle(p, kinEnergy)) {
390  if(FindEmModel(p, processName, kinEnergy)) {
391 
392  // Special case of ICRU'73 model
393  if(currentModel->GetName() == "ParamICRU73") {
394  res = currentModel->ComputeDEDXPerVolume(mat, p, kinEnergy, cut);
395  if(verbose > 1) {
396  G4cout << " ICRU73 ion E(MeV)= " << kinEnergy << " ";
397  G4cout << currentModel->GetName() << ": DEDX(MeV/mm)= " << res*mm/MeV
398  << " DEDX(MeV*cm^2/g)= "
399  << res*gram/(MeV*cm2*mat->GetDensity())
400  << G4endl;
401  }
402  } else {
403 
404  G4double escaled = kinEnergy*massRatio;
405  if(baseParticle) {
406  res = currentModel->ComputeDEDXPerVolume(
407  mat, baseParticle, escaled, cut) * chargeSquare;
408  if(verbose > 1) {
409  G4cout << baseParticle->GetParticleName()
410  << " Escaled(MeV)= " << escaled;
411  }
412  } else {
413  res = currentModel->ComputeDEDXPerVolume(mat, p, kinEnergy, cut);
414  if(verbose > 1) { G4cout << " no basePart E(MeV)= " << kinEnergy << " "; }
415  }
416  if(verbose > 1) {
417  G4cout << currentModel->GetName() << ": DEDX(MeV/mm)= " << res*mm/MeV
418  << " DEDX(MeV*cm^2/g)= "
419  << res*gram/(MeV*cm2*mat->GetDensity())
420  << G4endl;
421  }
422 
423  // emulate smoothing procedure
424  G4double eth = currentModel->LowEnergyLimit();
425  // G4cout << "massRatio= " << massRatio << " eth= " << eth << G4endl;
426  if(loweModel) {
427  G4double res0 = 0.0;
428  G4double res1 = 0.0;
429  if(baseParticle) {
430  res1 = currentModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut)
431  * chargeSquare;
432  res0 = loweModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut)
433  * chargeSquare;
434  } else {
435  res1 = currentModel->ComputeDEDXPerVolume(mat, p, eth, cut);
436  res0 = loweModel->ComputeDEDXPerVolume(mat, p, eth, cut);
437  }
438  if(verbose > 1) {
439  G4cout << "At boundary energy(MeV)= " << eth/MeV
440  << " DEDX(MeV/mm)= " << res1*mm/MeV
441  << G4endl;
442  }
443 
444  //G4cout << "eth= " << eth << " escaled= " << escaled
445  // << " res0= " << res0 << " res1= "
446  // << res1 << " q2= " << chargeSquare << G4endl;
447 
448  if(res1 > 0.0 && escaled > 0.0) {
449  res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
450  }
451  }
452 
453  // low energy correction for ions
454  if(isIon) {
455  G4double length = CLHEP::nm;
456  const G4Region* r = 0;
457  const G4MaterialCutsCouple* couple = FindCouple(mat, r);
458  G4double eloss = res*length;
459  G4double niel = 0.0;
460  dynParticle.SetKineticEnergy(kinEnergy);
461  currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
462  currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
463  res = eloss/length;
464 
465  if(verbose > 1) {
466  G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV
467  << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
468  << G4endl;
469  }
470  }
471  }
472  }
473  if(verbose > 0) {
474  G4cout << "Sum: E(MeV)= " << kinEnergy/MeV
475  << " DEDX(MeV/mm)= " << res*mm/MeV
476  << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
477  << " cut(MeV)= " << cut/MeV
478  << " " << p->GetParticleName()
479  << " in " << currentMaterialName
480  << " Zi^2= " << chargeSquare
481  << " isIon=" << isIon
482  << G4endl;
483  }
484  }
485  return res;
486 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:640
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
static constexpr double mm
Definition: G4SIunits.hh:115
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:370
static constexpr double cm2
Definition: G4SIunits.hh:120
G4double GetDensity() const
Definition: G4Material.hh:180
void SetupMaterial(const G4Material *)
const G4String & GetParticleName() const
static constexpr double gram
Definition: G4SIunits.hh:178
G4GLOB_DLL std::ostream G4cout
void SetKineticEnergy(G4double aEnergy)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:353
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.cc:248
static constexpr double nm
Definition: SystemOfUnits.h:92
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
const G4String & GetName() const
Definition: G4VEmModel.hh:794
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeDEDX ( G4double  kinEnergy,
const G4String part,
const G4String proc,
const G4String mat,
G4double  cut = DBL_MAX 
)
inline

Definition at line 472 of file G4EmCalculator.hh.

477 {
478  return ComputeDEDX(kinEnergy,FindParticle(particle),processName,
479  FindMaterial(material),cut);
480 }
const G4Material * FindMaterial(const G4String &)
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
const G4ParticleDefinition * FindParticle(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeDEDXForCutInRange ( G4double  kinEnergy,
const G4ParticleDefinition part,
const G4Material mat,
G4double  rangecut = DBL_MAX 
)

Definition at line 523 of file G4EmCalculator.cc.

527 {
528  SetupMaterial(mat);
529  G4double dedx = 0.0;
530  if(UpdateParticle(part, kinEnergy)) {
531 
533  const std::vector<G4VEnergyLossProcess*> vel =
534  lManager->GetEnergyLossProcessVector();
535  G4int n = vel.size();
536 
537  if(mat != cutMaterial) {
538  cutMaterial = mat;
539  cutenergy[0] = ComputeEnergyCutFromRangeCut(rangecut, G4Gamma::Gamma(), mat);
540  cutenergy[1] = ComputeEnergyCutFromRangeCut(rangecut, G4Electron::Electron(), mat);
541  cutenergy[2] = ComputeEnergyCutFromRangeCut(rangecut, G4Positron::Positron(), mat);
542  }
543 
544  //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
545  // << " n= " << n << G4endl;
546 
547  for(G4int i=0; i<n; ++i) {
548  if(vel[i]) {
549  G4VProcess* p = reinterpret_cast<G4VProcess*>(vel[i]);
550  if(ActiveForParticle(part, p)) {
551  //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
552  // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
553  const G4ParticleDefinition* sec = (vel[i])->SecondaryParticle();
554  G4int idx = 0;
555  if(sec == G4Electron::Electron()) { idx = 1; }
556  else if(sec == G4Positron::Positron()) { idx = 2; }
557 
558  dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),
559  mat,cutenergy[idx]);
560  }
561  }
562  }
563  }
564  return dedx;
565 }
static G4LossTableManager * Instance()
const char * p
Definition: xmltok.h:285
void SetupMaterial(const G4Material *)
int G4int
Definition: G4Types.hh:78
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Electron * Electron()
Definition: G4Electron.cc:94
double G4double
Definition: G4Types.hh:76
G4double ComputeEnergyCutFromRangeCut(G4double range, const G4ParticleDefinition *, const G4Material *)

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeDEDXForCutInRange ( G4double  kinEnergy,
const G4String part,
const G4String mat,
G4double  rangecut = DBL_MAX 
)
inline

Definition at line 449 of file G4EmCalculator.hh.

453 {
454  return ComputeDEDXForCutInRange(kinEnergy,FindParticle(part),
455  FindMaterial(mat), rangecut);
456 }
const G4Material * FindMaterial(const G4String &)
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeDEDXForCutInRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double rangecut=DBL_MAX)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeElectronicDEDX ( G4double  kinEnergy,
const G4ParticleDefinition part,
const G4Material mat,
G4double  cut = DBL_MAX 
)

Definition at line 490 of file G4EmCalculator.cc.

494 {
495  SetupMaterial(mat);
496  G4double dedx = 0.0;
497  if(UpdateParticle(part, kinEnergy)) {
498 
500  const std::vector<G4VEnergyLossProcess*> vel =
501  lManager->GetEnergyLossProcessVector();
502  G4int n = vel.size();
503 
504  //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
505  // << " n= " << n << G4endl;
506 
507  for(G4int i=0; i<n; ++i) {
508  if(vel[i]) {
509  G4VProcess* p = reinterpret_cast<G4VProcess*>(vel[i]);
510  if(ActiveForParticle(part, p)) {
511  //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
512  // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
513  dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
514  }
515  }
516  }
517  }
518  return dedx;
519 }
static G4LossTableManager * Instance()
const char * p
Definition: xmltok.h:285
void SetupMaterial(const G4Material *)
int G4int
Definition: G4Types.hh:78
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeElectronicDEDX ( G4double  kinEnergy,
const G4String part,
const G4String mat,
G4double  cut = DBL_MAX 
)
inline

Definition at line 439 of file G4EmCalculator.hh.

441 {
442  return
443  ComputeElectronicDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
444 }
const G4Material * FindMaterial(const G4String &)
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
const G4ParticleDefinition * FindParticle(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeEnergyCutFromRangeCut ( G4double  range,
const G4ParticleDefinition part,
const G4Material mat 
)

Definition at line 765 of file G4EmCalculator.cc.

769 {
771  ConvertRangeToEnergy(part, mat, range);
772 }
static G4ProductionCutsTable * GetProductionCutsTable()

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeEnergyCutFromRangeCut ( G4double  range,
const G4String particle,
const G4String material 
)
inline

Definition at line 537 of file G4EmCalculator.hh.

541 {
542  return ComputeEnergyCutFromRangeCut(range,FindParticle(particle),
543  FindMaterial(material));
544 }
const G4Material * FindMaterial(const G4String &)
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeEnergyCutFromRangeCut(G4double range, const G4ParticleDefinition *, const G4Material *)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeGammaAttenuationLength ( G4double  kinEnergy,
const G4Material mat 
)

Definition at line 710 of file G4EmCalculator.cc.

712 {
713  G4double res = 0.0;
714  const G4ParticleDefinition* gamma = G4Gamma::Gamma();
715  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "conv", mat, 0.0);
716  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "compt", mat, 0.0);
717  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "phot", mat, 0.0);
718  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "Rayl", mat, 0.0);
719  if(res > 0.0) { res = 1.0/res; }
720  return res;
721 }
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4double G4EmCalculator::ComputeMeanFreePath ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
const G4Material mat,
G4double  cut = 0.0 
)

Definition at line 744 of file G4EmCalculator.cc.

749 {
750  G4double mfp = DBL_MAX;
751  G4double x = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, cut);
752  if(x > 0.0) { mfp = 1.0/x; }
753  if(verbose>1) {
754  G4cout << "E(MeV)= " << kinEnergy/MeV
755  << " MFP(mm)= " << mfp/mm
756  << " " << p->GetParticleName()
757  << " in " << mat->GetName()
758  << G4endl;
759  }
760  return mfp;
761 }
static constexpr double mm
Definition: G4SIunits.hh:115
const G4String & GetName() const
Definition: G4Material.hh:178
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeMeanFreePath ( G4double  kinEnergy,
const G4String particle,
const G4String processName,
const G4String processName,
G4double  cut = 0.0 
)
inline

Definition at line 549 of file G4EmCalculator.hh.

554 {
555  return ComputeMeanFreePath(kinEnergy,FindParticle(particle),processName,
556  FindMaterial(material),cut);
557 }
const G4Material * FindMaterial(const G4String &)
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeNuclearDEDX ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4Material mat 
)

Definition at line 581 of file G4EmCalculator.cc.

584 {
585 
586  G4double res = corr->NuclearDEDX(p, mat, kinEnergy, false);
587 
588  if(verbose > 1) {
589  G4cout << p->GetParticleName() << " E(MeV)= " << kinEnergy/MeV
590  << " NuclearDEDX(MeV/mm)= " << res*mm/MeV
591  << " NuclearDEDX(MeV*cm^2/g)= "
592  << res*gram/(MeV*cm2*mat->GetDensity())
593  << G4endl;
594  }
595  return res;
596 }
static constexpr double mm
Definition: G4SIunits.hh:115
static constexpr double cm2
Definition: G4SIunits.hh:120
G4double GetDensity() const
Definition: G4Material.hh:180
const G4String & GetParticleName() const
static constexpr double gram
Definition: G4SIunits.hh:178
G4GLOB_DLL std::ostream G4cout
G4double NuclearDEDX(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4bool fluct=true)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeNuclearDEDX ( G4double  kinEnergy,
const G4String part,
const G4String mat 
)
inline

Definition at line 485 of file G4EmCalculator.hh.

488 {
489  return ComputeNuclearDEDX(kinEnergy,FindParticle(particle),
490  FindMaterial(material));
491 }
const G4Material * FindMaterial(const G4String &)
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
const G4ParticleDefinition * FindParticle(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::ComputeShellIonisationCrossSectionPerAtom ( const G4String part,
G4int  Z,
G4AtomicShellEnumerator  shell,
G4double  kinEnergy,
const G4Material mat = nullptr 
)

Definition at line 725 of file G4EmCalculator.cc.

731 {
732  G4double res = 0.0;
733  const G4ParticleDefinition* p = FindParticle(particle);
734  G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
735  if(p && ad) {
736  res = ad->ComputeShellIonisationCrossSectionPerAtom(p, Z, shell,
737  kinEnergy, mat);
738  }
739  return res;
740 }
const char * p
Definition: xmltok.h:285
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr)=0
const G4ParticleDefinition * FindParticle(const G4String &)
G4VAtomDeexcitation * AtomDeexcitation()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4double G4EmCalculator::ComputeTotalDEDX ( G4double  kinEnergy,
const G4ParticleDefinition part,
const G4Material mat,
G4double  cut = DBL_MAX 
)

Definition at line 569 of file G4EmCalculator.cc.

573 {
574  G4double dedx = ComputeElectronicDEDX(kinEnergy,part,mat,cut);
575  if(mass > 700.*MeV) { dedx += ComputeNuclearDEDX(kinEnergy,part,mat); }
576  return dedx;
577 }
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::ComputeTotalDEDX ( G4double  kinEnergy,
const G4String part,
const G4String mat,
G4double  cut = DBL_MAX 
)
inline

Definition at line 461 of file G4EmCalculator.hh.

465 {
466  return ComputeTotalDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
467 }
const G4Material * FindMaterial(const G4String &)
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)
const G4ParticleDefinition * FindParticle(const G4String &)

Here is the call graph for this function:

const G4MaterialCutsCouple * G4EmCalculator::FindCouple ( const G4Material material,
const G4Region r = nullptr 
)

Definition at line 896 of file G4EmCalculator.cc.

899 {
900  const G4MaterialCutsCouple* couple = 0;
901  SetupMaterial(material);
902  if(currentMaterial) {
903  // Access to materials
904  const G4ProductionCutsTable* theCoupleTable=
906  const G4Region* r = region;
907  if(r) {
908  couple = theCoupleTable->GetMaterialCutsCouple(material,
909  r->GetProductionCuts());
910  } else {
912  size_t nr = store->size();
913  if(0 < nr) {
914  for(size_t i=0; i<nr; ++i) {
915  couple = theCoupleTable->GetMaterialCutsCouple(
916  material, ((*store)[i])->GetProductionCuts());
917  if(couple) { break; }
918  }
919  }
920  }
921  }
922  if(!couple) {
924  ed << "G4EmCalculator::FindCouple: fail for material <"
925  << currentMaterialName << ">";
926  if(region) { ed << " and region " << region->GetName(); }
927  G4Exception("G4EmCalculator::FindCouple", "em0078",
928  FatalException, ed);
929  }
930  return couple;
931 }
G4ProductionCuts * GetProductionCuts() const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void SetupMaterial(const G4Material *)
static G4RegionStore * GetInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const

Here is the call graph for this function:

Here is the caller graph for this function:

const G4ParticleDefinition * G4EmCalculator::FindIon ( G4int  Z,
G4int  A 
)

Definition at line 861 of file G4EmCalculator.cc.

862 {
863  const G4ParticleDefinition* p = ionTable->GetIon(Z,A,0);
864  return p;
865 }
const char * p
Definition: xmltok.h:285
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:503
double A(double temperature)

Here is the call graph for this function:

const G4Material * G4EmCalculator::FindMaterial ( const G4String name)

Definition at line 869 of file G4EmCalculator.cc.

870 {
871  if(name != currentMaterialName) {
873  if(!currentMaterial) {
874  G4cout << "### WARNING: G4EmCalculator::FindMaterial fails to find "
875  << name << G4endl;
876  }
877  }
878  return currentMaterial;
879 }
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
void SetupMaterial(const G4Material *)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

const G4ParticleDefinition * G4EmCalculator::FindParticle ( const G4String name)

Definition at line 844 of file G4EmCalculator.cc.

845 {
846  const G4ParticleDefinition* p = 0;
847  if(name != currentParticleName) {
849  if(!p) {
850  G4cout << "### WARNING: G4EmCalculator::FindParticle fails to find "
851  << name << G4endl;
852  }
853  } else {
854  p = currentParticle;
855  }
856  return p;
857 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

G4VProcess * G4EmCalculator::FindProcess ( const G4ParticleDefinition part,
const G4String processName 
)

Definition at line 1216 of file G4EmCalculator.cc.

1218 {
1219  G4VProcess* proc = 0;
1220  const G4ProcessManager* procman = part->GetProcessManager();
1221  G4ProcessVector* pv = procman->GetProcessList();
1222  G4int nproc = pv->size();
1223  for(G4int i=0; i<nproc; ++i) {
1224  if(processName == (*pv)[i]->GetProcessName()) {
1225  proc = (*pv)[i];
1226  break;
1227  }
1228  }
1229  return proc;
1230 }
int G4int
Definition: G4Types.hh:78
G4int size() const
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const

Here is the call graph for this function:

const G4Region * G4EmCalculator::FindRegion ( const G4String reg)

Definition at line 883 of file G4EmCalculator.cc.

884 {
885  const G4Region* r = 0;
886  if(reg != "" && reg != "world") {
888  } else {
889  r = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld");
890  }
891  return r;
892 }
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4RegionStore * GetInstance()

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetCrossSectionPerVolume ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 272 of file G4EmCalculator.cc.

277 {
278  G4double res = 0.0;
279  const G4MaterialCutsCouple* couple = FindCouple(mat,region);
280 
281  if(couple && UpdateParticle(p, kinEnergy)) {
282  G4int idx = couple->GetIndex();
283  FindLambdaTable(p, processName, kinEnergy);
284 
285  if(currentLambda) {
286  G4double e = kinEnergy*massRatio;
287  res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
288  } else {
289  res = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat,
290  kinEnergy);
291  }
292  if(verbose>0) {
293  G4cout << "G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/MeV
294  << " cross(cm-1)= " << res*cm
295  << " " << p->GetParticleName()
296  << " in " << mat->GetName();
297  if(verbose>1)
298  G4cout << " idx= " << idx << " Escaled((MeV)= "
299  << kinEnergy*massRatio
300  << " q2= " << chargeSquare;
301  G4cout << G4endl;
302  }
303  }
304  return res;
305 }
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
const G4String & GetName() const
Definition: G4Material.hh:178
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetCrossSectionPerVolume ( G4double  kinEnergy,
const G4String part,
const G4String proc,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 413 of file G4EmCalculator.hh.

418 {
419  return GetCrossSectionPerVolume(kinEnergy,FindParticle(particle),processName,
420  FindMaterial(material),FindRegion(reg));
421 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetCSDARange ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 203 of file G4EmCalculator.cc.

207 {
208  G4double res = 0.0;
209  if(!theParameters->BuildCSDARange()) {
211  ed << "G4EmCalculator::GetCSDARange: CSDA table is not built; "
212  << " use UI command: /process/eLoss/CSDARange true";
213  G4Exception("G4EmCalculator::GetCSDARange", "em0077",
214  JustWarning, ed);
215  return res;
216  }
217 
218  const G4MaterialCutsCouple* couple = FindCouple(mat,region);
219  if(couple && UpdateParticle(p, kinEnergy)) {
220  res = manager->GetCSDARange(p, kinEnergy, couple);
221  if(verbose>1) {
222  G4cout << " G4EmCalculator::GetCSDARange: E(MeV)= " << kinEnergy/MeV
223  << " range(mm)= " << res/mm
224  << " " << p->GetParticleName()
225  << " in " << mat->GetName()
226  << G4endl;
227  }
228  }
229  return res;
230 }
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
static constexpr double mm
Definition: G4SIunits.hh:115
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
const G4String & GetParticleName() const
G4double GetCSDARange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4bool BuildCSDARange() const
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetCSDARange ( G4double  kinEnergy,
const G4String part,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 379 of file G4EmCalculator.hh.

383 {
384  return GetCSDARange(kinEnergy,FindParticle(particle),
385  FindMaterial(material),FindRegion(reg));
386 }
const G4Material * FindMaterial(const G4String &)
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
static const G4double reg
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetDEDX ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 139 of file G4EmCalculator.cc.

143 {
144  G4double res = 0.0;
145  const G4MaterialCutsCouple* couple = FindCouple(mat, region);
146  if(couple && UpdateParticle(p, kinEnergy) ) {
147  res = manager->GetDEDX(p, kinEnergy, couple);
148 
149  if(isIon) {
150  if(FindEmModel(p, currentProcessName, kinEnergy)) {
151  G4double length = CLHEP::nm;
152  G4double eloss = res*length;
153  //G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res
154  // << " de= " << eloss << G4endl;;
155  G4double niel = 0.0;
156  dynParticle.SetKineticEnergy(kinEnergy);
157  currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
158  currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
159  res = eloss/length;
160  //G4cout << " de1= " << eloss << " res1= " << res
161  // << " " << p->GetParticleName() <<G4endl;;
162  }
163  }
164 
165  if(verbose>0) {
166  G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV
167  << " DEDX(MeV/mm)= " << res*mm/MeV
168  << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
169  << " " << p->GetParticleName()
170  << " in " << mat->GetName()
171  << " isIon= " << isIon
172  << G4endl;
173  }
174  }
175  return res;
176 }
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
static constexpr double mm
Definition: G4SIunits.hh:115
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:370
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
static constexpr double cm2
Definition: G4SIunits.hh:120
const G4String & GetName() const
Definition: G4Material.hh:178
G4double GetDensity() const
Definition: G4Material.hh:180
const G4String & GetParticleName() const
static constexpr double gram
Definition: G4SIunits.hh:178
G4GLOB_DLL std::ostream G4cout
void SetKineticEnergy(G4double aEnergy)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:353
static constexpr double nm
Definition: SystemOfUnits.h:92
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetDEDX ( G4double  kinEnergy,
const G4String part,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 357 of file G4EmCalculator.hh.

359 {
360  return GetDEDX(kinEnergy,FindParticle(particle),
361  FindMaterial(material),FindRegion(reg));
362 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetKinEnergy ( G4double  range,
const G4ParticleDefinition p,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 250 of file G4EmCalculator.cc.

254 {
255  G4double res = 0.0;
256  const G4MaterialCutsCouple* couple = FindCouple(mat,region);
257  if(couple && UpdateParticle(p, 1.0*GeV)) {
258  res = manager->GetEnergy(p, range, couple);
259  if(verbose>0) {
260  G4cout << "G4EmCalculator::GetKinEnergy: Range(mm)= " << range/mm
261  << " KinE(MeV)= " << res/MeV
262  << " " << p->GetParticleName()
263  << " in " << mat->GetName()
264  << G4endl;
265  }
266  }
267  return res;
268 }
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
static constexpr double mm
Definition: G4SIunits.hh:115
const G4String & GetName() const
Definition: G4Material.hh:178
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetKinEnergy ( G4double  range,
const G4String part,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 403 of file G4EmCalculator.hh.

405 {
406  return GetKinEnergy(range,FindParticle(particle),
407  FindMaterial(material),FindRegion(reg));
408 }
const G4Material * FindMaterial(const G4String &)
G4double GetKinEnergy(G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
static const G4double reg
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetMeanFreePath ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4String processName,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 326 of file G4EmCalculator.cc.

331 {
332  G4double res = DBL_MAX;
333  G4double x = GetCrossSectionPerVolume(kinEnergy,p, processName, mat,region);
334  if(x > 0.0) { res = 1.0/x; }
335  if(verbose>1) {
336  G4cout << "G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/MeV
337  << " MFP(mm)= " << res/mm
338  << " " << p->GetParticleName()
339  << " in " << mat->GetName()
340  << G4endl;
341  }
342  return res;
343 }
static constexpr double mm
Definition: G4SIunits.hh:115
const G4String & GetName() const
Definition: G4Material.hh:178
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetMeanFreePath ( G4double  kinEnergy,
const G4String part,
const G4String proc,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 426 of file G4EmCalculator.hh.

431 {
432  return GetMeanFreePath(kinEnergy,FindParticle(particle),processName,
433  FindMaterial(material),FindRegion(reg));
434 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)

Here is the call graph for this function:

G4double G4EmCalculator::GetRange ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 234 of file G4EmCalculator.cc.

238 {
239  G4double res = 0.0;
240  if(theParameters->BuildCSDARange()) {
241  res = GetCSDARange(kinEnergy, p, mat, region);
242  } else {
243  res = GetRangeFromRestricteDEDX(kinEnergy, p, mat, region);
244  }
245  return res;
246 }
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4bool BuildCSDARange() const
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetRange ( G4double  kinEnergy,
const G4String part,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 391 of file G4EmCalculator.hh.

395 {
396  return GetRange(kinEnergy,FindParticle(particle),
397  FindMaterial(material),FindRegion(reg));
398 }
const G4Material * FindMaterial(const G4String &)
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
static const G4double reg
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetRangeFromRestricteDEDX ( G4double  kinEnergy,
const G4ParticleDefinition p,
const G4Material mat,
const G4Region r = nullptr 
)

Definition at line 180 of file G4EmCalculator.cc.

184 {
185  G4double res = 0.0;
186  const G4MaterialCutsCouple* couple = FindCouple(mat,region);
187  if(couple && UpdateParticle(p, kinEnergy)) {
188  res = manager->GetRangeFromRestricteDEDX(p, kinEnergy, couple);
189  if(verbose>1) {
190  G4cout << " G4EmCalculator::GetRangeFromRestrictedDEDX: E(MeV)= "
191  << kinEnergy/MeV
192  << " range(mm)= " << res/mm
193  << " " << p->GetParticleName()
194  << " in " << mat->GetName()
195  << G4endl;
196  }
197  }
198  return res;
199 }
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
static constexpr double mm
Definition: G4SIunits.hh:115
const G4String & GetName() const
Definition: G4Material.hh:178
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetRangeFromRestricteDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EmCalculator::GetRangeFromRestricteDEDX ( G4double  kinEnergy,
const G4String part,
const G4String mat,
const G4String s = "world" 
)
inline

Definition at line 367 of file G4EmCalculator.hh.

371 {
372  return GetRangeFromRestricteDEDX(kinEnergy,FindParticle(particle),
373  FindMaterial(material),FindRegion(reg));
374 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)

Here is the call graph for this function:

G4double G4EmCalculator::GetShellIonisationCrossSectionPerAtom ( const G4String part,
G4int  Z,
G4AtomicShellEnumerator  shell,
G4double  kinEnergy 
)

Definition at line 309 of file G4EmCalculator.cc.

314 {
315  G4double res = 0.0;
316  const G4ParticleDefinition* p = FindParticle(particle);
317  G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
318  if(p && ad) {
319  res = ad->GetShellIonisationCrossSectionPerAtom(p, Z, shell, kinEnergy);
320  }
321  return res;
322 }
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr)=0
const char * p
Definition: xmltok.h:285
const G4ParticleDefinition * FindParticle(const G4String &)
G4VAtomDeexcitation * AtomDeexcitation()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4EmCalculator::PrintDEDXTable ( const G4ParticleDefinition p)

Definition at line 347 of file G4EmCalculator.cc.

348 {
349  const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
350  G4cout << "##### DEDX Table for " << p->GetParticleName() << G4endl;
351  if(elp) G4cout << *(elp->DEDXTable()) << G4endl;
352 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * DEDXTable() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4EmCalculator::PrintInverseRangeTable ( const G4ParticleDefinition p)

Definition at line 365 of file G4EmCalculator.cc.

366 {
367  const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
368  G4cout << "### G4EmCalculator: Inverse Range Table for "
369  << p->GetParticleName() << G4endl;
370  if(elp) G4cout << *(elp->InverseRangeTable()) << G4endl;
371 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * InverseRangeTable() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4EmCalculator::PrintRangeTable ( const G4ParticleDefinition p)

Definition at line 356 of file G4EmCalculator.cc.

357 {
358  const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
359  G4cout << "##### Range Table for " << p->GetParticleName() << G4endl;
360  if(elp) G4cout << *(elp->RangeTableForLoss()) << G4endl;
361 }
G4PhysicsTable * RangeTableForLoss() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4EmCalculator::SetupMaterial ( const G4Material mat)

Definition at line 1253 of file G4EmCalculator.cc.

1254 {
1255  if(mat) {
1256  currentMaterial = mat;
1257  currentMaterialName = mat->GetName();
1258  } else {
1259  currentMaterial = 0;
1260  currentMaterialName = "";
1261  }
1262 }
const G4String & GetName() const
Definition: G4Material.hh:178

Here is the call graph for this function:

Here is the caller graph for this function:

void G4EmCalculator::SetupMaterial ( const G4String mname)

Definition at line 1266 of file G4EmCalculator.cc.

1267 {
1268  SetupMaterial(nist->FindOrBuildMaterial(mname));
1269 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void SetupMaterial(const G4Material *)

Here is the call graph for this function:

void G4EmCalculator::SetVerbose ( G4int  val)

Definition at line 1292 of file G4EmCalculator.cc.

1293 {
1294  verbose = verb;
1295 }

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