83 delete theEPTestMessenger;
93 for (i=0; i<n_proc; ++i) {
100 for(i=0; i<n_extra; ++i) {
101 if(extraProcess[i]) {
104 delete extraProcess[i];
115 G4HadronicProcessStore::G4HadronicProcessStore()
126 buildTableStart =
true;
185 const G4double* theAtomNumDensityVector =
188 for (
size_t i=0; i<nelm; ++i) {
189 const G4Element* elm = (*theElementVector)[i];
190 cross += theAtomNumDensityVector[i]*
231 const G4double* theAtomNumDensityVector =
234 for (
size_t i=0; i<nelm; ++i) {
235 const G4Element* elm = (*theElementVector)[i];
236 cross += theAtomNumDensityVector[i]*
277 const G4double* theAtomNumDensityVector =
280 for (
size_t i=0; i<nelm; ++i) {
281 const G4Element* elm = (*theElementVector)[i];
282 cross += theAtomNumDensityVector[i]*
323 const G4double* theAtomNumDensityVector =
326 for (
size_t i=0; i<nelm; i++) {
327 const G4Element* elm = (*theElementVector)[i];
328 cross += theAtomNumDensityVector[i]*
369 const G4double* theAtomNumDensityVector =
372 for (
size_t i=0; i<nelm; ++i) {
373 const G4Element* elm = (*theElementVector)[i];
374 cross += theAtomNumDensityVector[i]*
410 for(
G4int i=0; i<n_proc; ++i) {
411 if(process[i] == proc) {
return; }
414 G4cout <<
"G4HadronicProcessStore::Register hadronic " << n_proc
418 process.push_back(proc);
427 for(; i<n_proc; ++i) {
if(process[i] == proc)
break;}
429 for(; j<n_part; ++j) {
if(particle[j] == part)
break;}
432 G4cout <<
"G4HadronicProcessStore::RegisterParticle "
438 particle.push_back(part);
439 wasPrinted.push_back(0);
444 std::multimap<PD,HP,std::less<PD> >::iterator it;
445 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
446 if(it->first == part) {
447 HP process2 = (it->second);
448 if(proc == process2) {
return; }
453 p_map.insert(std::multimap<PD,HP>::value_type(part,proc));
462 for(; i<n_proc; ++i) {
if(process[i] == proc) {
break; }}
464 for(; k<n_model; ++k) {
if(
model[k] == mod) {
break; }}
466 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
470 model.push_back(mod);
479 for(
G4int i=0; i<n_proc; ++i) {
480 if(process[i] == proc) {
492 for(
G4int i=0; i<n_extra; ++i) {
493 if(extraProcess[i] == proc) {
return; }
497 for(
G4int i=0; i<n_proc; ++i) {
498 if(process[i] == hproc) {
return; }
502 G4cout <<
"Extra Process: " << n_extra
506 extraProcess.push_back(proc);
516 for(; i<n_extra; ++i) {
if(extraProcess[i] == proc) {
break; } }
518 for(; j<n_part; ++j) {
if(particle[j] == part) {
break; } }
522 particle.push_back(part);
523 wasPrinted.push_back(0);
528 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator it;
529 for(it=ep_map.lower_bound(part); it!=ep_map.upper_bound(part); ++it) {
530 if(it->first == part) {
532 if(proc == process2) {
return; }
537 ep_map.insert(std::multimap<PD,G4VProcess*>::value_type(part,proc));
544 for(
G4int i=0; i<n_extra; ++i) {
545 if(extraProcess[i] == proc) {
548 G4cout <<
"Extra Process: " << i <<
" "
562 if(buildTableStart && part == particle[n_part - 1]) {
563 buildTableStart =
false;
565 if (getenv(
"G4PhysListDocDir") )
DumpHtml();
578 char* dirName = getenv(
"G4PhysListDocDir");
579 char* physListName = getenv(
"G4PhysListName");
580 if (dirName && physListName) {
584 std::ofstream outFile;
585 outFile.open(pathName);
588 outFile <<
"<html>\n";
589 outFile <<
"<head>\n";
590 outFile <<
"<title>Physics List Summary</title>\n";
591 outFile <<
"</head>\n";
592 outFile <<
"<body>\n";
593 outFile <<
"<h2> Summary of Hadronic Processes, Models and Cross Sections for Physics List "
594 <<
G4String(physListName) <<
"</h2>\n";
610 outFile <<
"</ul>\n";
611 outFile <<
"</body>\n";
612 outFile <<
"</html>\n";
620 std::ofstream& outFile)
626 outFile <<
"<br> <li><h2><font color=\" ff0000 \">"
629 typedef std::multimap<PD,HP,std::less<PD> > PDHPmap;
630 typedef std::multimap<HP,HI,std::less<HP> > HPHImap;
632 std::pair<PDHPmap::iterator, PDHPmap::iterator> itpart =
633 p_map.equal_range(theParticle);
638 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
639 theProcess = (*it).second;
644 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
649 outFile <<
" <li><b><font color=\" 00AA00 \">models : </font></b>\n";
651 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
652 m_map.equal_range(theProcess);
654 outFile <<
" <ul>\n";
655 G4String physListName(getenv(
"G4PhysListName"));
657 for (HPHImap::iterator jt = itmod.first; jt != itmod.second; ++jt) {
658 outFile <<
" <li><b><a href=\"" << physListName <<
"_"
659 << HtmlFileName((*jt).second->GetModelName()) <<
"\"> "
660 << (*jt).second->GetModelName() <<
"</a>"
661 <<
" from " << (*jt).second->GetMinEnergy()/
GeV
662 <<
" GeV to " << (*jt).second->GetMaxEnergy()/
GeV
663 <<
" GeV </b></li>\n";
669 outFile <<
" </ul>\n";
670 outFile <<
" </li>\n";
673 outFile <<
" <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
674 outFile <<
" <ul>\n";
677 outFile <<
" </ul>\n";
679 outFile <<
" </li>\n";
680 outFile <<
"</ul>\n";
689 G4String dirName(getenv(
"G4PhysListDocDir"));
690 G4String physListName(getenv(
"G4PhysListName"));
692 std::ofstream outModel;
693 outModel.open(pathName);
694 outModel <<
"<html>\n";
695 outModel <<
"<head>\n";
696 outModel <<
"<title>Description of " << mod->
GetModelName()
698 outModel <<
"</head>\n";
699 outModel <<
"<body>\n";
703 outModel <<
"</body>\n";
704 outModel <<
"</html>\n";
715 std::transform(str.begin(), str.end(), str.begin(), [](
char ch) {
716 return ch ==
' ' ?
'_' : ch;
720 for(std::string::iterator it = str.begin(); it != str.end(); ++it) {
721 if(*it ==
' ') *it =
'_';
732 if (level == 0)
return;
735 <<
"\n====================================================================\n"
736 << std::setw(60) <<
"HADRONIC PROCESSES SUMMARY (verbose level " << level
739 for (
G4int i=0; i<n_part; ++i) {
740 PD part = particle[i];
744 if (level == 1 && (pname ==
"proton" ||
745 pname ==
"neutron" ||
746 pname ==
"deuteron" ||
760 pname ==
"GenericIon" ||
761 pname ==
"anti_neutron" ||
762 pname ==
"anti_proton" ||
763 pname ==
"anti_deuteron" ||
764 pname ==
"anti_triton" ||
765 pname ==
"anti_He3" ||
766 pname ==
"anti_alpha")) yes =
true;
767 if (level > 1) yes =
true;
770 std::multimap<PD,HP,std::less<PD> >::iterator it;
772 for (it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
773 if (it->first == part) {
774 HP proc = (it->second);
776 for (; j<n_proc; ++j) {
777 if (process[j] == proc) { Print(j, i); }
783 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
784 for(itp=ep_map.lower_bound(part); itp!=ep_map.upper_bound(part); ++itp) {
785 if(itp->first == part) {
787 if (wasPrinted[i] == 0) {
788 G4cout <<
"\n---------------------------------------------------\n"
789 << std::setw(50) <<
"Hadronic Processes for "
799 G4cout <<
"\n================================================================"
805 void G4HadronicProcessStore::Print(
G4int idxProc,
G4int idxPart)
809 if (wasPrinted[idxPart] == 0) {
810 G4cout <<
"\n---------------------------------------------------\n"
811 << std::setw(50) <<
"Hadronic Processes for "
813 wasPrinted[idxPart] = 1;
819 G4String stringEnergyPerNucleon =
"";
823 stringEnergyPerNucleon =
"/n";
827 std::multimap<HP,HI,std::less<HP> >::iterator ih;
828 for(ih=m_map.lower_bound(proc); ih!=m_map.upper_bound(proc); ++ih) {
829 if(ih->first == proc) {
832 for(; i<n_model; ++i) {
833 if(
model[i] == hi) {
break; }
835 G4cout <<
"\n Model: " << std::setw(25) << modelName[i] <<
": "
836 <<
G4BestUnit(hi->GetMinEnergy(),
"Energy") << stringEnergyPerNucleon
838 <<
G4BestUnit(hi->GetMaxEnergy(),
"Energy") << stringEnergyPerNucleon;
853 for(i=0; i<n_proc; ++i) {
854 if(process[i]) { process[i]->SetVerboseLevel(val); }
856 for(i=0; i<n_model; ++i) {
857 if(
model[i]) {
model[i]->SetVerboseLevel(val); }
877 if(part != currentParticle) {
882 if(p != currentParticle) {
888 if(!currentProcess) {
897 std::multimap<PD,HP,std::less<PD> >::iterator it;
898 for(it=p_map.lower_bound(currentParticle);
899 it!=p_map.upper_bound(currentParticle); ++it) {
900 if(it->first == currentParticle &&
901 subType == (it->second)->GetProcessSubType()) {
915 G4cout <<
" Setting energy/momentum report level to " << level
916 <<
" for " << process.size() <<
" hadronic processes " <<
G4endl;
917 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
918 process[i]->SetEpReportLevel(level);
926 G4cout <<
" Setting absolute energy/momentum test level to " << abslevel
930 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
931 theProcess = process[i];
941 G4cout <<
" Setting relative energy/momentum test level to " << rellevel
945 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
946 theProcess = process[i];
void DeRegisterExtraProcess(G4VProcess *)
void PrintModelHtml(const G4HadronicInteraction *model) const
void SetVerbose(G4int val)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetProcessAbsLevel(G4double absoluteLevel)
G4double GetCaptureCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
void RegisterInteraction(G4HadronicProcess *, G4HadronicInteraction *)
std::vector< G4Element * > G4ElementVector
void PrintHtml(const G4ParticleDefinition *, std::ofstream &)
static G4HadronicProcessStore * Instance()
G4double GetElasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
~G4HadronicProcessStore()
static G4GenericIon * Definition()
G4double GetElementCrossSection(const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=nullptr)
virtual void ModelDescription(std::ostream &outFile) const
G4double GetFissionCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetModelName() const
G4double GetFissionCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
const G4ElementVector * GetElementVector() const
const G4String & GetParticleName() const
static G4KaonMinus * KaonMinus()
const G4double * GetVecNbOfAtomsPerVolume() const
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
G4GLOB_DLL std::ostream G4cout
G4HadronicProcess * FindProcess(const G4ParticleDefinition *, G4HadronicProcessType subType)
void Register(G4HadronicProcess *)
G4double GetChargeExchangeCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
G4double GetInelasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4CrossSectionDataStore * GetCrossSectionDataStore()
G4double GetInelasticCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
static G4Proton * Proton()
static G4PionPlus * PionPlus()
const G4String & GetParticleType() const
G4double GetChargeExchangeCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
static G4Neutron * Neutron()
virtual void ProcessDescription(std::ostream &outFile) const
void RegisterParticle(G4HadronicProcess *, const G4ParticleDefinition *)
const G4String & GetProcessName() const
void DeRegister(G4HadronicProcess *)
void SetKineticEnergy(G4double aEnergy)
void RegisterExtraProcess(G4VProcess *)
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
static G4Positron * Positron()
void DumpPhysicsTable(const G4ParticleDefinition &)
G4double GetChargeExchangeCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4double GetFissionCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void DumpHtml(const G4ParticleDefinition &, std::ofstream &) const
static G4ParticleTable * GetParticleTable()
G4double GetElasticCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
G4double energy(const ThreeVector &p, const G4double m)
static G4HadronicInteractionRegistry * Instance()
G4double GetCrossSectionPerVolume(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
static G4PionMinus * PionMinus()
void SetProcessRelLevel(G4double relativeLevel)
static constexpr double GeV
static G4Electron * Electron()
void SetEpReportLevel(G4int level)
G4double GetCaptureCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
size_t GetNumberOfElements() const
static G4Lambda * Lambda()
G4double GetElasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
static G4KaonPlus * KaonPlus()
G4double GetInelasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
const XML_Char XML_Content * model
G4int GetProcessSubType() const
std::pair< G4double, G4double > GetEnergyMomentumCheckLevels() const
G4double GetCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=0)
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4int GetBaryonNumber() const
void PrintInfo(const G4ParticleDefinition *)