Geant4 10.7.0
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 81 of file G4HadronicProcessStore.cc.

82{
83 Clean();
84 delete theEPTestMessenger;
85}

Member Function Documentation

◆ Clean()

void G4HadronicProcessStore::Clean ( )

Definition at line 89 of file G4HadronicProcessStore.cc.

90{
91 G4int i;
92 for (i=0; i<n_proc; ++i) {
93 if( process[i] ) {
94 delete process[i];
95 process[i] = nullptr;
96 }
97 }
98 for(i=0; i<n_extra; ++i) {
99 if(extraProcess[i]) {
100 delete extraProcess[i];
101 extraProcess[i] = nullptr;
102 }
103 }
104 n_extra = 0;
105 n_proc = 0;
106}
int G4int
Definition: G4Types.hh:85

Referenced by ~G4HadronicProcessStore().

◆ DeRegister()

void G4HadronicProcessStore::DeRegister ( G4HadronicProcess proc)

Definition at line 474 of file G4HadronicProcessStore.cc.

475{
476 for(G4int i=0; i<n_proc; ++i) {
477 if(process[i] == proc) {
478 process[i] = nullptr;
480 return;
481 }
482 }
483}
void DeRegisterExtraProcess(G4VProcess *)

Referenced by G4HadronicProcess::~G4HadronicProcess().

◆ DeRegisterExtraProcess()

void G4HadronicProcessStore::DeRegisterExtraProcess ( G4VProcess proc)

Definition at line 539 of file G4HadronicProcessStore.cc.

540{
541 for(G4int i=0; i<n_extra; ++i) {
542 if(extraProcess[i] == proc) {
543 extraProcess[i] = nullptr;
544 if(1 < param->GetVerboseLevel()) {
545 G4cout << "Extra Process: " << i << " "
546 <<proc->GetProcessName()<< " is deregisted " << G4endl;
547 }
548 return;
549 }
550 }
551}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382

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

◆ Dump()

void G4HadronicProcessStore::Dump ( G4int  level)

Definition at line 755 of file G4HadronicProcessStore.cc.

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

Referenced by PrintInfo().

◆ DumpHtml()

void G4HadronicProcessStore::DumpHtml ( )

Definition at line 583 of file G4HadronicProcessStore.cc.

584{
585 // Automatic generation of html documentation page for physics lists
586 // List processes, models and cross sections for the most important
587 // particles in descending order of importance
588
589 char* dirName = std::getenv("G4PhysListDocDir");
590 char* physListName = std::getenv("G4PhysListName");
591 if (dirName && physListName) {
592
593 // Open output file with path name
594 G4String pathName = G4String(dirName) + "/" + G4String(physListName) + ".html";
595 std::ofstream outFile;
596 outFile.open(pathName);
597
598 // Write physics list summary file
599 outFile << "<html>\n";
600 outFile << "<head>\n";
601 outFile << "<title>Physics List Summary</title>\n";
602 outFile << "</head>\n";
603 outFile << "<body>\n";
604 outFile << "<h2> Summary of Hadronic Processes, Models and Cross Sections for Physics List "
605 << G4String(physListName) << "</h2>\n";
606 outFile << "<ul>\n";
607
608 PrintHtml(G4Proton::Proton(), outFile);
609 PrintHtml(G4Neutron::Neutron(), outFile);
610 PrintHtml(G4PionPlus::PionPlus(), outFile);
612 PrintHtml(G4Gamma::Gamma(), outFile);
614// PrintHtml(G4MuonMinus::MuonMinus(), outFile);
618 PrintHtml(G4Lambda::Lambda(), outFile);
619 PrintHtml(G4Alpha::Alpha(), outFile);
621
622 outFile << "</ul>\n";
623 outFile << "</body>\n";
624 outFile << "</html>\n";
625 outFile.close();
626 }
627}
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 926 of file G4HadronicProcessStore.cc.

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

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

◆ GetBuildXSTable()

G4bool G4HadronicProcessStore::GetBuildXSTable ( ) const

Definition at line 562 of file G4HadronicProcessStore.cc.

563{
564 return buildXSTable;
565}

◆ GetCaptureCrossSectionPerAtom()

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

Definition at line 287 of file G4HadronicProcessStore.cc.

291{
292 G4HadronicProcess* hp = FindProcess(aParticle, fCapture);
293 localDP.SetKineticEnergy(kineticEnergy);
294 G4double cross = 0.0;
295 if(hp) {
296 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
297 }
298 return cross;
299}
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 303 of file G4HadronicProcessStore.cc.

307{
308 return 0.0;
309}

◆ GetCaptureCrossSectionPerVolume()

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

Definition at line 267 of file G4HadronicProcessStore.cc.

271{
272 G4double cross = 0.0;
273 const G4ElementVector* theElementVector = material->GetElementVector();
274 const G4double* theAtomNumDensityVector =
275 material->GetVecNbOfAtomsPerVolume();
276 size_t nelm = material->GetNumberOfElements();
277 for (size_t i=0; i<nelm; ++i) {
278 const G4Element* elm = (*theElementVector)[i];
279 cross += theAtomNumDensityVector[i]*
280 GetCaptureCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
281 }
282 return cross;
283}
std::vector< G4Element * > G4ElementVector
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:204

Referenced by GetCrossSectionPerVolume().

◆ GetChargeExchangeCrossSectionPerAtom()

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

Definition at line 379 of file G4HadronicProcessStore.cc.

383{
385 localDP.SetKineticEnergy(kineticEnergy);
386 G4double cross = 0.0;
387 if(hp) {
388 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
389 }
390 return cross;
391}
@ fChargeExchange

Referenced by GetChargeExchangeCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetChargeExchangeCrossSectionPerIsotope()

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

Definition at line 395 of file G4HadronicProcessStore.cc.

399{
400 return 0.0;
401}

◆ GetChargeExchangeCrossSectionPerVolume()

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

Definition at line 359 of file G4HadronicProcessStore.cc.

363{
364 G4double cross = 0.0;
365 const G4ElementVector* theElementVector = material->GetElementVector();
366 const G4double* theAtomNumDensityVector =
367 material->GetVecNbOfAtomsPerVolume();
368 size_t nelm = material->GetNumberOfElements();
369 for (size_t i=0; i<nelm; ++i) {
370 const G4Element* elm = (*theElementVector)[i];
371 cross += theAtomNumDensityVector[i]*
372 GetChargeExchangeCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
373 }
374 return cross;
375}
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 128 of file G4HadronicProcessStore.cc.

134{
135 G4double cross = 0.;
136 G4int subType = proc->GetProcessSubType();
137 if (subType == fHadronElastic)
138 cross = GetElasticCrossSectionPerAtom(part,energy,element,material);
139 else if (subType == fHadronInelastic)
140 cross = GetInelasticCrossSectionPerAtom(part,energy,element,material);
141 else if (subType == fCapture)
142 cross = GetCaptureCrossSectionPerAtom(part,energy,element,material);
143 else if (subType == fFission)
144 cross = GetFissionCrossSectionPerAtom(part,energy,element,material);
145 else if (subType == fChargeExchange)
146 cross = GetChargeExchangeCrossSectionPerAtom(part,energy,element,material);
147 return cross;
148}
@ 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 152 of file G4HadronicProcessStore.cc.

157{
158 G4double cross = 0.;
159 G4int subType = proc->GetProcessSubType();
160 if (subType == fHadronElastic)
161 cross = GetElasticCrossSectionPerVolume(part,energy,material);
162 else if (subType == fHadronInelastic)
163 cross = GetInelasticCrossSectionPerVolume(part,energy,material);
164 else if (subType == fCapture)
165 cross = GetCaptureCrossSectionPerVolume(part,energy,material);
166 else if (subType == fFission)
167 cross = GetFissionCrossSectionPerVolume(part,energy,material);
168 else if (subType == fChargeExchange)
169 cross = GetChargeExchangeCrossSectionPerVolume(part,energy,material);
170 return cross;
171}
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 195 of file G4HadronicProcessStore.cc.

199{
201 G4double cross = 0.0;
202 localDP.SetKineticEnergy(kineticEnergy);
203 if(hp) {
204 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
205 }
206 return cross;
207}

Referenced by GetCrossSectionPerAtom(), and GetElasticCrossSectionPerVolume().

◆ GetElasticCrossSectionPerIsotope()

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

Definition at line 211 of file G4HadronicProcessStore.cc.

215{
216 return 0.0;
217}

◆ GetElasticCrossSectionPerVolume()

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

Definition at line 175 of file G4HadronicProcessStore.cc.

179{
180 G4double cross = 0.0;
181 const G4ElementVector* theElementVector = material->GetElementVector();
182 const G4double* theAtomNumDensityVector =
183 material->GetVecNbOfAtomsPerVolume();
184 size_t nelm = material->GetNumberOfElements();
185 for (size_t i=0; i<nelm; ++i) {
186 const G4Element* elm = (*theElementVector)[i];
187 cross += theAtomNumDensityVector[i]*
188 GetElasticCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
189 }
190 return cross;
191}

Referenced by GetCrossSectionPerVolume().

◆ GetFissionCrossSectionPerAtom()

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

Definition at line 333 of file G4HadronicProcessStore.cc.

337{
338 G4HadronicProcess* hp = FindProcess(aParticle, fFission);
339 localDP.SetKineticEnergy(kineticEnergy);
340 G4double cross = 0.0;
341 if(hp) {
342 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
343 }
344 return cross;
345}

Referenced by GetCrossSectionPerAtom(), and GetFissionCrossSectionPerVolume().

◆ GetFissionCrossSectionPerIsotope()

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

Definition at line 349 of file G4HadronicProcessStore.cc.

353{
354 return 0.0;
355}

◆ GetFissionCrossSectionPerVolume()

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

Definition at line 313 of file G4HadronicProcessStore.cc.

317{
318 G4double cross = 0.0;
319 const G4ElementVector* theElementVector = material->GetElementVector();
320 const G4double* theAtomNumDensityVector =
321 material->GetVecNbOfAtomsPerVolume();
322 size_t nelm = material->GetNumberOfElements();
323 for (size_t i=0; i<nelm; i++) {
324 const G4Element* elm = (*theElementVector)[i];
325 cross += theAtomNumDensityVector[i]*
326 GetFissionCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
327 }
328 return cross;
329}

Referenced by GetCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerAtom()

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

Definition at line 241 of file G4HadronicProcessStore.cc.

245{
247 localDP.SetKineticEnergy(kineticEnergy);
248 G4double cross = 0.0;
249 if(hp) {
250 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
251 }
252 return cross;
253}

Referenced by GetCrossSectionPerAtom(), and GetInelasticCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerIsotope()

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

Definition at line 257 of file G4HadronicProcessStore.cc.

261{
262 return 0.0;
263}

◆ GetInelasticCrossSectionPerVolume()

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

Definition at line 221 of file G4HadronicProcessStore.cc.

225{
226 G4double cross = 0.0;
227 const G4ElementVector* theElementVector = material->GetElementVector();
228 const G4double* theAtomNumDensityVector =
229 material->GetVecNbOfAtomsPerVolume();
230 size_t nelm = material->GetNumberOfElements();
231 for (size_t i=0; i<nelm; ++i) {
232 const G4Element* elm = (*theElementVector)[i];
233 cross += theAtomNumDensityVector[i]*
234 GetInelasticCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
235 }
236 return cross;
237}

Referenced by GetCrossSectionPerVolume().

◆ GetVerbose()

G4int G4HadronicProcessStore::GetVerbose ( )

Definition at line 919 of file G4HadronicProcessStore.cc.

920{
921 return param->GetVerboseLevel();
922}

◆ Instance()

◆ PrintHtml()

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

Definition at line 631 of file G4HadronicProcessStore.cc.

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

Referenced by DumpHtml().

◆ PrintInfo()

void G4HadronicProcessStore::PrintInfo ( const G4ParticleDefinition part)

Definition at line 569 of file G4HadronicProcessStore.cc.

570{
571 // Trigger particle/process/model printout only when last particle is
572 // registered
573 if(buildTableStart && part == particle[n_part - 1]) {
574 buildTableStart = false;
575 Dump(param->GetVerboseLevel());
576 if (std::getenv("G4PhysListDocDir") ) DumpHtml();
578 }
579}
static G4HadronicInteractionRegistry * Instance()

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

◆ PrintModelHtml()

void G4HadronicProcessStore::PrintModelHtml ( const G4HadronicInteraction model) const

Definition at line 717 of file G4HadronicProcessStore.cc.

718{
719 G4String dirName(std::getenv("G4PhysListDocDir"));
720 G4String physListName(std::getenv("G4PhysListName"));
721 G4String pathName = dirName + "/" + physListName + "_" + HtmlFileName(mod->GetModelName());
722 std::ofstream outModel;
723 outModel.open(pathName);
724 outModel << "<html>\n";
725 outModel << "<head>\n";
726 outModel << "<title>Description of " << mod->GetModelName()
727 << "</title>\n";
728 outModel << "</head>\n";
729 outModel << "<body>\n";
730
731 mod->ModelDescription(outModel);
732
733 outModel << "</body>\n";
734 outModel << "</html>\n";
735
736}

Referenced by PrintHtml().

◆ Register()

void G4HadronicProcessStore::Register ( G4HadronicProcess proc)

Definition at line 405 of file G4HadronicProcessStore.cc.

406{
407 for(G4int i=0; i<n_proc; ++i) {
408 if(process[i] == proc) { return; }
409 }
410 if(1 < param->GetVerboseLevel()) {
411 G4cout << "G4HadronicProcessStore::Register hadronic " << n_proc
412 << " " << proc->GetProcessName() << G4endl;
413 }
414 ++n_proc;
415 process.push_back(proc);
416}

◆ RegisterExtraProcess()

void G4HadronicProcessStore::RegisterExtraProcess ( G4VProcess proc)

Definition at line 487 of file G4HadronicProcessStore.cc.

488{
489 for(G4int i=0; i<n_extra; ++i) {
490 if(extraProcess[i] == proc) { return; }
491 }
492 G4HadronicProcess* hproc = reinterpret_cast<G4HadronicProcess*>(proc);
493 if(hproc) {
494 for(G4int i=0; i<n_proc; ++i) {
495 if(process[i] == hproc) { return; }
496 }
497 }
498 if(1 < param->GetVerboseLevel()) {
499 G4cout << "Extra Process: " << n_extra
500 << " " << proc->GetProcessName() << G4endl;
501 }
502 ++n_extra;
503 extraProcess.push_back(proc);
504}

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

◆ RegisterInteraction()

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

Definition at line 455 of file G4HadronicProcessStore.cc.

457{
458 G4int i=0;
459 for(; i<n_proc; ++i) {if(process[i] == proc) { break; }}
460 G4int k=0;
461 for(; k<n_model; ++k) {if(model[k] == mod) { break; }}
462
463 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
464
465 if(k == n_model) {
466 ++n_model;
467 model.push_back(mod);
468 modelName.push_back(mod->GetModelName());
469 }
470}
const G4String & GetModelName() const

Referenced by G4HadronicProcess::RegisterMe().

◆ RegisterParticle()

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

Definition at line 420 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::PreparePhysicsTable().

◆ RegisterParticleForExtraProcess()

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

Definition at line 508 of file G4HadronicProcessStore.cc.

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

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

◆ SetBuildXSTable()

void G4HadronicProcessStore::SetBuildXSTable ( G4bool  val)

Definition at line 555 of file G4HadronicProcessStore.cc.

556{
557 buildXSTable = val;
558}

◆ SetEpReportLevel()

void G4HadronicProcessStore::SetEpReportLevel ( G4int  level)

Definition at line 969 of file G4HadronicProcessStore.cc.

970{
971 G4cout << " Setting energy/momentum report level to " << level
972 << " for " << process.size() << " hadronic processes " << G4endl;
973 for (G4int i = 0; i < G4int(process.size()); ++i) {
974 process[i]->SetEpReportLevel(level);
975 }
976}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessAbsLevel()

void G4HadronicProcessStore::SetProcessAbsLevel ( G4double  absoluteLevel)

Definition at line 980 of file G4HadronicProcessStore.cc.

981{
982 G4cout << " Setting absolute energy/momentum test level to " << abslevel
983 << G4endl;
984 G4double rellevel = 0.0;
985 G4HadronicProcess* theProcess = 0;
986 for (G4int i = 0; i < G4int(process.size()); ++i) {
987 theProcess = process[i];
988 rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
989 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
990 }
991}
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 995 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetVerbose()

void G4HadronicProcessStore::SetVerbose ( G4int  val)

Definition at line 905 of file G4HadronicProcessStore.cc.

907{
908 G4int i;
909 for(i=0; i<n_proc; ++i) {
910 if(process[i]) { process[i]->SetVerboseLevel(val); }
911 }
912 for(i=0; i<n_model; ++i) {
913 if(model[i]) { model[i]->SetVerboseLevel(val); }
914 }
915}

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: