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

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

#include <ReinSehgalRESXSecFast.h>

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

Public Member Functions

 ReinSehgalRESXSecFast ()
 
 ReinSehgalRESXSecFast (string param_set)
 
virtual ~ReinSehgalRESXSecFast ()
 
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::ReinSehgalRESXSecWithCacheFast
 ReinSehgalRESXSecWithCacheFast ()
 
 ReinSehgalRESXSecWithCacheFast (string name)
 
 ReinSehgalRESXSecWithCacheFast (string name, string config)
 
virtual ~ReinSehgalRESXSecWithCacheFast ()
 
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::ReinSehgalRESXSecWithCacheFast
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, ReinSehgalRESXSecFast 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.
      Also this class integrates cross sections faster, than
      ReinSehgalRESXSec because of integration area transformation.

      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
Igor Kakorin kakor.nosp@m.in@j.nosp@m.inr.r.nosp@m.u Joint Institute for Nuclear Research

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

Created:
March 01, 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 47 of file ReinSehgalRESXSecFast.h.

Constructor & Destructor Documentation

ReinSehgalRESXSecFast::ReinSehgalRESXSecFast ( )

Definition at line 43 of file ReinSehgalRESXSecFast.cxx.

43  :
44 ReinSehgalRESXSecWithCacheFast("genie::ReinSehgalRESXSecFast")
45 {
46 
47 }
ReinSehgalRESXSecFast::ReinSehgalRESXSecFast ( string  param_set)

Definition at line 49 of file ReinSehgalRESXSecFast.cxx.

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

Definition at line 55 of file ReinSehgalRESXSecFast.cxx.

56 {
57 
58 }

Member Function Documentation

void ReinSehgalRESXSecFast::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 193 of file ReinSehgalRESXSecFast.cxx.

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

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

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

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

Implements genie::XSecIntegratorI.

Definition at line 60 of file ReinSehgalRESXSecFast.cxx.

References genie::utils::res::AsString(), genie::RunOpt::BareXSecPreCalc(), genie::ReinSehgalRESXSecWithCacheFast::CacheBranchName(), genie::ReinSehgalRESXSecWithCacheFast::CacheResExcitationXSec(), genie::units::cm2, genie::Spline::Evaluate(), genie::Interaction::ExclTag(), genie::ReinSehgalRESXSecWithCacheFast::fEMax, genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, genie::Cache::FindCacheBranch(), genie::ReinSehgalRESXSecWithCacheFast::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::kPdgTgtFreeN, genie::kPdgTgtFreeP, genie::kRfHitNucRest, 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().

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

Definition at line 205 of file ReinSehgalRESXSecFast.cxx.

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

Referenced by Configure().

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

account for Pauli blocking?

Definition at line 65 of file ReinSehgalRESXSecFast.h.

Referenced by Integrate(), and LoadConfig().


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