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::DISXSec Class Reference

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

#include <DISXSec.h>

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

Public Member Functions

 DISXSec ()
 
 DISXSec (string config)
 
virtual ~DISXSec ()
 
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 DIS Cross Section.
Is a concrete implementation of the XSecIntegratorI interface.
.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
May 04, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 26 of file DISXSec.h.

Constructor & Destructor Documentation

DISXSec::DISXSec ( )

Definition at line 39 of file DISXSec.cxx.

39  :
40 XSecIntegratorI("genie::DISXSec")
41 {
42 
43 }
DISXSec::DISXSec ( string  config)

Definition at line 45 of file DISXSec.cxx.

45  :
46 XSecIntegratorI("genie::DISXSec", config)
47 {
48 
49 }
DISXSec::~DISXSec ( )
virtual

Definition at line 51 of file DISXSec.cxx.

52 {
53 
54 }

Member Function Documentation

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

Definition at line 316 of file DISXSec.cxx.

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

Referenced by CacheFreeNucleonXSec(), and Integrate().

318 {
319 // Build a unique name for the cache branch
320 
321  Cache * cache = Cache::Instance();
322 
323  string algkey = model->Id().Key();
324  string ikey = interaction->AsString();
325  string key = cache->CacheBranchKey(algkey, ikey);
326  return key;
327 }
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 DISXSec::CacheFreeNucleonXSec ( const XSecAlgorithmI model,
const Interaction in 
) const
private

Definition at line 212 of file DISXSec.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::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, 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().

214 {
215  LOG("DISXSec", pWARN)
216  << "Wait while computing/caching free nucleon DIS xsections first...";
217 
218  // Create the cache branch
219  Cache * cache = Cache::Instance();
220  string key = this->CacheBranchName(model,interaction);
221  CacheBranchFx * cache_branch =
222  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
223  assert(!cache_branch);
224  cache_branch = new CacheBranchFx("DIS XSec");
225  cache->AddCacheBranch(key, cache_branch);
226 
227  // Tweak interaction to be on a free nucleon target
228  Target * target = interaction->InitStatePtr()->TgtPtr();
229  int nucpdgc = target->HitNucPdg();
230  if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); }
231  else { target->SetId(kPdgTgtFreeN); }
232 
233  // Compute threshold
234  const KPhaseSpace & kps = interaction->PhaseSpace();
235  double Ethr = kps.Threshold();
236 
237  // Compute the number of spline knots - use at least 10 knots per decade
238  // && at least 40 knots in the full energy range
239  const double Emin = fVldEmin/3.;
240  const double Emax = fVldEmax*3.;
241  const int nknots_min = (int) (10*(TMath::Log(Emax) - TMath::Log(Emin)));
242  const int nknots = TMath::Max(40, nknots_min);
243 
244  // Distribute the knots in the energy range as is being done in the
245  // XSecSplineList so that the energy threshold is treated correctly
246  // in the spline - see comments there in.
247  double * E = new double[nknots];
248  int nkb = (Ethr>Emin) ? 5 : 0; // number of knots < threshold
249  int nka = nknots-nkb; // number of knots >= threshold
250  // knots < energy threshold
251  double dEb = (Ethr>Emin) ? (Ethr - Emin) / nkb : 0;
252  for(int i=0; i<nkb; i++) {
253  E[i] = Emin + i*dEb;
254  }
255  // knots >= energy threshold
256  double E0 = TMath::Max(Ethr,Emin);
257  double dEa = (TMath::Log10(Emax) - TMath::Log10(E0)) /(nka-1);
258  for(int i=0; i<nka; i++) {
259  E[i+nkb] = TMath::Power(10., TMath::Log10(E0) + i * dEa);
260  }
261 
262  // Create the integrand
263  ROOT::Math::IBaseFunctionMultiDim * func =
264  new utils::gsl::d2XSec_dWdQ2_E(model, interaction);
265 
266  // Compute the cross section at the given set of knots
267  for(int ie=0; ie<nknots; ie++) {
268  double Ev = E[ie];
269  TLorentzVector p4(0,0,Ev,Ev);
270  interaction->InitStatePtr()->SetProbeP4(p4);
271  double xsec = 0.;
272  if(Ev>Ethr+kASmallNum) {
273  Range1D_t Wl = kps.WLim();
274  Range1D_t Q2l = kps.Q2Lim();
275  LOG("DISXSec", pINFO)
276  << "W integration range = [" << Wl.min << ", " << Wl.max << "]";
277  LOG("DISXSec", pINFO)
278  << "Q2 integration range = [" << Q2l.min << ", " << Q2l.max << "]";
279 
280  bool phsp_ok =
281  (Q2l.min >= 0. && Q2l.max >= 0. && Q2l.max >= Q2l.min &&
282  Wl.min >= 0. && Wl.max >= 0. && Wl.max >= Wl.min);
283 
284  if(phsp_ok) {
285  ROOT::Math::IntegrationMultiDim::Type ig_type =
287  double abstol = 1; //We mostly care about relative tolerance.
288  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
289 
290  if (ig_type == ROOT::Math::IntegrationMultiDim::kADAPTIVE) {
291  ROOT::Math::AdaptiveIntegratorMultiDim * cast =
292  dynamic_cast<ROOT::Math::AdaptiveIntegratorMultiDim*>( ig.GetIntegrator() );
293  assert(cast);
294  cast->SetMinPts(fGSLMinEval);
295  }
296 
297  double kine_min[2] = { Wl.min, Q2l.min };
298  double kine_max[2] = { Wl.max, Q2l.max };
299  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
300  }// phase space limits ok?
301  }//Ev>threshold
302 
303  LOG("DISXSec", pNOTICE)
304  << "Caching: XSec[DIS] (E = " << Ev << " GeV) = "
305  << xsec / (1E-38 * units::cm2) << " x 1E-38 cm^2";
306  cache_branch->AddValues(Ev,xsec);
307  }//ie
308 
309  // Create the spline
310  cache_branch->CreateSpline();
311 
312  delete [] E;
313  delete func;
314 }
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
double fVldEmax
Definition: DISXSec.h:48
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: DISXSec.h:47
string CacheBranchName(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DISXSec.cxx:316
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.
double fGSLRelTol
required relative tolerance (error)
void DISXSec::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 181 of file DISXSec.cxx.

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

182 {
183  Algorithm::Configure(config);
184  this->LoadConfig();
185 }
void LoadConfig(void)
Definition: DISXSec.cxx:193
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void DISXSec::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 187 of file DISXSec.cxx.

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

188 {
189  Algorithm::Configure(config);
190  this->LoadConfig();
191 }
void LoadConfig(void)
Definition: DISXSec.cxx:193
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double DISXSec::Integrate ( const XSecAlgorithmI model,
const Interaction i 
) const
virtual

XSecIntegratorI interface implementation.

Implements genie::XSecIntegratorI.

Definition at line 56 of file DISXSec.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().

58 {
59  if(! model->ValidProcess(in) ) return 0.;
60 
61  const KPhaseSpace & kps = in->PhaseSpace();
62  if(!kps.IsAboveThreshold()) {
63  LOG("DISXSec", pDEBUG) << "*** Below energy threshold";
64  return 0;
65  }
66 
67  const InitialState & init_state = in->InitState();
68  double Ev = init_state.ProbeE(kRfHitNucRest);
69 
70  int nucpdgc = init_state.Tgt().HitNucPdg();
71  int NNucl = (pdg::IsProton(nucpdgc)) ?
72  init_state.Tgt().Z() : init_state.Tgt().N();
73 
74  // If the input interaction is off a nuclear target, then chek whether
75  // the corresponding free nucleon cross section already exists at the
76  // cross section spline list.
77  // If yes, calculate the nuclear cross section based on that value.
78  //
80  if(init_state.Tgt().IsNucleus() && !xsl->IsEmpty() ) {
81  Interaction * interaction = new Interaction(*in);
82  Target * target = interaction->InitStatePtr()->TgtPtr();
83  if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); }
84  else { target->SetId(kPdgTgtFreeN); }
85  if(xsl->SplineExists(model,interaction)) {
86  const Spline * spl = xsl->GetSpline(model, interaction);
87  double xsec = spl->Evaluate(Ev);
88  LOG("DISXSec", pINFO)
89  << "From XSecSplineList: XSec[DIS,free nucleon] (E = " << Ev << " GeV) = " << xsec;
90  if(! interaction->TestBit(kIAssumeFreeNucleon) ) {
91  xsec *= NNucl;
92  LOG("DISXSec", pINFO) << "XSec[DIS] (E = " << Ev << " GeV) = " << xsec;
93  }
94  delete interaction;
95  return xsec;
96  }
97  delete interaction;
98  }
99 
100  // There was no corresponding free nucleon spline saved in XSecSplineList that
101  // could be used to speed up this calculation.
102  // Check whether local caching of free nucleon cross sections is allowed.
103  // If yes, store free nucleon cross sections at a cache branch and use those
104  // at any subsequent call.
105  //
106  bool precalc_bare_xsec = RunOpt::Instance()->BareXSecPreCalc();
107  if(precalc_bare_xsec) {
108  Cache * cache = Cache::Instance();
109  Interaction * interaction = new Interaction(*in);
110  string key = this->CacheBranchName(model,interaction);
111  LOG("DISXSec", pINFO) << "Finding cache branch with key: " << key;
112  CacheBranchFx * cache_branch =
113  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
114  if(!cache_branch) {
115  this->CacheFreeNucleonXSec(model,interaction);
116  cache_branch =
117  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
118  assert(cache_branch);
119  }
120  const CacheBranchFx & cb = (*cache_branch);
121  double xsec = cb(Ev);
122  if(! interaction->TestBit(kIAssumeFreeNucleon) ) { xsec *= NNucl; }
123  LOG("DISXSec", pINFO) << "XSec[DIS] (E = " << Ev << " GeV) = " << xsec;
124  delete interaction;
125  return xsec;
126  }
127  else {
128  // Just go ahead and integrate the input differential cross section for the
129  // specified interaction.
130  //
131  Interaction * interaction = new Interaction(*in);
132  interaction->SetBit(kISkipProcessChk);
133 // interaction->SetBit(kISkipKinematicChk);
134 
135  // **Important note**
136  // Based on discussions with Hugh at the GENIE mini-workshop / RAL - July '07
137  // The DIS nuclear corrections re-distribute the strength in x,y but do not
138  // affect the total cross-section They should be disabled at this step.
139  // But they should be enabled at the DIS thread's kinematical selection.
140  // Since nuclear corrections don't need to be included at this stage, all the
141  // nuclear cross sections can be trivially built from the free nucleon ones.
142  //
143  interaction->SetBit(kINoNuclearCorrection);
144 
145  Range1D_t Wl = kps.WLim();
146  Range1D_t Q2l = kps.Q2Lim();
147  LOG("DISXSec", pINFO)
148  << "W integration range = [" << Wl.min << ", " << Wl.max << "]";
149  LOG("DISXSec", pINFO)
150  << "Q2 integration range = [" << Q2l.min << ", " << Q2l.max << "]";
151 
152  bool phsp_ok =
153  (Q2l.min >= 0. && Q2l.max >= 0. && Q2l.max >= Q2l.min &&
154  Wl.min >= 0. && Wl.max >= 0. && Wl.max >= Wl.min);
155 
156  double xsec = 0.;
157 
158  if(phsp_ok) {
159  ROOT::Math::IBaseFunctionMultiDim * func =
160  new utils::gsl::d2XSec_dWdQ2_E(model, interaction);
161  ROOT::Math::IntegrationMultiDim::Type ig_type =
163 
164  double abstol = 1; //We mostly care about relative tolerance.
165  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
166  double kine_min[2] = { Wl.min, Q2l.min };
167  double kine_max[2] = { Wl.max, Q2l.max };
168  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
169  delete func;
170  }//phase space ok?
171 
172  LOG("DISXSec", pINFO) << "XSec[DIS] (E = " << Ev << " GeV) = " << xsec;
173 
174  delete interaction;
175 
176  return xsec;
177  }
178  return 0;
179 }
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
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
void CacheFreeNucleonXSec(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DISXSec.cxx:212
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
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
string CacheBranchName(const XSecAlgorithmI *model, const Interaction *in) const
Definition: DISXSec.cxx:316
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 DISXSec::LoadConfig ( void  )
private

Definition at line 193 of file DISXSec.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().

194 {
195  // Get GSL integration type & relative tolerance
196  GetParamDef("gsl-integration-type", fGSLIntgType, string("adaptive") ) ;
197  GetParamDef( "gsl-relative-tolerance", fGSLRelTol, 1E-2 ) ;
198 
199  int max_eval, min_eval ;
200  GetParamDef( "gsl-max-eval", max_eval, 500000 ) ;
201  GetParamDef( "gsl-min-eval", min_eval, 10000 ) ;
202 
203  fGSLMaxEval = (unsigned int) max_eval ;
204  fGSLMinEval = (unsigned int) min_eval ;
205 
206  // Energy range for cached splines
207  GetParam( "GVLD-Emin", fVldEmin) ;
208  GetParam( "GVLD-Emax", fVldEmax) ;
209 
210 }
string fGSLIntgType
name of GSL numerical integrator
double fVldEmax
Definition: DISXSec.h:48
int fGSLMaxEval
GSL max evaluations.
double fVldEmin
Definition: DISXSec.h:47
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::DISXSec::fVldEmax
private

Definition at line 48 of file DISXSec.h.

Referenced by CacheFreeNucleonXSec(), and LoadConfig().

double genie::DISXSec::fVldEmin
private

Definition at line 47 of file DISXSec.h.

Referenced by CacheFreeNucleonXSec(), and LoadConfig().


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