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

Computes the cross section for an exclusive 1pi reaction through resonance neutrinoproduction according to the Rein-Sehgal model. More...

#include <ReinSehgalRESXSec.h>

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

Public Member Functions

 ReinSehgalRESXSec ()
 
 ReinSehgalRESXSec (string param_set)
 
virtual ~ReinSehgalRESXSec ()
 
double Integrate (const XSecAlgorithmI *model, const Interaction *i) const
 
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)
 

Private Attributes

bool fUsePauliBlocking
 account for Pauli blocking? 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)
 
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::ReinSehgalRESXSecWithCache
 ReinSehgalRESXSecWithCache ()
 
 ReinSehgalRESXSecWithCache (string name)
 
 ReinSehgalRESXSecWithCache (string name, string config)
 
virtual ~ReinSehgalRESXSecWithCache ()
 
void CacheResExcitationXSec (const Interaction *interaction) const
 
string CacheBranchName (Resonance_t r, InteractionType_t it, int nu, int nuc) const
 
- 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::ReinSehgalRESXSecWithCache
bool fUsingDisResJoin
 
double fWcut
 
double fEMax
 
const XSecAlgorithmIfSingleResXSecModel
 
BaryonResList fResList
 
- 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 cross section for an exclusive 1pi reaction through resonance neutrinoproduction according to the Rein-Sehgal model.

      This algorithm produces in principle what you could also get from
      the genie::RESXSec algorithm (RES cross section integrator) by
      specifying the genie::ReinSehgalRESPXSec as the differential
      cross section model. However, ReinSehgalRESXSec offers a faster
      alternative. Before computing any RES cross section this algorithm
      computes and caches splines for resonance neutrino-production cross
      sections. This improves the speed of the GENIE spline construction
      phase if splines for multiple nuclear targets are to be computed.

      Is a concrete implementation of the XSecAlgorithmI interface.\n
References:
D.Rein and L.M.Sehgal, Neutrino Excitation of Baryon Resonances and Single Pion Production, Ann.Phys.133, 79 (1981)
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
March 09, 2006
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 40 of file ReinSehgalRESXSec.h.

Constructor & Destructor Documentation

ReinSehgalRESXSec::ReinSehgalRESXSec ( )

Definition at line 40 of file ReinSehgalRESXSec.cxx.

40  :
41 ReinSehgalRESXSecWithCache("genie::ReinSehgalRESXSec")
42 {
43 
44 }
ReinSehgalRESXSec::ReinSehgalRESXSec ( string  param_set)

Definition at line 46 of file ReinSehgalRESXSec.cxx.

46  :
47 ReinSehgalRESXSecWithCache("genie::ReinSehgalRESXSec", config)
48 {
49 
50 }
ReinSehgalRESXSec::~ReinSehgalRESXSec ( )
virtual

Definition at line 52 of file ReinSehgalRESXSec.cxx.

53 {
54 
55 }

Member Function Documentation

void ReinSehgalRESXSec::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 192 of file ReinSehgalRESXSec.cxx.

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

193 {
194  Algorithm::Configure(config);
195  this->LoadConfig();
196 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void ReinSehgalRESXSec::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 198 of file ReinSehgalRESXSec.cxx.

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

199 {
200  Algorithm::Configure(config);
201  this->LoadConfig();
202 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double ReinSehgalRESXSec::Integrate ( const XSecAlgorithmI model,
const Interaction i 
) const
virtual

Implements genie::XSecIntegratorI.

Definition at line 57 of file ReinSehgalRESXSec.cxx.

References genie::utils::res::AsString(), genie::RunOpt::BareXSecPreCalc(), genie::ReinSehgalRESXSecWithCache::CacheBranchName(), genie::ReinSehgalRESXSecWithCache::CacheResExcitationXSec(), genie::units::cm2, genie::Spline::Evaluate(), genie::Interaction::ExclTag(), genie::ReinSehgalRESXSecWithCache::fEMax, genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, genie::Cache::FindCacheBranch(), genie::ReinSehgalRESXSecWithCache::fSingleResXSecModel, func(), fUsePauliBlocking, 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::ProcessInfo::InteractionTypeId(), genie::KPhaseSpace::IsAboveThreshold(), genie::XSecSplineList::IsEmpty(), genie::Target::IsNucleus(), genie::pdg::IsProton(), genie::kIAssumeFreeNucleon, genie::kKVQ2, genie::kKVW, genie::kPdgTgtFreeN, genie::kPdgTgtFreeP, genie::kRfHitNucRest, genie::KPhaseSpace::Limits(), LOG, genie::Range1D_t::max, genie::Range1D_t::min, genie::Target::N(), pDEBUG, genie::Interaction::PhaseSpace(), pINFO, pNOTICE, genie::InitialState::ProbeE(), genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), pWARN, genie::XclsTag::Resonance(), genie::Target::SetId(), SLOG, genie::XSecSplineList::SplineExists(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), genie::XSecAlgorithmI::ValidProcess(), and genie::Target::Z().

59 {
60  if(! model->ValidProcess(interaction) ) return 0.;
61  fSingleResXSecModel = model;
62 
63  const KPhaseSpace & kps = interaction->PhaseSpace();
64  if(!kps.IsAboveThreshold()) {
65  LOG("ReinSehgalRESXSec", pDEBUG) << "*** Below energy threshold";
66  return 0;
67  }
68 
69  //-- Get init state and process information
70  const InitialState & init_state = interaction->InitState();
71  const ProcessInfo & proc_info = interaction->ProcInfo();
72  const Target & target = init_state.Tgt();
73 
74  InteractionType_t it = proc_info.InteractionTypeId();
75  int nucleon_pdgc = target.HitNucPdg();
76  int nu_pdgc = init_state.ProbePdg();
77 
78  //-- Get neutrino energy in the struck nucleon rest frame
79  double Ev = init_state.ProbeE(kRfHitNucRest);
80 
81  //-- Get the requested resonance
82  Resonance_t res = interaction->ExclTag().Resonance();
83 
84  // If the input interaction is off a nuclear target, then chek whether
85  // the corresponding free nucleon cross section already exists at the
86  // cross section spline list.
87  // If yes, calculate the nuclear cross section based on that value.
88  //
90  if(init_state.Tgt().IsNucleus() && !xsl->IsEmpty() ) {
91  Interaction * in = new Interaction(*interaction);
92  if(pdg::IsProton(nucleon_pdgc)) {
94  } else {
96  }
97  if(xsl->SplineExists(model,in)) {
98  const Spline * spl = xsl->GetSpline(model, in);
99  double xsec = spl->Evaluate(Ev);
100  SLOG("ReinSehgalResT", pNOTICE)
101  << "XSec[RES/" << utils::res::AsString(res)<< "/free] (Ev = "
102  << Ev << " GeV) = " << xsec/(1E-38 *genie::units::cm2) << " x 1E-38 cm^2";
103  if(! interaction->TestBit(kIAssumeFreeNucleon) ) {
104  int NNucl = (pdg::IsProton(nucleon_pdgc)) ? target.Z() : target.N();
105  xsec *= NNucl;
106  }
107  delete in;
108  return xsec;
109  }
110  delete in;
111  }
112 
113  // There was no corresponding free nucleon spline saved in XSecSplineList that
114  // could be used to speed up this calculation.
115  // Check whether local caching of free nucleon cross sections is allowed.
116  // If yes, store free nucleon cross sections at a cache branch and use those
117  // at any subsequent call.
118  //
119  bool bare_xsec_pre_calc = RunOpt::Instance()->BareXSecPreCalc();
120  if(bare_xsec_pre_calc && !fUsePauliBlocking) {
121  Cache * cache = Cache::Instance();
122  string key = this->CacheBranchName(res, it, nu_pdgc, nucleon_pdgc);
123  LOG("ReinSehgalResT", pINFO)
124  << "Finding cache branch with key: " << key;
125  CacheBranchFx * cache_branch =
126  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
127  if(!cache_branch) {
128  LOG("ReinSehgalResT", pWARN)
129  << "No cached RES v-production data for input neutrino"
130  << " (pdgc: " << nu_pdgc << ")";
131  LOG("ReinSehgalResT", pWARN)
132  << "Wait while computing/caching RES production xsec first...";
133 
134  this->CacheResExcitationXSec(interaction);
135 
136  LOG("ReinSehgalResT", pINFO) << "Done caching resonance xsec data";
137  LOG("ReinSehgalResT", pINFO)
138  << "Finding newly created cache branch with key: " << key;
139  cache_branch =
140  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
141  assert(cache_branch);
142  }
143  const CacheBranchFx & cbranch = (*cache_branch);
144 
145  //-- Get cached resonance neutrinoproduction xsec
146  // (If E>Emax, assume xsec = xsec(Emax) - but do not evaluate the
147  // cross section spline at the end of its energy range-)
148  double rxsec = (Ev<fEMax-1) ? cbranch(Ev) : cbranch(fEMax-1);
149 
150  SLOG("ReinSehgalResT", pNOTICE)
151  << "XSec[RES/" << utils::res::AsString(res)<< "/free] (Ev = "
152  << Ev << " GeV) = " << rxsec/(1E-38 *genie::units::cm2) << " x 1E-38 cm^2";
153 
154  if( interaction->TestBit(kIAssumeFreeNucleon) ) return rxsec;
155 
156  int NNucl = (pdg::IsProton(nucleon_pdgc)) ? target.Z() : target.N();
157  rxsec*=NNucl; // nuclear xsec
158  return rxsec;
159  } // disable local caching
160 
161  // Just go ahead and integrate the input differential cross section for the
162  // specified interaction.
163  else {
164 
165  Range1D_t rW = kps.Limits(kKVW);
166  Range1D_t rQ2 = kps.Limits(kKVQ2);
167 
168  LOG("ReinSehgalResC", pINFO)
169  << "*** Integrating d^2 XSec/dWdQ^2 for R: "
170  << utils::res::AsString(res) << " at Ev = " << Ev;
171  LOG("ReinSehgalResC", pINFO)
172  << "{W} = " << rW.min << ", " << rW.max;
173  LOG("ReinSehgalResC", pINFO)
174  << "{Q^2} = " << rQ2.min << ", " << rQ2.max;
175 
176  ROOT::Math::IBaseFunctionMultiDim * func =
177  new utils::gsl::d2XSec_dWdQ2_E(model, interaction);
178  ROOT::Math::IntegrationMultiDim::Type ig_type =
180  ROOT::Math::IntegratorMultiDim ig(ig_type,0,fGSLRelTol,fGSLMaxEval);
181  ig.SetFunction(*func);
182  double kine_min[2] = { rW.min, rQ2.min };
183  double kine_max[2] = { rW.max, rQ2.max };
184  double xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
185 
186  delete func;
187  return xsec;
188  }
189  return 0;
190 }
bool fUsePauliBlocking
account for Pauli blocking?
InteractionType_t InteractionTypeId(void) const
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()
double Evaluate(double x) const
Definition: Spline.cxx:363
enum genie::EResonance Resonance_t
void SetId(int pdgc)
Definition: Target.cxx:149
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
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
#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 class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
string CacheBranchName(Resonance_t r, InteractionType_t it, int nu, int nuc) const
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int ProbePdg(void) const
Definition: InitialState.h:64
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
void CacheResExcitationXSec(const Interaction *interaction) const
#define pWARN
Definition: Messenger.h:60
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
const char * AsString(Resonance_t res)
resonance id -&gt; string
double min
Definition: Range1.h:52
#define pNOTICE
Definition: Messenger.h:61
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
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
List of cross section vs energy splines.
double ProbeE(RefFrame_t rf) const
enum genie::EInteractionType InteractionType_t
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63
double fGSLRelTol
required relative tolerance (error)
void ReinSehgalRESXSec::LoadConfig ( void  )
private

Definition at line 204 of file ReinSehgalRESXSec.cxx.

References genie::BaryonResList::Clear(), genie::BaryonResList::DecodeFromNameList(), genie::ReinSehgalRESXSecWithCache::fEMax, genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, genie::ReinSehgalRESXSecWithCache::fResList, fUsePauliBlocking, genie::Algorithm::GetParam(), and genie::Algorithm::GetParamDef().

Referenced by Configure().

205 {
206  // Get GSL integration type & relative tolerance
207  GetParamDef( "gsl-integration-type", fGSLIntgType, string("adaptive") ) ;
208  GetParamDef( "gsl-relative-tolerance", fGSLRelTol, 0.01 ) ;
209  GetParamDef( "gsl-max-eval", fGSLMaxEval, 100000 ) ;
210  GetParam("UsePauliBlockingForRES", fUsePauliBlocking);
211  // Get upper E limit on res xsec spline (=f(E)) before assuming xsec=const
212  GetParamDef( "ESplineMax", fEMax, 100. ) ;
213  fEMax = TMath::Max(fEMax, 20.); // don't accept user Emax if less than 20 GeV
214 
215  // Create the baryon resonance list specified in the config.
216  fResList.Clear();
217  string resonances ;
218  GetParam( "ResonanceNameList", resonances ) ;
219  fResList.DecodeFromNameList(resonances);
220 
221 }
bool fUsePauliBlocking
account for Pauli blocking?
string fGSLIntgType
name of GSL numerical integrator
void DecodeFromNameList(string list, string delimiter=",")
int fGSLMaxEval
GSL max evaluations.
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fGSLRelTol
required relative tolerance (error)

Member Data Documentation

bool genie::ReinSehgalRESXSec::fUsePauliBlocking
private

account for Pauli blocking?

Definition at line 58 of file ReinSehgalRESXSec.h.

Referenced by Integrate(), and LoadConfig().


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