14 #include <Math/IFunction.h>
15 #include <Math/IntegratorMultiDim.h>
18 #include "Framework/Conventions/GBuild.h"
34 using std::ostringstream;
36 using namespace genie;
37 using namespace genie::controls;
38 using namespace genie::constants;
77 const double Emin = 0.01;
78 const int nknots_min = (int) (10*(TMath::Log(
fEMax)-TMath::Log(Emin)));
79 const int nknots = TMath::Max(40, nknots_min);
80 double * E =
new double[nknots];
82 TLorentzVector p4(0,0,0,0);
94 for(
unsigned int ires = 0; ires < nres; ires++) {
107 assert(!cache_branch);
111 <<
"\n ** Creating cache branch - key = " << key;
114 assert(cache_branch);
118 LOG(
"ReinSehgalResC",
pNOTICE) <<
"E threshold = " << Ethr;
123 int nkb = (Ethr>Emin) ? 5 : 0;
124 int nka = nknots-nkb;
126 double dEb = (Ethr>Emin) ? (Ethr - Emin) / nkb : 0;
127 for(
int i=0; i<nkb; i++) {
131 double E0 = TMath::Max(Ethr,Emin);
132 double dEa = (TMath::Log10(
fEMax) - TMath::Log10(E0)) /(nka-1);
133 for(
int i=0; i<nka; i++) {
134 E[i+nkb] = TMath::Power(10., TMath::Log10(E0) + i * dEa);
138 for(
int ie=0; ie<nknots; ie++) {
141 p4.SetPxPyPzE(0,0,Ev,Ev);
151 <<
"*** Integrating d^2 XSec/dWdQ^2 for R: "
154 <<
"{W} = " << rW.
min <<
", " << rW.
max;
156 <<
"{Q^2} = " << rQ2.
min <<
", " << rQ2.
max;
160 <<
"** Not allowed kinematically, xsec=0";
163 ROOT::Math::IBaseFunctionMultiDim *
func =
165 ROOT::Math::IntegrationMultiDim::Type ig_type =
168 ig.SetFunction(*func);
169 double kine_min[2] = { rW.
min, rQ2.
min };
170 double kine_max[2] = { rW.
max, rQ2.
max };
171 xsec = ig.Integral(kine_min, kine_max) * (1E-38 *
units::cm2);
176 <<
"** Below threshold E = " << Ev <<
" <= " << Ethr;
200 string nc_nuc = ((nucleonpdgc==
kPdgProton) ?
"p" :
"n");
203 intk <<
"ResExcitationXSec/R:" << res_name <<
";nu:" << nupdgc
204 <<
";int:" << it_name << nc_nuc;
207 string ikey = intk.str();
const KPhaseSpace & PhaseSpace(void) const
InteractionType_t InteractionTypeId(void) const
string fGSLIntgType
name of GSL numerical integrator
void SetProbeP4(const TLorentzVector &P4)
Cross Section Integrator Interface.
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
int HitNucPdg(void) const
A simple [min,max] interval for doubles.
double Threshold(void) const
Energy threshold.
void CreateSpline(string type="TSpline3")
ReinSehgalRESXSecWithCache()
enum genie::EResonance Resonance_t
unsigned int NResonances(void) const
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
void SetResonance(Resonance_t res)
void AddCacheBranch(string key, CacheBranchI *branch)
Summary information for an interaction.
void AddValues(double x, double y)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual ~ReinSehgalRESXSecWithCache()
static constexpr double cm2
string CacheBranchName(Resonance_t r, InteractionType_t it, int nu, int nuc) const
string CacheBranchKey(string k0, string k1="", string k2="") const
double func(double x, double y)
void SetPdgs(int tgt_pdgc, int probe_pdgc)
static const double kASmallNum
void CacheResExcitationXSec(const Interaction *interaction) const
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
static string AsString(InteractionType_t type)
XclsTag * ExclTagPtr(void) const
virtual const AlgId & Id(void) const
Get algorithm ID.
int fGSLMaxEval
GSL max evaluations.
void SetHitNucPdg(int pdgc)
Target * TgtPtr(void) const
InitialState * InitStatePtr(void) const
const InitialState & InitState(void) const
const char * AsString(Resonance_t res)
resonance id -> string
const ProcessInfo & ProcInfo(void) const
const Target & Tgt(void) const
static Cache * Instance(void)
A simple cache branch storing the cached data in a TNtuple.
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
enum genie::EInteractionType InteractionType_t
const XSecAlgorithmI * fSingleResXSecModel
double fGSLRelTol
required relative tolerance (error)
Resonance_t ResonanceId(unsigned int ires) const