19#include <Math/IFunction.h>
20#include <Math/IntegratorMultiDim.h>
24#include "Framework/Conventions/GBuild.h"
49using std::ostringstream;
92 const double Emin = 0.01;
93 const int nknots_min = (int) (10*(TMath::Log(
fEMax)-TMath::Log(Emin)));
94 const int nknots = TMath::Max(100, nknots_min);
95 double * E =
new double[nknots];
97 TLorentzVector p4(0,0,0,0);
108 unsigned int nres =
fResList.NResonances();
109 for(
unsigned int ires = 0; ires < nres; ires++) {
122 assert(!cache_branch);
126 <<
"\n ** Creating cache branch - key = " << key;
129 assert(cache_branch);
133 LOG(
"ReinSehgalResCF",
pNOTICE) <<
"E threshold = " << Ethr;
138 int nkb = (Ethr>Emin) ? 5 : 0;
139 int nka = nknots-nkb;
141 double dEb = (Ethr>Emin) ? (Ethr - Emin) / nkb : 0;
142 for(
int i=0; i<nkb; i++) {
146 double E0 = TMath::Max(Ethr,Emin);
147 double dEa = (TMath::Log10(
fEMax) - TMath::Log10(E0)) /(nka-1);
148 for(
int i=0; i<nka; i++) {
149 E[i+nkb] = TMath::Power(10., TMath::Log10(E0) + i * dEa);
153 for(
int ie=0; ie<nknots; ie++) {
156 p4.SetPxPyPzE(0,0,Ev,Ev);
165 <<
"*** Integrating d^2 XSec/dWdQ^2 for R: "
168 <<
"{W} = " << rW.
min <<
", " << rW.
max;
170 <<
"{Q^2} = " << rQ2.
min <<
", " << rQ2.
max;
174 <<
"** Not allowed kinematically, xsec=0";
179 ig.SetFunction(*
func);
180 double kine_min[2] = { rW.
min, rQ2.
min };
181 double kine_max[2] = { rW.
max, rQ2.
max };
182 xsec = ig.Integral(kine_min, kine_max) * (1E-38 *
units::cm2);
187 <<
"** Below threshold E = " << Ev <<
" <= " << Ethr;
212 string nc_nuc = ((nucleonpdgc==
kPdgProton) ?
"p" :
"n");
215 intk <<
"ResExcitationXSec/R:" << res_name <<
";nu:" << nupdgc
216 <<
";int:" << it_name << nc_nuc;
219 string ikey = intk.str();
229ROOT::Math::IBaseFunctionMultiDim(),
238 bool fUsingDisResJoin = fConfig.
GetBool(
"UseDRJoinScheme");
239 double fWcut = 999999;
249 bool fNormBW = fConfig.
GetBoolDef(
"BreitWignerNorm",
true);
252 double fN2ResMaxNWidths = fConfig.
GetDoubleDef(
"MaxNWidthForN2Res", 2.0);
253 double fN0ResMaxNWidths = fConfig.
GetDoubleDef(
"MaxNWidthForN0Res", 6.0);
254 double fGNResMaxNWidths = fConfig.
GetDoubleDef(
"MaxNWidthForGNRes", 4.0);
260 fWcut = MR + fN0ResMaxNWidths * WR;
262 fWcut = MR + fN2ResMaxNWidths * WR;
264 fWcut = MR + fGNResMaxNWidths * WR;
293 if (Q2l.
min<0 || Q2l.
max<0)
295 double Q2 = Q2l.
min+(Q2l.
max-Q2l.
min)*xin[1];
300ROOT::Math::IBaseFunctionMultiDim *
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
#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.
A simple cache branch storing the cached data in a TNtuple.
void CreateSpline(string type="TSpline3")
void AddValues(double x, double y)
string CacheBranchKey(string k0, string k1="", string k2="") const
void AddCacheBranch(string key, CacheBranchI *branch)
static Cache * Instance(void)
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
void SetPdgs(int tgt_pdgc, int probe_pdgc)
const Target & Tgt(void) const
void SetProbeP4(const TLorentzVector &P4)
Target * TgtPtr(void) const
static string AsString(InteractionType_t type)
Summary information for an interaction.
InitialState * InitStatePtr(void) const
XclsTag * ExclTagPtr(void) const
const ProcessInfo & ProcInfo(void) const
const KPhaseSpace & PhaseSpace(void) const
const InitialState & InitState(void) const
double Threshold(void) const
Energy threshold.
InteractionType_t InteractionTypeId(void) const
A simple [min,max] interval for doubles.
A registry. Provides the container for algorithm configuration parameters.
RgDbl GetDouble(RgKey key) const
RgBool GetBoolDef(RgKey key, RgBool def_opt, bool set_def=true)
RgBool GetBool(RgKey key) const
RgDbl GetDoubleDef(RgKey key, RgDbl def_opt, bool set_def=true)
virtual ~ReinSehgalRESXSecWithCacheFast()
ReinSehgalRESXSecWithCacheFast()
void CacheResExcitationXSec(const Interaction *interaction) const
const XSecAlgorithmI * fSingleResXSecModel
string CacheBranchName(Resonance_t r, InteractionType_t it, int nu, int nuc) const
int HitNucPdg(void) const
void SetHitNucPdg(int pdgc)
Cross Section Calculation Interface.
string fGSLIntgType
name of GSL numerical integrator
int fGSLMaxEval
GSL max evaluations.
double fGSLRelTol
required relative tolerance (error)
void SetResonance(Resonance_t res)
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
double DoEval(const double *xin) const
unsigned int NDim(void) const
d2XSecRESFast_dWQ2_E(const XSecAlgorithmI *m, const Interaction *i)
const XSecAlgorithmI * fModel
const Interaction * fInteraction
double func(double x, double y)
Misc GENIE control constants.
static const double kASmallNum
static constexpr double cm2
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
double Width(Resonance_t res)
resonance width (GeV)
double Mass(Resonance_t res)
resonance mass (GeV)
int ResonanceIndex(Resonance_t res)
resonance idx, quark model / SU(6)
const char * AsString(Resonance_t res)
resonance id -> string
THE MAIN GENIE PROJECT NAMESPACE
enum genie::EInteractionType InteractionType_t
enum genie::EResonance Resonance_t