79 delete theEPTestMessenger;
86 for (
auto const& itr : process)
90 for (
auto const& itr : extraProcess)
94 for (
auto const& it : ep_map)
106G4HadronicProcessStore::G4HadronicProcessStore()
170 const G4double* theAtomNumDensityVector =
173 for (
size_t i=0; i<nelm; ++i) {
174 const G4Element* elm = (*theElementVector)[i];
175 cross += theAtomNumDensityVector[i]*
216 const G4double* theAtomNumDensityVector =
219 for (
size_t i=0; i<nelm; ++i) {
220 const G4Element* elm = (*theElementVector)[i];
221 cross += theAtomNumDensityVector[i]*
262 const G4double* theAtomNumDensityVector =
265 for (
size_t i=0; i<nelm; ++i) {
266 const G4Element* elm = (*theElementVector)[i];
267 cross += theAtomNumDensityVector[i]*
308 const G4double* theAtomNumDensityVector =
311 for (
size_t i=0; i<nelm; i++) {
312 const G4Element* elm = (*theElementVector)[i];
313 cross += theAtomNumDensityVector[i]*
354 const G4double* theAtomNumDensityVector =
357 for (
size_t i=0; i<nelm; ++i) {
358 const G4Element* elm = (*theElementVector)[i];
359 cross += theAtomNumDensityVector[i]*
395 for(
G4int i=0; i<n_proc; ++i) {
396 if(process[i] == proc) {
return; }
399 G4cout <<
"G4HadronicProcessStore::Register hadronic " << n_proc
403 process.push_back(proc);
412 for(; i<n_proc; ++i) {
if(process[i] == proc)
break;}
414 for(; j<n_part; ++j) {
if(particle[j] == part)
break;}
417 G4cout <<
"G4HadronicProcessStore::RegisterParticle "
423 particle.push_back(part);
424 wasPrinted.push_back(0);
429 std::multimap<PD,HP,std::less<PD> >::iterator it;
430 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
431 if(it->first == part) {
432 HP process2 = (it->second);
433 if(proc == process2) {
return; }
438 p_map.insert(std::multimap<PD,HP>::value_type(part,proc));
447 for(; i<n_proc; ++i) {
if(process[i] == proc) {
break; }}
449 for(; k<n_model; ++k) {
if(model[k] == mod) {
break; }}
451 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
455 model.push_back(mod);
464 for(
G4int i=0; i<n_proc; ++i) {
465 if(process[i] == proc) {
466 process[i] =
nullptr;
477 for(
G4int i=0; i<n_extra; ++i) {
478 if(extraProcess[i] == proc) {
return; }
482 for(
G4int i=0; i<n_proc; ++i) {
483 if(process[i] == hproc) {
return; }
487 G4cout <<
"Extra Process: " << n_extra
491 extraProcess.push_back(proc);
501 for(; i<n_extra; ++i) {
if(extraProcess[i] == proc) {
break; } }
503 for(; j<n_part; ++j) {
if(particle[j] == part) {
break; } }
507 particle.push_back(part);
508 wasPrinted.push_back(0);
513 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator it;
514 for(it=ep_map.lower_bound(part); it!=ep_map.upper_bound(part); ++it) {
515 if(it->first == part) {
517 if(proc == process2) {
return; }
522 ep_map.insert(std::multimap<PD,G4VProcess*>::value_type(part,proc));
529 for(
G4int i=0; i<n_extra; ++i) {
530 if(extraProcess[i] == proc) {
531 extraProcess[i] =
nullptr;
533 G4cout <<
"Extra Process: " << i <<
" "
561 if(buildTableStart && part == particle[n_part - 1]) {
562 buildTableStart =
false;
579 if (!dir.empty() && !pl.empty()) {
582 G4String pathName = dir +
"/" + pl +
".html";
583 std::ofstream outFile;
584 outFile.open(pathName);
587 outFile <<
"<html>\n";
588 outFile <<
"<head>\n";
589 outFile <<
"<title>Physics List Summary</title>\n";
590 outFile <<
"</head>\n";
591 outFile <<
"<body>\n";
592 outFile <<
"<h2> Summary of Hadronic Processes, Models and Cross Sections"
593 <<
" for Physics List " << pl <<
"</h2>\n";
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);
639 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
640 theProcess = (*it).second;
641 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
646 outFile <<
" <li><b><font color=\" 00AA00 \">models : </font></b>\n";
648 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
649 m_map.equal_range(theProcess);
651 outFile <<
" <ul>\n";
653 for (HPHImap::iterator jt = itmod.first; jt != itmod.second; ++jt) {
654 outFile <<
" <li><b><a href=\"" << pl <<
"_"
655 << HtmlFileName((*jt).second->GetModelName()) <<
"\"> "
656 << (*jt).second->GetModelName() <<
"</a>"
657 <<
" from " << (*jt).second->GetMinEnergy()/GeV
658 <<
" GeV to " << (*jt).second->GetMaxEnergy()/GeV
659 <<
" GeV </b></li>\n";
665 outFile <<
" </ul>\n";
666 outFile <<
" </li>\n";
669 outFile <<
" <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
670 outFile <<
" <ul>\n";
673 outFile <<
" </ul>\n";
675 outFile <<
" </li>\n";
676 outFile <<
"</ul>\n";
681 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
682 for (itp=ep_map.lower_bound(theParticle); itp!=ep_map.upper_bound(theParticle); ++itp) {
683 if (itp->first == theParticle) {
685 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
690 outFile <<
" </li>\n";
691 outFile <<
"</ul>\n";
705 std::ofstream outModel;
706 outModel.open(pathName);
707 outModel <<
"<html>\n";
708 outModel <<
"<head>\n";
709 outModel <<
"<title>Description of " << mod->
GetModelName()
711 outModel <<
"</head>\n";
712 outModel <<
"<body>\n";
716 outModel <<
"</body>\n";
717 outModel <<
"</html>\n";
727 std::transform(str.begin(), str.end(), str.begin(), [](
char ch) {
728 return ch ==
' ' ?
'_' : ch;
739 if (0 == level)
return;
742 <<
"\n====================================================================\n"
743 << std::setw(60) <<
"HADRONIC PROCESSES SUMMARY (verbose level "
744 << level <<
")" <<
G4endl;
746 for (
G4int i=0; i<n_part; ++i) {
747 PD part = particle[i];
751 if (level == 1 && (pname ==
"proton" ||
752 pname ==
"neutron" ||
753 pname ==
"deuteron" ||
763 pname ==
"anti_nu_e" ||
765 pname ==
"anti_nu_mu" ||
771 pname ==
"anti_lambda" ||
775 pname ==
"GenericIon" ||
776 pname ==
"hypertriton" ||
777 pname ==
"anti_neutron" ||
778 pname ==
"anti_proton" ||
779 pname ==
"anti_deuteron" ||
780 pname ==
"anti_triton" ||
781 pname ==
"anti_He3" ||
782 pname ==
"anti_alpha" ||
783 pname ==
"anti_hypertriton")) yes =
true;
784 if (level > 1) yes =
true;
787 std::multimap<PD,HP,std::less<PD> >::iterator it;
789 for (it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
790 if (it->first == part) {
791 HP proc = (it->second);
793 for (; j<n_proc; ++j) {
794 if (process[j] == proc) { Print(j, i); }
800 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
801 for(itp=ep_map.lower_bound(part); itp!=ep_map.upper_bound(part); ++itp) {
802 if(itp->first == part) {
804 if (wasPrinted[i] == 0) {
805 G4cout <<
"-------------------------------------------------------------------------\n"
806 << std::setw(50) <<
"Hadronic Processes for "
819void G4HadronicProcessStore::Print(
G4int idxProc,
G4int idxPart)
823 if(part ==
nullptr || proc ==
nullptr) {
return; }
824 if (wasPrinted[idxPart] == 0) {
825 G4cout <<
"-----------------------------------------------------------------------\n"
826 << std::setw(50) <<
"Hadronic Processes for "
828 wasPrinted[idxPart] = 1;
834 G4String stringEnergyPerNucleon =
"";
837 stringEnergyPerNucleon =
"/n";
845 if(pdg == 2212 || pdg == 2112) {
847 }
else if(std::abs(pdg) == 211) {
853 if(pdg == 2212 || pdg == 2112) {
855 }
else if(std::abs(pdg) == 211) {
861 if(std::abs(fact - 1.0) > 1.e-6) {
862 G4cout <<
" XSfactor= " << fact;
867 std::multimap<HP,HI,std::less<HP> >::iterator ih;
868 for(ih=m_map.lower_bound(proc); ih!=m_map.upper_bound(proc); ++ih) {
869 if(ih->first == proc) {
872 for(; i<n_model; ++i) {
873 if(model[i] == hi) {
break; }
875 G4cout <<
"\n Model: " << std::setw(25) << modelName[i] <<
": "
877 << stringEnergyPerNucleon <<
" ---> "
879 << stringEnergyPerNucleon;
894 for(i=0; i<n_proc; ++i) {
895 if(process[i]) { process[i]->SetVerboseLevel(val); }
897 for(i=0; i<n_model; ++i) {
898 if(model[i]) { model[i]->SetVerboseLevel(val); }
918 if(part != currentParticle) {
923 if(p != currentParticle) {
929 if(!currentProcess) {
938 std::multimap<PD,HP,std::less<PD> >::iterator it;
939 for(it=p_map.lower_bound(currentParticle);
940 it!=p_map.upper_bound(currentParticle); ++it) {
941 if(it->first == currentParticle &&
942 subType == (it->second)->GetProcessSubType()) {
956 G4cout <<
" Setting energy/momentum report level to " << level
957 <<
" for " << process.size() <<
" hadronic processes " <<
G4endl;
958 for (
auto& theProcess : process) {
959 theProcess->SetEpReportLevel(level);
967 G4cout <<
" Setting absolute energy/momentum test level to " << abslevel
969 for (
auto& theProcess : process) {
970 G4double rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
971 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
979 G4cout <<
" Setting relative energy/momentum test level to " << rellevel
981 for (
auto& theProcess : process) {
982 G4double abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
983 theProcess->SetEnergyMomentumCheckLevels(rellevel, abslevel);
std::vector< const 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
const G4String & GetPhysListName() const
G4double XSFactorNucleonElastic() const
G4double XSFactorHadronInelastic() const
const G4String & GetPhysListDocDir() 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)
G4CrossSectionDataStore * GetCrossSectionDataStore()
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4Lambda * Lambda()
const G4ElementVector * GetElementVector() const
const G4double * GetVecNbOfAtomsPerVolume() const
std::size_t GetNumberOfElements() 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