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

#include <G4HadronicProcessStore.hh>

Public Member Functions

 ~G4HadronicProcessStore ()
 
void Clean ()
 
G4double GetCrossSectionPerAtom (const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=nullptr)
 
G4double GetCrossSectionPerVolume (const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
 
G4double GetInelasticCrossSectionPerVolume (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
 
G4double GetInelasticCrossSectionPerAtom (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
 
G4double GetInelasticCrossSectionPerIsotope (const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
 
G4double GetElasticCrossSectionPerVolume (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
 
G4double GetElasticCrossSectionPerAtom (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
 
G4double GetElasticCrossSectionPerIsotope (const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
 
G4double GetCaptureCrossSectionPerVolume (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
 
G4double GetCaptureCrossSectionPerAtom (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
 
G4double GetCaptureCrossSectionPerIsotope (const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
 
G4double GetFissionCrossSectionPerVolume (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
 
G4double GetFissionCrossSectionPerAtom (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
 
G4double GetFissionCrossSectionPerIsotope (const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
 
G4double GetChargeExchangeCrossSectionPerVolume (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
 
G4double GetChargeExchangeCrossSectionPerAtom (const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
 
G4double GetChargeExchangeCrossSectionPerIsotope (const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
 
void Register (G4HadronicProcess *)
 
void RegisterParticle (G4HadronicProcess *, const G4ParticleDefinition *)
 
void RegisterInteraction (G4HadronicProcess *, G4HadronicInteraction *)
 
void DeRegister (G4HadronicProcess *)
 
void RegisterExtraProcess (G4VProcess *)
 
void RegisterParticleForExtraProcess (G4VProcess *, const G4ParticleDefinition *)
 
void DeRegisterExtraProcess (G4VProcess *)
 
void SetBuildXSTable (G4bool val)
 
G4bool GetBuildXSTable () const
 
void PrintInfo (const G4ParticleDefinition *)
 
void Dump (G4int level)
 
void DumpHtml ()
 
void PrintHtml (const G4ParticleDefinition *, std::ofstream &)
 
void PrintModelHtml (const G4HadronicInteraction *model) const
 
void SetVerbose (G4int val)
 
G4int GetVerbose ()
 
G4HadronicProcessFindProcess (const G4ParticleDefinition *, G4HadronicProcessType subType)
 
void SetEpReportLevel (G4int level)
 
void SetProcessAbsLevel (G4double absoluteLevel)
 
void SetProcessRelLevel (G4double relativeLevel)
 

Static Public Member Functions

static G4HadronicProcessStoreInstance ()
 

Friends

class G4ThreadLocalSingleton< G4HadronicProcessStore >
 

Detailed Description

Definition at line 68 of file G4HadronicProcessStore.hh.

Constructor & Destructor Documentation

◆ ~G4HadronicProcessStore()

G4HadronicProcessStore::~G4HadronicProcessStore ( )

Definition at line 76 of file G4HadronicProcessStore.cc.

77{
78 Clean();
79 delete theEPTestMessenger;
80}

Member Function Documentation

◆ Clean()

void G4HadronicProcessStore::Clean ( )

Definition at line 84 of file G4HadronicProcessStore.cc.

85{
86 for(auto& itr : process)
87 delete itr;
88 process.clear();
89
90 for(auto& itr : extraProcess)
91 delete itr;
92 extraProcess.clear();
93
94 m_map.clear();
95 p_map.clear();
96
97 n_extra = 0;
98 n_proc = 0;
99}

Referenced by ~G4HadronicProcessStore().

◆ DeRegister()

void G4HadronicProcessStore::DeRegister ( G4HadronicProcess proc)

Definition at line 467 of file G4HadronicProcessStore.cc.

468{
469 for(G4int i=0; i<n_proc; ++i) {
470 if(process[i] == proc) {
471 process[i] = nullptr;
473 return;
474 }
475 }
476}
int G4int
Definition: G4Types.hh:85
void DeRegisterExtraProcess(G4VProcess *)

Referenced by G4HadronicProcess::~G4HadronicProcess().

◆ DeRegisterExtraProcess()

void G4HadronicProcessStore::DeRegisterExtraProcess ( G4VProcess proc)

Definition at line 532 of file G4HadronicProcessStore.cc.

533{
534 for(G4int i=0; i<n_extra; ++i) {
535 if(extraProcess[i] == proc) {
536 extraProcess[i] = nullptr;
537 if(1 < param->GetVerboseLevel()) {
538 G4cout << "Extra Process: " << i << " "
539 <<proc->GetProcessName()<< " is deregisted " << G4endl;
540 }
541 return;
542 }
543 }
544}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:386

Referenced by DeRegister(), and G4MuonMinusAtomicCapture::~G4MuonMinusAtomicCapture().

◆ Dump()

void G4HadronicProcessStore::Dump ( G4int  level)

Definition at line 748 of file G4HadronicProcessStore.cc.

749{
750 G4int level = std::max(param->GetVerboseLevel(), verb);
751 if (0 == level) return;
752
753 G4cout
754 << "\n====================================================================\n"
755 << std::setw(60) << "HADRONIC PROCESSES SUMMARY (verbose level "
756 << level << ")" << G4endl;
757
758 for (G4int i=0; i<n_part; ++i) {
759 PD part = particle[i];
760 G4String pname = part->GetParticleName();
761 G4bool yes = false;
762
763 if (level == 1 && (pname == "proton" ||
764 pname == "neutron" ||
765 pname == "deuteron" ||
766 pname == "triton" ||
767 pname == "He3" ||
768 pname == "alpha" ||
769 pname == "pi+" ||
770 pname == "pi-" ||
771 pname == "gamma" ||
772 pname == "e+" ||
773 pname == "e-" ||
774 pname == "mu+" ||
775 pname == "mu-" ||
776 pname == "kaon+" ||
777 pname == "kaon-" ||
778 pname == "lambda" ||
779 pname == "anti_lambda" ||
780 pname == "sigma-" ||
781 pname == "D-" ||
782 pname == "B-" ||
783 pname == "GenericIon" ||
784 pname == "hypertriton" ||
785 pname == "anti_neutron" ||
786 pname == "anti_proton" ||
787 pname == "anti_deuteron" ||
788 pname == "anti_triton" ||
789 pname == "anti_He3" ||
790 pname == "anti_alpha" ||
791 pname == "anti_hypertriton")) yes = true;
792 if (level > 1) yes = true;
793 if (yes) {
794 // main processes
795 std::multimap<PD,HP,std::less<PD> >::iterator it;
796
797 for (it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
798 if (it->first == part) {
799 HP proc = (it->second);
800 G4int j=0;
801 for (; j<n_proc; ++j) {
802 if (process[j] == proc) { Print(j, i); }
803 }
804 }
805 }
806
807 // extra processes
808 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
809 for(itp=ep_map.lower_bound(part); itp!=ep_map.upper_bound(part); ++itp) {
810 if(itp->first == part) {
811 G4VProcess* proc = (itp->second);
812 if (wasPrinted[i] == 0) {
813 G4cout << "\n---------------------------------------------------\n"
814 << std::setw(50) << "Hadronic Processes for "
815 << part->GetParticleName() << "\n";
816 wasPrinted[i] = 1;
817 }
818 G4cout << "\n Process: " << proc->GetProcessName() << G4endl;
819 }
820 }
821 }
822 }
823
824 G4cout << "\n================================================================"
825 << G4endl;
826}
bool G4bool
Definition: G4Types.hh:86

Referenced by PrintInfo().

◆ DumpHtml()

void G4HadronicProcessStore::DumpHtml ( )

Definition at line 576 of file G4HadronicProcessStore.cc.

577{
578 // Automatic generation of html documentation page for physics lists
579 // List processes, models and cross sections for the most important
580 // particles in descending order of importance
581
582 char* dirName = std::getenv("G4PhysListDocDir");
583 char* physListName = std::getenv("G4PhysListName");
584 if (dirName && physListName) {
585
586 // Open output file with path name
587 G4String pathName = G4String(dirName) + "/" + G4String(physListName) + ".html";
588 std::ofstream outFile;
589 outFile.open(pathName);
590
591 // Write physics list summary file
592 outFile << "<html>\n";
593 outFile << "<head>\n";
594 outFile << "<title>Physics List Summary</title>\n";
595 outFile << "</head>\n";
596 outFile << "<body>\n";
597 outFile << "<h2> Summary of Hadronic Processes, Models and Cross Sections for Physics List "
598 << G4String(physListName) << "</h2>\n";
599 outFile << "<ul>\n";
600
601 PrintHtml(G4Proton::Proton(), outFile);
602 PrintHtml(G4Neutron::Neutron(), outFile);
603 PrintHtml(G4PionPlus::PionPlus(), outFile);
605 PrintHtml(G4Gamma::Gamma(), outFile);
607// PrintHtml(G4MuonMinus::MuonMinus(), outFile);
611 PrintHtml(G4Lambda::Lambda(), outFile);
612 PrintHtml(G4Alpha::Alpha(), outFile);
614
615 outFile << "</ul>\n";
616 outFile << "</body>\n";
617 outFile << "</html>\n";
618 outFile.close();
619 }
620}
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:92
void PrintHtml(const G4ParticleDefinition *, std::ofstream &)
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:112
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:112
static G4Lambda * Lambda()
Definition: G4Lambda.cc:107
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97
static G4Positron * Positron()
Definition: G4Positron.cc:93
static G4Proton * Proton()
Definition: G4Proton.cc:92

Referenced by PrintInfo().

◆ FindProcess()

G4HadronicProcess * G4HadronicProcessStore::FindProcess ( const G4ParticleDefinition part,
G4HadronicProcessType  subType 
)

Definition at line 921 of file G4HadronicProcessStore.cc.

923{
924 bool isNew = false;
925 G4HadronicProcess* hp = nullptr;
926 localDP.SetDefinition(part);
927
928 if(part != currentParticle) {
929 const G4ParticleDefinition* p = part;
930 if(p->GetBaryonNumber() > 4 && p->GetParticleType() == "nucleus") {
931 p = theGenericIon;
932 }
933 if(p != currentParticle) {
934 isNew = true;
935 currentParticle = p;
936 }
937 }
938 if(!isNew) {
939 if(!currentProcess) {
940 isNew = true;
941 } else if(subType == currentProcess->GetProcessSubType()) {
942 hp = currentProcess;
943 } else {
944 isNew = true;
945 }
946 }
947 if(isNew) {
948 std::multimap<PD,HP,std::less<PD> >::iterator it;
949 for(it=p_map.lower_bound(currentParticle);
950 it!=p_map.upper_bound(currentParticle); ++it) {
951 if(it->first == currentParticle &&
952 subType == (it->second)->GetProcessSubType()) {
953 hp = it->second;
954 break;
955 }
956 }
957 currentProcess = hp;
958 }
959 return hp;
960}
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleType() const
G4int GetProcessSubType() const
Definition: G4VProcess.hh:404

Referenced by GetCaptureCrossSectionPerAtom(), GetChargeExchangeCrossSectionPerAtom(), GetElasticCrossSectionPerAtom(), GetFissionCrossSectionPerAtom(), and GetInelasticCrossSectionPerAtom().

◆ GetBuildXSTable()

G4bool G4HadronicProcessStore::GetBuildXSTable ( ) const

Definition at line 555 of file G4HadronicProcessStore.cc.

556{
557 return buildXSTable;
558}

◆ GetCaptureCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetCaptureCrossSectionPerAtom ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Element anElement,
const G4Material mat = nullptr 
)

Definition at line 280 of file G4HadronicProcessStore.cc.

284{
285 G4HadronicProcess* hp = FindProcess(aParticle, fCapture);
286 localDP.SetKineticEnergy(kineticEnergy);
287 G4double cross = 0.0;
288 if(hp) {
289 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
290 }
291 return cross;
292}
double G4double
Definition: G4Types.hh:83
void SetKineticEnergy(G4double aEnergy)
G4HadronicProcess * FindProcess(const G4ParticleDefinition *, G4HadronicProcessType subType)
G4double GetElementCrossSection(const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=nullptr)

Referenced by GetCaptureCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetCaptureCrossSectionPerIsotope()

G4double G4HadronicProcessStore::GetCaptureCrossSectionPerIsotope ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
G4int  Z,
G4int  A 
)

Definition at line 296 of file G4HadronicProcessStore.cc.

300{
301 return 0.0;
302}

◆ GetCaptureCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetCaptureCrossSectionPerVolume ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Material material 
)

Definition at line 260 of file G4HadronicProcessStore.cc.

264{
265 G4double cross = 0.0;
266 const G4ElementVector* theElementVector = material->GetElementVector();
267 const G4double* theAtomNumDensityVector =
268 material->GetVecNbOfAtomsPerVolume();
269 size_t nelm = material->GetNumberOfElements();
270 for (size_t i=0; i<nelm; ++i) {
271 const G4Element* elm = (*theElementVector)[i];
272 cross += theAtomNumDensityVector[i]*
273 GetCaptureCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
274 }
275 return cross;
276}
std::vector< const G4Element * > G4ElementVector
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:185
size_t GetNumberOfElements() const
Definition: G4Material.hh:181
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:201

Referenced by GetCrossSectionPerVolume().

◆ GetChargeExchangeCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetChargeExchangeCrossSectionPerAtom ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Element anElement,
const G4Material mat = nullptr 
)

Definition at line 372 of file G4HadronicProcessStore.cc.

376{
378 localDP.SetKineticEnergy(kineticEnergy);
379 G4double cross = 0.0;
380 if(hp) {
381 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
382 }
383 return cross;
384}
@ fChargeExchange

Referenced by GetChargeExchangeCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetChargeExchangeCrossSectionPerIsotope()

G4double G4HadronicProcessStore::GetChargeExchangeCrossSectionPerIsotope ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
G4int  Z,
G4int  A 
)

Definition at line 388 of file G4HadronicProcessStore.cc.

392{
393 return 0.0;
394}

◆ GetChargeExchangeCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetChargeExchangeCrossSectionPerVolume ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Material material 
)

Definition at line 352 of file G4HadronicProcessStore.cc.

356{
357 G4double cross = 0.0;
358 const G4ElementVector* theElementVector = material->GetElementVector();
359 const G4double* theAtomNumDensityVector =
360 material->GetVecNbOfAtomsPerVolume();
361 size_t nelm = material->GetNumberOfElements();
362 for (size_t i=0; i<nelm; ++i) {
363 const G4Element* elm = (*theElementVector)[i];
364 cross += theAtomNumDensityVector[i]*
365 GetChargeExchangeCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
366 }
367 return cross;
368}
G4double GetChargeExchangeCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)

Referenced by GetCrossSectionPerVolume().

◆ GetCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetCrossSectionPerAtom ( const G4ParticleDefinition particle,
G4double  kineticEnergy,
const G4VProcess process,
const G4Element element,
const G4Material material = nullptr 
)

Definition at line 121 of file G4HadronicProcessStore.cc.

127{
128 G4double cross = 0.;
129 G4int subType = proc->GetProcessSubType();
130 if (subType == fHadronElastic)
131 cross = GetElasticCrossSectionPerAtom(part,energy,element,material);
132 else if (subType == fHadronInelastic)
133 cross = GetInelasticCrossSectionPerAtom(part,energy,element,material);
134 else if (subType == fCapture)
135 cross = GetCaptureCrossSectionPerAtom(part,energy,element,material);
136 else if (subType == fFission)
137 cross = GetFissionCrossSectionPerAtom(part,energy,element,material);
138 else if (subType == fChargeExchange)
139 cross = GetChargeExchangeCrossSectionPerAtom(part,energy,element,material);
140 return cross;
141}
@ fHadronElastic
@ fHadronInelastic
G4double GetInelasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
G4double GetFissionCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
G4double GetElasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)

◆ GetCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetCrossSectionPerVolume ( const G4ParticleDefinition particle,
G4double  kineticEnergy,
const G4VProcess process,
const G4Material material 
)

Definition at line 145 of file G4HadronicProcessStore.cc.

150{
151 G4double cross = 0.;
152 G4int subType = proc->GetProcessSubType();
153 if (subType == fHadronElastic)
154 cross = GetElasticCrossSectionPerVolume(part,energy,material);
155 else if (subType == fHadronInelastic)
156 cross = GetInelasticCrossSectionPerVolume(part,energy,material);
157 else if (subType == fCapture)
158 cross = GetCaptureCrossSectionPerVolume(part,energy,material);
159 else if (subType == fFission)
160 cross = GetFissionCrossSectionPerVolume(part,energy,material);
161 else if (subType == fChargeExchange)
162 cross = GetChargeExchangeCrossSectionPerVolume(part,energy,material);
163 return cross;
164}
G4double GetCaptureCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4double GetChargeExchangeCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4double GetInelasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4double GetElasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4double GetFissionCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)

◆ GetElasticCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetElasticCrossSectionPerAtom ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Element anElement,
const G4Material mat = 0 
)

Definition at line 188 of file G4HadronicProcessStore.cc.

192{
194 G4double cross = 0.0;
195 localDP.SetKineticEnergy(kineticEnergy);
196 if(hp) {
197 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
198 }
199 return cross;
200}

Referenced by GetCrossSectionPerAtom(), and GetElasticCrossSectionPerVolume().

◆ GetElasticCrossSectionPerIsotope()

G4double G4HadronicProcessStore::GetElasticCrossSectionPerIsotope ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
G4int  Z,
G4int  A 
)

Definition at line 204 of file G4HadronicProcessStore.cc.

208{
209 return 0.0;
210}

◆ GetElasticCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetElasticCrossSectionPerVolume ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Material material 
)

Definition at line 168 of file G4HadronicProcessStore.cc.

172{
173 G4double cross = 0.0;
174 const G4ElementVector* theElementVector = material->GetElementVector();
175 const G4double* theAtomNumDensityVector =
176 material->GetVecNbOfAtomsPerVolume();
177 size_t nelm = material->GetNumberOfElements();
178 for (size_t i=0; i<nelm; ++i) {
179 const G4Element* elm = (*theElementVector)[i];
180 cross += theAtomNumDensityVector[i]*
181 GetElasticCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
182 }
183 return cross;
184}

Referenced by GetCrossSectionPerVolume().

◆ GetFissionCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetFissionCrossSectionPerAtom ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Element anElement,
const G4Material mat = nullptr 
)

Definition at line 326 of file G4HadronicProcessStore.cc.

330{
331 G4HadronicProcess* hp = FindProcess(aParticle, fFission);
332 localDP.SetKineticEnergy(kineticEnergy);
333 G4double cross = 0.0;
334 if(hp) {
335 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
336 }
337 return cross;
338}

Referenced by GetCrossSectionPerAtom(), and GetFissionCrossSectionPerVolume().

◆ GetFissionCrossSectionPerIsotope()

G4double G4HadronicProcessStore::GetFissionCrossSectionPerIsotope ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
G4int  Z,
G4int  A 
)

Definition at line 342 of file G4HadronicProcessStore.cc.

346{
347 return 0.0;
348}

◆ GetFissionCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetFissionCrossSectionPerVolume ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Material material 
)

Definition at line 306 of file G4HadronicProcessStore.cc.

310{
311 G4double cross = 0.0;
312 const G4ElementVector* theElementVector = material->GetElementVector();
313 const G4double* theAtomNumDensityVector =
314 material->GetVecNbOfAtomsPerVolume();
315 size_t nelm = material->GetNumberOfElements();
316 for (size_t i=0; i<nelm; i++) {
317 const G4Element* elm = (*theElementVector)[i];
318 cross += theAtomNumDensityVector[i]*
319 GetFissionCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
320 }
321 return cross;
322}

Referenced by GetCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetInelasticCrossSectionPerAtom ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Element anElement,
const G4Material mat = nullptr 
)

Definition at line 234 of file G4HadronicProcessStore.cc.

238{
240 localDP.SetKineticEnergy(kineticEnergy);
241 G4double cross = 0.0;
242 if(hp) {
243 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
244 }
245 return cross;
246}

Referenced by GetCrossSectionPerAtom(), and GetInelasticCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerIsotope()

G4double G4HadronicProcessStore::GetInelasticCrossSectionPerIsotope ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
G4int  Z,
G4int  A 
)

Definition at line 250 of file G4HadronicProcessStore.cc.

254{
255 return 0.0;
256}

◆ GetInelasticCrossSectionPerVolume()

G4double G4HadronicProcessStore::GetInelasticCrossSectionPerVolume ( const G4ParticleDefinition aParticle,
G4double  kineticEnergy,
const G4Material material 
)

Definition at line 214 of file G4HadronicProcessStore.cc.

218{
219 G4double cross = 0.0;
220 const G4ElementVector* theElementVector = material->GetElementVector();
221 const G4double* theAtomNumDensityVector =
222 material->GetVecNbOfAtomsPerVolume();
223 size_t nelm = material->GetNumberOfElements();
224 for (size_t i=0; i<nelm; ++i) {
225 const G4Element* elm = (*theElementVector)[i];
226 cross += theAtomNumDensityVector[i]*
227 GetInelasticCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
228 }
229 return cross;
230}

Referenced by GetCrossSectionPerVolume().

◆ GetVerbose()

G4int G4HadronicProcessStore::GetVerbose ( )

Definition at line 914 of file G4HadronicProcessStore.cc.

915{
916 return param->GetVerboseLevel();
917}

◆ Instance()

◆ PrintHtml()

void G4HadronicProcessStore::PrintHtml ( const G4ParticleDefinition theParticle,
std::ofstream &  outFile 
)

Definition at line 624 of file G4HadronicProcessStore.cc.

626{
627 // Automatic generation of html documentation page for physics lists
628 // List processes for the most important particles in descending order
629 // of importance
630
631 outFile << "<br> <li><h2><font color=\" ff0000 \">"
632 << theParticle->GetParticleName() << "</font></h2></li>\n";
633
634 typedef std::multimap<PD,HP,std::less<PD> > PDHPmap;
635 typedef std::multimap<HP,HI,std::less<HP> > HPHImap;
636
637 std::pair<PDHPmap::iterator, PDHPmap::iterator> itpart =
638 p_map.equal_range(theParticle);
639
640 // Loop over processes assigned to particle
641
642 G4HadronicProcess* theProcess;
643 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
644 theProcess = (*it).second;
645 // description is inline
646 //outFile << "<br> &nbsp;&nbsp; <b><font color=\" 0000ff \">process : <a href=\""
647 // << theProcess->GetProcessName() << ".html\"> "
648 // << theProcess->GetProcessName() << "</a></font></b>\n";
649 outFile << "<br> &nbsp;&nbsp; <b><font color=\" 0000ff \">process : "
650 << theProcess->GetProcessName() << "</font></b>\n";
651 outFile << "<ul>\n";
652 outFile << " <li>";
653 theProcess->ProcessDescription(outFile);
654 outFile << " <li><b><font color=\" 00AA00 \">models : </font></b>\n";
655 // Loop over models assigned to process
656 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
657 m_map.equal_range(theProcess);
658
659 outFile << " <ul>\n";
660 G4String physListName(std::getenv("G4PhysListName"));
661
662 for (HPHImap::iterator jt = itmod.first; jt != itmod.second; ++jt) {
663 outFile << " <li><b><a href=\"" << physListName << "_"
664 << HtmlFileName((*jt).second->GetModelName()) << "\"> "
665 << (*jt).second->GetModelName() << "</a>"
666 << " from " << (*jt).second->GetMinEnergy()/GeV
667 << " GeV to " << (*jt).second->GetMaxEnergy()/GeV
668 << " GeV </b></li>\n";
669
670 // Print ModelDescription, ignore that we overwrite files n-times.
671 PrintModelHtml((*jt).second);
672
673 }
674 outFile << " </ul>\n";
675 outFile << " </li>\n";
676
677 // List cross sections assigned to process
678 outFile << " <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
679 outFile << " <ul>\n";
680 theProcess->GetCrossSectionDataStore()->DumpHtml(*theParticle, outFile);
681 // << " \n";
682 outFile << " </ul>\n";
683
684 outFile << " </li>\n";
685 outFile << "</ul>\n";
686
687 }
688
689 // Loop over extra (G4VProcess) processes
690
691 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
692 for (itp=ep_map.lower_bound(theParticle); itp!=ep_map.upper_bound(theParticle); ++itp) {
693 if (itp->first == theParticle) {
694 G4VProcess* proc = (itp->second);
695 outFile << "<br> &nbsp;&nbsp; <b><font color=\" 0000ff \">process : "
696 << proc->GetProcessName() << "</font></b>\n";
697 outFile << "<ul>\n";
698 outFile << " <li>";
699 proc->ProcessDescription(outFile);
700 outFile << " </li>\n";
701 outFile << "</ul>\n";
702 }
703 }
704
705} // PrintHtml for particle
void DumpHtml(const G4ParticleDefinition &, std::ofstream &) const
void PrintModelHtml(const G4HadronicInteraction *model) const
void ProcessDescription(std::ostream &outFile) const override
G4CrossSectionDataStore * GetCrossSectionDataStore()
const G4String & GetParticleName() const
virtual void ProcessDescription(std::ostream &outfile) const
Definition: G4VProcess.cc:181

Referenced by DumpHtml().

◆ PrintInfo()

void G4HadronicProcessStore::PrintInfo ( const G4ParticleDefinition part)

Definition at line 562 of file G4HadronicProcessStore.cc.

563{
564 // Trigger particle/process/model printout only when last particle is
565 // registered
566 if(buildTableStart && part == particle[n_part - 1]) {
567 buildTableStart = false;
568 Dump(param->GetVerboseLevel());
569 if (std::getenv("G4PhysListDocDir") ) DumpHtml();
571 }
572}
static G4HadronicInteractionRegistry * Instance()

Referenced by G4HadronStoppingProcess::BuildPhysicsTable(), G4MuonMinusAtomicCapture::BuildPhysicsTable(), and G4HadronicProcess::BuildPhysicsTable().

◆ PrintModelHtml()

void G4HadronicProcessStore::PrintModelHtml ( const G4HadronicInteraction model) const

Definition at line 710 of file G4HadronicProcessStore.cc.

711{
712 G4String dirName(std::getenv("G4PhysListDocDir"));
713 G4String physListName(std::getenv("G4PhysListName"));
714 G4String pathName = dirName + "/" + physListName + "_" + HtmlFileName(mod->GetModelName());
715 std::ofstream outModel;
716 outModel.open(pathName);
717 outModel << "<html>\n";
718 outModel << "<head>\n";
719 outModel << "<title>Description of " << mod->GetModelName()
720 << "</title>\n";
721 outModel << "</head>\n";
722 outModel << "<body>\n";
723
724 mod->ModelDescription(outModel);
725
726 outModel << "</body>\n";
727 outModel << "</html>\n";
728
729}

Referenced by PrintHtml().

◆ Register()

void G4HadronicProcessStore::Register ( G4HadronicProcess proc)

Definition at line 398 of file G4HadronicProcessStore.cc.

399{
400 for(G4int i=0; i<n_proc; ++i) {
401 if(process[i] == proc) { return; }
402 }
403 if(1 < param->GetVerboseLevel()) {
404 G4cout << "G4HadronicProcessStore::Register hadronic " << n_proc
405 << " " << proc->GetProcessName() << G4endl;
406 }
407 ++n_proc;
408 process.push_back(proc);
409}

◆ RegisterExtraProcess()

void G4HadronicProcessStore::RegisterExtraProcess ( G4VProcess proc)

Definition at line 480 of file G4HadronicProcessStore.cc.

481{
482 for(G4int i=0; i<n_extra; ++i) {
483 if(extraProcess[i] == proc) { return; }
484 }
485 G4HadronicProcess* hproc = static_cast<G4HadronicProcess*>(proc);
486 if(hproc) {
487 for(G4int i=0; i<n_proc; ++i) {
488 if(process[i] == hproc) { return; }
489 }
490 }
491 if(1 < param->GetVerboseLevel()) {
492 G4cout << "Extra Process: " << n_extra
493 << " " << proc->GetProcessName() << G4endl;
494 }
495 ++n_extra;
496 extraProcess.push_back(proc);
497}

Referenced by G4NeutronTrackingCut::ConstructProcess(), G4HadronStoppingProcess::G4HadronStoppingProcess(), G4MuonMinusAtomicCapture::G4MuonMinusAtomicCapture(), and G4RadioactiveDecay::G4RadioactiveDecay().

◆ RegisterInteraction()

void G4HadronicProcessStore::RegisterInteraction ( G4HadronicProcess proc,
G4HadronicInteraction mod 
)

Definition at line 448 of file G4HadronicProcessStore.cc.

450{
451 G4int i=0;
452 for(; i<n_proc; ++i) {if(process[i] == proc) { break; }}
453 G4int k=0;
454 for(; k<n_model; ++k) {if(model[k] == mod) { break; }}
455
456 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
457
458 if(k == n_model) {
459 ++n_model;
460 model.push_back(mod);
461 modelName.push_back(mod->GetModelName());
462 }
463}
const G4String & GetModelName() const

Referenced by G4HadronicProcess::RegisterMe().

◆ RegisterParticle()

void G4HadronicProcessStore::RegisterParticle ( G4HadronicProcess proc,
const G4ParticleDefinition part 
)

Definition at line 413 of file G4HadronicProcessStore.cc.

415{
416 G4int i=0;
417 for(; i<n_proc; ++i) {if(process[i] == proc) break;}
418 G4int j=0;
419 for(; j<n_part; ++j) {if(particle[j] == part) break;}
420
421 if(1 < param->GetVerboseLevel()) {
422 G4cout << "G4HadronicProcessStore::RegisterParticle "
423 << part->GetParticleName()
424 << " for " << proc->GetProcessName() << G4endl;
425 }
426 if(j == n_part) {
427 ++n_part;
428 particle.push_back(part);
429 wasPrinted.push_back(0);
430 }
431
432 // the pair should be added?
433 if(i < n_proc) {
434 std::multimap<PD,HP,std::less<PD> >::iterator it;
435 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
436 if(it->first == part) {
437 HP process2 = (it->second);
438 if(proc == process2) { return; }
439 }
440 }
441 }
442
443 p_map.insert(std::multimap<PD,HP>::value_type(part,proc));
444}

Referenced by G4HadronicProcess::PreparePhysicsTable().

◆ RegisterParticleForExtraProcess()

void G4HadronicProcessStore::RegisterParticleForExtraProcess ( G4VProcess proc,
const G4ParticleDefinition part 
)

Definition at line 501 of file G4HadronicProcessStore.cc.

504{
505 G4int i=0;
506 for(; i<n_extra; ++i) { if(extraProcess[i] == proc) { break; } }
507 G4int j=0;
508 for(; j<n_part; ++j) { if(particle[j] == part) { break; } }
509
510 if(j == n_part) {
511 ++n_part;
512 particle.push_back(part);
513 wasPrinted.push_back(0);
514 }
515
516 // the pair should be added?
517 if(i < n_extra) {
518 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator it;
519 for(it=ep_map.lower_bound(part); it!=ep_map.upper_bound(part); ++it) {
520 if(it->first == part) {
521 G4VProcess* process2 = (it->second);
522 if(proc == process2) { return; }
523 }
524 }
525 }
526
527 ep_map.insert(std::multimap<PD,G4VProcess*>::value_type(part,proc));
528}

Referenced by G4RadioactiveDecay::BuildPhysicsTable(), G4NeutronTrackingCut::ConstructProcess(), G4HadronStoppingProcess::PreparePhysicsTable(), and G4MuonMinusAtomicCapture::PreparePhysicsTable().

◆ SetBuildXSTable()

void G4HadronicProcessStore::SetBuildXSTable ( G4bool  val)

Definition at line 548 of file G4HadronicProcessStore.cc.

549{
550 buildXSTable = val;
551}

◆ SetEpReportLevel()

void G4HadronicProcessStore::SetEpReportLevel ( G4int  level)

Definition at line 964 of file G4HadronicProcessStore.cc.

965{
966 G4cout << " Setting energy/momentum report level to " << level
967 << " for " << process.size() << " hadronic processes " << G4endl;
968 for (G4int i = 0; i < G4int(process.size()); ++i) {
969 process[i]->SetEpReportLevel(level);
970 }
971}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessAbsLevel()

void G4HadronicProcessStore::SetProcessAbsLevel ( G4double  absoluteLevel)

Definition at line 975 of file G4HadronicProcessStore.cc.

976{
977 G4cout << " Setting absolute energy/momentum test level to " << abslevel
978 << G4endl;
979 G4double rellevel = 0.0;
980 G4HadronicProcess* theProcess = 0;
981 for (G4int i = 0; i < G4int(process.size()); ++i) {
982 theProcess = process[i];
983 rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
984 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
985 }
986}
std::pair< G4double, G4double > GetEnergyMomentumCheckLevels() const
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessRelLevel()

void G4HadronicProcessStore::SetProcessRelLevel ( G4double  relativeLevel)

Definition at line 990 of file G4HadronicProcessStore.cc.

991{
992 G4cout << " Setting relative energy/momentum test level to " << rellevel
993 << G4endl;
994 G4double abslevel = 0.0;
995 G4HadronicProcess* theProcess = 0;
996 for (G4int i = 0; i < G4int(process.size()); ++i) {
997 theProcess = process[i];
998 abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
999 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
1000 }
1001}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetVerbose()

void G4HadronicProcessStore::SetVerbose ( G4int  val)

Definition at line 900 of file G4HadronicProcessStore.cc.

902{
903 G4int i;
904 for(i=0; i<n_proc; ++i) {
905 if(process[i]) { process[i]->SetVerboseLevel(val); }
906 }
907 for(i=0; i<n_model; ++i) {
908 if(model[i]) { model[i]->SetVerboseLevel(val); }
909 }
910}

Friends And Related Function Documentation

◆ G4ThreadLocalSingleton< G4HadronicProcessStore >

Definition at line 1 of file G4HadronicProcessStore.hh.


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