13 using namespace genie;
14 using namespace genie::evtlib;
17 EvtLibPXSec::EvtLibPXSec() :
40 LOG(
"ELI",
pFATAL) <<
"This point should not be reached" ;
80 for(
auto it:
fXSecs)
delete it.second;
90 GetParam(
"EventLibraryPath", libPath);
95 TFile fin(libPath.c_str());
96 if(fin.IsZombie()) exit(1);
98 TIter next(fin.GetListOfKeys());
99 while(TObject*
dir = next()){
100 const std::string& tgtName =
dir->GetName();
101 const TParticlePDG* tgtPart = pdglib->
DBase()->GetParticle(tgtName.c_str());
103 LOG(
"ELI",
pWARN) <<
"Unknown nucleus " << tgtName
104 <<
" found in " << libPath
113 for(
bool iscc: {
true,
false}){
116 if(!iscc && abs(pdg) !=
kPdgNuMu)
continue;
118 std::string nuName = pdglib->
Find(pdg)->GetName();
121 const std::string graphName =
125 nuName.c_str()).Data();
127 const Key key(tgtPart->PdgCode(), pdg, iscc);
129 TGraph*
g = (TGraph*)fin.Get(graphName.c_str());
131 LOG(
"ELI",
pINFO) << graphName <<
" not found in "
132 << libPath <<
" -- skipping";
136 fXSecs[key] =
new TGraph(*g);
149 LOG(
"ELI",
pINFO) <<
"Skipping unknown process " << proc;
162 auto it =
fXSecs.find(key);
164 LOG(
"ELI",
pINFO) <<
"Skipping process without xsec " << key;
Cross Section Calculation Interface.
bool IsWeakCC(void) const
static constexpr double g
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
void Expand(std::string &s)
Expand env vars/homedirs/wildcards in s.
TDatabasePDG * DBase(void)
enum genie::EKinePhaseSpace KinePhaseSpace_t
void Configure(const Registry &config)
Summary information for an interaction.
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double cm2
TGraph * GetXSec(const Interaction *in) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
std::map< Key, TGraph * > fXSecs
bool IsAntiNeutrino(int pdgc)
virtual void Configure(const Registry &config)
double Integral(const Interaction *i) const
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
static PDGLibrary * Instance(void)
Singleton class to load & serve a TDatabasePDG.
A registry. Provides the container for algorithm configuration parameters.
const InitialState & InitState(void) const
const ProcessInfo & ProcInfo(void) const
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
TParticlePDG * Find(int pdgc, bool must_exist=true)
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double ProbeE(RefFrame_t rf) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
Initial State information.