GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::DMDISXSec Class Reference

Computes the DMDIS Cross Section.
Is a concrete implementation of the XSecIntegratorI interface.
. More...

#include <DMDISXSec.h>

Inheritance diagram for genie::DMDISXSec:
Inheritance graph
[legend]
Collaboration diagram for genie::DMDISXSec:
Collaboration graph
[legend]

Public Member Functions

 DMDISXSec ()
 
 DMDISXSec (string config)
 
virtual ~DMDISXSec ()
 
double Integrate (const XSecAlgorithmI *model, const Interaction *i) const
 XSecIntegratorI interface implementation. More...
 
void Configure (const Registry &config)
 
void Configure (string config)
 
- Public Member Functions inherited from genie::XSecIntegratorI
virtual ~XSecIntegratorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void FindConfig (void)
 
virtual const RegistryGetConfig (void) const
 
RegistryGetOwnedConfig (void)
 
virtual const AlgIdId (void) const
 Get algorithm ID. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
virtual void SetId (string name, string config)
 
const AlgorithmSubAlg (const RgKey &registry_key) const
 
void AdoptConfig (void)
 
void AdoptSubstructure (void)
 
virtual void Print (ostream &stream) const
 Print algorithm info. More...
 

Private Member Functions

void LoadConfig (void)
 
void CacheFreeNucleonXSec (const XSecAlgorithmI *model, const Interaction *in) const
 
string CacheBranchName (const XSecAlgorithmI *model, const Interaction *in) const
 

Private Attributes

double fVldEmin
 
double fVldEmax
 

Additional Inherited Members

- Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
 
static string BuildParamVectSizeKey (const std::string &comm_name)
 
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
 
static string BuildParamMatRowSizeKey (const std::string &comm_name)
 
static string BuildParamMatColSizeKey (const std::string &comm_name)
 
- Protected Member Functions inherited from genie::XSecIntegratorI
 XSecIntegratorI ()
 
 XSecIntegratorI (string name)
 
 XSecIntegratorI (string name, string config)
 
- Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 
 Algorithm (string name)
 
 Algorithm (string name, string config)
 
void Initialize (void)
 
void DeleteConfig (void)
 
void DeleteSubstructure (void)
 
RegistryExtractLocalConfig (const Registry &in) const
 
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More...
 
template<class T >
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
 
template<class T >
bool GetParamDef (const RgKey &name, T &p, const T &def) const
 
template<class T >
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters. More...
 
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
template<class T >
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters. More...
 
template<class T >
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
 
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::XSecIntegratorI
const IntegratorI * fIntegrator
 GENIE numerical integrator. More...
 
string fGSLIntgType
 name of GSL numerical integrator More...
 
double fGSLRelTol
 required relative tolerance (error) More...
 
int fGSLMaxEval
 GSL max evaluations. More...
 
int fGSLMinEval
 GSL min evaluations. Ignored by some integrators. More...
 
unsigned int fGSLMaxSizeOfSubintervals
 GSL maximum number of sub-intervals for 1D integrator. More...
 
unsigned int fGSLRule
 GSL Gauss-Kronrod integration rule (only for GSL 1D adaptive type) More...
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Computes the DMDIS Cross Section.
Is a concrete implementation of the XSecIntegratorI interface.
.

Author
Joshua Berger <jberger physics.wisc.edu> University of Wisconsin-Madison

Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool

Created:
September 4, 2017
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 30 of file DMDISXSec.h.

Constructor & Destructor Documentation

DMDISXSec::DMDISXSec ( )

Definition at line 43 of file DMDISXSec.cxx.

43  :
44 XSecIntegratorI("genie::DMDISXSec")
45 {
46 
47 }
DMDISXSec::DMDISXSec ( string  config)

Definition at line 49 of file DMDISXSec.cxx.

49  :
50 XSecIntegratorI("genie::DMDISXSec", config)
51 {
52 
53 }
DMDISXSec::~DMDISXSec ( )
virtual

Definition at line 55 of file DMDISXSec.cxx.

56 {
57 
58 }

Member Function Documentation

string DMDISXSec::CacheBranchName ( const XSecAlgorithmI model,
const Interaction in 
) const
private

Definition at line 324 of file DMDISXSec.cxx.

References genie::Interaction::AsString(), genie::Cache::CacheBranchKey(), genie::Algorithm::Id(), genie::Cache::Instance(), and genie::AlgId::Key().

Referenced by CacheFreeNucleonXSec(), and Integrate().

326 {
327 // Build a unique name for the cache branch
328 
329  Cache * cache = Cache::Instance();
330 
331  string algkey = model->Id().Key();
332  string ikey = interaction->AsString();
333  string key = cache->CacheBranchKey(algkey, ikey);
334  return key;
335 }
string CacheBranchKey(string k0, string k1="", string k2="") const
Definition: Cache.cxx:93
GENIE Cache Memory.
Definition: Cache.h:38
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
static Cache * Instance(void)
Definition: Cache.cxx:67
string Key(void) const
Definition: AlgId.h:46
void DMDISXSec::CacheFreeNucleonXSec ( const XSecAlgorithmI model,
const Interaction in 
) const
private

Definition at line 216 of file DMDISXSec.cxx.

References genie::Cache::AddCacheBranch(), genie::CacheBranchFx::AddValues(), CacheBranchName(), genie::units::cm2, genie::CacheBranchFx::CreateSpline(), genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLMinEval, genie::XSecIntegratorI::fGSLRelTol, genie::Cache::FindCacheBranch(), func(), fVldEmax, fVldEmin, genie::InitialState::GetProbeP4(), genie::Target::HitNucPdg(), genie::Interaction::InitStatePtr(), genie::Cache::Instance(), genie::utils::gsl::IntegrationNDimTypeFromString(), genie::pdg::IsProton(), genie::controls::kASmallNum, genie::kPdgTgtFreeN, genie::kPdgTgtFreeP, LOG, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, genie::Interaction::PhaseSpace(), pINFO, pNOTICE, pWARN, genie::KPhaseSpace::Q2Lim(), genie::Target::SetId(), genie::InitialState::SetProbeP4(), genie::InitialState::TgtPtr(), genie::KPhaseSpace::Threshold(), and genie::KPhaseSpace::WLim().

Referenced by Integrate().

218 {
219  LOG("DMDISXSec", pWARN)
220  << "Wait while computing/caching free nucleon DIS xsections first...";
221 
222  // Create the cache branch
223  Cache * cache = Cache::Instance();
224  string key = this->CacheBranchName(model,interaction);
225  CacheBranchFx * cache_branch =
226  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
227  assert(!cache_branch);
228  cache_branch = new CacheBranchFx("DMDIS XSec");
229  cache->AddCacheBranch(key, cache_branch);
230 
231  // Tweak interaction to be on a free nucleon target
232  Target * target = interaction->InitStatePtr()->TgtPtr();
233  int nucpdgc = target->HitNucPdg();
234  if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); }
235  else { target->SetId(kPdgTgtFreeN); }
236 
237  // Compute threshold
238  const KPhaseSpace & kps = interaction->PhaseSpace();
239  double Ethr = kps.Threshold();
240 
241  // Compute the number of spline knots - use at least 10 knots per decade
242  // && at least 40 knots in the full energy range
243  const double Emin = fVldEmin/3.;
244  const double Emax = fVldEmax*3.;
245  const int nknots_min = (int) (10*(TMath::Log(Emax) - TMath::Log(Emin)));
246  const int nknots = TMath::Max(40, nknots_min);
247 
248  // Distribute the knots in the energy range as is being done in the
249  // XSecSplineList so that the energy threshold is treated correctly
250  // in the spline - see comments there in.
251  double * E = new double[nknots];
252  int nkb = (Ethr>Emin) ? 5 : 0; // number of knots < threshold
253  int nka = nknots-nkb; // number of knots >= threshold
254  // knots < energy threshold
255  double dEb = (Ethr>Emin) ? (Ethr - Emin) / nkb : 0;
256  for(int i=0; i<nkb; i++) {
257  E[i] = Emin + i*dEb;
258  }
259  // knots >= energy threshold
260  double E0 = TMath::Max(Ethr,Emin);
261  double dEa = (TMath::Log10(Emax) - TMath::Log10(E0)) /(nka-1);
262  for(int i=0; i<nka; i++) {
263  E[i+nkb] = TMath::Power(10., TMath::Log10(E0) + i * dEa);
264  }
265 
266  // Create the integrand
267  ROOT::Math::IBaseFunctionMultiDim * func =
268  new utils::gsl::d2XSec_dWdQ2_E(model, interaction);
269 
270  // Compute the cross section at the given set of knots
271  double Md = interaction->InitStatePtr()->GetProbeP4()->M();
272  double Md2 = Md*Md;
273  for(int ie=0; ie<nknots; ie++) {
274  LOG("DMDISXSec", pDEBUG) << "Dealing with knot " << ie << " out of " << nknots;
275  double Ed = E[ie];
276  double pd = TMath::Max(Ed*Ed - Md2,0.);
277  pd = TMath::Sqrt(pd);
278  TLorentzVector p4(0,0,pd,Ed);
279  interaction->InitStatePtr()->SetProbeP4(p4);
280  double xsec = 0.;
281  if(Ed>Ethr+kASmallNum) {
282  Range1D_t Wl = kps.WLim();
283  Range1D_t Q2l = kps.Q2Lim();
284  LOG("DMDISXSec", pINFO)
285  << "W integration range = [" << Wl.min << ", " << Wl.max << "]";
286  LOG("DMDISXSec", pINFO)
287  << "Q2 integration range = [" << Q2l.min << ", " << Q2l.max << "]";
288 
289  bool phsp_ok =
290  (Q2l.min >= 0. && Q2l.max >= 0. && Q2l.max >= Q2l.min &&
291  Wl.min >= 0. && Wl.max >= 0. && Wl.max >= Wl.min);
292 
293  if(phsp_ok) {
294  ROOT::Math::IntegrationMultiDim::Type ig_type =
296  double abstol = 1; //We mostly care about relative tolerance.
297  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
298 
299  if (ig_type == ROOT::Math::IntegrationMultiDim::kADAPTIVE) {
300  ROOT::Math::AdaptiveIntegratorMultiDim * cast =
301  dynamic_cast<ROOT::Math::AdaptiveIntegratorMultiDim*>( ig.GetIntegrator() );
302  assert(cast);
303  cast->SetMinPts(fGSLMinEval);
304  }
305  double kine_min[2] = { Wl.min, Q2l.min };
306  double kine_max[2] = { Wl.max, Q2l.max };
307  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
308  }// phase space limits ok?
309  }//Ev>threshold
310 
311  LOG("DMDISXSec", pNOTICE)
312  << "Caching: XSec[DMDIS] (E = " << Ed << " GeV) = "
313  << xsec / (1E-38 * units::cm2) << " x 1E-38 cm^2";
314  cache_branch->AddValues(Ed,xsec);
315  }//ie
316 
317  // Create the spline
318  cache_branch->CreateSpline();
319 
320  delete [] E;
321  delete func;
322 }
string fGSLIntgType
name of GSL numerical integrator
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition: GSLUtils.cxx:59
int HitNucPdg(void) const
Definition: Target.cxx:304
A simple [min,max] interval for doubles.
Definition: Range1.h:42
double Threshold(void) const
Energy threshold.
Definition: KPhaseSpace.cxx:82
void CreateSpline(string type="TSpline3")
Range1D_t Q2Lim(void) const
Q2 limits.
void SetId(int pdgc)
Definition: Target.cxx:149
void AddCacheBranch(string key, CacheBranchI *branch)
Definition: Cache.cxx:88
void AddValues(double x, double y)
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static constexpr double cm2
Definition: Units.h:69
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
Kinematical phase space.
Definition: KPhaseSpace.h:33
const int kPdgTgtFreeN
Definition: PDGCodes.h:200
const int kPdgTgtFreeP
Definition: PDGCodes.h:199
double func(double x, double y)
static const double kASmallNum
Definition: Controls.h:40
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
Definition: Cache.cxx:80
GENIE Cache Memory.
Definition: Cache.h:38
double max
Definition: Range1.h:53
int fGSLMaxEval
GSL max evaluations.
double fVldEmin
Definition: DMDISXSec.h:51
string CacheBranchName(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DMDISXSec.cxx:324
double fVldEmax
Definition: DMDISXSec.h:52
double min
Definition: Range1.h:52
#define pNOTICE
Definition: Messenger.h:61
static Cache * Instance(void)
Definition: Cache.cxx:67
A simple cache branch storing the cached data in a TNtuple.
Definition: CacheBranchFx.h:49
int fGSLMinEval
GSL min evaluations. Ignored by some integrators.
Range1D_t WLim(void) const
W limits.
#define pDEBUG
Definition: Messenger.h:63
double fGSLRelTol
required relative tolerance (error)
void DMDISXSec::Configure ( const Registry config)
virtual

Overload the Algorithm::Configure() methods to load private data members from configuration options

Reimplemented from genie::Algorithm.

Definition at line 185 of file DMDISXSec.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

186 {
187  Algorithm::Configure(config);
188  this->LoadConfig();
189 }
void LoadConfig(void)
Definition: DMDISXSec.cxx:197
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void DMDISXSec::Configure ( string  config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 191 of file DMDISXSec.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

192 {
193  Algorithm::Configure(config);
194  this->LoadConfig();
195 }
void LoadConfig(void)
Definition: DMDISXSec.cxx:197
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double DMDISXSec::Integrate ( const XSecAlgorithmI model,
const Interaction i 
) const
virtual

XSecIntegratorI interface implementation.

Implements genie::XSecIntegratorI.

Definition at line 60 of file DMDISXSec.cxx.

References genie::RunOpt::BareXSecPreCalc(), CacheBranchName(), CacheFreeNucleonXSec(), genie::units::cm2, genie::Spline::Evaluate(), genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, genie::Cache::FindCacheBranch(), func(), genie::XSecSplineList::GetSpline(), genie::Target::HitNucPdg(), genie::Interaction::InitState(), genie::Interaction::InitStatePtr(), genie::RunOpt::Instance(), genie::Cache::Instance(), genie::XSecSplineList::Instance(), genie::utils::gsl::IntegrationNDimTypeFromString(), genie::KPhaseSpace::IsAboveThreshold(), genie::XSecSplineList::IsEmpty(), genie::Target::IsNucleus(), genie::pdg::IsProton(), genie::kIAssumeFreeNucleon, genie::kINoNuclearCorrection, genie::kISkipProcessChk, genie::kPdgTgtFreeN, genie::kPdgTgtFreeP, genie::kRfHitNucRest, LOG, genie::Range1D_t::max, genie::Range1D_t::min, genie::Target::N(), pDEBUG, genie::Interaction::PhaseSpace(), pINFO, genie::InitialState::ProbeE(), genie::KPhaseSpace::Q2Lim(), genie::Target::SetId(), genie::XSecSplineList::SplineExists(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), genie::XSecAlgorithmI::ValidProcess(), genie::KPhaseSpace::WLim(), and genie::Target::Z().

62 {
63  if(! model->ValidProcess(in) ) return 0.;
64 
65  const KPhaseSpace & kps = in->PhaseSpace();
66  if(!kps.IsAboveThreshold()) {
67  LOG("DMDISXSec", pDEBUG) << "*** Below energy threshold";
68  return 0;
69  }
70 
71  const InitialState & init_state = in->InitState();
72  double Ed = init_state.ProbeE(kRfHitNucRest);
73 
74  int nucpdgc = init_state.Tgt().HitNucPdg();
75  int NNucl = (pdg::IsProton(nucpdgc)) ?
76  init_state.Tgt().Z() : init_state.Tgt().N();
77 
78  // If the input interaction is off a nuclear target, then chek whether
79  // the corresponding free nucleon cross section already exists at the
80  // cross section spline list.
81  // If yes, calculate the nuclear cross section based on that value.
82  //
84  if(init_state.Tgt().IsNucleus() && !xsl->IsEmpty() ) {
85  Interaction * interaction = new Interaction(*in);
86  Target * target = interaction->InitStatePtr()->TgtPtr();
87  if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); }
88  else { target->SetId(kPdgTgtFreeN); }
89  if(xsl->SplineExists(model,interaction)) {
90  const Spline * spl = xsl->GetSpline(model, interaction);
91  double xsec = spl->Evaluate(Ed);
92  LOG("DMDISXSec", pINFO)
93  << "From XSecSplineList: XSec[DIS,free nucleon] (E = " << Ed << " GeV) = " << xsec;
94  if(! interaction->TestBit(kIAssumeFreeNucleon) ) {
95  xsec *= NNucl;
96  LOG("DMDISXSec", pINFO) << "XSec[DIS] (E = " << Ed << " GeV) = " << xsec;
97  }
98  delete interaction;
99  return xsec;
100  }
101  delete interaction;
102  }
103 
104  // There was no corresponding free nucleon spline saved in XSecSplineList that
105  // could be used to speed up this calculation.
106  // Check whether local caching of free nucleon cross sections is allowed.
107  // If yes, store free nucleon cross sections at a cache branch and use those
108  // at any subsequent call.
109  //
110  bool precalc_bare_xsec = RunOpt::Instance()->BareXSecPreCalc();
111  if(precalc_bare_xsec) {
112  Cache * cache = Cache::Instance();
113  Interaction * interaction = new Interaction(*in);
114  string key = this->CacheBranchName(model,interaction);
115  LOG("DMDISXSec", pINFO) << "Finding cache branch with key: " << key;
116  CacheBranchFx * cache_branch =
117  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
118  if(!cache_branch) {
119  this->CacheFreeNucleonXSec(model,interaction);
120  cache_branch =
121  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
122  assert(cache_branch);
123  }
124  const CacheBranchFx & cb = (*cache_branch);
125  double xsec = cb(Ed);
126  if(! interaction->TestBit(kIAssumeFreeNucleon) ) { xsec *= NNucl; }
127  LOG("DMDISXSec", pINFO) << "XSec[DIS] (E = " << Ed << " GeV) = " << xsec;
128  delete interaction;
129  return xsec;
130  }
131  else {
132  // Just go ahead and integrate the input differential cross section for the
133  // specified interaction.
134  //
135  Interaction * interaction = new Interaction(*in);
136  interaction->SetBit(kISkipProcessChk);
137 // interaction->SetBit(kISkipKinematicChk);
138 
139  // **Important note**
140  // Based on discussions with Hugh at the GENIE mini-workshop / RAL - July '07
141  // The DIS nuclear corrections re-distribute the strength in x,y but do not
142  // affect the total cross-section They should be disabled at this step.
143  // But they should be enabled at the DIS thread's kinematical selection.
144  // Since nuclear corrections don't need to be included at this stage, all the
145  // nuclear cross sections can be trivially built from the free nucleon ones.
146  //
147  interaction->SetBit(kINoNuclearCorrection);
148 
149  Range1D_t Wl = kps.WLim();
150  Range1D_t Q2l = kps.Q2Lim();
151  LOG("DMDISXSec", pINFO)
152  << "W integration range = [" << Wl.min << ", " << Wl.max << "]";
153  LOG("DMDISXSec", pINFO)
154  << "Q2 integration range = [" << Q2l.min << ", " << Q2l.max << "]";
155 
156  bool phsp_ok =
157  (Q2l.min >= 0. && Q2l.max >= 0. && Q2l.max >= Q2l.min &&
158  Wl.min >= 0. && Wl.max >= 0. && Wl.max >= Wl.min);
159 
160  double xsec = 0.;
161 
162  if(phsp_ok) {
163  ROOT::Math::IBaseFunctionMultiDim * func =
164  new utils::gsl::d2XSec_dWdQ2_E(model, interaction);
165  ROOT::Math::IntegrationMultiDim::Type ig_type =
167 
168  double abstol = 1; //We mostly care about relative tolerance.
169  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
170  double kine_min[2] = { Wl.min, Q2l.min };
171  double kine_max[2] = { Wl.max, Q2l.max };
172  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
173  delete func;
174  }//phase space ok?
175 
176  LOG("DMDISXSec", pINFO) << "XSec[DIS] (E = " << Ed << " GeV) = " << xsec;
177 
178  delete interaction;
179 
180  return xsec;
181  }
182  return 0;
183 }
string fGSLIntgType
name of GSL numerical integrator
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition: GSLUtils.cxx:59
int HitNucPdg(void) const
Definition: Target.cxx:304
A simple [min,max] interval for doubles.
Definition: Range1.h:42
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:58
bool IsNucleus(void) const
Definition: Target.cxx:272
void CacheFreeNucleonXSec(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DMDISXSec.cxx:216
static XSecSplineList * Instance()
Range1D_t Q2Lim(void) const
Q2 limits.
double Evaluate(double x) const
Definition: Spline.cxx:363
void SetId(int pdgc)
Definition: Target.cxx:149
Summary information for an interaction.
Definition: Interaction.h:56
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
bool BareXSecPreCalc(void) const
Definition: RunOpt.h:53
const UInt_t kINoNuclearCorrection
if set, inhibit nuclear corrections
Definition: Interaction.h:51
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsEmpty(void) const
static constexpr double cm2
Definition: Units.h:69
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
Kinematical phase space.
Definition: KPhaseSpace.h:33
const int kPdgTgtFreeN
Definition: PDGCodes.h:200
const int kPdgTgtFreeP
Definition: PDGCodes.h:199
double func(double x, double y)
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
virtual bool ValidProcess(const Interaction *i) const =0
Can this cross section algorithm handle the input process?
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
Definition: Cache.cxx:80
GENIE Cache Memory.
Definition: Cache.h:38
double max
Definition: Range1.h:53
int fGSLMaxEval
GSL max evaluations.
int N(void) const
Definition: Target.h:69
static RunOpt * Instance(void)
Definition: RunOpt.cxx:54
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:49
Target * TgtPtr(void) const
Definition: InitialState.h:67
string CacheBranchName(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DMDISXSec.cxx:324
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
double min
Definition: Range1.h:52
const Target & Tgt(void) const
Definition: InitialState.h:66
static Cache * Instance(void)
Definition: Cache.cxx:67
A simple cache branch storing the cached data in a TNtuple.
Definition: CacheBranchFx.h:49
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
List of cross section vs energy splines.
double ProbeE(RefFrame_t rf) const
Range1D_t WLim(void) const
W limits.
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63
double fGSLRelTol
required relative tolerance (error)
void DMDISXSec::LoadConfig ( void  )
private

Definition at line 197 of file DMDISXSec.cxx.

References genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLMinEval, genie::XSecIntegratorI::fGSLRelTol, fVldEmax, fVldEmin, genie::Algorithm::GetParam(), and genie::Algorithm::GetParamDef().

Referenced by Configure().

198 {
199  // Get GSL integration type & relative tolerance
200  GetParamDef("gsl-integration-type", fGSLIntgType, string("adaptive") ) ;
201  GetParamDef( "gsl-relative-tolerance", fGSLRelTol, 1E-2 ) ;
202 
203  int max_eval, min_eval ;
204  GetParamDef( "gsl-max-eval", max_eval, 500000 ) ;
205  GetParamDef( "gsl-min-eval", min_eval, 10000 ) ;
206 
207  fGSLMaxEval = (unsigned int) max_eval ;
208  fGSLMinEval = (unsigned int) min_eval ;
209 
210  // Energy range for cached splines
211  GetParam( "GVLD-Emin", fVldEmin) ;
212  GetParam( "GVLD-Emax", fVldEmax) ;
213 
214 }
string fGSLIntgType
name of GSL numerical integrator
int fGSLMaxEval
GSL max evaluations.
double fVldEmin
Definition: DMDISXSec.h:51
double fVldEmax
Definition: DMDISXSec.h:52
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
int fGSLMinEval
GSL min evaluations. Ignored by some integrators.
double fGSLRelTol
required relative tolerance (error)

Member Data Documentation

double genie::DMDISXSec::fVldEmax
private

Definition at line 52 of file DMDISXSec.h.

Referenced by CacheFreeNucleonXSec(), and LoadConfig().

double genie::DMDISXSec::fVldEmin
private

Definition at line 51 of file DMDISXSec.h.

Referenced by CacheFreeNucleonXSec(), and LoadConfig().


The documentation for this class was generated from the following files: