Geant4  10.02.p03
G4EmCalculator Class Reference

#include <G4EmCalculator.hh>

Inheritance diagram for G4EmCalculator:
Collaboration diagram for G4EmCalculator:

Public Member Functions

 G4EmCalculator ()
 
 ~G4EmCalculator ()
 
G4double GetDEDX (G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
G4VProcessFindProcess (const G4ParticleDefinition *part, const G4String &processName)
 
void SetupMaterial (const G4Material *)
 
void SetupMaterial (const G4String &)
 
void SetVerbose (G4int val)
 

Private Member Functions

G4bool UpdateParticle (const G4ParticleDefinition *, G4double kinEnergy)
 
G4bool UpdateCouple (const G4Material *, G4double cut)
 
void FindLambdaTable (const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
 
G4bool FindEmModel (const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
 
G4VEnergyLossProcessFindEnergyLossProcess (const G4ParticleDefinition *)
 
G4VEnergyLossProcessFindEnLossProcess (const G4ParticleDefinition *, const G4String &processName)
 
G4VEmProcessFindDiscreteProcess (const G4ParticleDefinition *, const G4String &processName)
 
G4VMultipleScatteringFindMscProcess (const G4ParticleDefinition *, const G4String &processName)
 
G4bool ActiveForParticle (const G4ParticleDefinition *part, G4VProcess *proc)
 
void CheckMaterial (G4int Z)
 
G4EmCalculatoroperator= (const G4EmCalculator &right)
 
 G4EmCalculator (const G4EmCalculator &)
 

Private Attributes

std::vector< const G4Material * > localMaterials
 
std::vector< const G4MaterialCutsCouple * > localCouples
 
G4EmParameterstheParameters
 
G4LossTableManagermanager
 
G4NistManagernist
 
G4IonTableionTable
 
G4EmCorrectionscorr
 
G4DataVector localCuts
 
G4int nLocalMaterials
 
G4int verbose
 
G4int currentCoupleIndex
 
const G4MaterialCutsCouplecurrentCouple
 
const G4MaterialcurrentMaterial
 
const G4MaterialcutMaterial
 
const G4ParticleDefinitioncurrentParticle
 
const G4ParticleDefinitionlambdaParticle
 
const G4ParticleDefinitionbaseParticle
 
const G4PhysicsTablecurrentLambda
 
G4VEmModelcurrentModel
 
G4VEmModelloweModel
 
G4VEnergyLossProcesscurrentProcess
 
const G4ParticleDefinitiontheGenericIon
 
G4ionEffectiveChargeionEffCharge
 
G4DynamicParticle dynParticle
 
G4String currentName
 
G4String lambdaName
 
G4double currentCut
 
G4double chargeSquare
 
G4double massRatio
 
G4double mass
 
G4double cutenergy [3]
 
G4bool isIon
 
G4bool isApplicable
 
G4String currentParticleName
 
G4String currentMaterialName
 
G4String currentProcessName
 

Detailed Description

Definition at line 82 of file G4EmCalculator.hh.

Constructor & Destructor Documentation

◆ G4EmCalculator() [1/2]

G4EmCalculator::G4EmCalculator ( )

Definition at line 93 of file G4EmCalculator.cc.

94 {
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;
118  currentName = "";
119  lambdaName = "";
123  isIon = false;
124  isApplicable = false;
125 }
G4VEmModel * loweModel
const G4PhysicsTable * currentLambda
const G4ParticleDefinition * theGenericIon
static G4LossTableManager * Instance()
const G4Material * cutMaterial
const G4ParticleDefinition * currentParticle
G4EmCorrections * corr
G4ionEffectiveCharge * ionEffCharge
const G4MaterialCutsCouple * currentCouple
static G4NistManager * Instance()
G4double cutenergy[3]
G4VEnergyLossProcess * currentProcess
G4IonTable * GetIonTable() const
G4String currentName
const G4ParticleDefinition * baseParticle
G4EmCorrections * EmCorrections()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4double chargeSquare
static G4ParticleTable * GetParticleTable()
G4IonTable * ionTable
G4String currentMaterialName
G4String currentParticleName
static G4EmParameters * Instance()
const G4ParticleDefinition * lambdaParticle
const G4Material * currentMaterial
G4VEmModel * currentModel
#define DBL_MAX
Definition: templates.hh:83
G4LossTableManager * manager
G4EmParameters * theParameters
G4NistManager * nist
Here is the call graph for this function:

◆ ~G4EmCalculator()

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 }
std::vector< const G4MaterialCutsCouple * > localCouples
G4ionEffectiveCharge * ionEffCharge
int G4int
Definition: G4Types.hh:78

◆ G4EmCalculator() [2/2]

G4EmCalculator::G4EmCalculator ( const G4EmCalculator )
private

Member Function Documentation

◆ ActiveForParticle()

G4bool G4EmCalculator::ActiveForParticle ( const G4ParticleDefinition part,
G4VProcess proc 
)
private

Definition at line 1234 of file G4EmCalculator.cc.

1236 {
1237  G4ProcessManager* pm = part->GetProcessManager();
1238  G4ProcessVector* pv = pm->GetProcessList();
1239  G4int n = pv->size();
1240  G4bool res = false;
1241  for(G4int i=0; i<n; ++i) {
1242  if((*pv)[i] == proc) {
1243  if(pm->GetProcessActivation(i)) { res = true; }
1244  break;
1245  }
1246  }
1247  return res;
1248 }
G4ProcessVector * GetProcessList() const
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
Char_t n[5]
bool G4bool
Definition: G4Types.hh:79
G4int size() const
G4bool GetProcessActivation(G4VProcess *aProcess) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckMaterial()

void G4EmCalculator::CheckMaterial ( G4int  Z)
private

Definition at line 1272 of file G4EmCalculator.cc.

1273 {
1274  G4bool isFound = false;
1275  if(currentMaterial) {
1277  for(size_t i=0; i<nn; ++i) {
1278  if(Z == G4lrint(currentMaterial->GetElement(i)->GetZ())) {
1279  isFound = true;
1280  break;
1281  }
1282  }
1283  }
1284  if(!isFound) {
1286  }
1287 }
G4Material * FindOrBuildSimpleMaterial(G4int Z, G4bool warning=false)
void SetupMaterial(const G4Material *)
Float_t Z
bool G4bool
Definition: G4Types.hh:79
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202
int G4lrint(double ad)
Definition: templates.hh:163
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
const G4Material * currentMaterial
G4double GetZ() const
Definition: G4Element.hh:131
G4NistManager * nist
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeCrossSectionPerAtom() [1/2]

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)) {
645  if(FindEmModel(p, processName, kinEnergy)) {
646  G4double e = kinEnergy;
648  if(baseParticle) {
649  e *= kinEnergy*massRatio;
652  baseParticle, e, Z, A, aCut) * chargeSquare;
653  } else {
655  res = currentModel->ComputeCrossSectionPerAtom(p, e, Z, A, aCut);
656  }
657  if(verbose>0) {
658  G4cout << "E(MeV)= " << kinEnergy/MeV
659  << " cross(barn)= " << res/barn
660  << " " << p->GetParticleName()
661  << " Z= " << Z << " A= " << A/(g/mole) << " g/mole"
662  << " cut(keV)= " << aCut/keV
663  << G4endl;
664  }
665  }
666  }
667  return res;
668 }
static const double MeV
Definition: G4SIunits.hh:211
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:244
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
Float_t Z
const G4ParticleDefinition * baseParticle
G4bool FindEmModel(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
void CheckMaterial(G4int Z)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:313
G4double chargeSquare
int G4lrint(double ad)
Definition: templates.hh:163
G4double LowestElectronEnergy() const
static const double mole
Definition: G4SIunits.hh:283
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
static const double barn
Definition: G4SIunits.hh:104
double G4double
Definition: G4Types.hh:76
G4VEmModel * currentModel
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
G4EmParameters * theParameters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeCrossSectionPerAtom() [2/2]

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:134
const G4ParticleDefinition * FindParticle(const G4String &)
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
G4double GetZ() const
Definition: G4Element.hh:131
Here is the call graph for this function:

◆ ComputeCrossSectionPerShell() [1/2]

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

Definition at line 672 of file G4EmCalculator.cc.

677 {
678  G4double res = 0.0;
679  if(UpdateParticle(p, kinEnergy)) {
680  CheckMaterial(Z);
681  if(FindEmModel(p, processName, kinEnergy)) {
682  G4double e = kinEnergy;
684  if(baseParticle) {
685  e *= kinEnergy*massRatio;
688  e, aCut) * chargeSquare;
689  } else {
691  res = currentModel->ComputeCrossSectionPerAtom(p, Z, shellIdx, e, aCut);
692  }
693  if(verbose>0) {
694  G4cout << "E(MeV)= " << kinEnergy/MeV
695  << " cross(barn)= " << res/barn
696  << " " << p->GetParticleName()
697  << " Z= " << Z << " shellIdx= " << shellIdx
698  << " cut(keV)= " << aCut/keV
699  << G4endl;
700  }
701  }
702  }
703  return res;
704 }
static const double MeV
Definition: G4SIunits.hh:211
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:244
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
Float_t Z
const G4ParticleDefinition * baseParticle
G4bool FindEmModel(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
void CheckMaterial(G4int Z)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:313
G4double chargeSquare
G4double LowestElectronEnergy() const
virtual G4double ComputeCrossSectionPerShell(const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:323
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
static const double barn
Definition: G4SIunits.hh:104
double G4double
Definition: G4Types.hh:76
G4VEmModel * currentModel
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
G4EmParameters * theParameters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeCrossSectionPerShell() [2/2]

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, G4lrint(elm->GetZ()),
531  shellIdx, cut);
532 }
const G4ParticleDefinition * FindParticle(const G4String &)
int G4lrint(double ad)
Definition: templates.hh:163
G4double ComputeCrossSectionPerShell(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4int Z, G4int shellIdx, G4double cut=0.0)
G4double GetZ() const
Definition: G4Element.hh:131
Here is the call graph for this function:

◆ ComputeCrossSectionPerVolume() [1/2]

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;
613  if(baseParticle) {
614  e *= kinEnergy*massRatio;
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 }
static const double cm
Definition: G4SIunits.hh:118
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:258
static const double MeV
Definition: G4SIunits.hh:211
void SetupMaterial(const G4Material *)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * baseParticle
G4bool FindEmModel(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
G4double chargeSquare
G4double LowestElectronEnergy() const
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
G4VEmModel * currentModel
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
G4EmParameters * theParameters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeCrossSectionPerVolume() [2/2]

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 &)
string material
Definition: eplot.py:19
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:

◆ ComputeDEDX() [1/2]

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) {
407  mat, baseParticle, escaled, cut) * chargeSquare;
408  if(verbose > 1) {
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
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:641
static const double gram
Definition: G4SIunits.hh:175
G4VEmModel * loweModel
const G4String & GetName() const
Definition: G4VEmModel.hh:795
static const double MeV
Definition: G4SIunits.hh:211
static const double cm2
Definition: G4SIunits.hh:119
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:362
static const double nm
Definition: SystemOfUnits.h:91
G4double GetDensity() const
Definition: G4Material.hh:180
void SetupMaterial(const G4Material *)
G4DynamicParticle dynParticle
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
const G4ParticleDefinition * baseParticle
G4bool FindEmModel(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
void SetKineticEnergy(G4double aEnergy)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:345
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.cc:249
G4double chargeSquare
G4String currentMaterialName
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4VEmModel * currentModel
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeDEDX() [2/2]

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 &)
string material
Definition: eplot.py:19
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:

◆ ComputeDEDXForCutInRange() [1/2]

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;
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 G4Material * cutMaterial
void SetupMaterial(const G4Material *)
int G4int
Definition: G4Types.hh:78
Float_t mat
G4double cutenergy[3]
Char_t n[5]
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4bool ActiveForParticle(const G4ParticleDefinition *part, G4VProcess *proc)
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 *)
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeDEDXForCutInRange() [2/2]

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:

◆ ComputeElectronicDEDX() [1/2]

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()
void SetupMaterial(const G4Material *)
int G4int
Definition: G4Types.hh:78
Char_t n[5]
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
G4bool ActiveForParticle(const G4ParticleDefinition *part, G4VProcess *proc)
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
double G4double
Definition: G4Types.hh:76
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeElectronicDEDX() [2/2]

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:

◆ ComputeEnergyCutFromRangeCut() [1/2]

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

Definition at line 764 of file G4EmCalculator.cc.

768 {
770  ConvertRangeToEnergy(part, mat, range);
771 }
static G4ProductionCutsTable * GetProductionCutsTable()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeEnergyCutFromRangeCut() [2/2]

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:

◆ ComputeGammaAttenuationLength()

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

Definition at line 709 of file G4EmCalculator.cc.

711 {
712  G4double res = 0.0;
713  const G4ParticleDefinition* gamma = G4Gamma::Gamma();
714  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "conv", mat, 0.0);
715  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "compt", mat, 0.0);
716  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "phot", mat, 0.0);
717  res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "Rayl", mat, 0.0);
718  if(res > 0.0) { res = 1.0/res; }
719  return res;
720 }
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:

◆ ComputeMeanFreePath() [1/2]

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

Definition at line 743 of file G4EmCalculator.cc.

748 {
749  G4double mfp = DBL_MAX;
750  G4double x = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, cut);
751  if(x > 0.0) { mfp = 1.0/x; }
752  if(verbose>1) {
753  G4cout << "E(MeV)= " << kinEnergy/MeV
754  << " MFP(mm)= " << mfp/mm
755  << " " << p->GetParticleName()
756  << " in " << mat->GetName()
757  << G4endl;
758  }
759  return mfp;
760 }
static const double MeV
Definition: G4SIunits.hh:211
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
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
#define DBL_MAX
Definition: templates.hh:83
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeMeanFreePath() [2/2]

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 &)
string material
Definition: eplot.py:19
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:

◆ ComputeNuclearDEDX() [1/2]

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 const double gram
Definition: G4SIunits.hh:175
static const double MeV
Definition: G4SIunits.hh:211
static const double cm2
Definition: G4SIunits.hh:119
G4double GetDensity() const
Definition: G4Material.hh:180
G4EmCorrections * corr
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double NuclearDEDX(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4bool fluct=true)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeNuclearDEDX() [2/2]

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),
491 }
const G4Material * FindMaterial(const G4String &)
string material
Definition: eplot.py:19
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
const G4ParticleDefinition * FindParticle(const G4String &)
Here is the call graph for this function:

◆ ComputeShellIonisationCrossSectionPerAtom()

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

Definition at line 724 of file G4EmCalculator.cc.

730 {
731  G4double res = 0.0;
732  const G4ParticleDefinition* p = FindParticle(particle);
734  if(p && ad) {
735  res = ad->ComputeShellIonisationCrossSectionPerAtom(p, Z, shell,
736  kinEnergy, mat);
737  }
738  return res;
739 }
Float_t Z
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)=0
const G4ParticleDefinition * FindParticle(const G4String &)
G4VAtomDeexcitation * AtomDeexcitation()
double G4double
Definition: G4Types.hh:76
G4LossTableManager * manager
Here is the call graph for this function:

◆ ComputeTotalDEDX() [1/2]

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 }
static const double MeV
Definition: G4SIunits.hh:211
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTotalDEDX() [2/2]

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:

◆ FindCouple()

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

Definition at line 895 of file G4EmCalculator.cc.

898 {
899  const G4MaterialCutsCouple* couple = 0;
900  SetupMaterial(material);
901  if(currentMaterial) {
902  // Access to materials
903  const G4ProductionCutsTable* theCoupleTable=
905  const G4Region* r = region;
906  if(r) {
907  couple = theCoupleTable->GetMaterialCutsCouple(material,
908  r->GetProductionCuts());
909  } else {
911  size_t nr = store->size();
912  if(0 < nr) {
913  for(size_t i=0; i<nr; ++i) {
914  couple = theCoupleTable->GetMaterialCutsCouple(
915  material, ((*store)[i])->GetProductionCuts());
916  if(couple) { break; }
917  }
918  }
919  }
920  }
921  if(!couple) {
923  ed << "G4EmCalculator::FindCouple: fail for material <"
924  << currentMaterialName << ">";
925  if(region) { ed << " and region " << region->GetName(); }
926  G4Exception("G4EmCalculator::FindCouple", "em0078",
927  FatalException, ed);
928  }
929  return couple;
930 }
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
G4String currentMaterialName
G4ProductionCuts * GetProductionCuts() const
const G4Material * currentMaterial
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindDiscreteProcess()

G4VEmProcess * G4EmCalculator::FindDiscreteProcess ( const G4ParticleDefinition part,
const G4String processName 
)
private

Definition at line 1172 of file G4EmCalculator.cc.

1174 {
1175  G4VEmProcess* proc = 0;
1176  const std::vector<G4VEmProcess*> v =
1178  G4int n = v.size();
1179  for(G4int i=0; i<n; ++i) {
1180  if((v[i])->GetProcessName() == processName) {
1181  G4VProcess* p = reinterpret_cast<G4VProcess*>(v[i]);
1182  if(ActiveForParticle(part, p)) {
1183  proc = v[i];
1184  break;
1185  }
1186  }
1187  }
1188  return proc;
1189 }
const std::vector< G4VEmProcess * > & GetEmProcessVector()
int G4int
Definition: G4Types.hh:78
Char_t n[5]
G4bool ActiveForParticle(const G4ParticleDefinition *part, G4VProcess *proc)
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindEmModel()

G4bool G4EmCalculator::FindEmModel ( const G4ParticleDefinition p,
const G4String processName,
G4double  kinEnergy 
)
private

Definition at line 1023 of file G4EmCalculator.cc.

1026 {
1027  isApplicable = false;
1028  if(!p || !currentMaterial) {
1029  G4cout << "G4EmCalculator::FindEmModel WARNING: no particle"
1030  << " or materail defined; particle: " << p << G4endl;
1031  return isApplicable;
1032  }
1033  G4String partname = p->GetParticleName();
1034  const G4ParticleDefinition* part = p;
1035  G4double scaledEnergy = kinEnergy*massRatio;
1036  if(isIon) { part = theGenericIon; }
1037 
1038  if(verbose > 1) {
1039  G4cout << "## G4EmCalculator::FindEmModel for " << partname
1040  << " (type= " << p->GetParticleType()
1041  << ") and " << processName << " at E(MeV)= " << scaledEnergy
1042  << G4endl;
1043  if(p != part) { G4cout << " GenericIon is the base particle" << G4endl; }
1044  }
1045 
1046  // Search for energy loss process
1047  currentName = processName;
1048  currentModel = 0;
1049  loweModel = 0;
1050  size_t idx = 0;
1051 
1052  G4VEnergyLossProcess* elproc = FindEnLossProcess(part, processName);
1053  if(elproc) {
1054  currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx);
1056  currentModel->SetupForMaterial(part, currentMaterial, scaledEnergy);
1058  if(eth > 0.0) {
1059  loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
1060  if(loweModel == currentModel) { loweModel = nullptr; }
1061  else {
1064  }
1065  }
1066  }
1067 
1068  // Search for discrete process
1069  if(!currentModel) {
1070  G4VEmProcess* proc = FindDiscreteProcess(part, processName);
1071  if(proc) {
1072  currentModel = proc->SelectModelForMaterial(kinEnergy, idx);
1074  currentModel->SetupForMaterial(part, currentMaterial, kinEnergy);
1076  if(eth > 0.0) {
1077  loweModel = proc->SelectModelForMaterial(eth - CLHEP::eV, idx);
1078  if(loweModel == currentModel) { loweModel = 0; }
1079  else {
1082  }
1083  }
1084  }
1085  }
1086 
1087  // Search for msc process
1088  if(!currentModel) {
1089  G4VMultipleScattering* proc = FindMscProcess(part, processName);
1090  if(proc) {
1091  currentModel = proc->SelectModel(kinEnergy, idx);
1092  loweModel = 0;
1093  }
1094  }
1095  if(currentModel) {
1096  if(loweModel == currentModel) { loweModel = 0; }
1097  isApplicable = true;
1099  if(loweModel) {
1101  }
1102  if(verbose > 1) {
1103  G4cout << " Model <" << currentModel->GetName()
1104  << "> Emin(MeV)= " << currentModel->LowEnergyLimit()/MeV
1105  << " for " << part->GetParticleName();
1106  if(elproc) {
1107  G4cout << " and " << elproc->GetProcessName() << " " << elproc
1108  << G4endl;
1109  }
1110  if(loweModel) {
1111  G4cout << " LowEnergy model <" << loweModel->GetName() << ">";
1112  }
1113  G4cout << G4endl;
1114  }
1115  }
1116  return isApplicable;
1117 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4VEmModel * loweModel
G4VEmProcess * FindDiscreteProcess(const G4ParticleDefinition *, const G4String &processName)
const G4String & GetName() const
Definition: G4VEmModel.hh:795
const G4ParticleDefinition * theGenericIon
static const double MeV
Definition: G4SIunits.hh:211
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:403
const G4String & GetParticleType() const
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idxRegion) const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
virtual void InitialiseForMaterial(const G4ParticleDefinition *, const G4Material *)
Definition: G4VEmModel.cc:225
G4GLOB_DLL std::ostream G4cout
G4String currentName
TString part[npart]
G4VMultipleScattering * FindMscProcess(const G4ParticleDefinition *, const G4String &processName)
G4VEnergyLossProcess * FindEnLossProcess(const G4ParticleDefinition *, const G4String &processName)
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idx) const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4Material * currentMaterial
G4VEmModel * currentModel
static const double eV
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindEnergyLossProcess()

G4VEnergyLossProcess * G4EmCalculator::FindEnergyLossProcess ( const G4ParticleDefinition p)
private

Definition at line 1121 of file G4EmCalculator.cc.

1123 {
1124  G4VEnergyLossProcess* elp = 0;
1125  G4String partname = p->GetParticleName();
1126  const G4ParticleDefinition* part = p;
1127 
1128  if(p->GetParticleType() == "nucleus"
1129  && currentParticleName != "deuteron"
1130  && currentParticleName != "triton"
1131  && currentParticleName != "He3"
1132  && currentParticleName != "alpha"
1133  && currentParticleName != "alpha+"
1134  && currentParticleName != "helium"
1135  && currentParticleName != "hydrogen"
1136  ) { part = theGenericIon; }
1137 
1138  elp = manager->GetEnergyLossProcess(part);
1139  /*
1140  G4cout << "\n G4EmCalculator::FindEnergyLossProcess: for " << p->GetParticleName()
1141  << " found " << elp->GetProcessName() << " of "
1142  << elp->Particle()->GetParticleName() << " " << elp << G4endl;
1143  */
1144  return elp;
1145 }
const G4ParticleDefinition * theGenericIon
const G4String & GetParticleType() const
const G4String & GetParticleName() const
TString part[npart]
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
G4String currentParticleName
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindEnLossProcess()

G4VEnergyLossProcess * G4EmCalculator::FindEnLossProcess ( const G4ParticleDefinition part,
const G4String processName 
)
private

Definition at line 1150 of file G4EmCalculator.cc.

1152 {
1153  G4VEnergyLossProcess* proc = 0;
1154  const std::vector<G4VEnergyLossProcess*> v =
1156  G4int n = v.size();
1157  for(G4int i=0; i<n; ++i) {
1158  if((v[i])->GetProcessName() == processName) {
1159  G4VProcess* p = reinterpret_cast<G4VProcess*>(v[i]);
1160  if(ActiveForParticle(part, p)) {
1161  proc = v[i];
1162  break;
1163  }
1164  }
1165  }
1166  return proc;
1167 }
int G4int
Definition: G4Types.hh:78
Char_t n[5]
G4bool ActiveForParticle(const G4ParticleDefinition *part, G4VProcess *proc)
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindIon()

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

Definition at line 860 of file G4EmCalculator.cc.

861 {
862  const G4ParticleDefinition* p = ionTable->GetIon(Z,A,0);
863  return p;
864 }
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:491
double A(double temperature)
Float_t Z
G4IonTable * ionTable
Here is the call graph for this function:

◆ FindLambdaTable()

void G4EmCalculator::FindLambdaTable ( const G4ParticleDefinition p,
const G4String processName,
G4double  kinEnergy 
)
private

Definition at line 959 of file G4EmCalculator.cc.

962 {
963  // Search for the process
964  if (!currentLambda || p != lambdaParticle || processName != lambdaName) {
965  lambdaName = processName;
966  currentLambda = 0;
967  lambdaParticle = p;
968 
969  const G4ParticleDefinition* part = p;
970  if(isIon) { part = theGenericIon; }
971 
972  // Search for energy loss process
973  currentName = processName;
974  currentModel = 0;
975  loweModel = 0;
976 
977  G4VEnergyLossProcess* elproc = FindEnLossProcess(part, processName);
978  if(elproc) {
979  currentLambda = elproc->LambdaTable();
980  if(currentLambda) {
981  isApplicable = true;
982  if(verbose>1) {
983  G4cout << "G4VEnergyLossProcess is found out: " << currentName
984  << G4endl;
985  }
986  }
987  return;
988  }
989 
990  // Search for discrete process
991  G4VEmProcess* proc = FindDiscreteProcess(part, processName);
992  if(proc) {
993  currentLambda = proc->LambdaTable();
994  if(currentLambda) {
995  isApplicable = true;
996  if(verbose>1) {
997  G4cout << "G4VEmProcess is found out: " << currentName << G4endl;
998  }
999  }
1000  return;
1001  }
1002 
1003  // Search for msc process
1004  G4VMultipleScattering* msc = FindMscProcess(part, processName);
1005  if(msc) {
1006  currentModel = msc->SelectModel(kinEnergy,0);
1007  if(currentModel) {
1009  if(currentLambda) {
1010  isApplicable = true;
1011  if(verbose>1) {
1012  G4cout << "G4VMultipleScattering is found out: " << currentName
1013  << G4endl;
1014  }
1015  }
1016  }
1017  }
1018  }
1019 }
G4VEmModel * loweModel
G4VEmProcess * FindDiscreteProcess(const G4ParticleDefinition *, const G4String &processName)
const G4PhysicsTable * currentLambda
const G4ParticleDefinition * theGenericIon
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
G4PhysicsTable * GetCrossSectionTable()
Definition: G4VEmModel.hh:826
G4PhysicsTable * LambdaTable() const
G4PhysicsTable * LambdaTable() const
G4GLOB_DLL std::ostream G4cout
G4String currentName
TString part[npart]
G4VMultipleScattering * FindMscProcess(const G4ParticleDefinition *, const G4String &processName)
G4VEnergyLossProcess * FindEnLossProcess(const G4ParticleDefinition *, const G4String &processName)
#define G4endl
Definition: G4ios.hh:61
const G4ParticleDefinition * lambdaParticle
G4VEmModel * currentModel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMaterial()

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

Definition at line 868 of file G4EmCalculator.cc.

869 {
870  if(name != currentMaterialName) {
872  if(!currentMaterial) {
873  G4cout << "### WARNING: G4EmCalculator::FindMaterial fails to find "
874  << name << G4endl;
875  }
876  }
877  return currentMaterial;
878 }
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:604
void SetupMaterial(const G4Material *)
G4GLOB_DLL std::ostream G4cout
G4String currentMaterialName
#define G4endl
Definition: G4ios.hh:61
const G4Material * currentMaterial
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMscProcess()

G4VMultipleScattering * G4EmCalculator::FindMscProcess ( const G4ParticleDefinition part,
const G4String processName 
)
private

Definition at line 1194 of file G4EmCalculator.cc.

1196 {
1197  G4VMultipleScattering* proc = 0;
1198  const std::vector<G4VMultipleScattering*> v =
1200  G4int n = v.size();
1201  for(G4int i=0; i<n; ++i) {
1202  if((v[i])->GetProcessName() == processName) {
1203  G4VProcess* p = reinterpret_cast<G4VProcess*>(v[i]);
1204  if(ActiveForParticle(part, p)) {
1205  proc = v[i];
1206  break;
1207  }
1208  }
1209  }
1210  return proc;
1211 }
int G4int
Definition: G4Types.hh:78
Char_t n[5]
G4bool ActiveForParticle(const G4ParticleDefinition *part, G4VProcess *proc)
G4LossTableManager * manager
const std::vector< G4VMultipleScattering * > & GetMultipleScatteringVector()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindParticle()

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

Definition at line 843 of file G4EmCalculator.cc.

844 {
845  const G4ParticleDefinition* p = 0;
846  if(name != currentParticleName) {
848  if(!p) {
849  G4cout << "### WARNING: G4EmCalculator::FindParticle fails to find "
850  << name << G4endl;
851  }
852  } else {
853  p = currentParticle;
854  }
855  return p;
856 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const G4ParticleDefinition * currentParticle
G4GLOB_DLL std::ostream G4cout
static G4ParticleTable * GetParticleTable()
G4String currentParticleName
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindProcess()

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

Definition at line 1215 of file G4EmCalculator.cc.

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

◆ FindRegion()

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

Definition at line 882 of file G4EmCalculator.cc.

883 {
884  const G4Region* r = 0;
885  if(reg != "" && reg != "world") {
887  } else {
888  r = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld");
889  }
890  return r;
891 }
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCrossSectionPerVolume() [1/2]

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

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 }
static const double cm
Definition: G4SIunits.hh:118
const G4PhysicsTable * currentLambda
void FindLambdaTable(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
static const double MeV
Definition: G4SIunits.hh:211
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
G4double chargeSquare
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCrossSectionPerVolume() [2/2]

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,
421 }
const G4Material * FindMaterial(const G4String &)
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
static const G4double reg
string material
Definition: eplot.py:19
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetCSDARange() [1/2]

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

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 }
static const double MeV
Definition: G4SIunits.hh:211
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4double GetCSDARange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
static const double mm
Definition: G4SIunits.hh:114
G4LossTableManager * manager
G4EmParameters * theParameters
G4bool BuildCSDARange() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCSDARange() [2/2]

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),
386 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
string material
Definition: eplot.py:19
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetDEDX() [1/2]

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

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 }
static const double gram
Definition: G4SIunits.hh:175
static const double MeV
Definition: G4SIunits.hh:211
static const double cm2
Definition: G4SIunits.hh:119
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:362
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
static const double nm
Definition: SystemOfUnits.h:91
G4double GetDensity() const
Definition: G4Material.hh:180
G4DynamicParticle dynParticle
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
G4bool FindEmModel(const G4ParticleDefinition *, const G4String &processName, G4double kinEnergy)
void SetKineticEnergy(G4double aEnergy)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:345
G4String currentProcessName
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4VEmModel * currentModel
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
static const double mm
Definition: G4SIunits.hh:114
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDEDX() [2/2]

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),
362 }
const G4Material * FindMaterial(const G4String &)
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
static const G4double reg
string material
Definition: eplot.py:19
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetKinEnergy() [1/2]

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

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 }
static const double MeV
Definition: G4SIunits.hh:211
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
static const double GeV
Definition: G4SIunits.hh:214
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
static const double mm
Definition: G4SIunits.hh:114
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetKinEnergy() [2/2]

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),
408 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
string material
Definition: eplot.py:19
const G4ParticleDefinition * FindParticle(const G4String &)
G4double GetKinEnergy(G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetMeanFreePath() [1/2]

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

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 const double MeV
Definition: G4SIunits.hh:211
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
#define DBL_MAX
Definition: templates.hh:83
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeanFreePath() [2/2]

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,
434 }
const G4Material * FindMaterial(const G4String &)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
static const G4double reg
string material
Definition: eplot.py:19
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetRange() [1/2]

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

Definition at line 234 of file G4EmCalculator.cc.

238 {
239  G4double res = 0.0;
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=0)
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
double G4double
Definition: G4Types.hh:76
G4EmParameters * theParameters
G4bool BuildCSDARange() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRange() [2/2]

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),
398 }
const G4Material * FindMaterial(const G4String &)
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
static const G4double reg
string material
Definition: eplot.py:19
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetRangeFromRestricteDEDX() [1/2]

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

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 }
static const double MeV
Definition: G4SIunits.hh:211
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
G4double GetRangeFromRestricteDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
G4bool UpdateParticle(const G4ParticleDefinition *, G4double kinEnergy)
static const double mm
Definition: G4SIunits.hh:114
G4LossTableManager * manager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRangeFromRestricteDEDX() [2/2]

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),
374 }
const G4Material * FindMaterial(const G4String &)
static const G4double reg
string material
Definition: eplot.py:19
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const G4ParticleDefinition * FindParticle(const G4String &)
const G4Region * FindRegion(const G4String &)
Here is the call graph for this function:

◆ GetShellIonisationCrossSectionPerAtom()

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);
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=0)=0
Float_t Z
const G4ParticleDefinition * FindParticle(const G4String &)
G4VAtomDeexcitation * AtomDeexcitation()
double G4double
Definition: G4Types.hh:76
G4LossTableManager * manager
Here is the call graph for this function:

◆ operator=()

G4EmCalculator& G4EmCalculator::operator= ( const G4EmCalculator right)
private

◆ PrintDEDXTable()

void G4EmCalculator::PrintDEDXTable ( const G4ParticleDefinition p)

Definition at line 347 of file G4EmCalculator.cc.

348 {
350  G4cout << "##### DEDX Table for " << p->GetParticleName() << G4endl;
351  if(elp) G4cout << *(elp->DEDXTable()) << G4endl;
352 }
const G4String & GetParticleName() const
G4VEnergyLossProcess * FindEnergyLossProcess(const G4ParticleDefinition *)
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * DEDXTable() const
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintInverseRangeTable()

void G4EmCalculator::PrintInverseRangeTable ( const G4ParticleDefinition p)

Definition at line 365 of file G4EmCalculator.cc.

366 {
368  G4cout << "### G4EmCalculator: Inverse Range Table for "
369  << p->GetParticleName() << G4endl;
370  if(elp) G4cout << *(elp->InverseRangeTable()) << G4endl;
371 }
G4PhysicsTable * InverseRangeTable() const
const G4String & GetParticleName() const
G4VEnergyLossProcess * FindEnergyLossProcess(const G4ParticleDefinition *)
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:

◆ PrintRangeTable()

void G4EmCalculator::PrintRangeTable ( const G4ParticleDefinition p)

Definition at line 356 of file G4EmCalculator.cc.

357 {
359  G4cout << "##### Range Table for " << p->GetParticleName() << G4endl;
360  if(elp) G4cout << *(elp->RangeTableForLoss()) << G4endl;
361 }
const G4String & GetParticleName() const
G4VEnergyLossProcess * FindEnergyLossProcess(const G4ParticleDefinition *)
G4GLOB_DLL std::ostream G4cout
G4PhysicsTable * RangeTableForLoss() const
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupMaterial() [1/2]

void G4EmCalculator::SetupMaterial ( const G4Material mat)

Definition at line 1252 of file G4EmCalculator.cc.

1253 {
1254  if(mat) {
1255  currentMaterial = mat;
1256  currentMaterialName = mat->GetName();
1257  } else {
1258  currentMaterial = 0;
1259  currentMaterialName = "";
1260  }
1261 }
Float_t mat
G4String currentMaterialName
const G4Material * currentMaterial
const G4String & GetName() const
Definition: G4Material.hh:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupMaterial() [2/2]

void G4EmCalculator::SetupMaterial ( const G4String mname)

Definition at line 1265 of file G4EmCalculator.cc.

1266 {
1268 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void SetupMaterial(const G4Material *)
G4NistManager * nist
Here is the call graph for this function:

◆ SetVerbose()

void G4EmCalculator::SetVerbose ( G4int  val)

Definition at line 1291 of file G4EmCalculator.cc.

1292 {
1293  verbose = verb;
1294 }
Here is the caller graph for this function:

◆ UpdateCouple()

G4bool G4EmCalculator::UpdateCouple ( const G4Material material,
G4double  cut 
)
private

Definition at line 934 of file G4EmCalculator.cc.

935 {
936  SetupMaterial(material);
937  if(!currentMaterial) { return false; }
938  for (G4int i=0; i<nLocalMaterials; ++i) {
939  if(material == localMaterials[i] && cut == localCuts[i]) {
942  currentCut = cut;
943  return true;
944  }
945  }
946  const G4MaterialCutsCouple* cc = new G4MaterialCutsCouple(material);
947  localMaterials.push_back(material);
948  localCouples.push_back(cc);
949  localCuts.push_back(cut);
950  nLocalMaterials++;
951  currentCouple = cc;
953  currentCut = cut;
954  return true;
955 }
std::vector< const G4MaterialCutsCouple * > localCouples
const G4MaterialCutsCouple * currentCouple
void SetupMaterial(const G4Material *)
int G4int
Definition: G4Types.hh:78
G4DataVector localCuts
std::vector< const G4Material * > localMaterials
const G4Material * currentMaterial
Here is the call graph for this function:

◆ UpdateParticle()

G4bool G4EmCalculator::UpdateParticle ( const G4ParticleDefinition p,
G4double  kinEnergy 
)
private

Definition at line 775 of file G4EmCalculator.cc.

777 {
778  if(p != currentParticle) {
779 
780  // new particle
781  currentParticle = p;
782  dynParticle.SetDefinition(const_cast<G4ParticleDefinition*>(p));
783  dynParticle.SetKineticEnergy(kinEnergy);
784  baseParticle = 0;
786  massRatio = 1.0;
787  mass = p->GetPDGMass();
788  chargeSquare = 1.0;
790  currentProcessName = "";
791  isIon = false;
792 
793  // ionisation process exist
794  if(currentProcess) {
797 
798  // base particle is used
799  if(baseParticle) {
802  chargeSquare = q*q;
803  }
804 
805  if(p->GetParticleType() == "nucleus"
806  && currentParticleName != "deuteron"
807  && currentParticleName != "triton"
808  && currentParticleName != "alpha+"
809  && currentParticleName != "helium"
810  && currentParticleName != "hydrogen"
811  ) {
812  isIon = true;
815  if(verbose>1) {
816  G4cout << "\n G4EmCalculator::UpdateParticle: isIon 1 "
817  << p->GetParticleName()
818  << " in " << currentMaterial->GetName()
819  << " e= " << kinEnergy << G4endl;
820  }
821  }
822  }
823  }
824 
825  // Effective charge for ions
826  if(isIon) {
827  chargeSquare =
830  if(currentProcess) {
832  if(verbose>1) {
833  G4cout <<"\n NewIon: massR= "<< massRatio << " q2= "
834  << chargeSquare << " " << currentProcess << G4endl;
835  }
836  }
837  }
838  return true;
839 }
const G4ParticleDefinition * theGenericIon
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
const G4ParticleDefinition * currentParticle
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4String & GetParticleType() const
G4EmCorrections * corr
G4DynamicParticle dynParticle
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4VEnergyLossProcess * FindEnergyLossProcess(const G4ParticleDefinition *)
G4GLOB_DLL std::ostream G4cout
G4VEnergyLossProcess * currentProcess
const G4ParticleDefinition * baseParticle
void SetKineticEnergy(G4double aEnergy)
G4double chargeSquare
G4String currentProcessName
G4String currentParticleName
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4Material * currentMaterial
const G4String & GetName() const
Definition: G4Material.hh:178
const G4ParticleDefinition * BaseParticle() const
G4double GetPDGCharge() const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ baseParticle

const G4ParticleDefinition* G4EmCalculator::baseParticle
private

Definition at line 328 of file G4EmCalculator.hh.

◆ chargeSquare

G4double G4EmCalculator::chargeSquare
private

Definition at line 341 of file G4EmCalculator.hh.

◆ corr

G4EmCorrections* G4EmCalculator::corr
private

Definition at line 315 of file G4EmCalculator.hh.

◆ currentCouple

const G4MaterialCutsCouple* G4EmCalculator::currentCouple
private

Definition at line 323 of file G4EmCalculator.hh.

◆ currentCoupleIndex

G4int G4EmCalculator::currentCoupleIndex
private

Definition at line 322 of file G4EmCalculator.hh.

◆ currentCut

G4double G4EmCalculator::currentCut
private

Definition at line 340 of file G4EmCalculator.hh.

◆ currentLambda

const G4PhysicsTable* G4EmCalculator::currentLambda
private

Definition at line 329 of file G4EmCalculator.hh.

◆ currentMaterial

const G4Material* G4EmCalculator::currentMaterial
private

Definition at line 324 of file G4EmCalculator.hh.

◆ currentMaterialName

G4String G4EmCalculator::currentMaterialName
private

Definition at line 349 of file G4EmCalculator.hh.

◆ currentModel

G4VEmModel* G4EmCalculator::currentModel
private

Definition at line 330 of file G4EmCalculator.hh.

◆ currentName

G4String G4EmCalculator::currentName
private

Definition at line 338 of file G4EmCalculator.hh.

◆ currentParticle

const G4ParticleDefinition* G4EmCalculator::currentParticle
private

Definition at line 326 of file G4EmCalculator.hh.

◆ currentParticleName

G4String G4EmCalculator::currentParticleName
private

Definition at line 348 of file G4EmCalculator.hh.

◆ currentProcess

G4VEnergyLossProcess* G4EmCalculator::currentProcess
private

Definition at line 332 of file G4EmCalculator.hh.

◆ currentProcessName

G4String G4EmCalculator::currentProcessName
private

Definition at line 350 of file G4EmCalculator.hh.

◆ cutenergy

G4double G4EmCalculator::cutenergy[3]
private

Definition at line 344 of file G4EmCalculator.hh.

◆ cutMaterial

const G4Material* G4EmCalculator::cutMaterial
private

Definition at line 325 of file G4EmCalculator.hh.

◆ dynParticle

G4DynamicParticle G4EmCalculator::dynParticle
private

Definition at line 336 of file G4EmCalculator.hh.

◆ ionEffCharge

G4ionEffectiveCharge* G4EmCalculator::ionEffCharge
private

Definition at line 335 of file G4EmCalculator.hh.

◆ ionTable

G4IonTable* G4EmCalculator::ionTable
private

Definition at line 314 of file G4EmCalculator.hh.

◆ isApplicable

G4bool G4EmCalculator::isApplicable
private

Definition at line 346 of file G4EmCalculator.hh.

◆ isIon

G4bool G4EmCalculator::isIon
private

Definition at line 345 of file G4EmCalculator.hh.

◆ lambdaName

G4String G4EmCalculator::lambdaName
private

Definition at line 339 of file G4EmCalculator.hh.

◆ lambdaParticle

const G4ParticleDefinition* G4EmCalculator::lambdaParticle
private

Definition at line 327 of file G4EmCalculator.hh.

◆ localCouples

std::vector<const G4MaterialCutsCouple*> G4EmCalculator::localCouples
private

Definition at line 309 of file G4EmCalculator.hh.

◆ localCuts

G4DataVector G4EmCalculator::localCuts
private

Definition at line 316 of file G4EmCalculator.hh.

◆ localMaterials

std::vector<const G4Material*> G4EmCalculator::localMaterials
private

Definition at line 308 of file G4EmCalculator.hh.

◆ loweModel

G4VEmModel* G4EmCalculator::loweModel
private

Definition at line 331 of file G4EmCalculator.hh.

◆ manager

G4LossTableManager* G4EmCalculator::manager
private

Definition at line 312 of file G4EmCalculator.hh.

◆ mass

G4double G4EmCalculator::mass
private

Definition at line 343 of file G4EmCalculator.hh.

◆ massRatio

G4double G4EmCalculator::massRatio
private

Definition at line 342 of file G4EmCalculator.hh.

◆ nist

G4NistManager* G4EmCalculator::nist
private

Definition at line 313 of file G4EmCalculator.hh.

◆ nLocalMaterials

G4int G4EmCalculator::nLocalMaterials
private

Definition at line 317 of file G4EmCalculator.hh.

◆ theGenericIon

const G4ParticleDefinition* G4EmCalculator::theGenericIon
private

Definition at line 334 of file G4EmCalculator.hh.

◆ theParameters

G4EmParameters* G4EmCalculator::theParameters
private

Definition at line 311 of file G4EmCalculator.hh.

◆ verbose

G4int G4EmCalculator::verbose
private

Definition at line 319 of file G4EmCalculator.hh.


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