Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::DFRXSec Class Reference

Computes the cross section for DFR neutrino-nucleus pi production.
Is a concrete implementation of the XSecIntegratorI interface. More...

#include <DFRXSec.h>

Inheritance diagram for genie::DFRXSec:
genie::XSecIntegratorI genie::Algorithm

Public Member Functions

 DFRXSec ()
 
 DFRXSec (std::string config)
 
virtual ~DFRXSec ()
 
double Integrate (const XSecAlgorithmI *model, const Interaction *i) const
 
void Configure (const Registry &config)
 
void Configure (std::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)
 

Private Attributes

double fTMax
 upper bound for t = (q - p_pi)^2 More...
 

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)
 
- 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
 
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< boolfOwnerships
 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 cross section for DFR neutrino-nucleus pi production.
Is a concrete implementation of the XSecIntegratorI interface.

Author
Jeremy Wolcott <jeremy.wolcott tufts.edu> Tufts University

May 13, 2016

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 36 of file DFRXSec.h.

Constructor & Destructor Documentation

DFRXSec::DFRXSec ( )

Definition at line 37 of file DFRXSec.cxx.

38  : XSecIntegratorI("genie::DFRXSec")
39 {
40 
41 }
DFRXSec::DFRXSec ( std::string  config)

Definition at line 44 of file DFRXSec.cxx.

45  : XSecIntegratorI("genie::DFRXSec", config)
46 {
47 
48 }
static Config * config
Definition: config.cpp:1054
DFRXSec::~DFRXSec ( )
virtual

Definition at line 51 of file DFRXSec.cxx.

52 {
53 
54 }

Member Function Documentation

void DFRXSec::Configure ( const Registry config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 108 of file DFRXSec.cxx.

109 {
110  Algorithm::Configure(config);
111  this->LoadConfig();
112 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
Definition: DFRXSec.cxx:122
void DFRXSec::Configure ( std::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 115 of file DFRXSec.cxx.

116 {
118  this->LoadConfig();
119 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
Definition: DFRXSec.cxx:122
double DFRXSec::Integrate ( const XSecAlgorithmI model,
const Interaction i 
) const
virtual

Implements genie::XSecIntegratorI.

Definition at line 57 of file DFRXSec.cxx.

58 {
59  if(! model->ValidProcess(in) ) return 0.;
60 
61  const KPhaseSpace & kps = in->PhaseSpace();
62  if(!kps.IsAboveThreshold()) {
63  LOG("DFRXSec", pDEBUG) << "*** Below energy threshold";
64  return 0;
65  }
66  Range1D_t xl = kps.Limits(kKVx);
67  Range1D_t yl = kps.Limits(kKVy);
68  // the actual t lower limit depends on Q^2 and nu, or, equivalently, x and y.
69  // defer to KPhaseSpace::IsAlllowed() on where to start the t integral.
70  Range1D_t tl;
72  tl.max = fTMax;
73 
74  Interaction * interaction = new Interaction(*in);
75  interaction->SetBit(kISkipProcessChk); // todo: was enabled in COH model. do I need it here?
76  //interaction->SetBit(kISkipKinematicChk);
77 
78  double xsec = 0.0;
79  LOG("DFRXSec", pINFO)
80  << "x integration range = [" << xl.min << ", " << xl.max << "]";
81  LOG("DFRXSec", pINFO)
82  << "y integration range = [" << yl.min << ", " << yl.max << "]";
83  LOG("DFRXSec", pINFO)
84  << "t integration range = [" << tl.min << ", " << tl.max << "]";
85 
86  ROOT::Math::IBaseFunctionMultiDim * func =
87  new utils::gsl::d3XSec_dxdydt_E(model, interaction);
90 
91  double abstol = 1; //We mostly care about relative tolerance.
92  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
93  if (ig_type == ROOT::Math::IntegrationMultiDim::kADAPTIVE) {
94  ROOT::Math::AdaptiveIntegratorMultiDim * cast =
95  dynamic_cast<ROOT::Math::AdaptiveIntegratorMultiDim*>( ig.GetIntegrator() );
96  assert(cast);
97  cast->SetMinPts(fGSLMinEval);
98  }
99 
100  double kine_min[3] = { xl.min, yl.min, tl.min };
101  double kine_max[3] = { xl.max, yl.max, tl.max };
102  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
103  delete func;
104  return xsec;
105 }
string fGSLIntgType
name of GSL numerical integrator
double fTMax
upper bound for t = (q - p_pi)^2
Definition: DFRXSec.h:54
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition: GSLUtils.cxx:59
int Type
Definition: 018_def.c:12
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
Summary information for an interaction.
Definition: Interaction.h:56
#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
Kinematical phase space.
Definition: KPhaseSpace.h:33
static const double kASmallNum
Definition: Controls.h:40
#define pINFO
Definition: Messenger.h:62
double max
Definition: Range1.h:53
int fGSLMaxEval
GSL max evaluations.
def func()
Definition: docstring.py:7
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
virtual bool ValidProcess(const Interaction *i) const =0
Can this cross section algorithm handle the input process?
double min
Definition: Range1.h:52
int fGSLMinEval
GSL min evaluations. Ignored by some integrators.
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
#define pDEBUG
Definition: Messenger.h:63
double fGSLRelTol
required relative tolerance (error)
void DFRXSec::LoadConfig ( void  )
private

Definition at line 122 of file DFRXSec.cxx.

123 {
124  // Get GSL integration type & relative tolerance
125  GetParamDef( "gsl-integration-type", fGSLIntgType, string("adaptive") ) ;
126  GetParamDef( "gsl-relative-tolerance", fGSLRelTol, 1E-2 ) ;
127 
128  int max, min;
129  GetParamDef( "gsl-max-eval", max, 500000 ) ;
130  GetParamDef( "gsl-min-eval", min, 5000 ) ;
131  fGSLMaxEval = (unsigned int) max ;
132  fGSLMinEval = (unsigned int) min ;
133 
134  //-- DFR model parameter t_max for t = (q - p_pi)^2
135  GetParam( "DFR-t-max", fTMax ) ;
136 
137 }
string fGSLIntgType
name of GSL numerical integrator
double fTMax
upper bound for t = (q - p_pi)^2
Definition: DFRXSec.h:54
static int max(int a, int b)
int fGSLMaxEval
GSL max evaluations.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
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::DFRXSec::fTMax
private

upper bound for t = (q - p_pi)^2

Definition at line 54 of file DFRXSec.h.


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