22#include <Math/IFunction.h>
23#include <Math/IntegratorMultiDim.h>
24#include <Math/AdaptiveIntegratorMultiDim.h>
28#include "Framework/Conventions/GBuild.h"
49using std::ostringstream;
94 const double Emin = xsl -> Emin() ;
95 const double Emax = std::min(
fEMax, xsl -> Emax() ) ;
97 const int nknots = xsl -> NKnots() ;
99 vector<double> E( nknots, 0. ) ;
117 assert(!cache_branch);
121 <<
"\n ** Creating cache branch - key = " << key;
124 assert(cache_branch);
129 LOG(
"SPPCache",
pNOTICE) <<
"E threshold = " << Ethr;
134 int nkb = (Ethr>Emin) ? 5 : 0;
135 int nka = nknots-nkb;
137 double dEb = (Ethr>Emin) ? (Ethr - Emin) / nkb : 0;
138 for(
int i=0; i<nkb; i++) {
142 double E0 = TMath::Max(Ethr,Emin);
143 double dEa = (TMath::Log10(Emax) - TMath::Log10(E0)) /(nka-1);
144 for(
int i=0; i<nka; i++) {
145 E[i+nkb] = TMath::Power(10., TMath::Log10(E0) + i*dEa);
149 for(
int ie=0; ie<nknots; ie++) {
153 TLorentzVector p4(0., 0., Ev, Ev);
159 <<
"*** Integrating d^3 XSec/dWdQ^2dCosTheta for Ch: "
165 if (ig_type == ROOT::Math::IntegrationMultiDim::kADAPTIVE)
167 ROOT::Math::AdaptiveIntegratorMultiDim * cast =
dynamic_cast<ROOT::Math::AdaptiveIntegratorMultiDim*
>( ig.GetIntegrator() );
171 ig.SetFunction(
func);
172 double kine_min[3] = { 0., 0., 0.};
173 double kine_max[3] = { 1., 1., 1.};
174 xsec = ig.Integral(kine_min, kine_max)*(1E-38 *
units::cm2);;
177 LOG(
"SPPCache",
pINFO) <<
"** Below threshold E = " << Ev <<
" <= " << Ethr;
187 <<
", E="<< Ev <<
") = "<< xsec <<
" x 1E-38 cm^2";
206 intk <<
"ResSPPXSec/Ch:" << spp_channel_name << nc_nuc << nupdgc
207 <<
";int:" << it_name;
210 string ikey = intk.str();
220 ROOT::Math::IBaseFunctionMultiDim(),
233 const InitialState & init_state = interaction -> InitState();
237 if (Enu < kps->Threshold_SPP_iso())
243 Wl =
kps->WLim_SPP_iso();
265 double W2 =
Wl.min*
Wl.min + (
Wl.max*
Wl.max -
Wl.min*
Wl.min)*xin[0];
270 double sqrt_Q2 = TMath::Sqrt(Q2l.
min) + ( TMath::Sqrt(Q2l.
max) - TMath::Sqrt(Q2l.
min) )*xin[1];
278ROOT::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
Initial State information.
void SetPdgs(int tgt_pdgc, int probe_pdgc)
const Target & Tgt(void) const
void SetProbeP4(const TLorentzVector &P4)
double ProbeE(RefFrame_t rf) const
Target * TgtPtr(void) const
static string AsString(InteractionType_t type)
Summary information for an interaction.
InitialState * InitStatePtr(void) const
const ProcessInfo & ProcInfo(void) const
const KPhaseSpace & PhaseSpace(void) const
const InitialState & InitState(void) const
double Threshold_SPP_iso(void) const
Energy limit for resonance single pion production on isoscalar nucleon.
InteractionType_t InteractionTypeId(void) const
A simple [min,max] interval for doubles.
string CacheBranchName(SppChannel_t spp_channel, InteractionType_t it, int nu) const
const XSecAlgorithmI * fSinglePionProductionXSecModel
void CacheResExcitationXSec(const Interaction *interaction) const
virtual ~SPPXSecWithCache()
static string AsString(SppChannel_t channel)
static SppChannel_t FromInteraction(const Interaction *interaction)
int HitNucPdg(void) const
void SetHitNucPdg(int pdgc)
Cross Section Calculation Interface.
int fGSLMinEval
GSL min evaluations. Ignored by some integrators.
string fGSLIntgType
name of GSL numerical integrator
int fGSLMaxEval
GSL max evaluations.
double fGSLRelTol
required relative tolerance (error)
List of cross section vs energy splines.
static XSecSplineList * Instance()
Interaction * fInteraction
const XSecAlgorithmI * fModel
~d3XSecMK_dWQ2CosTheta_E()
d3XSecMK_dWQ2CosTheta_E(const XSecAlgorithmI *m, const Interaction *i, double wcut)
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
double DoEval(const double *xin) const
double func(double x, double y)
Misc GENIE control constants.
static const double kASmallNum
bool IsNeutrino(int pdgc)
static constexpr double cm2
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
THE MAIN GENIE PROJECT NAMESPACE
enum genie::EInteractionType InteractionType_t
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
enum genie::ESppChannel SppChannel_t
const UInt_t kISkipProcessChk
if set, skip process validity checks