Geant4 11.2.2
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 67 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 const& itr : process)
87 delete itr;
88 process.clear();
89
90 for (auto const& itr : extraProcess)
91 delete itr;
92 extraProcess.clear();
93
94 for (auto const& it : ep_map)
95 delete it.second;
96
97 m_map.clear();
98 p_map.clear();
99
100 n_extra = 0;
101 n_proc = 0;
102}

Referenced by ~G4HadronicProcessStore().

◆ DeRegister()

void G4HadronicProcessStore::DeRegister ( G4HadronicProcess * proc)

Definition at line 462 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::~G4HadronicProcess().

◆ DeRegisterExtraProcess()

void G4HadronicProcessStore::DeRegisterExtraProcess ( G4VProcess * proc)

Definition at line 527 of file G4HadronicProcessStore.cc.

528{
529 for(G4int i=0; i<n_extra; ++i) {
530 if(extraProcess[i] == proc) {
531 extraProcess[i] = nullptr;
532 if(1 < param->GetVerboseLevel()) {
533 G4cout << "Extra Process: " << i << " "
534 <<proc->GetProcessName()<< " is deregisted " << G4endl;
535 }
536 return;
537 }
538 }
539}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const

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

◆ Dump()

void G4HadronicProcessStore::Dump ( G4int level)

Definition at line 736 of file G4HadronicProcessStore.cc.

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

Referenced by PrintInfo().

◆ DumpHtml()

void G4HadronicProcessStore::DumpHtml ( )

Definition at line 571 of file G4HadronicProcessStore.cc.

572{
573 // Automatic generation of html documentation page for physics lists
574 // List processes, models and cross sections for the most important
575 // particles in descending order of importance
576
577 const G4String& dir = param->GetPhysListDocDir();
578 const G4String& pl = param->GetPhysListName();
579 if (!dir.empty() && !pl.empty()) {
580
581 // Open output file with path name
582 G4String pathName = dir + "/" + pl + ".html";
583 std::ofstream outFile;
584 outFile.open(pathName);
585
586 // Write physics list summary file
587 outFile << "<html>\n";
588 outFile << "<head>\n";
589 outFile << "<title>Physics List Summary</title>\n";
590 outFile << "</head>\n";
591 outFile << "<body>\n";
592 outFile << "<h2> Summary of Hadronic Processes, Models and Cross Sections"
593 << " for Physics List " << pl << "</h2>\n";
594 outFile << "<ul>\n";
595
596 PrintHtml(G4Proton::Proton(), outFile);
597 PrintHtml(G4Neutron::Neutron(), outFile);
598 PrintHtml(G4PionPlus::PionPlus(), outFile);
600 PrintHtml(G4Gamma::Gamma(), outFile);
602 // PrintHtml(G4MuonMinus::MuonMinus(), outFile);
606 PrintHtml(G4Lambda::Lambda(), outFile);
607 PrintHtml(G4Alpha::Alpha(), outFile);
609
610 outFile << "</ul>\n";
611 outFile << "</body>\n";
612 outFile << "</html>\n";
613 outFile.close();
614 }
615}
static G4Alpha * Alpha()
Definition G4Alpha.cc:83
static G4Electron * Electron()
Definition G4Electron.cc:91
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
static G4GenericIon * GenericIon()
const G4String & GetPhysListName() const
const G4String & GetPhysListDocDir() const
void PrintHtml(const G4ParticleDefinition *, std::ofstream &)
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4Lambda * Lambda()
Definition G4Lambda.cc:105
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
Definition G4PionPlus.cc:93
static G4Positron * Positron()
Definition G4Positron.cc:90
static G4Proton * Proton()
Definition G4Proton.cc:90

Referenced by PrintInfo().

◆ FindProcess()

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

Definition at line 911 of file G4HadronicProcessStore.cc.

913{
914 bool isNew = false;
915 G4HadronicProcess* hp = nullptr;
916 localDP.SetDefinition(part);
917
918 if(part != currentParticle) {
919 const G4ParticleDefinition* p = part;
920 if(p->GetBaryonNumber() > 4 && p->GetParticleType() == "nucleus") {
921 p = theGenericIon;
922 }
923 if(p != currentParticle) {
924 isNew = true;
925 currentParticle = p;
926 }
927 }
928 if(!isNew) {
929 if(!currentProcess) {
930 isNew = true;
931 } else if(subType == currentProcess->GetProcessSubType()) {
932 hp = currentProcess;
933 } else {
934 isNew = true;
935 }
936 }
937 if(isNew) {
938 std::multimap<PD,HP,std::less<PD> >::iterator it;
939 for(it=p_map.lower_bound(currentParticle);
940 it!=p_map.upper_bound(currentParticle); ++it) {
941 if(it->first == currentParticle &&
942 subType == (it->second)->GetProcessSubType()) {
943 hp = it->second;
944 break;
945 }
946 }
947 currentProcess = hp;
948 }
949 return hp;
950}
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleType() const
G4int GetProcessSubType() const

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

◆ GetBuildXSTable()

G4bool G4HadronicProcessStore::GetBuildXSTable ( ) const

Definition at line 550 of file G4HadronicProcessStore.cc.

551{
552 return buildXSTable;
553}

◆ GetCaptureCrossSectionPerAtom()

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

Definition at line 275 of file G4HadronicProcessStore.cc.

279{
280 G4HadronicProcess* hp = FindProcess(aParticle, fCapture);
281 localDP.SetKineticEnergy(kineticEnergy);
282 G4double cross = 0.0;
283 if(hp) {
284 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
285 }
286 return cross;
287}
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 291 of file G4HadronicProcessStore.cc.

295{
296 return 0.0;
297}

◆ GetCaptureCrossSectionPerVolume()

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

Definition at line 255 of file G4HadronicProcessStore.cc.

259{
260 G4double cross = 0.0;
261 const G4ElementVector* theElementVector = material->GetElementVector();
262 const G4double* theAtomNumDensityVector =
263 material->GetVecNbOfAtomsPerVolume();
264 size_t nelm = material->GetNumberOfElements();
265 for (size_t i=0; i<nelm; ++i) {
266 const G4Element* elm = (*theElementVector)[i];
267 cross += theAtomNumDensityVector[i]*
268 GetCaptureCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
269 }
270 return cross;
271}
std::vector< const G4Element * > G4ElementVector
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
const G4ElementVector * GetElementVector() const
const G4double * GetVecNbOfAtomsPerVolume() const
std::size_t GetNumberOfElements() const

Referenced by GetCrossSectionPerVolume().

◆ GetChargeExchangeCrossSectionPerAtom()

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

Definition at line 367 of file G4HadronicProcessStore.cc.

371{
373 localDP.SetKineticEnergy(kineticEnergy);
374 G4double cross = 0.0;
375 if(hp) {
376 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
377 }
378 return cross;
379}
@ fChargeExchange

Referenced by GetChargeExchangeCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetChargeExchangeCrossSectionPerIsotope()

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

Definition at line 383 of file G4HadronicProcessStore.cc.

387{
388 return 0.0;
389}

◆ GetChargeExchangeCrossSectionPerVolume()

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

Definition at line 347 of file G4HadronicProcessStore.cc.

351{
352 G4double cross = 0.0;
353 const G4ElementVector* theElementVector = material->GetElementVector();
354 const G4double* theAtomNumDensityVector =
355 material->GetVecNbOfAtomsPerVolume();
356 size_t nelm = material->GetNumberOfElements();
357 for (size_t i=0; i<nelm; ++i) {
358 const G4Element* elm = (*theElementVector)[i];
359 cross += theAtomNumDensityVector[i]*
360 GetChargeExchangeCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
361 }
362 return cross;
363}
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 116 of file G4HadronicProcessStore.cc.

122{
123 G4double cross = 0.;
124 G4int subType = proc->GetProcessSubType();
125 if (subType == fHadronElastic)
126 cross = GetElasticCrossSectionPerAtom(part,energy,element,material);
127 else if (subType == fHadronInelastic)
128 cross = GetInelasticCrossSectionPerAtom(part,energy,element,material);
129 else if (subType == fCapture)
130 cross = GetCaptureCrossSectionPerAtom(part,energy,element,material);
131 else if (subType == fFission)
132 cross = GetFissionCrossSectionPerAtom(part,energy,element,material);
133 else if (subType == fChargeExchange)
134 cross = GetChargeExchangeCrossSectionPerAtom(part,energy,element,material);
135 return cross;
136}
@ 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 140 of file G4HadronicProcessStore.cc.

145{
146 G4double cross = 0.;
147 G4int subType = proc->GetProcessSubType();
148 if (subType == fHadronElastic)
149 cross = GetElasticCrossSectionPerVolume(part,energy,material);
150 else if (subType == fHadronInelastic)
151 cross = GetInelasticCrossSectionPerVolume(part,energy,material);
152 else if (subType == fCapture)
153 cross = GetCaptureCrossSectionPerVolume(part,energy,material);
154 else if (subType == fFission)
155 cross = GetFissionCrossSectionPerVolume(part,energy,material);
156 else if (subType == fChargeExchange)
157 cross = GetChargeExchangeCrossSectionPerVolume(part,energy,material);
158 return cross;
159}
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 183 of file G4HadronicProcessStore.cc.

187{
189 G4double cross = 0.0;
190 localDP.SetKineticEnergy(kineticEnergy);
191 if(hp) {
192 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
193 }
194 return cross;
195}

Referenced by GetCrossSectionPerAtom(), and GetElasticCrossSectionPerVolume().

◆ GetElasticCrossSectionPerIsotope()

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

Definition at line 199 of file G4HadronicProcessStore.cc.

203{
204 return 0.0;
205}

◆ GetElasticCrossSectionPerVolume()

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

Definition at line 163 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerVolume().

◆ GetFissionCrossSectionPerAtom()

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

Definition at line 321 of file G4HadronicProcessStore.cc.

325{
326 G4HadronicProcess* hp = FindProcess(aParticle, fFission);
327 localDP.SetKineticEnergy(kineticEnergy);
328 G4double cross = 0.0;
329 if(hp) {
330 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
331 }
332 return cross;
333}

Referenced by GetCrossSectionPerAtom(), and GetFissionCrossSectionPerVolume().

◆ GetFissionCrossSectionPerIsotope()

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

Definition at line 337 of file G4HadronicProcessStore.cc.

341{
342 return 0.0;
343}

◆ GetFissionCrossSectionPerVolume()

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

Definition at line 301 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerAtom()

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

Definition at line 229 of file G4HadronicProcessStore.cc.

233{
235 localDP.SetKineticEnergy(kineticEnergy);
236 G4double cross = 0.0;
237 if(hp) {
238 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
239 }
240 return cross;
241}

Referenced by GetCrossSectionPerAtom(), and GetInelasticCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerIsotope()

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

Definition at line 245 of file G4HadronicProcessStore.cc.

249{
250 return 0.0;
251}

◆ GetInelasticCrossSectionPerVolume()

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

Definition at line 209 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerVolume().

◆ GetVerbose()

G4int G4HadronicProcessStore::GetVerbose ( )

Definition at line 904 of file G4HadronicProcessStore.cc.

905{
906 return param->GetVerboseLevel();
907}

◆ Instance()

◆ PrintHtml()

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

Definition at line 619 of file G4HadronicProcessStore.cc.

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

Referenced by DumpHtml().

◆ PrintInfo()

void G4HadronicProcessStore::PrintInfo ( const G4ParticleDefinition * part)

Definition at line 557 of file G4HadronicProcessStore.cc.

558{
559 // Trigger particle/process/model printout only when last particle is
560 // registered
561 if(buildTableStart && part == particle[n_part - 1]) {
562 buildTableStart = false;
563 Dump(param->GetVerboseLevel());
564 if (!(param->GetPhysListDocDir()).empty()) DumpHtml();
566 }
567}
static G4HadronicInteractionRegistry * Instance()

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

◆ PrintModelHtml()

void G4HadronicProcessStore::PrintModelHtml ( const G4HadronicInteraction * model) const

Definition at line 700 of file G4HadronicProcessStore.cc.

701{
702 const G4String& dir = param->GetPhysListDocDir();
703 const G4String& pl = param->GetPhysListName();
704 G4String pathName = dir + "/" + pl + "_" + HtmlFileName(mod->GetModelName());
705 std::ofstream outModel;
706 outModel.open(pathName);
707 outModel << "<html>\n";
708 outModel << "<head>\n";
709 outModel << "<title>Description of " << mod->GetModelName()
710 << "</title>\n";
711 outModel << "</head>\n";
712 outModel << "<body>\n";
713
714 mod->ModelDescription(outModel);
715
716 outModel << "</body>\n";
717 outModel << "</html>\n";
718}

Referenced by PrintHtml().

◆ Register()

void G4HadronicProcessStore::Register ( G4HadronicProcess * proc)

Definition at line 393 of file G4HadronicProcessStore.cc.

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

◆ RegisterExtraProcess()

void G4HadronicProcessStore::RegisterExtraProcess ( G4VProcess * proc)

Definition at line 475 of file G4HadronicProcessStore.cc.

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

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

◆ RegisterInteraction()

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

Definition at line 443 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::RegisterMe().

◆ RegisterParticle()

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

Definition at line 408 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::PreparePhysicsTable().

◆ RegisterParticleForExtraProcess()

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

Definition at line 496 of file G4HadronicProcessStore.cc.

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

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

◆ SetBuildXSTable()

void G4HadronicProcessStore::SetBuildXSTable ( G4bool val)

Definition at line 543 of file G4HadronicProcessStore.cc.

544{
545 buildXSTable = val;
546}

◆ SetEpReportLevel()

void G4HadronicProcessStore::SetEpReportLevel ( G4int level)

Definition at line 954 of file G4HadronicProcessStore.cc.

955{
956 G4cout << " Setting energy/momentum report level to " << level
957 << " for " << process.size() << " hadronic processes " << G4endl;
958 for (auto& theProcess : process) {
959 theProcess->SetEpReportLevel(level);
960 }
961}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessAbsLevel()

void G4HadronicProcessStore::SetProcessAbsLevel ( G4double absoluteLevel)

Definition at line 965 of file G4HadronicProcessStore.cc.

966{
967 G4cout << " Setting absolute energy/momentum test level to " << abslevel
968 << G4endl;
969 for (auto& theProcess : process) {
970 G4double rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
971 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
972 }
973}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessRelLevel()

void G4HadronicProcessStore::SetProcessRelLevel ( G4double relativeLevel)

Definition at line 977 of file G4HadronicProcessStore.cc.

978{
979 G4cout << " Setting relative energy/momentum test level to " << rellevel
980 << G4endl;
981 for (auto& theProcess : process) {
982 G4double abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
983 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
984 }
985}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetVerbose()

void G4HadronicProcessStore::SetVerbose ( G4int val)

Definition at line 890 of file G4HadronicProcessStore.cc.

892{
893 G4int i;
894 for(i=0; i<n_proc; ++i) {
895 if(process[i]) { process[i]->SetVerboseLevel(val); }
896 }
897 for(i=0; i<n_model; ++i) {
898 if(model[i]) { model[i]->SetVerboseLevel(val); }
899 }
900}

Friends And Related Symbol Documentation

◆ G4ThreadLocalSingleton< G4HadronicProcessStore >

Definition at line 1 of file G4HadronicProcessStore.hh.


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