79 delete theEPTestMessenger;
86 for(
auto& itr : process)
90 for(
auto& itr : extraProcess)
103G4HadronicProcessStore::G4HadronicProcessStore()
109 currentProcess =
nullptr;
110 currentParticle =
nullptr;
114 buildTableStart =
true;
115 buildXSTable =
false;
175 const G4double* theAtomNumDensityVector =
178 for (
size_t i=0; i<nelm; ++i) {
179 const G4Element* elm = (*theElementVector)[i];
180 cross += theAtomNumDensityVector[i]*
221 const G4double* theAtomNumDensityVector =
224 for (
size_t i=0; i<nelm; ++i) {
225 const G4Element* elm = (*theElementVector)[i];
226 cross += theAtomNumDensityVector[i]*
267 const G4double* theAtomNumDensityVector =
270 for (
size_t i=0; i<nelm; ++i) {
271 const G4Element* elm = (*theElementVector)[i];
272 cross += theAtomNumDensityVector[i]*
313 const G4double* theAtomNumDensityVector =
316 for (
size_t i=0; i<nelm; i++) {
317 const G4Element* elm = (*theElementVector)[i];
318 cross += theAtomNumDensityVector[i]*
359 const G4double* theAtomNumDensityVector =
362 for (
size_t i=0; i<nelm; ++i) {
363 const G4Element* elm = (*theElementVector)[i];
364 cross += theAtomNumDensityVector[i]*
400 for(
G4int i=0; i<n_proc; ++i) {
401 if(process[i] == proc) {
return; }
404 G4cout <<
"G4HadronicProcessStore::Register hadronic " << n_proc
408 process.push_back(proc);
417 for(; i<n_proc; ++i) {
if(process[i] == proc)
break;}
419 for(; j<n_part; ++j) {
if(particle[j] == part)
break;}
422 G4cout <<
"G4HadronicProcessStore::RegisterParticle "
428 particle.push_back(part);
429 wasPrinted.push_back(0);
434 std::multimap<PD,HP,std::less<PD> >::iterator it;
435 for(it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
436 if(it->first == part) {
437 HP process2 = (it->second);
438 if(proc == process2) {
return; }
443 p_map.insert(std::multimap<PD,HP>::value_type(part,proc));
452 for(; i<n_proc; ++i) {
if(process[i] == proc) {
break; }}
454 for(; k<n_model; ++k) {
if(model[k] == mod) {
break; }}
456 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
460 model.push_back(mod);
469 for(
G4int i=0; i<n_proc; ++i) {
470 if(process[i] == proc) {
471 process[i] =
nullptr;
482 for(
G4int i=0; i<n_extra; ++i) {
483 if(extraProcess[i] == proc) {
return; }
487 for(
G4int i=0; i<n_proc; ++i) {
488 if(process[i] == hproc) {
return; }
492 G4cout <<
"Extra Process: " << n_extra
496 extraProcess.push_back(proc);
506 for(; i<n_extra; ++i) {
if(extraProcess[i] == proc) {
break; } }
508 for(; j<n_part; ++j) {
if(particle[j] == part) {
break; } }
512 particle.push_back(part);
513 wasPrinted.push_back(0);
518 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator it;
519 for(it=ep_map.lower_bound(part); it!=ep_map.upper_bound(part); ++it) {
520 if(it->first == part) {
522 if(proc == process2) {
return; }
527 ep_map.insert(std::multimap<PD,G4VProcess*>::value_type(part,proc));
534 for(
G4int i=0; i<n_extra; ++i) {
535 if(extraProcess[i] == proc) {
536 extraProcess[i] =
nullptr;
538 G4cout <<
"Extra Process: " << i <<
" "
566 if(buildTableStart && part == particle[n_part - 1]) {
567 buildTableStart =
false;
569 if (std::getenv(
"G4PhysListDocDir") )
DumpHtml();
582 char* dirName = std::getenv(
"G4PhysListDocDir");
583 char* physListName = std::getenv(
"G4PhysListName");
584 if (dirName && physListName) {
588 std::ofstream outFile;
589 outFile.open(pathName);
592 outFile <<
"<html>\n";
593 outFile <<
"<head>\n";
594 outFile <<
"<title>Physics List Summary</title>\n";
595 outFile <<
"</head>\n";
596 outFile <<
"<body>\n";
597 outFile <<
"<h2> Summary of Hadronic Processes, Models and Cross Sections for Physics List "
598 <<
G4String(physListName) <<
"</h2>\n";
615 outFile <<
"</ul>\n";
616 outFile <<
"</body>\n";
617 outFile <<
"</html>\n";
625 std::ofstream& outFile)
631 outFile <<
"<br> <li><h2><font color=\" ff0000 \">"
634 typedef std::multimap<PD,HP,std::less<PD> > PDHPmap;
635 typedef std::multimap<HP,HI,std::less<HP> > HPHImap;
637 std::pair<PDHPmap::iterator, PDHPmap::iterator> itpart =
638 p_map.equal_range(theParticle);
643 for (PDHPmap::iterator it = itpart.first; it != itpart.second; ++it) {
644 theProcess = (*it).second;
649 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
654 outFile <<
" <li><b><font color=\" 00AA00 \">models : </font></b>\n";
656 std::pair<HPHImap::iterator, HPHImap::iterator> itmod =
657 m_map.equal_range(theProcess);
659 outFile <<
" <ul>\n";
660 G4String physListName(std::getenv(
"G4PhysListName"));
662 for (HPHImap::iterator jt = itmod.first; jt != itmod.second; ++jt) {
663 outFile <<
" <li><b><a href=\"" << physListName <<
"_"
664 << HtmlFileName((*jt).second->GetModelName()) <<
"\"> "
665 << (*jt).second->GetModelName() <<
"</a>"
666 <<
" from " << (*jt).second->GetMinEnergy()/GeV
667 <<
" GeV to " << (*jt).second->GetMaxEnergy()/GeV
668 <<
" GeV </b></li>\n";
674 outFile <<
" </ul>\n";
675 outFile <<
" </li>\n";
678 outFile <<
" <li><b><font color=\" 00AA00 \">cross sections : </font></b>\n";
679 outFile <<
" <ul>\n";
682 outFile <<
" </ul>\n";
684 outFile <<
" </li>\n";
685 outFile <<
"</ul>\n";
691 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
692 for (itp=ep_map.lower_bound(theParticle); itp!=ep_map.upper_bound(theParticle); ++itp) {
693 if (itp->first == theParticle) {
695 outFile <<
"<br> <b><font color=\" 0000ff \">process : "
700 outFile <<
" </li>\n";
701 outFile <<
"</ul>\n";
712 G4String dirName(std::getenv(
"G4PhysListDocDir"));
713 G4String physListName(std::getenv(
"G4PhysListName"));
715 std::ofstream outModel;
716 outModel.open(pathName);
717 outModel <<
"<html>\n";
718 outModel <<
"<head>\n";
719 outModel <<
"<title>Description of " << mod->
GetModelName()
721 outModel <<
"</head>\n";
722 outModel <<
"<body>\n";
726 outModel <<
"</body>\n";
727 outModel <<
"</html>\n";
738 std::transform(str.begin(), str.end(), str.begin(), [](
char ch)
740 return ch ==
' ' ?
'_' : ch;
751 if (0 == level)
return;
754 <<
"\n====================================================================\n"
755 << std::setw(60) <<
"HADRONIC PROCESSES SUMMARY (verbose level "
756 << level <<
")" <<
G4endl;
758 for (
G4int i=0; i<n_part; ++i) {
759 PD part = particle[i];
763 if (level == 1 && (pname ==
"proton" ||
764 pname ==
"neutron" ||
765 pname ==
"deuteron" ||
779 pname ==
"anti_lambda" ||
783 pname ==
"GenericIon" ||
784 pname ==
"hypertriton" ||
785 pname ==
"anti_neutron" ||
786 pname ==
"anti_proton" ||
787 pname ==
"anti_deuteron" ||
788 pname ==
"anti_triton" ||
789 pname ==
"anti_He3" ||
790 pname ==
"anti_alpha" ||
791 pname ==
"anti_hypertriton")) yes =
true;
792 if (level > 1) yes =
true;
795 std::multimap<PD,HP,std::less<PD> >::iterator it;
797 for (it=p_map.lower_bound(part); it!=p_map.upper_bound(part); ++it) {
798 if (it->first == part) {
799 HP proc = (it->second);
801 for (; j<n_proc; ++j) {
802 if (process[j] == proc) { Print(j, i); }
808 std::multimap<PD,G4VProcess*,std::less<PD> >::iterator itp;
809 for(itp=ep_map.lower_bound(part); itp!=ep_map.upper_bound(part); ++itp) {
810 if(itp->first == part) {
812 if (wasPrinted[i] == 0) {
813 G4cout <<
"\n---------------------------------------------------\n"
814 << std::setw(50) <<
"Hadronic Processes for "
824 G4cout <<
"\n================================================================"
830void G4HadronicProcessStore::Print(
G4int idxProc,
G4int idxPart)
834 if(part ==
nullptr || proc ==
nullptr) {
return; }
835 if (wasPrinted[idxPart] == 0) {
836 G4cout <<
"\n---------------------------------------------------\n"
837 << std::setw(50) <<
"Hadronic Processes for "
839 wasPrinted[idxPart] = 1;
845 G4String stringEnergyPerNucleon =
"";
848 stringEnergyPerNucleon =
"/n";
856 if(pdg == 2212 || pdg == 2112) {
858 }
else if(std::abs(pdg) == 211) {
864 if(pdg == 2212 || pdg == 2112) {
866 }
else if(std::abs(pdg) == 211) {
872 if(std::abs(fact - 1.0) > 1.e-6) {
873 G4cout <<
" XSfactor= " << fact;
878 std::multimap<HP,HI,std::less<HP> >::iterator ih;
879 for(ih=m_map.lower_bound(proc); ih!=m_map.upper_bound(proc); ++ih) {
880 if(ih->first == proc) {
883 for(; i<n_model; ++i) {
884 if(model[i] == hi) {
break; }
886 G4cout <<
"\n Model: " << std::setw(25) << modelName[i] <<
": "
887 <<
G4BestUnit(hi->GetMinEnergy(),
"Energy") << stringEnergyPerNucleon
889 <<
G4BestUnit(hi->GetMaxEnergy(),
"Energy") << stringEnergyPerNucleon;
904 for(i=0; i<n_proc; ++i) {
905 if(process[i]) { process[i]->SetVerboseLevel(val); }
907 for(i=0; i<n_model; ++i) {
908 if(model[i]) { model[i]->SetVerboseLevel(val); }
928 if(part != currentParticle) {
933 if(p != currentParticle) {
939 if(!currentProcess) {
948 std::multimap<PD,HP,std::less<PD> >::iterator it;
949 for(it=p_map.lower_bound(currentParticle);
950 it!=p_map.upper_bound(currentParticle); ++it) {
951 if(it->first == currentParticle &&
952 subType == (it->second)->GetProcessSubType()) {
966 G4cout <<
" Setting energy/momentum report level to " << level
967 <<
" for " << process.size() <<
" hadronic processes " <<
G4endl;
968 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
969 process[i]->SetEpReportLevel(level);
977 G4cout <<
" Setting absolute energy/momentum test level to " << abslevel
981 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
982 theProcess = process[i];
992 G4cout <<
" Setting relative energy/momentum test level to " << rellevel
996 for (
G4int i = 0; i <
G4int(process.size()); ++i) {
997 theProcess = process[i];
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
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