Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LossTableManager Class Reference

#include <G4LossTableManager.hh>

Public Member Functions

 ~G4LossTableManager ()
 
void PreparePhysicsTable (const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
 
void PreparePhysicsTable (const G4ParticleDefinition *aParticle, G4VEmProcess *p, G4bool theMaster)
 
void PreparePhysicsTable (const G4ParticleDefinition *aParticle, G4VMultipleScattering *p, G4bool theMaster)
 
void BuildPhysicsTable (const G4ParticleDefinition *aParticle)
 
void BuildPhysicsTable (const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
 
void LocalPhysicsTables (const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
 
void DumpHtml ()
 
G4double GetDEDX (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetSubDEDX (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetRange (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetCSDARange (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetRangeFromRestricteDEDX (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetEnergy (const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
 
G4double GetDEDXDispersion (const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double &length)
 
void Register (G4VEnergyLossProcess *p)
 
void DeRegister (G4VEnergyLossProcess *p)
 
void Register (G4VMultipleScattering *p)
 
void DeRegister (G4VMultipleScattering *p)
 
void Register (G4VEmProcess *p)
 
void DeRegister (G4VEmProcess *p)
 
void Register (G4VProcess *p)
 
void DeRegister (G4VProcess *p)
 
void Register (G4VEmModel *p)
 
void DeRegister (G4VEmModel *p)
 
void Register (G4VEmFluctuationModel *p)
 
void DeRegister (G4VEmFluctuationModel *p)
 
void RegisterExtraParticle (const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
 
void SetVerbose (G4int val)
 
void ResetParameters ()
 
void SetAtomDeexcitation (G4VAtomDeexcitation *)
 
void SetSubCutProducer (G4VSubCutProducer *)
 
void SetNIELCalculator (G4NIELCalculator *)
 
G4bool IsMaster () const
 
G4VEnergyLossProcessGetEnergyLossProcess (const G4ParticleDefinition *)
 
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector ()
 
const std::vector< G4VEmProcess * > & GetEmProcessVector ()
 
const std::vector< G4VMultipleScattering * > & GetMultipleScatteringVector ()
 
G4EmSaturationEmSaturation ()
 
G4EmConfiguratorEmConfigurator ()
 
G4ElectronIonPairElectronIonPair ()
 
G4NIELCalculatorNIELCalculator ()
 
G4EmCorrectionsEmCorrections ()
 
G4VAtomDeexcitationAtomDeexcitation ()
 
G4VSubCutProducerSubCutProducer ()
 
G4LossTableBuilderGetTableBuilder ()
 
void SetGammaGeneralProcess (G4VEmProcess *)
 
G4VEmProcessGetGammaGeneralProcess ()
 
void SetElectronGeneralProcess (G4VEmProcess *)
 
G4VEmProcessGetElectronGeneralProcess ()
 
void SetPositronGeneralProcess (G4VEmProcess *)
 
G4VEmProcessGetPositronGeneralProcess ()
 

Static Public Member Functions

static G4LossTableManagerInstance ()
 

Friends

class G4ThreadLocalSingleton< G4LossTableManager >
 

Detailed Description

Definition at line 76 of file G4LossTableManager.hh.

Constructor & Destructor Documentation

◆ ~G4LossTableManager()

G4LossTableManager::~G4LossTableManager ( )

Definition at line 98 of file G4LossTableManager.cc.

99{
100 for (G4int i=0; i<n_loss; ++i) {
101 delete loss_vector[i];
102 }
103 size_t msc = msc_vector.size();
104 for (size_t j=0; j<msc; ++j) {
105 delete msc_vector[j];
106 }
107 size_t emp = emp_vector.size();
108 for (size_t k=0; k<emp; ++k) {
109 delete emp_vector[k];
110 }
111 emp = p_vector.size();
112 for (size_t k=0; k<emp; ++k) {
113 delete p_vector[k];
114 }
115 size_t mod = mod_vector.size();
116 size_t fmod = fmod_vector.size();
117 //G4cout << " Nmod" << mod << " Nfluc= " << fmod << G4endl;
118 for (size_t a=0; a<mod; ++a) {
119 //G4cout << "Delete model #" << a << " " << mod_vector[a] << G4endl;
120 if( nullptr != mod_vector[a] ) {
121 for (size_t b=0; b<fmod; ++b) {
122 if((G4VEmModel*)(fmod_vector[b]) == mod_vector[a]) {
123 fmod_vector[b] = nullptr;
124 }
125 }
126 delete mod_vector[a];
127 mod_vector[a] = nullptr;
128 }
129 }
130 for (size_t b=0; b<fmod; ++b) {
131 delete fmod_vector[b];
132 }
133 Clear();
134 delete tableBuilder;
135 delete emCorrections;
136 delete emConfigurator;
137 delete emElectronIonPair;
138 delete nielCalculator;
139 delete atomDeexcitation;
140 delete subcutProducer;
141}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ AtomDeexcitation()

◆ BuildPhysicsTable() [1/2]

void G4LossTableManager::BuildPhysicsTable ( const G4ParticleDefinition aParticle)

Definition at line 537 of file G4LossTableManager.cc.

538{
539 if(-1 == run && startInitialisation) {
540 if(emConfigurator) { emConfigurator->Clear(); }
541 }
542}

Referenced by G4VEnergyLossProcess::BuildPhysicsTable(), and G4VMultipleScattering::BuildPhysicsTable().

◆ BuildPhysicsTable() [2/2]

void G4LossTableManager::BuildPhysicsTable ( const G4ParticleDefinition aParticle,
G4VEnergyLossProcess p 
)

Definition at line 626 of file G4LossTableManager.cc.

629{
630 if(1 < verbose) {
631 G4cout << "### G4LossTableManager::BuildPhysicsTable() for "
632 << aParticle->GetParticleName()
633 << " and process " << p->GetProcessName() << G4endl;
634 }
635 // clear configurator
636 if(-1 == run && startInitialisation) {
637 if(emConfigurator) { emConfigurator->Clear(); }
638 firstParticle = aParticle;
639 }
640 if(startInitialisation) {
641 ++run;
642 if(1 < verbose) {
643 G4cout << "===== G4LossTableManager::BuildPhysicsTable() for run "
644 << run << " ===== " << atomDeexcitation << G4endl;
645 }
646 currentParticle = nullptr;
647 all_tables_are_built= true;
648 }
649
650 // initialisation before any table is built
651 if ( startInitialisation && aParticle == firstParticle ) {
652
653 startInitialisation = false;
654 if(1 < verbose) {
655 G4cout << "### G4LossTableManager start initialisation for first particle "
656 << firstParticle->GetParticleName()
657 << G4endl;
658 }
659
660 if(nielCalculator) { nielCalculator->Initialise(); }
661
662 for (G4int i=0; i<n_loss; ++i) {
663 G4VEnergyLossProcess* el = loss_vector[i];
664
665 if(el) {
666 isActive[i] = true;
667 base_part_vector[i] = el->BaseParticle();
668 tables_are_built[i] = false;
669 all_tables_are_built= false;
670 if(!isActive[i]) {
671 el->SetIonisation(false);
672 tables_are_built[i] = true;
673 }
674
675 if(1 < verbose) {
676 G4cout << i <<". "<< el->GetProcessName();
677 if(el->Particle()) {
678 G4cout << " for " << el->Particle()->GetParticleName();
679 }
680 G4cout << " active= " << isActive[i]
681 << " table= " << tables_are_built[i]
682 << " isIonisation= " << el->IsIonisationProcess();
683 if(base_part_vector[i]) {
684 G4cout << " base particle "
685 << base_part_vector[i]->GetParticleName();
686 }
687 G4cout << G4endl;
688 }
689 } else {
690 tables_are_built[i] = true;
691 part_vector[i] = nullptr;
692 isActive[i] = false;
693 }
694 }
695 }
696
697 if (all_tables_are_built) { return; }
698
699 // Build tables for given particle
700 all_tables_are_built = true;
701
702 for(G4int i=0; i<n_loss; ++i) {
703 if(p == loss_vector[i] && !tables_are_built[i] && !base_part_vector[i]) {
704 const G4ParticleDefinition* curr_part = part_vector[i];
705 if(1 < verbose) {
706 G4cout << "### Build Table for " << p->GetProcessName()
707 << " and " << curr_part->GetParticleName()
708 << " " << tables_are_built[i] << " " << base_part_vector[i]
709 << G4endl;
710 }
711 G4VEnergyLossProcess* curr_proc = BuildTables(curr_part);
712 if(curr_proc) {
713 CopyTables(curr_part, curr_proc);
714 if(p == curr_proc && 0 == run && p->IsIonisationProcess()) {
715 loss_map[aParticle] = p;
716 //G4cout << "G4LossTableManager::BuildPhysicsTable: "
717 // << aParticle->GetParticleName()
718 // << " added to map " << p << G4endl;
719 }
720 }
721 }
722 if ( !tables_are_built[i] ) { all_tables_are_built = false; }
723 }
724 if(1 < verbose) {
725 G4cout << "### G4LossTableManager::BuildPhysicsTable end: "
726 << "all_tables_are_built= " << all_tables_are_built << " "
727 << aParticle->GetParticleName() << " proc: " << p << G4endl;
728 }
729 if(all_tables_are_built) {
730 if(1 < verbose) {
731 G4cout << "%%%%% All dEdx and Range tables are built for master run= "
732 << run << " %%%%%" << G4endl;
733 }
734 }
735}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4String & GetParticleName() const
const G4ParticleDefinition * BaseParticle() const
const G4ParticleDefinition * Particle() const
G4bool IsIonisationProcess() const
void SetIonisation(G4bool val)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382

◆ DeRegister() [1/6]

void G4LossTableManager::DeRegister ( G4VEmFluctuationModel p)

Definition at line 379 of file G4LossTableManager.cc.

380{
381 size_t n = fmod_vector.size();
382 for (size_t i=0; i<n; ++i) {
383 if(fmod_vector[i] == p) { fmod_vector[i] = nullptr; }
384 }
385}

◆ DeRegister() [2/6]

void G4LossTableManager::DeRegister ( G4VEmModel p)

Definition at line 354 of file G4LossTableManager.cc.

355{
356 //G4cout << "G4LossTableManager::DeRegister G4VEmModel : " << p << G4endl;
357 size_t n = mod_vector.size();
358 for (size_t i=0; i<n; ++i) {
359 if(mod_vector[i] == p) {
360 mod_vector[i] = nullptr;
361 break;
362 }
363 }
364}

◆ DeRegister() [3/6]

void G4LossTableManager::DeRegister ( G4VEmProcess p)

Definition at line 299 of file G4LossTableManager.cc.

300{
301 if(!p) { return; }
302 size_t emp = emp_vector.size();
303 for (size_t i=0; i<emp; ++i) {
304 if(emp_vector[i] == p) {
305 emp_vector[i] = nullptr;
306 break;
307 }
308 }
309}

◆ DeRegister() [4/6]

◆ DeRegister() [5/6]

void G4LossTableManager::DeRegister ( G4VMultipleScattering p)

Definition at line 269 of file G4LossTableManager.cc.

270{
271 if(!p) { return; }
272 size_t msc = msc_vector.size();
273 for (size_t i=0; i<msc; ++i) {
274 if(msc_vector[i] == p) {
275 msc_vector[i] = nullptr;
276 break;
277 }
278 }
279}

◆ DeRegister() [6/6]

void G4LossTableManager::DeRegister ( G4VProcess p)

Definition at line 329 of file G4LossTableManager.cc.

330{
331 if(!p) { return; }
332 size_t emp = p_vector.size();
333 for (size_t i=0; i<emp; ++i) {
334 if(p_vector[i] == p) {
335 p_vector[i] = nullptr;
336 break;
337 }
338 }
339}

◆ DumpHtml()

void G4LossTableManager::DumpHtml ( )

Definition at line 1093 of file G4LossTableManager.cc.

1094{
1095 // Automatic generation of html documentation page for physics lists
1096 // List processes and models for the most important
1097 // particles in descending order of importance
1098 // NB. for model names with length > 18 characters the .rst file needs
1099 // to be edited by hand. Or modify G4EmModelManager::DumpModelList
1100
1101 char* dirName = std::getenv("G4PhysListDocDir");
1102 char* physList = std::getenv("G4PhysListName");
1103 if (dirName && physList) {
1104 G4String physListName = G4String(physList);
1105 G4String pathName = G4String(dirName) + "/" + physListName + ".rst";
1106
1107 std::ofstream outFile;
1108 outFile.open(pathName);
1109
1110 outFile << physListName << G4endl;
1111 outFile << std::string(physListName.length(), '=') << G4endl;
1112
1113 std::vector<G4ParticleDefinition*> particles {
1120 };
1121
1122 std::vector<G4VEmProcess*> emproc_vector = GetEmProcessVector();
1123 std::vector<G4VEnergyLossProcess*> enloss_vector =
1125 std::vector<G4VMultipleScattering*> mscat_vector =
1127
1128 for (auto theParticle : particles) {
1129 outFile << G4endl << "**" << theParticle->GetParticleName()
1130 << "**" << G4endl << G4endl << " .. code-block:: none" << G4endl;
1131
1132 G4ProcessManager* pm = theParticle->GetProcessManager();
1133 G4ProcessVector* pv = pm->GetProcessList();
1134 G4int plen = pm->GetProcessListLength();
1135
1136 for (auto emproc : emproc_vector) {
1137 for (G4int i = 0; i < plen; ++i) {
1138 G4VProcess* proc = (*pv)[i];
1139 if (proc == emproc) {
1140 outFile << G4endl;
1141 proc->ProcessDescription(outFile);
1142 break;
1143 }
1144 }
1145 }
1146
1147 for (auto mscproc : mscat_vector) {
1148 for (G4int i = 0; i < plen; ++i) {
1149 G4VProcess* proc = (*pv)[i];
1150 if (proc == mscproc) {
1151 outFile << G4endl;
1152 proc->ProcessDescription(outFile);
1153 break;
1154 }
1155 }
1156 }
1157
1158 for (auto enlossproc : enloss_vector) {
1159 for (G4int i = 0; i < plen; ++i) {
1160 G4VProcess* proc = (*pv)[i];
1161 if (proc == enlossproc) {
1162 outFile << G4endl;
1163 proc->ProcessDescription(outFile);
1164 break;
1165 }
1166 }
1167 }
1168 }
1169 outFile.close();
1170 }
1171}
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
const std::vector< G4VEmProcess * > & GetEmProcessVector()
const std::vector< G4VMultipleScattering * > & GetMultipleScatteringVector()
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:94
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:93
static G4Positron * Positron()
Definition: G4Positron.cc:93
G4int GetProcessListLength() const
G4ProcessVector * GetProcessList() const
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:87
virtual void ProcessDescription(std::ostream &outfile) const
Definition: G4VProcess.cc:175

◆ ElectronIonPair()

G4ElectronIonPair * G4LossTableManager::ElectronIonPair ( )

Definition at line 1026 of file G4LossTableManager.cc.

1027{
1028 if(!emElectronIonPair) {
1029 emElectronIonPair = new G4ElectronIonPair(verbose);
1030 }
1031 return emElectronIonPair;
1032}

◆ EmConfigurator()

G4EmConfigurator * G4LossTableManager::EmConfigurator ( )

Definition at line 1016 of file G4LossTableManager.cc.

1017{
1018 if(!emConfigurator) {
1019 emConfigurator = new G4EmConfigurator(verbose);
1020 }
1021 return emConfigurator;
1022}

Referenced by G4EmLivermorePolarizedPhysics::ConstructProcess().

◆ EmCorrections()

◆ EmSaturation()

G4EmSaturation * G4LossTableManager::EmSaturation ( )

Definition at line 1009 of file G4LossTableManager.cc.

1010{
1011 return theParameters->GetEmSaturation();
1012}
G4EmSaturation * GetEmSaturation()

Referenced by G4OpticalPhysics::ConstructProcess().

◆ GetCSDARange()

G4double G4LossTableManager::GetCSDARange ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 333 of file G4LossTableManager.hh.

336{
337 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
338 return currentLoss ? currentLoss->GetCSDARange(kineticEnergy, couple) : DBL_MAX;
339}
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
G4double GetCSDARange(G4double kineticEnergy, const G4MaterialCutsCouple *)
#define DBL_MAX
Definition: templates.hh:62

Referenced by G4EmCalculator::GetCSDARange().

◆ GetDEDX()

G4double G4LossTableManager::GetDEDX ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 311 of file G4LossTableManager.hh.

314{
315 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
316 return currentLoss ? currentLoss->GetDEDX(kineticEnergy, couple) : 0.0;
317}
G4double GetDEDX(G4double kineticEnergy, const G4MaterialCutsCouple *)

Referenced by G4EnergyLossTables::GetDEDX(), G4EmCalculator::GetDEDX(), G4EnergyLossTables::GetPreciseDEDX(), G4EnergyLossTables::GetPreciseRangeFromEnergy(), and G4Cerenkov::PostStepGetPhysicalInteractionLength().

◆ GetDEDXDispersion()

G4double G4LossTableManager::GetDEDXDispersion ( const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double length 
)
inline

Definition at line 378 of file G4LossTableManager.hh.

382{
383 const G4ParticleDefinition* aParticle = dp->GetParticleDefinition();
384 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
385 return currentLoss ? currentLoss->GetDEDXDispersion(couple, dp, length) : 0.0;
386}
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)

◆ GetElectronGeneralProcess()

G4VEmProcess * G4LossTableManager::GetElectronGeneralProcess ( )
inline

Definition at line 446 of file G4LossTableManager.hh.

447{
448 return eGeneral;
449}

◆ GetEmProcessVector()

const std::vector< G4VEmProcess * > & G4LossTableManager::GetEmProcessVector ( )

Definition at line 994 of file G4LossTableManager.cc.

995{
996 return emp_vector;
997}

Referenced by DumpHtml().

◆ GetEnergy()

G4double G4LossTableManager::GetEnergy ( const G4ParticleDefinition aParticle,
G4double  range,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 367 of file G4LossTableManager.hh.

370{
371 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
372 return currentLoss ? currentLoss->GetKineticEnergy(range, couple) : 0.0;
373}
G4double GetKineticEnergy(G4double range, const G4MaterialCutsCouple *)

Referenced by G4EmCalculator::GetKinEnergy(), and G4EnergyLossTables::GetPreciseEnergyFromRange().

◆ GetEnergyLossProcess()

G4VEnergyLossProcess * G4LossTableManager::GetEnergyLossProcess ( const G4ParticleDefinition aParticle)

Definition at line 416 of file G4LossTableManager.cc.

417{
418 //G4cout << "G4LossTableManager::GetEnergyLossProcess: "
419 //<< aParticle << " " << currentParticle << " " << currentLoss << G4endl;
420 if(aParticle != currentParticle) {
421 currentParticle = aParticle;
422 std::map<PD,G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos;
423 if ((pos = loss_map.find(aParticle)) != loss_map.end()) {
424 currentLoss = (*pos).second;
425 } else {
426 currentLoss = nullptr;
427 if ((pos = loss_map.find(theGenericIon)) != loss_map.end()) {
428 currentLoss = (*pos).second;
429 }
430 }
431 }
432 return currentLoss;
433}

Referenced by GetCSDARange(), GetDEDX(), GetDEDXDispersion(), GetEnergy(), GetRange(), GetRangeFromRestricteDEDX(), GetSubDEDX(), and G4VMultipleScattering::StartTracking().

◆ GetEnergyLossProcessVector()

const std::vector< G4VEnergyLossProcess * > & G4LossTableManager::GetEnergyLossProcessVector ( )

Definition at line 987 of file G4LossTableManager.cc.

988{
989 return loss_vector;
990}

Referenced by G4EmCalculator::ComputeDEDXForCutInRange(), G4EmCalculator::ComputeElectronicDEDX(), and DumpHtml().

◆ GetGammaGeneralProcess()

G4VEmProcess * G4LossTableManager::GetGammaGeneralProcess ( )
inline

Definition at line 432 of file G4LossTableManager.hh.

433{
434 return gGeneral;
435}

Referenced by G4BertiniElectroNuclearBuilder::Build(), and G4EmExtraPhysics::ConstructProcess().

◆ GetMultipleScatteringVector()

const std::vector< G4VMultipleScattering * > & G4LossTableManager::GetMultipleScatteringVector ( )

Definition at line 1002 of file G4LossTableManager.cc.

1003{
1004 return msc_vector;
1005}

Referenced by DumpHtml().

◆ GetPositronGeneralProcess()

G4VEmProcess * G4LossTableManager::GetPositronGeneralProcess ( )
inline

Definition at line 460 of file G4LossTableManager.hh.

461{
462 return pGeneral;
463}

◆ GetRange()

G4double G4LossTableManager::GetRange ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 356 of file G4LossTableManager.hh.

359{
360 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
361 return currentLoss ? currentLoss->GetRange(kineticEnergy, couple) : DBL_MAX;
362}
G4double GetRange(G4double kineticEnergy, const G4MaterialCutsCouple *)

Referenced by G4ITStepProcessor::ApplyProductionCut(), G4EnergyLossTables::GetRange(), G4Cerenkov::PostStepGetPhysicalInteractionLength(), G4UserSpecialCuts::PostStepGetPhysicalInteractionLength(), and G4EmSaturation::VisibleEnergyDeposition().

◆ GetRangeFromRestricteDEDX()

G4double G4LossTableManager::GetRangeFromRestricteDEDX ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 344 of file G4LossTableManager.hh.

348{
349 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
350 return currentLoss ? currentLoss->GetRangeForLoss(kineticEnergy, couple) : DBL_MAX;
351}
G4double GetRangeForLoss(G4double kineticEnergy, const G4MaterialCutsCouple *)

Referenced by G4EmCalculator::GetRangeFromRestricteDEDX().

◆ GetSubDEDX()

G4double G4LossTableManager::GetSubDEDX ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 322 of file G4LossTableManager.hh.

325{
326 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
327 return currentLoss ? currentLoss->GetDEDXForSubsec(kineticEnergy, couple) : 0.0;
328}
G4double GetDEDXForSubsec(G4double kineticEnergy, const G4MaterialCutsCouple *)

◆ GetTableBuilder()

◆ Instance()

G4LossTableManager * G4LossTableManager::Instance ( )
static

Definition at line 87 of file G4LossTableManager.cc.

88{
89 if(!instance) {
91 instance = inst.Instance();
92 }
93 return instance;
94}

Referenced by G4ITStepProcessor::ApplyProductionCut(), G4BertiniElectroNuclearBuilder::Build(), G4EmCalculator::ComputeDEDXForCutInRange(), G4EmCalculator::ComputeElectronicDEDX(), LBE::ConstructGeneral(), G4EmDNAPhysics::ConstructProcess(), G4EmDNAPhysics_option1::ConstructProcess(), G4EmDNAPhysics_option2::ConstructProcess(), G4EmDNAPhysics_option3::ConstructProcess(), G4EmDNAPhysics_option4::ConstructProcess(), G4EmDNAPhysics_option5::ConstructProcess(), G4EmDNAPhysics_option6::ConstructProcess(), G4EmDNAPhysics_option7::ConstructProcess(), G4EmDNAPhysics_option8::ConstructProcess(), G4EmDNAPhysics_stationary::ConstructProcess(), G4EmDNAPhysics_stationary_option2::ConstructProcess(), G4EmDNAPhysics_stationary_option4::ConstructProcess(), G4EmDNAPhysics_stationary_option6::ConstructProcess(), G4OpticalPhysics::ConstructProcess(), G4EmExtraPhysics::ConstructProcess(), G4RadioactiveDecayPhysics::ConstructProcess(), G4EmDNAPhysicsActivator::ConstructProcess(), G4EmLivermorePolarizedPhysics::ConstructProcess(), G4EmStandardPhysics::ConstructProcess(), G4EmStandardPhysics_option1::ConstructProcess(), G4EmStandardPhysics_option2::ConstructProcess(), G4EmStandardPhysics_option3::ConstructProcess(), G4EmStandardPhysics_option4::ConstructProcess(), G4ECDecay::DecayIt(), G4ITDecay::DecayIt(), G4AnnihiToMuPair::G4AnnihiToMuPair(), G4AtimaEnergyLossModel::G4AtimaEnergyLossModel(), G4BetheBlochModel::G4BetheBlochModel(), G4BraggModel::G4BraggModel(), G4EmCalculator::G4EmCalculator(), G4GammaConversionToMuons::G4GammaConversionToMuons(), G4GoudsmitSaundersonMscModel::G4GoudsmitSaundersonMscModel(), G4ionIonisation::G4ionIonisation(), G4IonParametrisedLossModel::G4IonParametrisedLossModel(), G4LindhardSorensenIonModel::G4LindhardSorensenIonModel(), G4MuBetheBlochModel::G4MuBetheBlochModel(), G4NIELCalculator::G4NIELCalculator(), G4SynchrotronRadiation::G4SynchrotronRadiation(), G4UAtomicDeexcitation::G4UAtomicDeexcitation(), G4UrbanAdjointMscModel::G4UrbanAdjointMscModel(), G4UrbanMscModel::G4UrbanMscModel(), G4UserSpecialCuts::G4UserSpecialCuts(), G4VEmFluctuationModel::G4VEmFluctuationModel(), G4VEmModel::G4VEmModel(), G4VEmProcess::G4VEmProcess(), G4VEnergyLossProcess::G4VEnergyLossProcess(), G4VMultipleScattering::G4VMultipleScattering(), G4VTransitionRadiation::G4VTransitionRadiation(), G4EnergyLossTables::GetDEDX(), G4VMscModel::GetParticleChangeForMSC(), G4EnergyLossTables::GetPreciseDEDX(), G4EnergyLossTables::GetPreciseEnergyFromRange(), G4EnergyLossTables::GetPreciseRangeFromEnergy(), G4EnergyLossTables::GetRange(), G4DNARuddIonisationExtendedModel::Initialise(), G4DNARuddIonisationModel::Initialise(), G4LivermoreComptonModel::Initialise(), G4LivermoreComptonModifiedModel::Initialise(), G4LivermorePhotoElectricModel::Initialise(), G4LivermorePolarizedComptonModel::Initialise(), G4LivermorePolarizedPhotoElectricGDModel::Initialise(), G4LivermorePolarizedPhotoElectricModel::Initialise(), G4LowEPComptonModel::Initialise(), G4LowEPPolarizedComptonModel::Initialise(), G4MicroElecInelasticModel::Initialise(), G4PenelopeComptonModel::Initialise(), G4PenelopeIonisationModel::Initialise(), G4PenelopePhotoElectricModel::Initialise(), G4MicroElecInelasticModel_new::Initialise(), G4BraggIonModel::Initialise(), G4KleinNishinaModel::Initialise(), G4PEEffectFluoModel::Initialise(), G4DNABornIonisationModel1::Initialise(), G4DNABornIonisationModel2::Initialise(), G4DNACPA100IonisationModel::Initialise(), G4DNAEmfietzoglouIonisationModel::Initialise(), G4Cerenkov::PostStepGetPhysicalInteractionLength(), G4EmBuilder::PrepareEMPhysics(), G4EmSaturation::VisibleEnergyDeposition(), and G4AnnihiToMuPair::~G4AnnihiToMuPair().

◆ IsMaster()

◆ LocalPhysicsTables()

void G4LossTableManager::LocalPhysicsTables ( const G4ParticleDefinition aParticle,
G4VEnergyLossProcess p 
)

Definition at line 546 of file G4LossTableManager.cc.

549{
550 if(1 < verbose) {
551 G4cout << "### G4LossTableManager::LocalPhysicsTable() for "
552 << aParticle->GetParticleName()
553 << " and process " << p->GetProcessName()
554 << G4endl;
555 }
556
557 if(-1 == run && startInitialisation) {
558 if(emConfigurator) { emConfigurator->Clear(); }
559 firstParticle = aParticle;
560 }
561
562 if(startInitialisation) {
563 ++run;
564 if(1 < verbose) {
565 G4cout << "===== G4LossTableManager::LocalPhysicsTable() for run "
566 << run << " =====" << G4endl;
567 }
568 currentParticle = nullptr;
569 startInitialisation = false;
570 for (G4int i=0; i<n_loss; ++i) {
571 if(loss_vector[i]) {
572 tables_are_built[i] = false;
573 } else {
574 tables_are_built[i] = true;
575 part_vector[i] = nullptr;
576 }
577 }
578 }
579
580 all_tables_are_built= true;
581 for (G4int i=0; i<n_loss; ++i) {
582 if(p == loss_vector[i]) {
583 tables_are_built[i] = true;
584 isActive[i] = true;
585 part_vector[i] = p->Particle();
586 base_part_vector[i] = p->BaseParticle();
587 dedx_vector[i] = p->DEDXTable();
588 range_vector[i] = p->RangeTableForLoss();
589 inv_range_vector[i] = p->InverseRangeTable();
590 if(0 == run && p->IsIonisationProcess()) {
591 loss_map[part_vector[i]] = p;
592 //G4cout << "G4LossTableManager::LocalPhysicsTable " << part_vector[i]->GetParticleName()
593 // << " added to map " << p << G4endl;
594 }
595
596 if(1 < verbose) {
597 G4cout << i <<". "<< p->GetProcessName();
598 if(part_vector[i]) {
599 G4cout << " for " << part_vector[i]->GetParticleName();
600 }
601 G4cout << " active= " << isActive[i]
602 << " table= " << tables_are_built[i]
603 << " isIonisation= " << p->IsIonisationProcess()
604 << G4endl;
605 }
606 break;
607 } else if(!tables_are_built[i]) {
608 all_tables_are_built = false;
609 }
610 }
611
612 if(1 < verbose) {
613 G4cout << "### G4LossTableManager::LocalPhysicsTable end"
614 << G4endl;
615 }
616 if(all_tables_are_built) {
617 if(1 < verbose) {
618 G4cout << "%%%%% All dEdx and Range tables for worker are ready for run "
619 << run << " %%%%%" << G4endl;
620 }
621 }
622}
G4PhysicsTable * RangeTableForLoss() const
G4PhysicsTable * InverseRangeTable() const
G4PhysicsTable * DEDXTable() const

Referenced by G4VEnergyLossProcess::BuildPhysicsTable().

◆ NIELCalculator()

G4NIELCalculator * G4LossTableManager::NIELCalculator ( )

Definition at line 1046 of file G4LossTableManager.cc.

1047{
1048 if(!nielCalculator) {
1049 nielCalculator = new G4NIELCalculator(nullptr, verbose);
1050 }
1051 return nielCalculator;
1052}

◆ PreparePhysicsTable() [1/3]

void G4LossTableManager::PreparePhysicsTable ( const G4ParticleDefinition aParticle,
G4VEmProcess p,
G4bool  theMaster 
)

Definition at line 479 of file G4LossTableManager.cc.

481{
482 if (1 < verbose) {
483 G4cout << "G4LossTableManager::PreparePhysicsTable for "
484 << particle->GetParticleName()
485 << " and " << p->GetProcessName() << G4endl;
486 }
487 isMaster = theMaster;
488
489 if(!startInitialisation) {
491 if (1 < verbose) {
492 G4cout << "====== G4LossTableManager::PreparePhysicsTable start ====="
493 << G4endl;
494 }
495 }
496
497 // start initialisation for the first run
498 if( -1 == run ) {
499 if(emConfigurator) { emConfigurator->PrepareModels(particle, p); }
500 }
501 startInitialisation = true;
502}
void PrepareModels(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)

◆ PreparePhysicsTable() [2/3]

void G4LossTableManager::PreparePhysicsTable ( const G4ParticleDefinition aParticle,
G4VEnergyLossProcess p,
G4bool  theMaster 
)

Definition at line 438 of file G4LossTableManager.cc.

441{
442 if (1 < verbose) {
443 G4cout << "G4LossTableManager::PreparePhysicsTable for "
444 << particle->GetParticleName()
445 << " and " << p->GetProcessName() << " run= " << run
446 << " loss_vector " << loss_vector.size() << G4endl;
447 }
448
449 isMaster = theMaster;
450
451 if(!startInitialisation) {
453 if (1 < verbose) {
454 G4cout << "====== G4LossTableManager::PreparePhysicsTable start ====="
455 << G4endl;
456 }
457 }
458
459 // start initialisation for the first run
460 if( -1 == run ) {
461 if(emConfigurator) { emConfigurator->PrepareModels(particle, p); }
462
463 // initialise particles for given process
464 for (G4int j=0; j<n_loss; ++j) {
465 if (p == loss_vector[j] && !part_vector[j]) {
466 part_vector[j] = particle;
467 if(particle->GetParticleName() == "GenericIon") {
468 theGenericIon = particle;
469 }
470 }
471 }
472 }
473 startInitialisation = true;
474}

Referenced by G4VEmProcess::PreparePhysicsTable(), G4VEnergyLossProcess::PreparePhysicsTable(), and G4VMultipleScattering::PreparePhysicsTable().

◆ PreparePhysicsTable() [3/3]

void G4LossTableManager::PreparePhysicsTable ( const G4ParticleDefinition aParticle,
G4VMultipleScattering p,
G4bool  theMaster 
)

Definition at line 507 of file G4LossTableManager.cc.

510{
511 if (1 < verbose) {
512 G4cout << "G4LossTableManager::PreparePhysicsTable for "
513 << particle->GetParticleName()
514 << " and " << p->GetProcessName() << G4endl;
515 }
516
517 isMaster = theMaster;
518
519 if(!startInitialisation) {
521 if (1 < verbose) {
522 G4cout << "====== G4LossTableManager::PreparePhysicsTable start ====="
523 << G4endl;
524 }
525 }
526
527 // start initialisation for the first run
528 if( -1 == run ) {
529 if(emConfigurator) { emConfigurator->PrepareModels(particle, p); }
530 }
531 startInitialisation = true;
532}

◆ Register() [1/6]

void G4LossTableManager::Register ( G4VEmFluctuationModel p)

Definition at line 368 of file G4LossTableManager.cc.

369{
370 fmod_vector.push_back(p);
371 if(verbose > 1) {
372 G4cout << "G4LossTableManager::Register G4VEmFluctuationModel : "
373 << p->GetName() << " " << fmod_vector.size() << G4endl;
374 }
375}
const G4String & GetName() const

◆ Register() [2/6]

void G4LossTableManager::Register ( G4VEmModel p)

Definition at line 343 of file G4LossTableManager.cc.

344{
345 mod_vector.push_back(p);
346 if(verbose > 1) {
347 G4cout << "G4LossTableManager::Register G4VEmModel : "
348 << p->GetName() << " " << p << " " << mod_vector.size() << G4endl;
349 }
350}
const G4String & GetName() const
Definition: G4VEmModel.hh:827

◆ Register() [3/6]

void G4LossTableManager::Register ( G4VEmProcess p)

Definition at line 283 of file G4LossTableManager.cc.

284{
285 if(!p) { return; }
286 G4int n = emp_vector.size();
287 for (G4int i=0; i<n; ++i) {
288 if(emp_vector[i] == p) { return; }
289 }
290 if(verbose > 1) {
291 G4cout << "G4LossTableManager::Register G4VEmProcess : "
292 << p->GetProcessName() << " idx= " << emp_vector.size() << G4endl;
293 }
294 emp_vector.push_back(p);
295}

◆ Register() [4/6]

void G4LossTableManager::Register ( G4VEnergyLossProcess p)

Definition at line 197 of file G4LossTableManager.cc.

198{
199 if(!p) { return; }
200 for (G4int i=0; i<n_loss; ++i) {
201 if(loss_vector[i] == p) { return; }
202 }
203 if(verbose > 1) {
204 G4cout << "G4LossTableManager::Register G4VEnergyLossProcess : "
205 << p->GetProcessName() << " idx= " << n_loss << G4endl;
206 }
207 ++n_loss;
208 loss_vector.push_back(p);
209 part_vector.push_back(nullptr);
210 base_part_vector.push_back(nullptr);
211 dedx_vector.push_back(nullptr);
212 range_vector.push_back(nullptr);
213 inv_range_vector.push_back(nullptr);
214 tables_are_built.push_back(false);
215 isActive.push_back(true);
216 all_tables_are_built = false;
217}

Referenced by G4AnnihiToMuPair::G4AnnihiToMuPair(), G4GammaConversionToMuons::G4GammaConversionToMuons(), G4SynchrotronRadiation::G4SynchrotronRadiation(), G4VEmFluctuationModel::G4VEmFluctuationModel(), G4VEmModel::G4VEmModel(), G4VEmProcess::G4VEmProcess(), G4VEnergyLossProcess::G4VEnergyLossProcess(), G4VMultipleScattering::G4VMultipleScattering(), and G4VTransitionRadiation::G4VTransitionRadiation().

◆ Register() [5/6]

void G4LossTableManager::Register ( G4VMultipleScattering p)

Definition at line 253 of file G4LossTableManager.cc.

254{
255 if(!p) { return; }
256 G4int n = msc_vector.size();
257 for (G4int i=0; i<n; ++i) {
258 if(msc_vector[i] == p) { return; }
259 }
260 if(verbose > 1) {
261 G4cout << "G4LossTableManager::Register G4VMultipleScattering : "
262 << p->GetProcessName() << " idx= " << msc_vector.size() << G4endl;
263 }
264 msc_vector.push_back(p);
265}

◆ Register() [6/6]

void G4LossTableManager::Register ( G4VProcess p)

Definition at line 313 of file G4LossTableManager.cc.

314{
315 if(!p) { return; }
316 G4int n = p_vector.size();
317 for (G4int i=0; i<n; ++i) {
318 if(p_vector[i] == p) { return; }
319 }
320 if(verbose > 1) {
321 G4cout << "G4LossTableManager::Register G4VProcess : "
322 << p->GetProcessName() << " idx= " << p_vector.size() << G4endl;
323 }
324 p_vector.push_back(p);
325}

◆ RegisterExtraParticle()

void G4LossTableManager::RegisterExtraParticle ( const G4ParticleDefinition aParticle,
G4VEnergyLossProcess p 
)

Definition at line 389 of file G4LossTableManager.cc.

392{
393 if(!p || !part) { return; }
394 for (G4int i=0; i<n_loss; ++i) {
395 if(loss_vector[i] == p) { return; }
396 }
397 if(verbose > 1) {
398 G4cout << "G4LossTableManager::RegisterExtraParticle "
399 << part->GetParticleName() << " G4VEnergyLossProcess : "
400 << p->GetProcessName() << " idx= " << n_loss << G4endl;
401 }
402 ++n_loss;
403 loss_vector.push_back(p);
404 part_vector.push_back(part);
405 base_part_vector.push_back(p->BaseParticle());
406 dedx_vector.push_back(nullptr);
407 range_vector.push_back(nullptr);
408 inv_range_vector.push_back(nullptr);
409 tables_are_built.push_back(false);
410 all_tables_are_built = false;
411}

Referenced by G4VEnergyLossProcess::PreparePhysicsTable().

◆ ResetParameters()

void G4LossTableManager::ResetParameters ( )

Definition at line 221 of file G4LossTableManager.cc.

222{
223 verbose = theParameters->Verbose();
224 if(!isMaster) {
225 verbose = theParameters->WorkerVerbose();
226 }
227 tableBuilder->SetSplineFlag(theParameters->Spline());
228 tableBuilder->SetInitialisationFlag(false);
229 emCorrections->SetVerbose(verbose);
230 if(emConfigurator) { emConfigurator->SetVerbose(verbose); };
231 if(emElectronIonPair) { emElectronIonPair->SetVerbose(verbose); };
232 if(atomDeexcitation) {
233 atomDeexcitation->SetVerboseLevel(verbose);
234 atomDeexcitation->InitialiseAtomicDeexcitation();
235 }
236}
void SetVerbose(G4int value)
void SetVerbose(G4int verb)
G4int Verbose() const
G4int WorkerVerbose() const
G4bool Spline() const
void SetSplineFlag(G4bool flag)
void SetInitialisationFlag(G4bool flag)

Referenced by G4RadioactiveDecayPhysics::ConstructProcess(), and PreparePhysicsTable().

◆ SetAtomDeexcitation()

◆ SetElectronGeneralProcess()

void G4LossTableManager::SetElectronGeneralProcess ( G4VEmProcess ptr)
inline

Definition at line 439 of file G4LossTableManager.hh.

440{
441 eGeneral = ptr;
442}

◆ SetGammaGeneralProcess()

◆ SetNIELCalculator()

void G4LossTableManager::SetNIELCalculator ( G4NIELCalculator ptr)

Definition at line 1036 of file G4LossTableManager.cc.

1037{
1038 if(ptr && ptr != nielCalculator) {
1039 delete nielCalculator;
1040 nielCalculator = ptr;
1041 }
1042}

Referenced by G4NIELCalculator::G4NIELCalculator().

◆ SetPositronGeneralProcess()

void G4LossTableManager::SetPositronGeneralProcess ( G4VEmProcess ptr)
inline

Definition at line 453 of file G4LossTableManager.hh.

454{
455 pGeneral = ptr;
456}

◆ SetSubCutProducer()

void G4LossTableManager::SetSubCutProducer ( G4VSubCutProducer p)

Definition at line 1066 of file G4LossTableManager.cc.

1067{
1068 if(subcutProducer != p) {
1069 delete subcutProducer;
1070 subcutProducer = p;
1071 }
1072}

◆ SetVerbose()

void G4LossTableManager::SetVerbose ( G4int  val)

Definition at line 979 of file G4LossTableManager.cc.

980{
981 verbose = val;
982}

◆ SubCutProducer()

G4VSubCutProducer * G4LossTableManager::SubCutProducer ( )
inline

Definition at line 411 of file G4LossTableManager.hh.

412{
413 return subcutProducer;
414}

Referenced by G4VEnergyLossProcess::BuildPhysicsTable(), and G4VEnergyLossProcess::PreparePhysicsTable().

Friends And Related Function Documentation

◆ G4ThreadLocalSingleton< G4LossTableManager >

Definition at line 460 of file G4LossTableManager.hh.


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