Geant4 9.6.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=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 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 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)
 
void SetVerbose (G4int val)
 

Detailed Description

Definition at line 79 of file G4EmCalculator.hh.

Constructor & Destructor Documentation

◆ G4EmCalculator()

G4EmCalculator::G4EmCalculator ( )

Definition at line 88 of file G4EmCalculator.cc.

89{
91 corr = manager->EmCorrections();
92 nLocalMaterials = 0;
93 verbose = 0;
94 currentCoupleIndex = 0;
95 currentCouple = 0;
96 currentMaterial = 0;
97 currentParticle = 0;
98 lambdaParticle = 0;
99 baseParticle = 0;
100 currentLambda = 0;
101 currentModel = 0;
102 currentProcess = 0;
103 loweModel = 0;
104 chargeSquare = 1.0;
105 massRatio = 1.0;
106 mass = 0.0;
107 currentCut = 0.0;
108 currentParticleName= "";
109 currentMaterialName= "";
110 currentName = "";
111 lambdaName = "";
112 theGenericIon = G4GenericIon::GenericIon();
113 ionEffCharge = new G4ionEffectiveCharge();
114 isIon = false;
115 isApplicable = false;
116}
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:92
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()

◆ ~G4EmCalculator()

G4EmCalculator::~G4EmCalculator ( )

Definition at line 120 of file G4EmCalculator.cc.

121{
122 delete ionEffCharge;
123 for (G4int i=0; i<nLocalMaterials; ++i) {
124 delete localCouples[i];
125 }
126}
int G4int
Definition: G4Types.hh:66

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

698{
699 G4double res = 0.0;
700 if(UpdateParticle(p, kinEnergy)) {
701 if(FindEmModel(p, processName, kinEnergy)) {
702 G4double e = kinEnergy;
703 if(baseParticle) {
704 e *= kinEnergy*massRatio;
705 res = currentModel->ComputeCrossSectionPerAtom(
706 baseParticle, e, Z, A, cut) * chargeSquare;
707 } else {
708 res = currentModel->ComputeCrossSectionPerAtom(p, e, Z, A, cut);
709 }
710 if(verbose>0) {
711 G4cout << "E(MeV)= " << kinEnergy/MeV
712 << " cross(barn)= " << res/barn
713 << " " << p->GetParticleName()
714 << " Z= " << Z << " A= " << A/(g/mole) << " g/mole"
715 << G4endl;
716 }
717 }
718 }
719 return res;
720}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
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:240

Referenced by ComputeCrossSectionPerAtom().

◆ ComputeCrossSectionPerAtom() [2/2]

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

Definition at line 724 of file G4EmCalculator.cc.

729{
730 return ComputeCrossSectionPerAtom(kinEnergy,FindParticle(particle),
731 processName,
732 elm->GetZ(),elm->GetN(),cut);
733}
G4double GetZ() const
Definition: G4Element.hh:131
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)

◆ ComputeCrossSectionPerVolume() [1/2]

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

Definition at line 643 of file G4EmCalculator.cc.

649{
650 currentMaterial = mat;
651 currentMaterialName = mat->GetName();
652 G4double res = 0.0;
653 if(UpdateParticle(p, kinEnergy)) {
654 if(FindEmModel(p, processName, kinEnergy)) {
655 G4double e = kinEnergy;
656 if(baseParticle) {
657 e *= kinEnergy*massRatio;
658 res = currentModel->CrossSectionPerVolume(
659 mat, baseParticle, e, cut, e) * chargeSquare;
660 } else {
661 res = currentModel->CrossSectionPerVolume(mat, p, e, cut, e);
662 }
663 if(verbose>0) {
664 G4cout << "G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/MeV
665 << " cross(cm-1)= " << res*cm
666 << " cut(keV)= " << cut/keV
667 << " " << p->GetParticleName()
668 << " in " << mat->GetName()
669 << G4endl;
670 }
671 }
672 }
673 return res;
674}
const G4String & GetName() const
Definition: G4Material.hh:177
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:186

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 
)

Definition at line 678 of file G4EmCalculator.cc.

684{
685 return ComputeCrossSectionPerVolume(kinEnergy,FindParticle(particle),
686 processName,
687 FindMaterial(material),cut);
688}
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 435 of file G4EmCalculator.cc.

440{
441 currentMaterial = mat;
442 currentMaterialName = mat->GetName();
443 G4double res = 0.0;
444 if(verbose > 1) {
445 G4cout << "### G4EmCalculator::ComputeDEDX: " << p->GetParticleName()
446 << " in " << currentMaterialName
447 << " e(MeV)= " << kinEnergy/MeV << " cut(MeV)= " << cut/MeV
448 << G4endl;
449 }
450 if(UpdateParticle(p, kinEnergy)) {
451 if(FindEmModel(p, processName, kinEnergy)) {
452 G4double escaled = kinEnergy*massRatio;
453 if(baseParticle) {
454 res = currentModel->ComputeDEDXPerVolume(
455 mat, baseParticle, escaled, cut) * chargeSquare;
456 if(verbose > 1) {
457 G4cout << baseParticle->GetParticleName()
458 << " Escaled(MeV)= " << escaled;
459 }
460 } else {
461 res = currentModel->ComputeDEDXPerVolume(mat, p, kinEnergy, cut);
462 if(verbose > 1) { G4cout << " no basePart E(MeV)= " << kinEnergy << " "; }
463 }
464 if(verbose > 1) {
465 G4cout << currentModel->GetName() << ": DEDX(MeV/mm)= " << res*mm/MeV
466 << " DEDX(MeV*cm^2/g)= "
467 << res*gram/(MeV*cm2*mat->GetDensity())
468 << G4endl;
469 }
470
471 // emulate smoothing procedure
472 G4double eth = currentModel->LowEnergyLimit();
473 // G4cout << "massRatio= " << massRatio << " eth= " << eth << G4endl;
474 if(loweModel) {
475 G4double res0 = 0.0;
476 G4double res1 = 0.0;
477 if(baseParticle) {
478 res1 = currentModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut)
479 * chargeSquare;
480 res0 = loweModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut)
481 * chargeSquare;
482 } else {
483 res1 = currentModel->ComputeDEDXPerVolume(mat, p, eth, cut);
484 res0 = loweModel->ComputeDEDXPerVolume(mat, p, eth, cut);
485 }
486 if(verbose > 1) {
487 G4cout << "At boundary energy(MeV)= " << eth/MeV
488 << " DEDX(MeV/mm)= " << res1*mm/MeV
489 << G4endl;
490 }
491
492 //G4cout << "eth= " << eth << " escaled= " << escaled
493 // << " res0= " << res0 << " res1= "
494 // << res1 << " q2= " << chargeSquare << G4endl;
495
496 if(res1 > 0.0 && escaled > 0.0) {
497 res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
498 }
499 }
500
501 // low energy correction for ions
502 if(isIon) {
503 G4double length = CLHEP::nm;
504 const G4Region* r = 0;
505 const G4MaterialCutsCouple* couple = FindCouple(mat, r);
506 G4double eloss = res*length;
507 G4double niel = 0.0;
508 dynParticle.SetKineticEnergy(kinEnergy);
509 currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
510 currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
511 res = eloss/length;
512
513 if(verbose > 1) {
514 G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV
515 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
516 << G4endl;
517 }
518 }
519 }
520
521 if(verbose > 0) {
522 G4cout << "Sum: E(MeV)= " << kinEnergy/MeV
523 << " DEDX(MeV/mm)= " << res*mm/MeV
524 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
525 << " cut(MeV)= " << cut/MeV
526 << " " << p->GetParticleName()
527 << " in " << currentMaterialName
528 << " Zi^2= " << chargeSquare
529 << " isIon=" << isIon
530 << G4endl;
531 }
532 }
533 return res;
534}
void SetKineticEnergy(G4double aEnergy)
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
G4double GetDensity() const
Definition: G4Material.hh:179
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:279
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:529
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:262
const G4String & GetName() const
Definition: G4VEmModel.hh:655
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.cc:177

Referenced by ComputeDEDX(), and ComputeElectronicDEDX().

◆ ComputeDEDX() [2/2]

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

Definition at line 602 of file G4EmCalculator.cc.

607{
608 return ComputeDEDX(kinEnergy,FindParticle(particle),processName,
609 FindMaterial(material),cut);
610}
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)

◆ ComputeElectronicDEDX() [1/2]

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

Definition at line 538 of file G4EmCalculator.cc.

542{
543 currentMaterial = mat;
544 currentMaterialName = mat->GetName();
545 G4double dedx = 0.0;
546 if(UpdateParticle(part, kinEnergy)) {
547
549 const std::vector<G4VEnergyLossProcess*> vel =
550 lManager->GetEnergyLossProcessVector();
551 G4int n = vel.size();
552
553 //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
554 // << " n= " << n << G4endl;
555
556 for(G4int i=0; i<n; ++i) {
557 if(vel[i]) {
558 G4VProcess* p = reinterpret_cast<G4VProcess*>(vel[i]);
559 if(ActiveForParticle(part, p)) {
560 //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
561 // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
562 dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
563 }
564 }
565 }
566 }
567 return dedx;
568}
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()

Referenced by ComputeElectronicDEDX(), and ComputeTotalDEDX().

◆ ComputeElectronicDEDX() [2/2]

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

Definition at line 572 of file G4EmCalculator.cc.

574{
575 return ComputeElectronicDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
576}
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 805 of file G4EmCalculator.cc.

809{
811 ConvertRangeToEnergy(part, mat, range);
812}
static G4ProductionCutsTable * GetProductionCutsTable()

Referenced by ComputeEnergyCutFromRangeCut().

◆ ComputeEnergyCutFromRangeCut() [2/2]

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

Definition at line 816 of file G4EmCalculator.cc.

820{
821 return ComputeEnergyCutFromRangeCut(range,FindParticle(particle),
822 FindMaterial(material));
823}
G4double ComputeEnergyCutFromRangeCut(G4double range, const G4ParticleDefinition *, const G4Material *)

◆ ComputeGammaAttenuationLength()

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

Definition at line 738 of file G4EmCalculator.cc.

740{
741 G4double res = 0.0;
742 const G4ParticleDefinition* gamma = G4Gamma::Gamma();
743 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "conv", mat, 0.0);
744 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "compt", mat, 0.0);
745 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "phot", mat, 0.0);
746 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "Rayl", mat, 0.0);
747 if(res > 0.0) { res = 1.0/res; }
748 return res;
749}
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86

◆ ComputeMeanFreePath() [1/2]

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

Definition at line 772 of file G4EmCalculator.cc.

777{
778 G4double mfp = DBL_MAX;
779 G4double x = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, cut);
780 if(x > 0.0) { mfp = 1.0/x; }
781 if(verbose>1) {
782 G4cout << "E(MeV)= " << kinEnergy/MeV
783 << " MFP(mm)= " << mfp/mm
784 << " " << p->GetParticleName()
785 << " in " << mat->GetName()
786 << G4endl;
787 }
788 return mfp;
789}
#define DBL_MAX
Definition: templates.hh:83

Referenced by ComputeMeanFreePath().

◆ ComputeMeanFreePath() [2/2]

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

Definition at line 793 of file G4EmCalculator.cc.

798{
799 return ComputeMeanFreePath(kinEnergy,FindParticle(particle),processName,
800 FindMaterial(material),cut);
801}
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 614 of file G4EmCalculator.cc.

617{
618
619 G4double res = corr->NuclearDEDX(p, mat, kinEnergy, false);
620
621 if(verbose > 1) {
622 G4cout << p->GetParticleName() << " E(MeV)= " << kinEnergy/MeV
623 << " NuclearDEDX(MeV/mm)= " << res*mm/MeV
624 << " NuclearDEDX(MeV*cm^2/g)= "
625 << res*gram/(MeV*cm2*mat->GetDensity())
626 << G4endl;
627 }
628 return res;
629}
G4double NuclearDEDX(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4bool fluct=true)

Referenced by ComputeNuclearDEDX(), and ComputeTotalDEDX().

◆ ComputeNuclearDEDX() [2/2]

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

Definition at line 633 of file G4EmCalculator.cc.

636{
637 return ComputeNuclearDEDX(kinEnergy,FindParticle(particle),
638 FindMaterial(material));
639}
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)

◆ ComputeShellIonisationCrossSectionPerAtom()

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

Definition at line 753 of file G4EmCalculator.cc.

759{
760 G4double res = 0.0;
761 const G4ParticleDefinition* p = FindParticle(particle);
762 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
763 if(p && ad) {
764 res = ad->ComputeShellIonisationCrossSectionPerAtom(p, Z, shell,
765 kinEnergy, mat);
766 }
767 return res;
768}
G4VAtomDeexcitation * AtomDeexcitation()
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)=0

◆ ComputeTotalDEDX() [1/2]

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

Definition at line 580 of file G4EmCalculator.cc.

584{
585 G4double dedx = ComputeElectronicDEDX(kinEnergy,part,mat,cut);
586 if(mass > 700.*MeV) { dedx += ComputeNuclearDEDX(kinEnergy,part,mat); }
587 return dedx;
588}

Referenced by ComputeTotalDEDX().

◆ ComputeTotalDEDX() [2/2]

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

Definition at line 592 of file G4EmCalculator.cc.

596{
597 return ComputeTotalDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
598}
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)

◆ FindCouple()

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

Definition at line 943 of file G4EmCalculator.cc.

946{
947 if(!material) return 0;
948 currentMaterial = material;
949 currentMaterialName = material->GetName();
950 // Access to materials
951 const G4ProductionCutsTable* theCoupleTable=
953 const G4Region* r = region;
954 if(!r) {
955 r = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld");
956 }
957 return theCoupleTable->GetMaterialCutsCouple(material,r->GetProductionCuts());
958
959}
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
G4ProductionCuts * GetProductionCuts() const

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

◆ FindIon()

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

Definition at line 907 of file G4EmCalculator.cc.

908{
909 const G4ParticleDefinition* p =
911 return p;
912}
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()

◆ FindMaterial()

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

Definition at line 916 of file G4EmCalculator.cc.

917{
918 if(name != currentMaterialName) {
919 currentMaterial = G4Material::GetMaterial(name);
920 currentMaterialName = name;
921 if(!currentMaterial)
922 G4cout << "### WARNING: G4EmCalculator::FindMaterial fails to find "
923 << name << G4endl;
924 }
925 return currentMaterial;
926}
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:576

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

◆ FindParticle()

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

Definition at line 890 of file G4EmCalculator.cc.

891{
892 const G4ParticleDefinition* p = 0;
893 if(name != currentParticleName) {
895 if(!p) {
896 G4cout << "### WARNING: G4EmCalculator::FindParticle fails to find "
897 << name << G4endl;
898 }
899 } else {
900 p = currentParticle;
901 }
902 return p;
903}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)

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

◆ FindRegion()

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

Definition at line 930 of file G4EmCalculator.cc.

931{
932 const G4Region* r = 0;
933 if(reg != "" && reg != "world") {
935 } else {
936 r = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld");
937 }
938 return r;
939}

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 = 0 
)

Definition at line 308 of file G4EmCalculator.cc.

313{
314 G4double res = 0.0;
315 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
316
317 if(couple && UpdateParticle(p, kinEnergy)) {
318 G4int idx = couple->GetIndex();
319 FindLambdaTable(p, processName, kinEnergy);
320
321 if(currentLambda) {
322 G4double e = kinEnergy*massRatio;
323 res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
324 } else {
325 res = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat,
326 kinEnergy);
327 }
328 if(verbose>0) {
329 G4cout << "G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/MeV
330 << " cross(cm-1)= " << res*cm
331 << " " << p->GetParticleName()
332 << " in " << mat->GetName();
333 if(verbose>1)
334 G4cout << " idx= " << idx << " Escaled((MeV)= "
335 << kinEnergy*massRatio
336 << " q2= " << chargeSquare;
337 G4cout << G4endl;
338 }
339 }
340 return res;
341}

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" 
)

Definition at line 345 of file G4EmCalculator.cc.

350{
351 return GetCrossSectionPerVolume(kinEnergy,FindParticle(particle),processName,
352 FindMaterial(material),FindRegion(reg));
353}
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
const G4Region * FindRegion(const G4String &)

◆ GetCSDARange() [1/2]

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

Definition at line 200 of file G4EmCalculator.cc.

204{
205 G4double res = 0.0;
206 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
207 if(couple && UpdateParticle(p, kinEnergy)) {
208 res = manager->GetCSDARange(p, kinEnergy, couple);
209 if(verbose>0) {
210 G4cout << "G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/MeV
211 << " range(mm)= " << res/mm
212 << " " << p->GetParticleName()
213 << " in " << mat->GetName()
214 << G4endl;
215 }
216 }
217 return res;
218}
G4double GetCSDARange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetCSDARange().

◆ GetCSDARange() [2/2]

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

Definition at line 255 of file G4EmCalculator.cc.

259{
260 return GetCSDARange(kinEnergy,FindParticle(particle),
261 FindMaterial(material),FindRegion(reg));
262}
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)

◆ GetDEDX() [1/2]

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

Definition at line 130 of file G4EmCalculator.cc.

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

Definition at line 169 of file G4EmCalculator.cc.

171{
172 return GetDEDX(kinEnergy,FindParticle(particle),
173 FindMaterial(material),FindRegion(reg));
174}
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)

◆ GetKinEnergy() [1/2]

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

Definition at line 277 of file G4EmCalculator.cc.

281{
282 G4double res = 0.0;
283 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
284 if(couple && UpdateParticle(p, 1.0*GeV)) {
285 res = manager->GetEnergy(p, range, couple);
286 if(verbose>0) {
287 G4cout << "G4EmCalculator::GetKinEnergy: Range(mm)= " << range/mm
288 << " KinE(MeV)= " << res/MeV
289 << " " << p->GetParticleName()
290 << " in " << mat->GetName()
291 << G4endl;
292 }
293 }
294 return res;
295}
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" 
)

Definition at line 299 of file G4EmCalculator.cc.

301{
302 return GetKinEnergy(range,FindParticle(particle),
303 FindMaterial(material),FindRegion(reg));
304}
G4double GetKinEnergy(G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)

◆ GetMeanFreePath() [1/2]

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

Definition at line 374 of file G4EmCalculator.cc.

379{
380 G4double res = DBL_MAX;
381 G4double x = GetCrossSectionPerVolume(kinEnergy,p, processName, mat,region);
382 if(x > 0.0) { res = 1.0/x; }
383 if(verbose>1) {
384 G4cout << "G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/MeV
385 << " MFP(mm)= " << res/mm
386 << " " << p->GetParticleName()
387 << " in " << mat->GetName()
388 << G4endl;
389 }
390 return res;
391}

Referenced by GetMeanFreePath().

◆ GetMeanFreePath() [2/2]

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

Definition at line 395 of file G4EmCalculator.cc.

400{
401 return GetMeanFreePath(kinEnergy,FindParticle(particle),processName,
402 FindMaterial(material),FindRegion(reg));
403}
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)

◆ GetRange() [1/2]

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

Definition at line 222 of file G4EmCalculator.cc.

226{
227 G4double res = 0.0;
228 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
229 if(couple && UpdateParticle(p, kinEnergy)) {
230 res = manager->GetRange(p, kinEnergy, couple);
231 if(verbose>0) {
232 G4cout << "G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/MeV
233 << " range(mm)= " << res/mm
234 << " " << p->GetParticleName()
235 << " in " << mat->GetName()
236 << G4endl;
237 }
238 }
239 return res;
240}
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetRange().

◆ GetRange() [2/2]

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

Definition at line 266 of file G4EmCalculator.cc.

270{
271 return GetRange(kinEnergy,FindParticle(particle),
272 FindMaterial(material),FindRegion(reg));
273}
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)

◆ GetRangeFromRestricteDEDX() [1/2]

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

Definition at line 178 of file G4EmCalculator.cc.

182{
183 G4double res = 0.0;
184 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
185 if(couple && UpdateParticle(p, kinEnergy)) {
186 res = manager->GetRangeFromRestricteDEDX(p, kinEnergy, couple);
187 if(verbose>0) {
188 G4cout << "G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/MeV
189 << " range(mm)= " << res/mm
190 << " " << p->GetParticleName()
191 << " in " << mat->GetName()
192 << G4endl;
193 }
194 }
195 return res;
196}
G4double GetRangeFromRestricteDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)

Referenced by GetRangeFromRestricteDEDX().

◆ GetRangeFromRestricteDEDX() [2/2]

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

Definition at line 244 of file G4EmCalculator.cc.

248{
249 return GetRangeFromRestricteDEDX(kinEnergy,FindParticle(particle),
250 FindMaterial(material),FindRegion(reg));
251}
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)

◆ GetShellIonisationCrossSectionPerAtom()

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

Definition at line 357 of file G4EmCalculator.cc.

362{
363 G4double res = 0.0;
364 const G4ParticleDefinition* p = FindParticle(particle);
365 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
366 if(p && ad) {
367 res = ad->GetShellIonisationCrossSectionPerAtom(p, Z, shell, kinEnergy);
368 }
369 return res;
370}
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)=0

◆ PrintDEDXTable()

void G4EmCalculator::PrintDEDXTable ( const G4ParticleDefinition p)

Definition at line 407 of file G4EmCalculator.cc.

408{
409 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
410 G4cout << "##### DEDX Table for " << p->GetParticleName() << G4endl;
411 if(elp) G4cout << *(elp->DEDXTable()) << G4endl;
412}
G4PhysicsTable * DEDXTable() const

◆ PrintInverseRangeTable()

void G4EmCalculator::PrintInverseRangeTable ( const G4ParticleDefinition p)

Definition at line 425 of file G4EmCalculator.cc.

426{
427 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
428 G4cout << "### G4EmCalculator: Inverse Range Table for "
429 << p->GetParticleName() << G4endl;
430 if(elp) G4cout << *(elp->InverseRangeTable()) << G4endl;
431}
G4PhysicsTable * InverseRangeTable() const

◆ PrintRangeTable()

void G4EmCalculator::PrintRangeTable ( const G4ParticleDefinition p)

Definition at line 416 of file G4EmCalculator.cc.

417{
418 const G4VEnergyLossProcess* elp = FindEnergyLossProcess(p);
419 G4cout << "##### Range Table for " << p->GetParticleName() << G4endl;
420 if(elp) G4cout << *(elp->RangeTableForLoss()) << G4endl;
421}
G4PhysicsTable * RangeTableForLoss() const

◆ SetVerbose()

void G4EmCalculator::SetVerbose ( G4int  val)

Definition at line 1242 of file G4EmCalculator.cc.

1243{
1244 verbose = verb;
1245}

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