Geant4 11.1.1
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 &regname="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 &regname="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 &regname="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 &regname="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 &regname="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 &regname="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 &regname="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)
 
void SetApplySmoothing (G4int val)
 
G4EmCalculatoroperator= (const G4EmCalculator &right)=delete
 
 G4EmCalculator (const G4EmCalculator &)=delete
 

Detailed Description

Definition at line 79 of file G4EmCalculator.hh.

Constructor & Destructor Documentation

◆ G4EmCalculator() [1/2]

G4EmCalculator::G4EmCalculator ( )

Definition at line 76 of file G4EmCalculator.cc.

77{
80 theParameters = G4EmParameters::Instance();
81 corr = manager->EmCorrections();
82 cutenergy[0] = cutenergy[1] = cutenergy[2] = DBL_MAX;
83 theGenericIon = G4GenericIon::GenericIon();
84 ionEffCharge = new G4ionEffectiveCharge();
85 dynParticle = new G4DynamicParticle();
87}
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 91 of file G4EmCalculator.cc.

92{
93 delete ionEffCharge;
94 delete dynParticle;
95 for (G4int i=0; i<nLocalMaterials; ++i) {
96 delete localCouples[i];
97 }
98}
int G4int
Definition: G4Types.hh:85

◆ G4EmCalculator() [2/2]

G4EmCalculator::G4EmCalculator ( const G4EmCalculator )
delete

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

614{
615 G4double res = 0.0;
616 if(UpdateParticle(p, kinEnergy)) {
617 G4int iz = G4lrint(Z);
618 CheckMaterial(iz);
619 if(FindEmModel(p, processName, kinEnergy)) {
620 G4double e = kinEnergy;
621 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
622 if(baseParticle) {
623 e *= kinEnergy*massRatio;
624 currentModel->InitialiseForElement(baseParticle, iz);
625 res = currentModel->ComputeCrossSectionPerAtom(
626 baseParticle, e, Z, A, aCut) * chargeSquare;
627 } else {
628 currentModel->InitialiseForElement(p, iz);
629 res = currentModel->ComputeCrossSectionPerAtom(p, e, Z, A, aCut);
630 }
631 if(verbose>0) {
632 G4cout << "E(MeV)= " << kinEnergy/MeV
633 << " cross(barn)= " << res/barn
634 << " " << p->GetParticleName()
635 << " Z= " << Z << " A= " << A/(g/mole) << " g/mole"
636 << " cut(keV)= " << aCut/keV
637 << G4endl;
638 }
639 }
640 }
641 return res;
642}
double G4double
Definition: G4Types.hh:83
const G4int Z[17]
const G4double A[17]
#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:284
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
Definition: G4VEmModel.cc:167
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 508 of file G4EmCalculator.hh.

513{
514 return ComputeCrossSectionPerAtom(kinEnergy,FindParticle(particle),
515 processName,
516 elm->GetZ(),elm->GetN(),cut);
517}
G4double GetZ() const
Definition: G4Element.hh:131
G4double GetN() const
Definition: G4Element.hh:135
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 647 of file G4EmCalculator.cc.

652{
653 G4double res = 0.0;
654 if(UpdateParticle(p, kinEnergy)) {
655 CheckMaterial(Z);
656 if(FindEmModel(p, processName, kinEnergy)) {
657 G4double e = kinEnergy;
658 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
659 if(nullptr != baseParticle) {
660 e *= kinEnergy*massRatio;
661 currentModel->InitialiseForElement(baseParticle, Z);
662 res =
663 currentModel->ComputeCrossSectionPerShell(baseParticle, Z, shellIdx,
664 e, aCut) * chargeSquare;
665 } else {
666 currentModel->InitialiseForElement(p, Z);
667 res = currentModel->ComputeCrossSectionPerAtom(p, Z, shellIdx, e, aCut);
668 }
669 if(verbose>0) {
670 G4cout << "E(MeV)= " << kinEnergy/MeV
671 << " cross(barn)= " << res/barn
672 << " " << p->GetParticleName()
673 << " Z= " << Z << " shellIdx= " << shellIdx
674 << " cut(keV)= " << aCut/keV
675 << G4endl;
676 }
677 }
678 }
679 return res;
680}
virtual G4double ComputeCrossSectionPerShell(const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:294

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

525{
526 return ComputeCrossSectionPerShell(kinEnergy, FindParticle(part),
527 processName, elm->GetZasInt(),
528 shellIdx, cut);
529}
G4int GetZasInt() const
Definition: G4Element.hh:132
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 572 of file G4EmCalculator.cc.

578{
579 SetupMaterial(mat);
580 G4double res = 0.0;
581 if(UpdateParticle(p, kinEnergy)) {
582 if(FindEmModel(p, processName, kinEnergy)) {
583 G4double e = kinEnergy;
584 G4double aCut = std::max(cut, theParameters->LowestElectronEnergy());
585 if(baseParticle) {
586 e *= kinEnergy*massRatio;
587 res = currentModel->CrossSectionPerVolume(
588 mat, baseParticle, e, aCut, e) * chargeSquare;
589 } else {
590 res = currentModel->CrossSectionPerVolume(mat, p, e, aCut, e);
591 }
592 if(verbose>0) {
593 G4cout << "G4EmCalculator::ComputeXSPerVolume: E(MeV)= "
594 << kinEnergy/MeV
595 << " cross(cm-1)= " << res*cm
596 << " cut(keV)= " << aCut/keV
597 << " " << p->GetParticleName()
598 << " in " << mat->GetName()
599 << G4endl;
600 }
601 }
602 }
603 return res;
604}
void SetupMaterial(const G4Material *)
const G4String & GetName() const
Definition: G4Material.hh:172
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:181

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

499{
500 return ComputeCrossSectionPerVolume(kinEnergy,FindParticle(particle),
501 processName,
502 FindMaterial(material),cut);
503}
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 353 of file G4EmCalculator.cc.

358{
359 SetupMaterial(mat);
360 G4double res = 0.0;
361 if(verbose > 1) {
362 G4cout << "### G4EmCalculator::ComputeDEDX: " << p->GetParticleName()
363 << " in " << currentMaterialName
364 << " e(MeV)= " << kinEnergy/MeV << " cut(MeV)= " << cut/MeV
365 << G4endl;
366 }
367 if(UpdateParticle(p, kinEnergy)) {
368 if(FindEmModel(p, processName, kinEnergy)) {
369 G4double escaled = kinEnergy*massRatio;
370 if(nullptr != baseParticle) {
371 res = currentModel->ComputeDEDXPerVolume(mat, baseParticle,
372 escaled, cut) * chargeSquare;
373 if(verbose > 1) {
374 G4cout << "Particle: " << p->GetParticleName()
375 << " E(MeV)=" << kinEnergy
376 << " Base particle: " << baseParticle->GetParticleName()
377 << " Escaled(MeV)= " << escaled
378 << " q2=" << chargeSquare << G4endl;
379 }
380 } else {
381 res = currentModel->ComputeDEDXPerVolume(mat, p, kinEnergy, cut);
382 if(verbose > 1) {
383 G4cout << "Particle: " << p->GetParticleName()
384 << " E(MeV)=" << kinEnergy << G4endl;
385 }
386 }
387 if(verbose > 1) {
388 G4cout << currentModel->GetName() << ": DEDX(MeV/mm)= " << res*mm/MeV
389 << " DEDX(MeV*cm^2/g)= "
390 << res*gram/(MeV*cm2*mat->GetDensity())
391 << G4endl;
392 }
393 // emulate smoothing procedure
394 if(applySmoothing && nullptr != loweModel) {
395 G4double eth = currentModel->LowEnergyLimit();
396 G4double res0 = 0.0;
397 G4double res1 = 0.0;
398 if(nullptr != baseParticle) {
399 res1 = chargeSquare*
400 currentModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut);
401 res0 = chargeSquare*
402 loweModel->ComputeDEDXPerVolume(mat, baseParticle, eth, cut);
403 } else {
404 res1 = currentModel->ComputeDEDXPerVolume(mat, p, eth, cut);
405 res0 = loweModel->ComputeDEDXPerVolume(mat, p, eth, cut);
406 }
407 if(res1 > 0.0 && escaled > 0.0) {
408 res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
409 }
410 if(verbose > 1) {
411 G4cout << "At boundary energy(MeV)= " << eth/MeV
412 << " DEDX(MeV/mm)= " << res0*mm/MeV << " " << res1*mm/MeV
413 << " after correction DEDX(MeV/mm)=" << res*mm/MeV << G4endl;
414 }
415 }
416 // correction for ions
417 if(isIon) {
418 const G4double length = CLHEP::nm;
419 if(UpdateCouple(mat, cut)) {
420 G4double eloss = res*length;
421 dynParticle->SetKineticEnergy(kinEnergy);
422 currentModel->CorrectionsAlongStep(currentCouple,dynParticle,
423 length,eloss);
424 res = eloss/length;
425
426 if(verbose > 1) {
427 G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV
428 << " DEDX(MeV*cm^2/g)= "
429 << res*gram/(MeV*cm2*mat->GetDensity()) << G4endl;
430 }
431 }
432 }
433 if(verbose > 0) {
434 G4cout << "## E(MeV)= " << kinEnergy/MeV
435 << " DEDX(MeV/mm)= " << res*mm/MeV
436 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
437 << " cut(MeV)= " << cut/MeV
438 << " " << p->GetParticleName()
439 << " in " << currentMaterialName
440 << " Zi^2= " << chargeSquare
441 << " isIon=" << isIon
442 << G4endl;
443 }
444 }
445 }
446 return res;
447}
void SetKineticEnergy(G4double aEnergy)
G4double GetDensity() const
Definition: G4Material.hh:175
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
Definition: G4VEmModel.cc:342
const G4String & GetName() const
Definition: G4VEmModel.hh:816
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.cc:172

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

474{
475 return ComputeDEDX(kinEnergy,FindParticle(particle),processName,
476 FindMaterial(material),cut);
477}
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 485 of file G4EmCalculator.cc.

489{
490 SetupMaterial(mat);
491 G4double dedx = 0.0;
492 if(UpdateParticle(part, kinEnergy)) {
493
495 const std::vector<G4VEnergyLossProcess*> vel =
496 lManager->GetEnergyLossProcessVector();
497 std::size_t n = vel.size();
498
499 if(mat != cutMaterial) {
500 cutMaterial = mat;
501 cutenergy[0] =
503 cutenergy[1] =
505 cutenergy[2] =
507 }
508
509 //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
510 // << " n= " << n << G4endl;
511
512 for(std::size_t i=0; i<n; ++i) {
513 if(vel[i]) {
514 auto p = static_cast<G4VProcess*>(vel[i]);
515 if(ActiveForParticle(part, p)) {
516 //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
517 // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
518 const G4ParticleDefinition* sec = (vel[i])->SecondaryParticle();
519 std::size_t idx = 0;
520 if(sec == G4Electron::Electron()) { idx = 1; }
521 else if(sec == G4Positron::Positron()) { idx = 2; }
522
523 dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),
524 mat,cutenergy[idx]);
525 }
526 }
527 }
528 }
529 return dedx;
530}
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 446 of file G4EmCalculator.hh.

450{
451 return ComputeDEDXForCutInRange(kinEnergy,FindParticle(part),
452 FindMaterial(mat), rangecut);
453}
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 451 of file G4EmCalculator.cc.

455{
456 SetupMaterial(mat);
457 G4double dedx = 0.0;
458 if(UpdateParticle(part, kinEnergy)) {
459
461 const std::vector<G4VEnergyLossProcess*> vel =
462 lManager->GetEnergyLossProcessVector();
463 std::size_t n = vel.size();
464
465 //G4cout << "ComputeElectronicDEDX for " << part->GetParticleName()
466 // << " n= " << n << G4endl;
467
468 for(std::size_t i=0; i<n; ++i) {
469 if(vel[i]) {
470 auto p = static_cast<G4VProcess*>(vel[i]);
471 if(ActiveForParticle(part, p)) {
472 //G4cout << "idx= " << i << " " << (vel[i])->GetProcessName()
473 // << " " << (vel[i])->Particle()->GetParticleName() << G4endl;
474 dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
475 }
476 }
477 }
478 }
479 return dedx;
480}

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

438{
439 return
440 ComputeElectronicDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
441}
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 741 of file G4EmCalculator.cc.

745{
747 ConvertRangeToEnergy(part, mat, range);
748}
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 534 of file G4EmCalculator.hh.

538{
539 return ComputeEnergyCutFromRangeCut(range,FindParticle(particle),
540 FindMaterial(material));
541}

◆ ComputeGammaAttenuationLength()

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

Definition at line 685 of file G4EmCalculator.cc.

687{
688 G4double res = 0.0;
689 const G4ParticleDefinition* gamma = G4Gamma::Gamma();
690 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "conv", mat, 0.0);
691 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "compt", mat, 0.0);
692 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "phot", mat, 0.0);
693 res += ComputeCrossSectionPerVolume(kinEnergy, gamma, "Rayl", mat, 0.0);
694 if(res > 0.0) { res = 1.0/res; }
695 return res;
696}

◆ ComputeMeanFreePath() [1/2]

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

Definition at line 719 of file G4EmCalculator.cc.

724{
725 G4double mfp = DBL_MAX;
726 G4double x =
727 ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, cut);
728 if(x > 0.0) { mfp = 1.0/x; }
729 if(verbose>1) {
730 G4cout << "E(MeV)= " << kinEnergy/MeV
731 << " MFP(mm)= " << mfp/mm
732 << " " << p->GetParticleName()
733 << " in " << mat->GetName()
734 << G4endl;
735 }
736 return mfp;
737}

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

551{
552 return ComputeMeanFreePath(kinEnergy,FindParticle(particle),processName,
553 FindMaterial(material),cut);
554}
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 546 of file G4EmCalculator.cc.

549{
550 G4double res = 0.0;
551 G4VEmProcess* nucst = FindDiscreteProcess(p, "nuclearStopping");
552 if(nucst) {
553 G4VEmModel* mod = nucst->EmModel();
554 if(mod) {
555 mod->SetFluctuationFlag(false);
556 res = mod->ComputeDEDXPerVolume(mat, p, kinEnergy);
557 }
558 }
559
560 if(verbose > 1) {
561 G4cout << p->GetParticleName() << " E(MeV)= " << kinEnergy/MeV
562 << " NuclearDEDX(MeV/mm)= " << res*mm/MeV
563 << " NuclearDEDX(MeV*cm^2/g)= "
564 << res*gram/(MeV*cm2*mat->GetDensity())
565 << G4endl;
566 }
567 return res;
568}
void SetFluctuationFlag(G4bool val)
Definition: G4VEmModel.hh:711
G4VEmModel * EmModel(size_t index=0) const

Referenced by ComputeNuclearDEDX(), and ComputeTotalDEDX().

◆ ComputeNuclearDEDX() [2/2]

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

Definition at line 482 of file G4EmCalculator.hh.

485{
486 return ComputeNuclearDEDX(kinEnergy,FindParticle(particle),
487 FindMaterial(material));
488}
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 700 of file G4EmCalculator.cc.

706{
707 G4double res = 0.0;
708 const G4ParticleDefinition* p = FindParticle(particle);
709 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
710 if(p && ad) {
711 res = ad->ComputeShellIonisationCrossSectionPerAtom(p, Z, shell,
712 kinEnergy, mat);
713 }
714 return res;
715}
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 534 of file G4EmCalculator.cc.

538{
539 G4double dedx = ComputeElectronicDEDX(kinEnergy,part,mat,cut);
540 if(mass > 700.*MeV) { dedx += ComputeNuclearDEDX(kinEnergy,part,mat); }
541 return dedx;
542}

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

462{
463 return ComputeTotalDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut);
464}
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 848 of file G4EmCalculator.cc.

851{
852 const G4MaterialCutsCouple* couple = nullptr;
853 SetupMaterial(material);
854 if(nullptr != currentMaterial) {
855 // Access to materials
856 const G4ProductionCutsTable* theCoupleTable=
858 const G4Region* r = region;
859 if(nullptr != r) {
860 couple = theCoupleTable->GetMaterialCutsCouple(material,
861 r->GetProductionCuts());
862 } else {
864 std::size_t nr = store->size();
865 if(0 < nr) {
866 for(std::size_t i=0; i<nr; ++i) {
867 couple = theCoupleTable->GetMaterialCutsCouple(
868 material, ((*store)[i])->GetProductionCuts());
869 if(nullptr != couple) { break; }
870 }
871 }
872 }
873 }
874 if(nullptr == couple) {
876 ed << "G4EmCalculator::FindCouple: fail for material <"
877 << currentMaterialName << ">";
878 if(region) { ed << " and region " << region->GetName(); }
879 G4Exception("G4EmCalculator::FindCouple", "em0078",
880 FatalException, ed);
881 }
882 return couple;
883}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4RegionStore * GetInstance()
G4ProductionCuts * GetProductionCuts() const

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

◆ FindIon()

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

Definition at line 819 of file G4EmCalculator.cc.

820{
821 const G4ParticleDefinition* p = ionTable->GetIon(Z,A,0);
822 return p;
823}
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522

◆ FindMaterial()

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

Definition at line 827 of file G4EmCalculator.cc.

828{
829 if(name != currentMaterialName) {
831 if(nullptr == currentMaterial) {
832 G4cout << "### WARNING: G4EmCalculator::FindMaterial fails to find "
833 << name << G4endl;
834 }
835 }
836 return currentMaterial;
837}
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:691
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 802 of file G4EmCalculator.cc.

803{
804 const G4ParticleDefinition* p = nullptr;
805 if(name != currentParticleName) {
807 if(nullptr == p) {
808 G4cout << "### WARNING: G4EmCalculator::FindParticle fails to find "
809 << name << G4endl;
810 }
811 } else {
812 p = currentParticle;
813 }
814 return p;
815}
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 1148 of file G4EmCalculator.cc.

1150{
1151 G4VProcess* proc = nullptr;
1152 const G4ProcessManager* procman = part->GetProcessManager();
1153 G4ProcessVector* pv = procman->GetProcessList();
1154 G4int nproc = (G4int)pv->size();
1155 for(G4int i=0; i<nproc; ++i) {
1156 if(processName == (*pv)[i]->GetProcessName()) {
1157 proc = (*pv)[i];
1158 break;
1159 }
1160 }
1161 return proc;
1162}
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const
std::size_t size() const

◆ FindRegion()

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

Definition at line 841 of file G4EmCalculator.cc.

842{
843 return G4EmUtility::FindRegion(reg);
844}
static const G4Region * FindRegion(const G4String &regionName, const G4int verbose=0)
Definition: G4EmUtility.cc:47

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

239{
240 G4double res = 0.0;
241 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
242
243 if(nullptr != couple && UpdateParticle(p, kinEnergy)) {
244 if(FindEmModel(p, processName, kinEnergy)) {
245 G4int idx = couple->GetIndex();
246 G4int procType = -1;
247 FindLambdaTable(p, processName, kinEnergy, procType);
248
249 G4VEmProcess* emproc = FindDiscreteProcess(p, processName);
250 if(nullptr != emproc) {
251 res = emproc->GetCrossSection(kinEnergy, couple);
252 } else if(currentLambda) {
253 // special tables are built for Msc models
254 // procType is set in FindLambdaTable
255 if(procType==2) {
256 auto mscM = static_cast<G4VMscModel*>(currentModel);
257 mscM->SetCurrentCouple(couple);
258 G4double tr1Mfp = mscM->GetTransportMeanFreePath(p, kinEnergy);
259 if (tr1Mfp<DBL_MAX) {
260 res = 1./tr1Mfp;
261 }
262 } else {
263 G4double e = kinEnergy*massRatio;
264 res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
265 }
266 } else {
267 res = ComputeCrossSectionPerVolume(kinEnergy, p, processName, mat, kinEnergy);
268 }
269 if(verbose>0) {
270 G4cout << "G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/MeV
271 << " cross(cm-1)= " << res*cm
272 << " " << p->GetParticleName()
273 << " in " << mat->GetName();
274 if(verbose>1)
275 G4cout << " idx= " << idx << " Escaled((MeV)= "
276 << kinEnergy*massRatio
277 << " q2= " << chargeSquare;
278 G4cout << G4endl;
279 }
280 }
281 }
282 return res;
283}
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:468
G4double GetCrossSection(const G4double kinEnergy, const G4MaterialCutsCouple *couple) override

Referenced by GetCrossSectionPerVolume(), and GetMeanFreePath().

◆ GetCrossSectionPerVolume() [2/2]

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

Definition at line 410 of file G4EmCalculator.hh.

415{
416 return GetCrossSectionPerVolume(kinEnergy,FindParticle(particle),processName,
417 FindMaterial(material),FindRegion(reg));
418}
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 165 of file G4EmCalculator.cc.

169{
170 G4double res = 0.0;
171 if(!theParameters->BuildCSDARange()) {
173 ed << "G4EmCalculator::GetCSDARange: CSDA table is not built; "
174 << " use UI command: /process/eLoss/CSDARange true";
175 G4Exception("G4EmCalculator::GetCSDARange", "em0077",
176 JustWarning, ed);
177 return res;
178 }
179
180 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
181 if(nullptr != couple && UpdateParticle(p, kinEnergy)) {
182 res = manager->GetCSDARange(p, kinEnergy, couple);
183 if(verbose>1) {
184 G4cout << " G4EmCalculator::GetCSDARange: E(MeV)= " << kinEnergy/MeV
185 << " range(mm)= " << res/mm
186 << " " << p->GetParticleName()
187 << " in " << mat->GetName()
188 << G4endl;
189 }
190 }
191 return res;
192}
@ 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 regname = "world" 
)
inline

Definition at line 376 of file G4EmCalculator.hh.

380{
381 return GetCSDARange(kinEnergy,FindParticle(particle),
382 FindMaterial(material),FindRegion(reg));
383}
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 102 of file G4EmCalculator.cc.

106{
107 G4double res = 0.0;
108 const G4MaterialCutsCouple* couple = FindCouple(mat, region);
109 if(nullptr != couple && UpdateParticle(p, kinEnergy) ) {
110 res = manager->GetDEDX(p, kinEnergy, couple);
111
112 if(isIon) {
113 if(FindEmModel(p, currentProcessName, kinEnergy)) {
114 G4double length = CLHEP::nm;
115 G4double eloss = res*length;
116 //G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res
117 // << " de= " << eloss << G4endl;;
118 dynParticle->SetKineticEnergy(kinEnergy);
119 currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
120 currentModel->CorrectionsAlongStep(couple,dynParticle,length,eloss);
121 res = eloss/length;
122 //G4cout << " de1= " << eloss << " res1= " << res
123 // << " " << p->GetParticleName() <<G4endl;;
124 }
125 }
126
127 if(verbose>0) {
128 G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV
129 << " DEDX(MeV/mm)= " << res*mm/MeV
130 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
131 << " " << p->GetParticleName()
132 << " in " << mat->GetName()
133 << " isIon= " << isIon
134 << G4endl;
135 }
136 }
137 return res;
138}
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:325

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

◆ GetDEDX() [2/2]

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

Definition at line 354 of file G4EmCalculator.hh.

356{
357 return GetDEDX(kinEnergy,FindParticle(particle),
358 FindMaterial(material),FindRegion(reg));
359}
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 212 of file G4EmCalculator.cc.

216{
217 G4double res = 0.0;
218 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
219 if(nullptr != couple && UpdateParticle(p, 1.0*GeV)) {
220 res = manager->GetEnergy(p, range, couple);
221 if(verbose>0) {
222 G4cout << "G4EmCalculator::GetKinEnergy: Range(mm)= " << range/mm
223 << " KinE(MeV)= " << res/MeV
224 << " " << p->GetParticleName()
225 << " in " << mat->GetName()
226 << G4endl;
227 }
228 }
229 return res;
230}
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 regname = "world" 
)
inline

Definition at line 400 of file G4EmCalculator.hh.

402{
403 return GetKinEnergy(range,FindParticle(particle),
404 FindMaterial(material),FindRegion(reg));
405}
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 304 of file G4EmCalculator.cc.

309{
310 G4double res = DBL_MAX;
311 G4double x = GetCrossSectionPerVolume(kinEnergy,p, processName, mat,region);
312 if(x > 0.0) { res = 1.0/x; }
313 if(verbose>1) {
314 G4cout << "G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/MeV
315 << " MFP(mm)= " << res/mm
316 << " " << p->GetParticleName()
317 << " in " << mat->GetName()
318 << G4endl;
319 }
320 return res;
321}

Referenced by GetMeanFreePath().

◆ GetMeanFreePath() [2/2]

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

Definition at line 423 of file G4EmCalculator.hh.

428{
429 return GetMeanFreePath(kinEnergy,FindParticle(particle),processName,
430 FindMaterial(material),FindRegion(reg));
431}
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 196 of file G4EmCalculator.cc.

200{
201 G4double res = 0.0;
202 if(theParameters->BuildCSDARange()) {
203 res = GetCSDARange(kinEnergy, p, mat, region);
204 } else {
205 res = GetRangeFromRestricteDEDX(kinEnergy, p, mat, region);
206 }
207 return res;
208}
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 regname = "world" 
)
inline

Definition at line 388 of file G4EmCalculator.hh.

392{
393 return GetRange(kinEnergy,FindParticle(particle),
394 FindMaterial(material),FindRegion(reg));
395}
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 142 of file G4EmCalculator.cc.

146{
147 G4double res = 0.0;
148 const G4MaterialCutsCouple* couple = FindCouple(mat,region);
149 if(couple && UpdateParticle(p, kinEnergy)) {
150 res = manager->GetRangeFromRestricteDEDX(p, kinEnergy, couple);
151 if(verbose>1) {
152 G4cout << " G4EmCalculator::GetRangeFromRestrictedDEDX: E(MeV)= "
153 << kinEnergy/MeV
154 << " range(mm)= " << res/mm
155 << " " << p->GetParticleName()
156 << " in " << mat->GetName()
157 << G4endl;
158 }
159 }
160 return res;
161}
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 regname = "world" 
)
inline

Definition at line 364 of file G4EmCalculator.hh.

368{
369 return GetRangeFromRestricteDEDX(kinEnergy,FindParticle(particle),
370 FindMaterial(material),FindRegion(reg));
371}

◆ GetShellIonisationCrossSectionPerAtom()

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

Definition at line 287 of file G4EmCalculator.cc.

292{
293 G4double res = 0.0;
294 const G4ParticleDefinition* p = FindParticle(particle);
295 G4VAtomDeexcitation* ad = manager->AtomDeexcitation();
296 if(nullptr != p && nullptr != ad) {
297 res = ad->GetShellIonisationCrossSectionPerAtom(p, Z, shell, kinEnergy);
298 }
299 return res;
300}
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr)=0

◆ operator=()

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

◆ PrintDEDXTable()

void G4EmCalculator::PrintDEDXTable ( const G4ParticleDefinition p)

Definition at line 325 of file G4EmCalculator.cc.

326{
327 const G4VEnergyLossProcess* elp = manager->GetEnergyLossProcess(p);
328 G4cout << "##### DEDX Table for " << p->GetParticleName() << G4endl;
329 if(nullptr != elp) G4cout << *(elp->DEDXTable()) << G4endl;
330}
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
G4PhysicsTable * DEDXTable() const

◆ PrintInverseRangeTable()

void G4EmCalculator::PrintInverseRangeTable ( const G4ParticleDefinition p)

Definition at line 343 of file G4EmCalculator.cc.

344{
345 const G4VEnergyLossProcess* elp = manager->GetEnergyLossProcess(p);
346 G4cout << "### G4EmCalculator: Inverse Range Table for "
347 << p->GetParticleName() << G4endl;
348 if(nullptr != elp) G4cout << *(elp->InverseRangeTable()) << G4endl;
349}
G4PhysicsTable * InverseRangeTable() const

◆ PrintRangeTable()

void G4EmCalculator::PrintRangeTable ( const G4ParticleDefinition p)

Definition at line 334 of file G4EmCalculator.cc.

335{
336 const G4VEnergyLossProcess* elp = manager->GetEnergyLossProcess(p);
337 G4cout << "##### Range Table for " << p->GetParticleName() << G4endl;
338 if(nullptr != elp) G4cout << *(elp->RangeTableForLoss()) << G4endl;
339}
G4PhysicsTable * RangeTableForLoss() const

◆ SetApplySmoothing()

void G4EmCalculator::SetApplySmoothing ( G4int  val)
inline

Definition at line 558 of file G4EmCalculator.hh.

559{
560 applySmoothing = val;
561}

◆ SetupMaterial() [1/2]

void G4EmCalculator::SetupMaterial ( const G4Material mat)

Definition at line 1184 of file G4EmCalculator.cc.

1185{
1186 if(mat) {
1187 currentMaterial = mat;
1188 currentMaterialName = mat->GetName();
1189 } else {
1190 currentMaterial = nullptr;
1191 currentMaterialName = "";
1192 }
1193}

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

◆ SetupMaterial() [2/2]

void G4EmCalculator::SetupMaterial ( const G4String mname)

Definition at line 1197 of file G4EmCalculator.cc.

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

◆ SetVerbose()

void G4EmCalculator::SetVerbose ( G4int  val)

Definition at line 1223 of file G4EmCalculator.cc.

1224{
1225 verbose = verb;
1226}

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