Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::G4EmCalculator ( )

Definition at line 74 of file G4EmCalculator.cc.

75{
78 theParameters = G4EmParameters::Instance();
79 corr = manager->EmCorrections();
80 nLocalMaterials = 0;
81 verbose = 0;
82 currentCoupleIndex = 0;
83 currentCouple = nullptr;
84 currentMaterial = cutMaterial = nullptr;
85 currentParticle = nullptr;
86 lambdaParticle = nullptr;
87 baseParticle = nullptr;
88 currentLambda = nullptr;
89 currentModel = nullptr;
90 currentProcess = nullptr;
91 curProcess = nullptr;
92 loweModel = nullptr;
93 chargeSquare = 1.0;
94 massRatio = 1.0;
95 mass = 0.0;
96 currentCut = 0.0;
97 cutenergy[0] = cutenergy[1] = cutenergy[2] = DBL_MAX;
98 currentParticleName= "";
99 currentMaterialName= "";
100 currentName = "";
101 lambdaName = "";
102 theGenericIon = G4GenericIon::GenericIon();
103 ionEffCharge = new G4ionEffectiveCharge();
105 isIon = false;
106 isApplicable = false;
107}
static G4EmParameters * Instance()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:92
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
static G4NistManager * Instance()
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
#define DBL_MAX
Definition: templates.hh:62

◆ ~G4EmCalculator()

G4EmCalculator::~G4EmCalculator ( )

Definition at line 111 of file G4EmCalculator.cc.

112{
113 delete ionEffCharge;
114 for (G4int i=0; i<nLocalMaterials; ++i) {
115 delete localCouples[i];
116 }
117}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ 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 640 of file G4EmCalculator.cc.

646{
647 G4double res = 0.0;
648 if(UpdateParticle(p, kinEnergy)) {
649 G4int iz = G4lrint(Z);
650 CheckMaterial(iz);
651 if(FindEmModel(p, processName, kinEnergy)) {
652 G4double e = kinEnergy;
653 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
654 if(baseParticle) {
655 e *= kinEnergy*massRatio;
656 currentModel->InitialiseForElement(baseParticle, iz);
657 res = currentModel->ComputeCrossSectionPerAtom(
658 baseParticle, e, Z, A, aCut) * chargeSquare;
659 } else {
660 currentModel->InitialiseForElement(p, iz);
661 res = currentModel->ComputeCrossSectionPerAtom(p, e, Z, A, aCut);
662 }
663 if(verbose>0) {
664 G4cout << "E(MeV)= " << kinEnergy/MeV
665 << " cross(barn)= " << res/barn
666 << " " << p->GetParticleName()
667 << " Z= " << Z << " A= " << A/(g/mole) << " g/mole"
668 << " cut(keV)= " << aCut/keV
669 << G4endl;
670 }
671 }
672 }
673 return res;
674}
double A(double temperature)
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double LowestElectronEnergy() const
const G4String & GetParticleName() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:359
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:240
int G4lrint(double ad)
Definition: templates.hh:134

Referenced by ComputeCrossSectionPerAtom().

◆ 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 513 of file G4EmCalculator.hh.

518{
519 return ComputeCrossSectionPerAtom(kinEnergy,FindParticle(particle),
520 processName,
521 elm->GetZ(),elm->GetN(),cut);
522}
G4double GetZ() const
Definition: G4Element.hh:130
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)

◆ 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 678 of file G4EmCalculator.cc.

683{
684 G4double res = 0.0;
685 if(UpdateParticle(p, kinEnergy)) {
686 CheckMaterial(Z);
687 if(FindEmModel(p, processName, kinEnergy)) {
688 G4double e = kinEnergy;
689 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
690 if(baseParticle) {
691 e *= kinEnergy*massRatio;
692 currentModel->InitialiseForElement(baseParticle, Z);
693 res = currentModel->ComputeCrossSectionPerShell(baseParticle, Z, shellIdx,
694 e, aCut) * chargeSquare;
695 } else {
696 currentModel->InitialiseForElement(p, Z);
697 res = currentModel->ComputeCrossSectionPerAtom(p, Z, shellIdx, e, aCut);
698 }
699 if(verbose>0) {
700 G4cout << "E(MeV)= " << kinEnergy/MeV
701 << " cross(barn)= " << res/barn
702 << " " << p->GetParticleName()
703 << " Z= " << Z << " shellIdx= " << shellIdx
704 << " cut(keV)= " << aCut/keV
705 << G4endl;
706 }
707 }
708 }
709 return res;
710}
virtual G4double ComputeCrossSectionPerShell(const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:369

Referenced by ComputeCrossSectionPerShell().

◆ 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 526 of file G4EmCalculator.hh.

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

◆ ComputeCrossSectionPerVolume() [1/2]

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

Definition at line 605 of file G4EmCalculator.cc.

611{
612 SetupMaterial(mat);
613 G4double res = 0.0;
614 if(UpdateParticle(p, kinEnergy)) {
615 if(FindEmModel(p, processName, kinEnergy)) {
616 G4double e = kinEnergy;
617 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
618 if(baseParticle) {
619 e *= kinEnergy*massRatio;
620 res = currentModel->CrossSectionPerVolume(
621 mat, baseParticle, e, aCut, e) * chargeSquare;
622 } else {
623 res = currentModel->CrossSectionPerVolume(mat, p, e, aCut, e);
624 }
625 if(verbose>0) {
626 G4cout << "G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/MeV
627 << " cross(cm-1)= " << res*cm
628 << " cut(keV)= " << aCut/keV
629 << " " << p->GetParticleName()
630 << " in " << mat->GetName()
631 << G4endl;
632 }
633 }
634 }
635 return res;
636}
void SetupMaterial(const G4Material *)
const G4String & GetName() const
Definition: G4Material.hh:175
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:254

Referenced by ComputeCrossSectionPerVolume(), ComputeGammaAttenuationLength(), ComputeMeanFreePath(), and GetCrossSectionPerVolume().

◆ 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 498 of file G4EmCalculator.hh.

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

◆ ComputeDEDX() [1/2]

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

Definition at line 372 of file G4EmCalculator.cc.

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

Referenced by ComputeDEDX(), ComputeDEDXForCutInRange(), and ComputeElectronicDEDX().

◆ 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 474 of file G4EmCalculator.hh.

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

◆ ComputeDEDXForCutInRange() [1/2]

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

Definition at line 521 of file G4EmCalculator.cc.

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

Referenced by ComputeDEDXForCutInRange().

◆ ComputeDEDXForCutInRange() [2/2]

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

Definition at line 451 of file G4EmCalculator.hh.

455{
456 return ComputeDEDXForCutInRange(kinEnergy,FindParticle(part),
457 FindMaterial(mat), rangecut);
458}
G4double ComputeDEDXForCutInRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double rangecut=DBL_MAX)

◆ ComputeElectronicDEDX() [1/2]

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

Definition at line 488 of file G4EmCalculator.cc.

492{
493 SetupMaterial(mat);
494 G4double dedx = 0.0;
495 if(UpdateParticle(part, kinEnergy)) {
496
498 const std::vector<G4VEnergyLossProcess*> vel =
499 lManager->GetEnergyLossProcessVector();
500 G4int n = vel.size();
501
502 //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
503 // << " n= " << n << G4endl;
504
505 for(G4int i=0; i<n; ++i) {
506 if(vel[i]) {
507 G4VProcess* p = reinterpret_cast<G4VProcess*>(vel[i]);
508 if(ActiveForParticle(part, p)) {
509 //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
510 // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
511 dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
512 }
513 }
514 }
515 }
516 return dedx;
517}

Referenced by ComputeElectronicDEDX(), and ComputeTotalDEDX().

◆ ComputeElectronicDEDX() [2/2]

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

Definition at line 441 of file G4EmCalculator.hh.

443{
444 return
445 ComputeElectronicDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
446}
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)

◆ ComputeEnergyCutFromRangeCut() [1/2]

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

Definition at line 770 of file G4EmCalculator.cc.

774{
776 ConvertRangeToEnergy(part, mat, range);
777}
static G4ProductionCutsTable * GetProductionCutsTable()

Referenced by ComputeDEDXForCutInRange(), and ComputeEnergyCutFromRangeCut().

◆ ComputeEnergyCutFromRangeCut() [2/2]

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

Definition at line 539 of file G4EmCalculator.hh.

543{
544 return ComputeEnergyCutFromRangeCut(range,FindParticle(particle),
545 FindMaterial(material));
546}

◆ ComputeGammaAttenuationLength()

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

Definition at line 715 of file G4EmCalculator.cc.

717{
718 G4double res = 0.0;
719 const G4ParticleDefinition* gamma = G4Gamma::Gamma();
720 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "conv", mat, 0.0);
721 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "compt", mat, 0.0);
722 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "phot", mat, 0.0);
723 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "Rayl", mat, 0.0);
724 if(res > 0.0) { res = 1.0/res; }
725 return res;
726}

◆ ComputeMeanFreePath() [1/2]

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

Definition at line 749 of file G4EmCalculator.cc.

754{
755 G4double mfp = DBL_MAX;
756 G4double x = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, cut);
757 if(x > 0.0) { mfp = 1.0/x; }
758 if(verbose>1) {
759 G4cout << "E(MeV)= " << kinEnergy/MeV
760 << " MFP(mm)= " << mfp/mm
761 << " " << p->GetParticleName()
762 << " in " << mat->GetName()
763 << G4endl;
764 }
765 return mfp;
766}

Referenced by ComputeMeanFreePath().

◆ 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 551 of file G4EmCalculator.hh.

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

◆ ComputeNuclearDEDX() [1/2]

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

Definition at line 579 of file G4EmCalculator.cc.

582{
583 G4double res = 0.0;
584 G4VEmProcess* nucst = FindDiscreteProcess(p, "nuclearStopping");
585 if(nucst) {
586 G4VEmModel* mod = nucst->GetModelByIndex();
587 if(mod) {
588 mod->SetFluctuationFlag(false);
589 res = mod->ComputeDEDXPerVolume(mat, p, kinEnergy);
590 }
591 }
592
593 if(verbose > 1) {
594 G4cout << p->GetParticleName() << " E(MeV)= " << kinEnergy/MeV
595 << " NuclearDEDX(MeV/mm)= " << res*mm/MeV
596 << " NuclearDEDX(MeV*cm^2/g)= "
597 << res*gram/(MeV*cm2*mat->GetDensity())
598 << G4endl;
599 }
600 return res;
601}
void SetFluctuationFlag(G4bool val)
Definition: G4VEmModel.hh:722
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const

Referenced by ComputeNuclearDEDX(), and ComputeTotalDEDX().

◆ ComputeNuclearDEDX() [2/2]

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

Definition at line 487 of file G4EmCalculator.hh.

490{
491 return ComputeNuclearDEDX(kinEnergy,FindParticle(particle),
492 FindMaterial(material));
493}
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)

◆ ComputeShellIonisationCrossSectionPerAtom()

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

Definition at line 730 of file G4EmCalculator.cc.

736{
737 G4double res = 0.0;
738 const G4ParticleDefinition* p = FindParticle(particle);
739 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
740 if(p && ad) {
741 res = ad->ComputeShellIonisationCrossSectionPerAtom(p, Z, shell,
742 kinEnergy, mat);
743 }
744 return res;
745}
G4VAtomDeexcitation * AtomDeexcitation()
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr)=0

◆ ComputeTotalDEDX() [1/2]

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

Definition at line 567 of file G4EmCalculator.cc.

571{
572 G4double dedx = ComputeElectronicDEDX(kinEnergy,part,mat,cut);
573 if(mass > 700.*MeV) { dedx += ComputeNuclearDEDX(kinEnergy,part,mat); }
574 return dedx;
575}

Referenced by ComputeTotalDEDX().

◆ ComputeTotalDEDX() [2/2]

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

Definition at line 463 of file G4EmCalculator.hh.

467{
468 return ComputeTotalDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
469}
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)

◆ FindCouple()

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

Definition at line 901 of file G4EmCalculator.cc.

904{
905 const G4MaterialCutsCouple* couple = nullptr;
906 SetupMaterial(material);
907 if(currentMaterial) {
908 // Access to materials
909 const G4ProductionCutsTable* theCoupleTable=
911 const G4Region* r = region;
912 if(r) {
913 couple = theCoupleTable->GetMaterialCutsCouple(material,
914 r->GetProductionCuts());
915 } else {
917 size_t nr = store->size();
918 if(0 < nr) {
919 for(size_t i=0; i<nr; ++i) {
920 couple = theCoupleTable->GetMaterialCutsCouple(
921 material, ((*store)[i])->GetProductionCuts());
922 if(couple) { break; }
923 }
924 }
925 }
926 }
927 if(!couple) {
929 ed << "G4EmCalculator::FindCouple: fail for material <"
930 << currentMaterialName << ">";
931 if(region) { ed << " and region " << region->GetName(); }
932 G4Exception("G4EmCalculator::FindCouple", "em0078",
933 FatalException, ed);
934 }
935 return couple;
936}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4RegionStore * GetInstance()
G4ProductionCuts * GetProductionCuts() const

Referenced by ComputeDEDX(), GetCrossSectionPerVolume(), GetCSDARange(), GetDEDX(), GetKinEnergy(), and GetRangeFromRestricteDEDX().

◆ FindIon()

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

Definition at line 866 of file G4EmCalculator.cc.

867{
868 const G4ParticleDefinition* p = ionTable->GetIon(Z,A,0);
869 return p;
870}
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522

◆ FindMaterial()

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

Definition at line 874 of file G4EmCalculator.cc.

875{
876 if(name != currentMaterialName) {
878 if(!currentMaterial) {
879 G4cout << "### WARNING: G4EmCalculator::FindMaterial fails to find "
880 << name << G4endl;
881 }
882 }
883 return currentMaterial;
884}
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:651
const char * name(G4int ptype)

Referenced by ComputeCrossSectionPerVolume(), ComputeDEDX(), ComputeDEDXForCutInRange(), ComputeElectronicDEDX(), ComputeEnergyCutFromRangeCut(), ComputeMeanFreePath(), ComputeNuclearDEDX(), ComputeTotalDEDX(), GetCrossSectionPerVolume(), GetCSDARange(), GetDEDX(), GetKinEnergy(), GetMeanFreePath(), GetRange(), and GetRangeFromRestricteDEDX().

◆ FindParticle()

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

Definition at line 849 of file G4EmCalculator.cc.

850{
851 const G4ParticleDefinition* p = 0;
852 if(name != currentParticleName) {
854 if(!p) {
855 G4cout << "### WARNING: G4EmCalculator::FindParticle fails to find "
856 << name << G4endl;
857 }
858 } else {
859 p = currentParticle;
860 }
861 return p;
862}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)

Referenced by ComputeCrossSectionPerAtom(), ComputeCrossSectionPerShell(), ComputeCrossSectionPerVolume(), ComputeDEDX(), ComputeDEDXForCutInRange(), ComputeElectronicDEDX(), ComputeEnergyCutFromRangeCut(), ComputeMeanFreePath(), ComputeNuclearDEDX(), ComputeShellIonisationCrossSectionPerAtom(), ComputeTotalDEDX(), GetCrossSectionPerVolume(), GetCSDARange(), GetDEDX(), GetKinEnergy(), GetMeanFreePath(), GetRange(), GetRangeFromRestricteDEDX(), and GetShellIonisationCrossSectionPerAtom().

◆ FindProcess()

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

Definition at line 1230 of file G4EmCalculator.cc.

1232{
1233 G4VProcess* proc = 0;
1234 const G4ProcessManager* procman = part->GetProcessManager();
1235 G4ProcessVector* pv = procman->GetProcessList();
1236 G4int nproc = pv->size();
1237 for(G4int i=0; i<nproc; ++i) {
1238 if(processName == (*pv)[i]->GetProcessName()) {
1239 proc = (*pv)[i];
1240 break;
1241 }
1242 }
1243 return proc;
1244}
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const
std::size_t size() const

◆ FindRegion()

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

Definition at line 888 of file G4EmCalculator.cc.

889{
890 const G4Region* r = 0;
891 if(reg != "" && reg != "world") {
893 } else {
894 r = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld");
895 }
896 return r;
897}
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const

Referenced by GetCrossSectionPerVolume(), GetCSDARange(), GetDEDX(), GetKinEnergy(), GetMeanFreePath(), GetRange(), and GetRangeFromRestricteDEDX().

◆ GetCrossSectionPerVolume() [1/2]

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

Definition at line 254 of file G4EmCalculator.cc.

259{
260 G4double res = 0.0;
261 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
262
263 if(couple && UpdateParticle(p, kinEnergy)) {
264 if(FindEmModel(p, processName, kinEnergy)) {
265 G4int idx = couple->GetIndex();
266 G4int procType = -1;
267 FindLambdaTable(p, processName, kinEnergy, procType);
268
269 G4VEmProcess* emproc = FindDiscreteProcess(p, processName);
270 if(emproc) {
271 res = emproc->CrossSectionPerVolume(kinEnergy, couple);
272 } else if(currentLambda) {
273 // special tables are built for Msc models (procType is set in FindLambdaTable
274 if(procType==2) {
275 G4VMscModel* mscM = static_cast<G4VMscModel*>(currentModel);
276 mscM->SetCurrentCouple(couple);
277 G4double tr1Mfp = mscM->GetTransportMeanFreePath(p, kinEnergy);
278 if (tr1Mfp<DBL_MAX) {
279 res = 1./tr1Mfp;
280 }
281 } else {
282 G4double e = kinEnergy*massRatio;
283 res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
284 }
285 } else {
286 res = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, kinEnergy);
287 }
288 if(verbose>0) {
289 G4cout << "G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/MeV
290 << " cross(cm-1)= " << res*cm
291 << " " << p->GetParticleName()
292 << " in " << mat->GetName();
293 if(verbose>1)
294 G4cout << " idx= " << idx << " Escaled((MeV)= "
295 << kinEnergy*massRatio
296 << " q2= " << chargeSquare;
297 G4cout << G4endl;
298 }
299 }
300 }
301 return res;
302}
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:465
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple, G4double logKinEnergy=DBL_MAX)
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:405

Referenced by GetCrossSectionPerVolume(), and GetMeanFreePath().

◆ 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 415 of file G4EmCalculator.hh.

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

◆ GetCSDARange() [1/2]

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

Definition at line 185 of file G4EmCalculator.cc.

189{
190 G4double res = 0.0;
191 if(!theParameters->BuildCSDARange()) {
193 ed << "G4EmCalculator::GetCSDARange: CSDA table is not built; "
194 << " use UI command: /process/eLoss/CSDARange true";
195 G4Exception("G4EmCalculator::GetCSDARange", "em0077",
196 JustWarning, ed);
197 return res;
198 }
199
200 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
201 if(couple && UpdateParticle(p, kinEnergy)) {
202 res = manager->GetCSDARange(p, kinEnergy, couple);
203 if(verbose>1) {
204 G4cout << " G4EmCalculator::GetCSDARange: E(MeV)= " << kinEnergy/MeV
205 << " range(mm)= " << res/mm
206 << " " << p->GetParticleName()
207 << " in " << mat->GetName()
208 << G4endl;
209 }
210 }
211 return res;
212}
@ JustWarning
G4bool BuildCSDARange() const
G4double GetCSDARange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetCSDARange(), and GetRange().

◆ GetCSDARange() [2/2]

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

Definition at line 381 of file G4EmCalculator.hh.

385{
386 return GetCSDARange(kinEnergy,FindParticle(particle),
387 FindMaterial(material),FindRegion(reg));
388}
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)

◆ GetDEDX() [1/2]

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

Definition at line 121 of file G4EmCalculator.cc.

125{
126 G4double res = 0.0;
127 const G4MaterialCutsCouple* couple = FindCouple(mat, region);
128 if(couple && UpdateParticle(p, kinEnergy) ) {
129 res = manager->GetDEDX(p, kinEnergy, couple);
130
131 if(isIon) {
132 if(FindEmModel(p, currentProcessName, kinEnergy)) {
133 G4double length = CLHEP::nm;
134 G4double eloss = res*length;
135 //G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res
136 // << " de= " << eloss << G4endl;;
137 G4double niel = 0.0;
138 dynParticle.SetKineticEnergy(kinEnergy);
139 currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
140 currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
141 res = eloss/length;
142 //G4cout << " de1= " << eloss << " res1= " << res
143 // << " " << p->GetParticleName() <<G4endl;;
144 }
145 }
146
147 if(verbose>0) {
148 G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV
149 << " DEDX(MeV/mm)= " << res*mm/MeV
150 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
151 << " " << p->GetParticleName()
152 << " in " << mat->GetName()
153 << " isIon= " << isIon
154 << G4endl;
155 }
156 }
157 return res;
158}
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetDEDX(), and G4EnergySplitter::SplitEnergyInVolumes().

◆ GetDEDX() [2/2]

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

Definition at line 359 of file G4EmCalculator.hh.

361{
362 return GetDEDX(kinEnergy,FindParticle(particle),
363 FindMaterial(material),FindRegion(reg));
364}
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)

◆ GetKinEnergy() [1/2]

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

Definition at line 232 of file G4EmCalculator.cc.

236{
237 G4double res = 0.0;
238 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
239 if(couple && UpdateParticle(p, 1.0*GeV)) {
240 res = manager->GetEnergy(p, range, couple);
241 if(verbose>0) {
242 G4cout << "G4EmCalculator::GetKinEnergy: Range(mm)= " << range/mm
243 << " KinE(MeV)= " << res/MeV
244 << " " << p->GetParticleName()
245 << " in " << mat->GetName()
246 << G4endl;
247 }
248 }
249 return res;
250}
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)

Referenced by GetKinEnergy().

◆ GetKinEnergy() [2/2]

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

Definition at line 405 of file G4EmCalculator.hh.

407{
408 return GetKinEnergy(range,FindParticle(particle),
409 FindMaterial(material),FindRegion(reg));
410}
G4double GetKinEnergy(G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)

◆ GetMeanFreePath() [1/2]

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

Definition at line 323 of file G4EmCalculator.cc.

328{
329 G4double res = DBL_MAX;
330 G4double x = GetCrossSectionPerVolume(kinEnergy,p, processName, mat,region);
331 if(x > 0.0) { res = 1.0/x; }
332 if(verbose>1) {
333 G4cout << "G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/MeV
334 << " MFP(mm)= " << res/mm
335 << " " << p->GetParticleName()
336 << " in " << mat->GetName()
337 << G4endl;
338 }
339 return res;
340}

Referenced by GetMeanFreePath().

◆ 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 428 of file G4EmCalculator.hh.

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

◆ GetRange() [1/2]

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

Definition at line 216 of file G4EmCalculator.cc.

220{
221 G4double res = 0.0;
222 if(theParameters->BuildCSDARange()) {
223 res = GetCSDARange(kinEnergy, p, mat, region);
224 } else {
225 res = GetRangeFromRestricteDEDX(kinEnergy, p, mat, region);
226 }
227 return res;
228}
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)

Referenced by GetRange().

◆ GetRange() [2/2]

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

Definition at line 393 of file G4EmCalculator.hh.

397{
398 return GetRange(kinEnergy,FindParticle(particle),
399 FindMaterial(material),FindRegion(reg));
400}
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)

◆ GetRangeFromRestricteDEDX() [1/2]

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

Definition at line 162 of file G4EmCalculator.cc.

166{
167 G4double res = 0.0;
168 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
169 if(couple && UpdateParticle(p, kinEnergy)) {
170 res = manager->GetRangeFromRestricteDEDX(p, kinEnergy, couple);
171 if(verbose>1) {
172 G4cout << " G4EmCalculator::GetRangeFromRestrictedDEDX: E(MeV)= "
173 << kinEnergy/MeV
174 << " range(mm)= " << res/mm
175 << " " << p->GetParticleName()
176 << " in " << mat->GetName()
177 << G4endl;
178 }
179 }
180 return res;
181}
G4double GetRangeFromRestricteDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetRange(), and GetRangeFromRestricteDEDX().

◆ GetRangeFromRestricteDEDX() [2/2]

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

Definition at line 369 of file G4EmCalculator.hh.

373{
374 return GetRangeFromRestricteDEDX(kinEnergy,FindParticle(particle),
375 FindMaterial(material),FindRegion(reg));
376}

◆ GetShellIonisationCrossSectionPerAtom()

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

Definition at line 306 of file G4EmCalculator.cc.

311{
312 G4double res = 0.0;
313 const G4ParticleDefinition* p = FindParticle(particle);
314 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
315 if(p && ad) {
316 res = ad->GetShellIonisationCrossSectionPerAtom(p, Z, shell, kinEnergy);
317 }
318 return res;
319}
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr)=0

◆ PrintDEDXTable()

void G4EmCalculator::PrintDEDXTable ( const G4ParticleDefinition p)

Definition at line 344 of file G4EmCalculator.cc.

345{
346 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
347 G4cout << "##### DEDX Table for " << p->GetParticleName() << G4endl;
348 if(elp) G4cout << *(elp->DEDXTable()) << G4endl;
349}
G4PhysicsTable * DEDXTable() const

◆ PrintInverseRangeTable()

void G4EmCalculator::PrintInverseRangeTable ( const G4ParticleDefinition p)

Definition at line 362 of file G4EmCalculator.cc.

363{
364 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
365 G4cout << "### G4EmCalculator: Inverse Range Table for "
366 << p->GetParticleName() << G4endl;
367 if(elp) G4cout << *(elp->InverseRangeTable()) << G4endl;
368}
G4PhysicsTable * InverseRangeTable() const

◆ PrintRangeTable()

void G4EmCalculator::PrintRangeTable ( const G4ParticleDefinition p)

Definition at line 353 of file G4EmCalculator.cc.

354{
355 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
356 G4cout << "##### Range Table for " << p->GetParticleName() << G4endl;
357 if(elp) G4cout << *(elp->RangeTableForLoss()) << G4endl;
358}
G4PhysicsTable * RangeTableForLoss() const

◆ SetupMaterial() [1/2]

void G4EmCalculator::SetupMaterial ( const G4Material mat)

Definition at line 1266 of file G4EmCalculator.cc.

1267{
1268 if(mat) {
1269 currentMaterial = mat;
1270 currentMaterialName = mat->GetName();
1271 } else {
1272 currentMaterial = 0;
1273 currentMaterialName = "";
1274 }
1275}

Referenced by ComputeCrossSectionPerVolume(), ComputeDEDX(), ComputeDEDXForCutInRange(), ComputeElectronicDEDX(), FindCouple(), FindMaterial(), and SetupMaterial().

◆ SetupMaterial() [2/2]

void G4EmCalculator::SetupMaterial ( const G4String mname)

Definition at line 1279 of file G4EmCalculator.cc.

1280{
1281 SetupMaterial(nist->FindOrBuildMaterial(mname));
1282}
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)

◆ SetVerbose()

void G4EmCalculator::SetVerbose ( G4int  val)

Definition at line 1305 of file G4EmCalculator.cc.

1306{
1307 verbose = verb;
1308}

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