Geant4 9.6.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)
 
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=0)
 
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=0)
 
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=0)
 
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=0)
 
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 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 ()
 

Detailed Description

Definition at line 68 of file G4HadronicProcessStore.hh.

Constructor & Destructor Documentation

◆ ~G4HadronicProcessStore()

G4HadronicProcessStore::~G4HadronicProcessStore ( )

Member Function Documentation

◆ Clean()

void G4HadronicProcessStore::Clean ( )

Definition at line 86 of file G4HadronicProcessStore.cc.

87{
88 G4int i;
89 //G4cout << "G4HadronicProcessStore::Clean() Nproc= " << n_proc
90 // << " Nextra= " << n_extra << G4endl;
91 if(n_proc > 0) {
92 for (i=0; i<n_proc; ++i) {
93 if( process[i] ) {
94 //G4cout << "G4HadronicProcessStore::Clean() delete hadronic " << i << G4endl;
95 //G4cout << process[i]->GetProcessName() << G4endl;
96 G4HadronicProcess* p = process[i];
97 process[i] = 0;
98 delete p;
99 }
100 }
101 }
102 if(n_extra > 0) {
103 for(i=0; i<n_extra; ++i) {
104 if(extraProcess[i]) {
105 //G4cout << "G4HadronicProcessStore::Clean() delete extra "
106 // << i << G4endl;
107 //G4cout << extraProcess[i]->GetProcessName() << G4endl;
108 G4VProcess* p = extraProcess[i];
109 extraProcess[i] = 0;
110 delete p;
111 }
112 }
113 }
114 //G4cout << "G4HadronicProcessStore::Clean() done" << G4endl;
115 n_extra = 0;
116 n_proc = 0;
117}
int G4int
Definition: G4Types.hh:66

Referenced by ~G4HadronicProcessStore().

◆ DeRegister()

void G4HadronicProcessStore::DeRegister ( G4HadronicProcess proc)

Definition at line 470 of file G4HadronicProcessStore.cc.

471{
472 if(0 == n_proc) return;
473 for(G4int i=0; i<n_proc; ++i) {
474 if(process[i] == proc) {
475 process[i] = 0;
476 return;
477 }
478 }
479}

Referenced by G4HadronicProcess::~G4HadronicProcess().

◆ DeRegisterExtraProcess()

void G4HadronicProcessStore::DeRegisterExtraProcess ( G4VProcess proc)

Definition at line 530 of file G4HadronicProcessStore.cc.

531{
532 //G4cout << "Deregister Extra Process: " << proc << " "<<proc->GetProcessName()<< G4endl;
533 if(0 == n_extra) { return; }
534 for(G4int i=0; i<n_extra; ++i) {
535 if(extraProcess[i] == proc) {
536 extraProcess[i] = 0;
537 //G4cout << "Extra Process: " << i << " is deregisted " << G4endl;
538 return;
539 }
540 }
541}

Referenced by G4AntiNeutronAnnihilationAtRest::~G4AntiNeutronAnnihilationAtRest(), G4AntiProtonAnnihilationAtRest::~G4AntiProtonAnnihilationAtRest(), G4HadronStoppingProcess::~G4HadronStoppingProcess(), G4KaonMinusAbsorption::~G4KaonMinusAbsorption(), G4KaonMinusAbsorptionAtRest::~G4KaonMinusAbsorptionAtRest(), G4MuonMinusCaptureAtRest::~G4MuonMinusCaptureAtRest(), G4NeutronCaptureAtRest::~G4NeutronCaptureAtRest(), G4PiMinusAbsorptionAtRest::~G4PiMinusAbsorptionAtRest(), and G4PionMinusAbsorptionAtRest::~G4PionMinusAbsorptionAtRest().

◆ Dump()

void G4HadronicProcessStore::Dump ( G4int  level)

Definition at line 678 of file G4HadronicProcessStore.cc.

679{
680 if(level > 0) {
681 G4cout << "=============================================================="
682 << "=============================="
683 << G4endl;
684 G4cout << " HADRONIC PROCESSES SUMMARY (verbose level " << level
685 << ")" << G4endl;
686 }
687 for(G4int i=0; i<n_part; ++i) {
688 PD part = particle[i];
689 G4String pname = part->GetParticleName();
690 G4bool yes = false;
691 if(level >= 2) yes = true;
692
693 else if(level == 1 && (pname == "proton" ||
694 pname == "neutron" ||
695 pname == "pi+" ||
696 pname == "pi-" ||
697 pname == "gamma" ||
698 pname == "e+" ||
699 pname == "e-" ||
700 pname == "mu+" ||
701 pname == "mu-" ||
702 pname == "kaon+" ||
703 pname == "kaon-" ||
704 pname == "lambda" ||
705 pname == "GenericIon" ||
706 pname == "anti_neutron" ||
707 pname == "anti_proton")) yes = true;
708 if(yes) {
709 // main processes
710 std::multimap<PD,HP,std::less<PD> >::iterator it;
711
712 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
713 if(it->first == part) {
714 HP proc = (it->second);
715 G4int j=0;
716 for(; j<n_proc; ++j) {
717 if(process[j] == proc) {
718 Print(j, i);
719 }
720 }
721 }
722 }
723 // extra processes
724 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
725 for(itp=ep_map.lower_bound(part); itp!=ep_map.upper_bound(part); ++itp) {
726 if(itp->first == part) {
727 G4VProcess* proc = (itp->second);
728 if(wasPrinted[i] == 0) {
729 wasPrinted[i] = 1;
730 G4cout<<G4endl;
731 G4cout << " Hadronic Processes for <"
732 <<part->GetParticleName() << ">" << G4endl;
733 }
734 G4cout << " " << proc->GetProcessName() << G4endl;
735 }
736 }
737 }
738 }
739 if(level > 0) {
740 G4cout << "=============================================================="
741 << "=============================="
742 << G4endl;
743 }
744}
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:379

Referenced by PrintInfo().

◆ DumpHtml()

void G4HadronicProcessStore::DumpHtml ( )

Definition at line 556 of file G4HadronicProcessStore.cc.

557{
558 // Automatic generation of html documentation page for physics lists
559 // List processes, models and cross sections for the most important
560 // particles in descending order of importance
561
562 char* dirName = getenv("G4PhysListDocDir");
563 char* physListName = getenv("G4PhysListName");
564 if (dirName && physListName) {
565
566 // Open output file with path name
567 G4String pathName = G4String(dirName) + "/" + G4String(physListName) + ".html";
568 std::ofstream outFile;
569 outFile.open(pathName);
570
571 // Write physics list summary file
572 outFile << "<html>\n";
573 outFile << "<head>\n";
574 outFile << "<title>Physics List Summary</title>\n";
575 outFile << "</head>\n";
576 outFile << "<body>\n";
577 outFile << "<h2> Summary of Hadronic Processes, Models and Cross Sections for Physics List "
578 << G4String(physListName) << "</h2>\n";
579 outFile << "<ul>\n";
580
581 PrintHtml(G4Proton::Proton(), outFile);
582 PrintHtml(G4Neutron::Neutron(), outFile);
583 PrintHtml(G4PionPlus::PionPlus(), outFile);
585 PrintHtml(G4Gamma::Gamma(), outFile);
587// PrintHtml(G4MuonMinus::MuonMinus(), outFile);
591 PrintHtml(G4Lambda::Lambda(), outFile);
592 PrintHtml(G4Alpha::Alpha(), outFile);
593
594 outFile << "</ul>\n";
595 outFile << "</body>\n";
596 outFile << "</html>\n";
597 outFile.close();
598 }
599}
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
static G4Electron * Electron()
Definition: G4Electron.cc:94
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void PrintHtml(const G4ParticleDefinition *, std::ofstream &)
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
static G4Lambda * Lambda()
Definition: G4Lambda.cc:108
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Proton * Proton()
Definition: G4Proton.cc:93

Referenced by PrintInfo().

◆ FindProcess()

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

Definition at line 814 of file G4HadronicProcessStore.cc.

816{
817 bool isNew = false;
818 G4HadronicProcess* hp = 0;
819
820 if(part != currentParticle) {
821 isNew = true;
822 currentParticle = part;
823 localDP.SetDefinition(part);
824 } else if(!currentProcess) {
825 isNew = true;
826 } else if(subType == currentProcess->GetProcessSubType()) {
827 hp = currentProcess;
828 } else {
829 isNew = true;
830 }
831
832 if(isNew) {
833 std::multimap<PD,HP,std::less<PD> >::iterator it;
834 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
835 if(it->first == part && subType == (it->second)->GetProcessSubType()) {
836 hp = it->second;
837 break;
838 }
839 }
840 currentProcess = hp;
841 }
842
843 return hp;
844}
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4int GetProcessSubType() const
Definition: G4VProcess.hh:397

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

◆ GetCaptureCrossSectionPerAtom()

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

Definition at line 290 of file G4HadronicProcessStore.cc.

294{
295 G4HadronicProcess* hp = FindProcess(aParticle, fCapture);
296 localDP.SetKineticEnergy(kineticEnergy);
297 G4double cross = 0.0;
298 if(hp) {
299 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
300 }
301 return cross;
302}
double G4double
Definition: G4Types.hh:64
void SetKineticEnergy(G4double aEnergy)
G4HadronicProcess * FindProcess(const G4ParticleDefinition *, G4HadronicProcessType subType)
G4double GetElementCrossSection(const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=0)

Referenced by GetCaptureCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetCaptureCrossSectionPerIsotope()

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

Definition at line 306 of file G4HadronicProcessStore.cc.

310{
311 return 0.0;
312}

◆ GetCaptureCrossSectionPerVolume()

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

Definition at line 271 of file G4HadronicProcessStore.cc.

275{
276 G4double cross = 0.0;
277 const G4ElementVector* theElementVector = material->GetElementVector();
278 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
279 size_t nelm = material->GetNumberOfElements();
280 for (size_t i=0; i<nelm; ++i) {
281 const G4Element* elm = (*theElementVector)[i];
282 cross += theAtomNumDensityVector[i]*
283 GetCaptureCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
284 }
285 return cross;
286}
std::vector< G4Element * > G4ElementVector
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:189
size_t GetNumberOfElements() const
Definition: G4Material.hh:185
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:205

Referenced by GetCrossSectionPerVolume().

◆ GetChargeExchangeCrossSectionPerAtom()

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

Definition at line 380 of file G4HadronicProcessStore.cc.

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

Referenced by GetChargeExchangeCrossSectionPerVolume(), and GetCrossSectionPerAtom().

◆ GetChargeExchangeCrossSectionPerIsotope()

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

Definition at line 396 of file G4HadronicProcessStore.cc.

400{
401 return 0.0;
402}

◆ GetChargeExchangeCrossSectionPerVolume()

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

Definition at line 361 of file G4HadronicProcessStore.cc.

365{
366 G4double cross = 0.0;
367 const G4ElementVector* theElementVector = material->GetElementVector();
368 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
369 size_t nelm = material->GetNumberOfElements();
370 for (size_t i=0; i<nelm; ++i) {
371 const G4Element* elm = (*theElementVector)[i];
372 cross += theAtomNumDensityVector[i]*
373 GetChargeExchangeCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
374 }
375 return cross;
376}
G4double GetChargeExchangeCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)

Referenced by GetCrossSectionPerVolume().

◆ GetCrossSectionPerAtom()

G4double G4HadronicProcessStore::GetCrossSectionPerAtom ( const G4ParticleDefinition particle,
G4double  kineticEnergy,
const G4VProcess process,
const G4Element element 
)

Definition at line 135 of file G4HadronicProcessStore.cc.

140{
141 G4double cross = 0.;
142 G4int subType = proc->GetProcessSubType();
143 if (subType == fHadronElastic)
144 cross = GetElasticCrossSectionPerAtom(part,energy,element);
145 else if (subType == fHadronInelastic)
146 cross = GetInelasticCrossSectionPerAtom(part,energy,element);
147 else if (subType == fCapture)
148 cross = GetCaptureCrossSectionPerAtom(part,energy,element);
149 else if (subType == fFission)
150 cross = GetFissionCrossSectionPerAtom(part,energy,element);
151 else if (subType == fChargeExchange)
152 cross = GetChargeExchangeCrossSectionPerAtom(part,energy,element);
153 return cross;
154}
@ fHadronElastic
@ fHadronInelastic
G4double GetFissionCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4double GetElasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4double GetInelasticCrossSectionPerAtom(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 158 of file G4HadronicProcessStore.cc.

163{
164 G4double cross = 0.;
165 G4int subType = proc->GetProcessSubType();
166 if (subType == fHadronElastic)
167 cross = GetElasticCrossSectionPerVolume(part,energy,material);
168 else if (subType == fHadronInelastic)
169 cross = GetInelasticCrossSectionPerVolume(part,energy,material);
170 else if (subType == fCapture)
171 cross = GetCaptureCrossSectionPerVolume(part,energy,material);
172 else if (subType == fFission)
173 cross = GetFissionCrossSectionPerVolume(part,energy,material);
174 else if (subType == fChargeExchange)
175 cross = GetChargeExchangeCrossSectionPerVolume(part,energy,material);
176 return cross;
177}
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 200 of file G4HadronicProcessStore.cc.

204{
206 G4double cross = 0.0;
207 localDP.SetKineticEnergy(kineticEnergy);
208 if(hp) {
209 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
210 }
211 return cross;
212}

Referenced by GetCrossSectionPerAtom(), and GetElasticCrossSectionPerVolume().

◆ GetElasticCrossSectionPerIsotope()

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

Definition at line 216 of file G4HadronicProcessStore.cc.

220{
221 return 0.0;
222}

◆ GetElasticCrossSectionPerVolume()

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

Definition at line 181 of file G4HadronicProcessStore.cc.

185{
186 G4double cross = 0.0;
187 const G4ElementVector* theElementVector = material->GetElementVector();
188 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
189 size_t nelm = material->GetNumberOfElements();
190 for (size_t i=0; i<nelm; ++i) {
191 const G4Element* elm = (*theElementVector)[i];
192 cross += theAtomNumDensityVector[i]*
193 GetElasticCrossSectionPerAtom(aParticle,kineticEnergy,elm,material);
194 }
195 return cross;
196}

Referenced by GetCrossSectionPerVolume().

◆ GetFissionCrossSectionPerAtom()

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

Definition at line 335 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerAtom(), and GetFissionCrossSectionPerVolume().

◆ GetFissionCrossSectionPerIsotope()

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

Definition at line 351 of file G4HadronicProcessStore.cc.

355{
356 return 0.0;
357}

◆ GetFissionCrossSectionPerVolume()

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

Definition at line 316 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerAtom()

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

Definition at line 245 of file G4HadronicProcessStore.cc.

249{
251 localDP.SetKineticEnergy(kineticEnergy);
252 G4double cross = 0.0;
253 if(hp) {
254 cross = hp->GetElementCrossSection(&localDP,anElement,mat);
255 }
256 return cross;
257}

Referenced by GetCrossSectionPerAtom(), and GetInelasticCrossSectionPerVolume().

◆ GetInelasticCrossSectionPerIsotope()

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

Definition at line 261 of file G4HadronicProcessStore.cc.

265{
266 return 0.0;
267}

◆ GetInelasticCrossSectionPerVolume()

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

Definition at line 226 of file G4HadronicProcessStore.cc.

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

Referenced by GetCrossSectionPerVolume().

◆ GetVerbose()

G4int G4HadronicProcessStore::GetVerbose ( )

Definition at line 807 of file G4HadronicProcessStore.cc.

808{
809 return verbose;
810}

◆ Instance()

G4HadronicProcessStore * G4HadronicProcessStore::Instance ( )
static

Definition at line 65 of file G4HadronicProcessStore.cc.

66{
67 if(0 == theInstance) {
68 static G4HadronicProcessStore manager;
69 theInstance = &manager;
70 }
71 return theInstance;
72}

Referenced by G4HadronicProcess::BuildPhysicsTable(), G4AntiNeutronAnnihilationAtRest::BuildPhysicsTable(), G4AntiProtonAnnihilationAtRest::BuildPhysicsTable(), G4HadronStoppingProcess::BuildPhysicsTable(), G4KaonMinusAbsorption::BuildPhysicsTable(), G4KaonMinusAbsorptionAtRest::BuildPhysicsTable(), G4MuonMinusCaptureAtRest::BuildPhysicsTable(), G4NeutronCaptureAtRest::BuildPhysicsTable(), G4PiMinusAbsorptionAtRest::BuildPhysicsTable(), G4PionMinusAbsorptionAtRest::BuildPhysicsTable(), G4HadronInelasticQBBC::ConstructProcess(), G4AntiNeutronAnnihilationAtRest::G4AntiNeutronAnnihilationAtRest(), G4AntiProtonAnnihilationAtRest::G4AntiProtonAnnihilationAtRest(), G4HadronicProcess::G4HadronicProcess(), G4HadronStoppingProcess::G4HadronStoppingProcess(), G4KaonMinusAbsorption::G4KaonMinusAbsorption(), G4KaonMinusAbsorptionAtRest::G4KaonMinusAbsorptionAtRest(), G4MuonMinusCaptureAtRest::G4MuonMinusCaptureAtRest(), G4NeutronCaptureAtRest::G4NeutronCaptureAtRest(), G4PiMinusAbsorptionAtRest::G4PiMinusAbsorptionAtRest(), G4PionMinusAbsorptionAtRest::G4PionMinusAbsorptionAtRest(), G4HadronicProcess::PreparePhysicsTable(), G4AntiNeutronAnnihilationAtRest::PreparePhysicsTable(), G4AntiProtonAnnihilationAtRest::PreparePhysicsTable(), G4HadronStoppingProcess::PreparePhysicsTable(), G4KaonMinusAbsorption::PreparePhysicsTable(), G4KaonMinusAbsorptionAtRest::PreparePhysicsTable(), G4MuonMinusCaptureAtRest::PreparePhysicsTable(), G4NeutronCaptureAtRest::PreparePhysicsTable(), G4PiMinusAbsorptionAtRest::PreparePhysicsTable(), G4PionMinusAbsorptionAtRest::PreparePhysicsTable(), G4HadronicProcess::RegisterMe(), G4AntiNeutronAnnihilationAtRest::~G4AntiNeutronAnnihilationAtRest(), G4AntiProtonAnnihilationAtRest::~G4AntiProtonAnnihilationAtRest(), G4HadronicProcess::~G4HadronicProcess(), G4HadronStoppingProcess::~G4HadronStoppingProcess(), G4KaonMinusAbsorption::~G4KaonMinusAbsorption(), G4KaonMinusAbsorptionAtRest::~G4KaonMinusAbsorptionAtRest(), G4MuonMinusCaptureAtRest::~G4MuonMinusCaptureAtRest(), G4NeutronCaptureAtRest::~G4NeutronCaptureAtRest(), G4PiMinusAbsorptionAtRest::~G4PiMinusAbsorptionAtRest(), and G4PionMinusAbsorptionAtRest::~G4PionMinusAbsorptionAtRest().

◆ PrintHtml()

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

Definition at line 602 of file G4HadronicProcessStore.cc.

604{
605 // Automatic generation of html documentation page for physics lists
606 // List processes for the most important particles in descending order
607 // of importance
608
609 outFile << "<br> <li><h2><font color=\" ff0000 \">"
610 << theParticle->GetParticleName() << "</font></h2></li>\n";
611
612 typedef std::multimap<PD,HP,std::less<PD> > PDHPmap;
613 typedef std::multimap<HP,HI,std::less<HP> > HPHImap;
614
615 std::pair<PDHPmap::iterator, PDHPmap::iterator> itpart =
616 p_map.equal_range(theParticle);
617
618 // Loop over processes assigned to particle
619
620 G4HadronicProcess* theProcess;
621 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
622 theProcess = (*it).second;
623 outFile << "<br> &nbsp;&nbsp; <b><font color=\" 0000ff \">process : <a href=\""
624 << theProcess->GetProcessName() << ".html\"> "
625 << theProcess->GetProcessName() << "</a></font></b>\n";
626 outFile << "<ul>\n";
627 outFile << " <li><b><font color=\" 00AA00 \">models : </font></b>\n";
628
629 // Loop over models assigned to process
630 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
631 m_map.equal_range(theProcess);
632
633 outFile << " <ul>\n";
634 for (HPHImap::iterator jt = itmod.first; jt != itmod.second; ++jt) {
635 outFile << " <li><b><a href=\"" << (*jt).second->GetModelName() << ".html\"> "
636 << (*jt).second->GetModelName() << "</a>"
637 << " from " << (*jt).second->GetMinEnergy()/GeV
638 << " GeV to " << (*jt).second->GetMaxEnergy()/GeV
639 << " GeV </b></li>\n";
640
641 // Print ModelDescription, ignore that we overwrite files n-times.
642 PrintModelHtml((*jt).second);
643
644 }
645 outFile << " </ul>\n";
646 outFile << " </li>\n";
647
648 // List cross sections assigned to process
649 outFile << " <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
650 outFile << " <ul>\n";
651 theProcess->GetCrossSectionDataStore()->DumpHtml(*theParticle, outFile);
652 // << " \n";
653 outFile << " </ul>\n";
654
655 outFile << " </li>\n";
656 outFile << "</ul>\n";
657 }
658}
void DumpHtml(const G4ParticleDefinition &, std::ofstream &)
void PrintModelHtml(const G4HadronicInteraction *model) const
G4CrossSectionDataStore * GetCrossSectionDataStore()
const G4String & GetParticleName() const

Referenced by DumpHtml().

◆ PrintInfo()

void G4HadronicProcessStore::PrintInfo ( const G4ParticleDefinition part)

◆ PrintModelHtml()

void G4HadronicProcessStore::PrintModelHtml ( const G4HadronicInteraction model) const

Definition at line 660 of file G4HadronicProcessStore.cc.

661{
662 G4String dirName(getenv("G4PhysListDocDir"));
663 G4String pathName = dirName + "/" + mod->GetModelName() + ".html";
664 std::ofstream outModel;
665 outModel.open(pathName);
666 outModel << "<html>\n";
667 outModel << "<head>\n";
668 outModel << "<title>Description of " << mod->GetModelName() << "</title>\n";
669 outModel << "</head>\n";
670 outModel << "<body>\n";
671
672 mod->ModelDescription(outModel);
673
674 outModel << "</body>\n";
675 outModel << "</html>\n";
676
677}

Referenced by PrintHtml().

◆ Register()

void G4HadronicProcessStore::Register ( G4HadronicProcess proc)

Definition at line 406 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::G4HadronicProcess().

◆ RegisterExtraProcess()

void G4HadronicProcessStore::RegisterExtraProcess ( G4VProcess proc)

◆ RegisterInteraction()

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

Definition at line 451 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::RegisterMe().

◆ RegisterParticle()

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

Definition at line 421 of file G4HadronicProcessStore.cc.

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

Referenced by G4HadronicProcess::PreparePhysicsTable().

◆ RegisterParticleForExtraProcess()

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

Definition at line 499 of file G4HadronicProcessStore.cc.

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

Referenced by G4AntiNeutronAnnihilationAtRest::PreparePhysicsTable(), G4AntiProtonAnnihilationAtRest::PreparePhysicsTable(), G4HadronStoppingProcess::PreparePhysicsTable(), G4KaonMinusAbsorption::PreparePhysicsTable(), G4KaonMinusAbsorptionAtRest::PreparePhysicsTable(), G4MuonMinusCaptureAtRest::PreparePhysicsTable(), G4NeutronCaptureAtRest::PreparePhysicsTable(), G4PiMinusAbsorptionAtRest::PreparePhysicsTable(), and G4PionMinusAbsorptionAtRest::PreparePhysicsTable().

◆ SetEpReportLevel()

void G4HadronicProcessStore::SetEpReportLevel ( G4int  level)

Definition at line 846 of file G4HadronicProcessStore.cc.

847{
848 G4cout << " Setting energy/momentum report level to " << level
849 << " for " << process.size() << " hadronic processes " << G4endl;
850 for (G4int i = 0; i < G4int(process.size()); ++i) {
851 process[i]->SetEpReportLevel(level);
852 }
853}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetProcessAbsLevel()

void G4HadronicProcessStore::SetProcessAbsLevel ( G4double  absoluteLevel)

Definition at line 855 of file G4HadronicProcessStore.cc.

856{
857 G4cout << " Setting absolute energy/momentum test level to " << abslevel << G4endl;
858 G4double rellevel = 0.0;
859 G4HadronicProcess* theProcess = 0;
860 for (G4int i = 0; i < G4int(process.size()); ++i) {
861 theProcess = process[i];
862 rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
863 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
864 }
865}
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 867 of file G4HadronicProcessStore.cc.

868{
869 G4cout << " Setting relative energy/momentum test level to " << rellevel << G4endl;
870 G4double abslevel = 0.0;
871 G4HadronicProcess* theProcess = 0;
872 for (G4int i = 0; i < G4int(process.size()); ++i) {
873 theProcess = process[i];
874 abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
875 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
876 }
877}

Referenced by G4HadronicEPTestMessenger::SetNewValue().

◆ SetVerbose()

void G4HadronicProcessStore::SetVerbose ( G4int  val)

Definition at line 793 of file G4HadronicProcessStore.cc.

794{
795 verbose = val;
796 G4int i;
797 for(i=0; i<n_proc; ++i) {
798 if(process[i]) { process[i]->SetVerboseLevel(val); }
799 }
800 for(i=0; i<n_model; ++i) {
801 if(model[i]) { model[i]->SetVerboseLevel(val); }
802 }
803}

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