GENIEGenerator
Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for genie::DFRXSec:
[legend]

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 Configure (string config)
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
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.

Private Member Functions

void LoadConfig (void)

Private Attributes

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

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.
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.
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.
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
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.
Protected Attributes inherited from genie::XSecIntegratorI
const IntegratorI * fIntegrator
 GENIE numerical integrator.
string fGSLIntgType
 name of GSL numerical integrator
double fGSLRelTol
 required relative tolerance (error)
int fGSLMaxEval
 GSL max evaluations.
int fGSLMinEval
 GSL min evaluations. Ignored by some integrators.
unsigned int fGSLMaxSizeOfSubintervals
 GSL maximum number of sub-intervals for 1D integrator.
unsigned int fGSLRule
 GSL Gauss-Kronrod integration rule (only for GSL 1D adaptive type)
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

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 \at tufts.edu> Tufts University
Created:\n May 13, 2016
License:\n Copyright (c) 2003-2025, 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() [1/2]

DFRXSec::DFRXSec ( )

Definition at line 37 of file DFRXSec.cxx.

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

References genie::XSecIntegratorI::XSecIntegratorI().

◆ DFRXSec() [2/2]

DFRXSec::DFRXSec ( std::string config)

Definition at line 44 of file DFRXSec.cxx.

45 : XSecIntegratorI("genie::DFRXSec", config)
46{
47
48}

References genie::XSecIntegratorI::XSecIntegratorI().

◆ ~DFRXSec()

DFRXSec::~DFRXSec ( )
virtual

Definition at line 51 of file DFRXSec.cxx.

52{
53
54}

Member Function Documentation

◆ Configure() [1/2]

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

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

◆ Configure() [2/2]

void DFRXSec::Configure ( std::string config)

Definition at line 115 of file DFRXSec.cxx.

116{
117 Algorithm::Configure(config);
118 this->LoadConfig();
119}

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

◆ Integrate()

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);
88 ROOT::Math::IntegrationMultiDim::Type ig_type =
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}
#define pINFO
Definition Messenger.h:62
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
double fTMax
upper bound for t = (q - p_pi)^2
Definition DFRXSec.h:54
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
virtual bool ValidProcess(const Interaction *i) const =0
Can this cross section algorithm handle the input process?
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)
double func(double x, double y)
static const double kASmallNum
Definition Controls.h:40
static constexpr double cm2
Definition Units.h:69
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition GSLUtils.cxx:59
@ kKVx
Definition KineVar.h:31
@ kKVy
Definition KineVar.h:32
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition Interaction.h:47

References genie::units::cm2, genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLMinEval, genie::XSecIntegratorI::fGSLRelTol, fTMax, func(), genie::utils::gsl::IntegrationNDimTypeFromString(), genie::KPhaseSpace::IsAboveThreshold(), genie::controls::kASmallNum, genie::kISkipProcessChk, genie::kKVx, genie::kKVy, genie::KPhaseSpace::Limits(), LOG, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, genie::Interaction::PhaseSpace(), pINFO, and genie::XSecAlgorithmI::ValidProcess().

◆ LoadConfig()

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}
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool GetParamDef(const RgKey &name, T &p, const T &def) const

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

Referenced by Configure(), and Configure().

Member Data Documentation

◆ fTMax

double genie::DFRXSec::fTMax
private

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

Definition at line 54 of file DFRXSec.h.

Referenced by Integrate(), and LoadConfig().


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