84 delete theEPTestMessenger;
92 for (i=0; i<n_proc; ++i) {
98 for(i=0; i<n_extra; ++i) {
100 delete extraProcess[i];
101 extraProcess[i] =
nullptr;
110G4HadronicProcessStore::G4HadronicProcessStore()
116 currentProcess =
nullptr;
117 currentParticle =
nullptr;
121 buildTableStart =
true;
122 buildXSTable =
false;
182 const G4double* theAtomNumDensityVector =
185 for (
size_t i=0; i<nelm; ++i) {
186 const G4Element* elm = (*theElementVector)[i];
187 cross += theAtomNumDensityVector[i]*
228 const G4double* theAtomNumDensityVector =
231 for (
size_t i=0; i<nelm; ++i) {
232 const G4Element* elm = (*theElementVector)[i];
233 cross += theAtomNumDensityVector[i]*
274 const G4double* theAtomNumDensityVector =
277 for (
size_t i=0; i<nelm; ++i) {
278 const G4Element* elm = (*theElementVector)[i];
279 cross += theAtomNumDensityVector[i]*
320 const G4double* theAtomNumDensityVector =
323 for (
size_t i=0; i<nelm; i++) {
324 const G4Element* elm = (*theElementVector)[i];
325 cross += theAtomNumDensityVector[i]*
366 const G4double* theAtomNumDensityVector =
369 for (
size_t i=0; i<nelm; ++i) {
370 const G4Element* elm = (*theElementVector)[i];
371 cross += theAtomNumDensityVector[i]*
407 for(
G4int i=0; i<n_proc; ++i) {
408 if(process[i] == proc) {
return; }
411 G4cout <<
"G4HadronicProcessStore::Register hadronic " << n_proc
415 process.push_back(proc);
424 for(; i<n_proc; ++i) {
if(process[i] == proc)
break;}
426 for(; j<n_part; ++j) {
if(particle[j] == part)
break;}
429 G4cout <<
"G4HadronicProcessStore::RegisterParticle "
435 particle.push_back(part);
436 wasPrinted.push_back(0);
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; }
450 p_map.insert(std::multimap<PD,HP>::value_type(part,proc));
459 for(; i<n_proc; ++i) {
if(process[i] == proc) {
break; }}
461 for(; k<n_model; ++k) {
if(model[k] == mod) {
break; }}
463 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
467 model.push_back(mod);
476 for(
G4int i=0; i<n_proc; ++i) {
477 if(process[i] == proc) {
478 process[i] =
nullptr;
489 for(
G4int i=0; i<n_extra; ++i) {
490 if(extraProcess[i] == proc) {
return; }
494 for(
G4int i=0; i<n_proc; ++i) {
495 if(process[i] == hproc) {
return; }
499 G4cout <<
"Extra Process: " << n_extra
503 extraProcess.push_back(proc);
513 for(; i<n_extra; ++i) {
if(extraProcess[i] == proc) {
break; } }
515 for(; j<n_part; ++j) {
if(particle[j] == part) {
break; } }
519 particle.push_back(part);
520 wasPrinted.push_back(0);
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) {
529 if(proc == process2) {
return; }
534 ep_map.insert(std::multimap<PD,G4VProcess*>::value_type(part,proc));
541 for(
G4int i=0; i<n_extra; ++i) {
542 if(extraProcess[i] == proc) {
543 extraProcess[i] =
nullptr;
545 G4cout <<
"Extra Process: " << i <<
" "
573 if(buildTableStart && part == particle[n_part - 1]) {
574 buildTableStart =
false;
576 if (std::getenv(
"G4PhysListDocDir") )
DumpHtml();
589 char* dirName = std::getenv(
"G4PhysListDocDir");
590 char* physListName = std::getenv(
"G4PhysListName");
591 if (dirName && physListName) {
595 std::ofstream outFile;
596 outFile.open(pathName);
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";
622 outFile <<
"</ul>\n";
623 outFile <<
"</body>\n";
624 outFile <<
"</html>\n";
632 std::ofstream& outFile)
638 outFile <<
"<br> <li><h2><font color=\" ff0000 \">"
641 typedef std::multimap<PD,HP,std::less<PD> > PDHPmap;
642 typedef std::multimap<HP,HI,std::less<HP> > HPHImap;
644 std::pair<PDHPmap::iterator, PDHPmap::iterator> itpart =
645 p_map.equal_range(theParticle);
650 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
651 theProcess = (*it).second;
656 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
661 outFile <<
" <li><b><font color=\" 00AA00 \">models : </font></b>\n";
663 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
664 m_map.equal_range(theProcess);
666 outFile <<
" <ul>\n";
667 G4String physListName(std::getenv(
"G4PhysListName"));
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";
681 outFile <<
" </ul>\n";
682 outFile <<
" </li>\n";
685 outFile <<
" <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
686 outFile <<
" <ul>\n";
689 outFile <<
" </ul>\n";
691 outFile <<
" </li>\n";
692 outFile <<
"</ul>\n";
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) {
702 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
707 outFile <<
" </li>\n";
708 outFile <<
"</ul>\n";
719 G4String dirName(std::getenv(
"G4PhysListDocDir"));
720 G4String physListName(std::getenv(
"G4PhysListName"));
722 std::ofstream outModel;
723 outModel.open(pathName);
724 outModel <<
"<html>\n";
725 outModel <<
"<head>\n";
726 outModel <<
"<title>Description of " << mod->
GetModelName()
728 outModel <<
"</head>\n";
729 outModel <<
"<body>\n";
733 outModel <<
"</body>\n";
734 outModel <<
"</html>\n";
745 std::transform(str.begin(), str.end(), str.begin(), [](
char ch)
747 return ch ==
' ' ?
'_' : ch;
758 if (0 == level)
return;
761 <<
"\n====================================================================\n"
762 << std::setw(60) <<
"HADRONIC PROCESSES SUMMARY (verbose level "
763 << level <<
")" <<
G4endl;
765 for (
G4int i=0; i<n_part; ++i) {
766 PD part = particle[i];
770 if (level == 1 && (pname ==
"proton" ||
771 pname ==
"neutron" ||
772 pname ==
"deuteron" ||
786 pname ==
"anti_lambda" ||
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;
800 std::multimap<PD,HP,std::less<PD> >::iterator it;
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);
806 for (; j<n_proc; ++j) {
807 if (process[j] == proc) { Print(j, i); }
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) {
817 if (wasPrinted[i] == 0) {
818 G4cout <<
"\n---------------------------------------------------\n"
819 << std::setw(50) <<
"Hadronic Processes for "
829 G4cout <<
"\n================================================================"
835void G4HadronicProcessStore::Print(
G4int idxProc,
G4int idxPart)
839 if(part ==
nullptr || proc ==
nullptr) {
return; }
840 if (wasPrinted[idxPart] == 0) {
841 G4cout <<
"\n---------------------------------------------------\n"
842 << std::setw(50) <<
"Hadronic Processes for "
844 wasPrinted[idxPart] = 1;
850 G4String stringEnergyPerNucleon =
"";
853 stringEnergyPerNucleon =
"/n";
861 if(pdg == 2212 || pdg == 2112) {
863 }
else if(std::abs(pdg) == 211) {
869 if(pdg == 2212 || pdg == 2112) {
871 }
else if(std::abs(pdg) == 211) {
877 if(std::abs(fact - 1.0) > 1.e-6) {
878 G4cout <<
" XSfactor= " << fact;
883 std::multimap<HP,HI,std::less<HP> >::iterator ih;
884 for(ih=m_map.lower_bound(proc); ih!=m_map.upper_bound(proc); ++ih) {
885 if(ih->first == proc) {
888 for(; i<n_model; ++i) {
889 if(model[i] == hi) {
break; }
891 G4cout <<
"\n Model: " << std::setw(25) << modelName[i] <<
": "
892 <<
G4BestUnit(hi->GetMinEnergy(),
"Energy") << stringEnergyPerNucleon
894 <<
G4BestUnit(hi->GetMaxEnergy(),
"Energy") << stringEnergyPerNucleon;
909 for(i=0; i<n_proc; ++i) {
910 if(process[i]) { process[i]->SetVerboseLevel(val); }
912 for(i=0; i<n_model; ++i) {
913 if(model[i]) { model[i]->SetVerboseLevel(val); }
933 if(part != currentParticle) {
938 if(p != currentParticle) {
944 if(!currentProcess) {
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()) {
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);
982 G4cout <<
" Setting absolute energy/momentum test level to " << abslevel
986 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
987 theProcess = process[i];
997 G4cout <<
" Setting relative energy/momentum test level to " << rellevel
1001 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
1002 theProcess = process[i];
std::vector< G4Element * > G4ElementVector
G4GLOB_DLL std::ostream G4cout
void DumpHtml(const G4ParticleDefinition &, std::ofstream &) const
void DumpPhysicsTable(const G4ParticleDefinition &)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(G4double aEnergy)
static G4Electron * Electron()
static G4GenericIon * Definition()
static G4GenericIon * GenericIon()
static G4HadronicInteractionRegistry * Instance()
virtual void ModelDescription(std::ostream &outFile) const
const G4String & GetModelName() const
G4bool ApplyFactorXS() const
G4double XSFactorPionElastic() const
static G4HadronicParameters * Instance()
G4int GetVerboseLevel() const
G4double XSFactorNucleonElastic() const
G4double XSFactorHadronInelastic() const
G4double XSFactorPionInelastic() const
G4double XSFactorHadronElastic() const
G4double XSFactorNucleonInelastic() const
void DeRegister(G4HadronicProcess *)
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 GetCrossSectionPerVolume(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
~G4HadronicProcessStore()
G4double GetCaptureCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
G4HadronicProcess * FindProcess(const G4ParticleDefinition *, G4HadronicProcessType subType)
void RegisterParticle(G4HadronicProcess *, const G4ParticleDefinition *)
G4double GetChargeExchangeCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void PrintHtml(const G4ParticleDefinition *, std::ofstream &)
void SetProcessAbsLevel(G4double absoluteLevel)
G4double GetChargeExchangeCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
G4double GetFissionCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
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 GetInelasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void SetProcessRelLevel(G4double relativeLevel)
void DeRegisterExtraProcess(G4VProcess *)
void SetBuildXSTable(G4bool val)
G4double GetFissionCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
G4double GetChargeExchangeCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=nullptr)
void RegisterExtraProcess(G4VProcess *)
G4double GetElasticCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
void SetEpReportLevel(G4int level)
static G4HadronicProcessStore * Instance()
G4double GetElasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
void RegisterInteraction(G4HadronicProcess *, G4HadronicInteraction *)
G4double GetCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=nullptr)
void SetVerbose(G4int val)
G4bool GetBuildXSTable() const
void Register(G4HadronicProcess *)
void PrintModelHtml(const G4HadronicInteraction *model) const
G4double GetElasticCrossSectionPerIsotope(const G4ParticleDefinition *aParticle, G4double kineticEnergy, G4int Z, G4int A)
void PrintInfo(const G4ParticleDefinition *)
G4double GetFissionCrossSectionPerVolume(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Material *material)
void ProcessDescription(std::ostream &outFile) const override
G4double GetElementCrossSection(const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=nullptr)
std::pair< G4double, G4double > GetEnergyMomentumCheckLevels() const
G4CrossSectionDataStore * GetCrossSectionDataStore()
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4Lambda * Lambda()
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
static G4Neutron * Neutron()
const G4String & GetParticleType() const
G4int GetPDGEncoding() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
static G4Positron * Positron()
static G4Proton * Proton()
virtual void ProcessDescription(std::ostream &outfile) const
G4int GetProcessSubType() const
const G4String & GetProcessName() const