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

A cross-section integrator and GSL interface for the M. Rafi Alam, I. Ruiz Simo, M. Sajjad Athar and M.J. Vicente Vacas single-Kaon production model. Is a concrete implementation of the XSecIntegratorI interface. More...

#include <AlamSimoAtharVacasSKXSec.h>

Inheritance diagram for genie::AlamSimoAtharVacasSKXSec:
genie::XSecIntegratorI genie::Algorithm

Public Member Functions

 AlamSimoAtharVacasSKXSec ()
 
 AlamSimoAtharVacasSKXSec (string config)
 
virtual ~AlamSimoAtharVacasSKXSec ()
 
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...
 

Protected Attributes

bool fSplitIntegral
 
- 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...
 

Private Member Functions

void LoadConfig (void)
 

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...
 

Detailed Description

A cross-section integrator and GSL interface for the M. Rafi Alam, I. Ruiz Simo, M. Sajjad Athar and M.J. Vicente Vacas single-Kaon production model. Is a concrete implementation of the XSecIntegratorI interface.

Author
Chris Marshall and Martti Nirkko

March 20, 2014

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

Definition at line 34 of file AlamSimoAtharVacasSKXSec.h.

Constructor & Destructor Documentation

AlamSimoAtharVacasSKXSec::AlamSimoAtharVacasSKXSec ( )

Definition at line 40 of file AlamSimoAtharVacasSKXSec.cxx.

40  :
41 XSecIntegratorI("genie::AlamSimoAtharVacasSKXSec")
42 {
43 
44 }
AlamSimoAtharVacasSKXSec::AlamSimoAtharVacasSKXSec ( string  config)

Definition at line 46 of file AlamSimoAtharVacasSKXSec.cxx.

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

Definition at line 52 of file AlamSimoAtharVacasSKXSec.cxx.

53 {
54 
55 }

Member Function Documentation

void AlamSimoAtharVacasSKXSec::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 145 of file AlamSimoAtharVacasSKXSec.cxx.

146 {
147  Algorithm::Configure(config);
148  this->LoadConfig();
149 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void AlamSimoAtharVacasSKXSec::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 151 of file AlamSimoAtharVacasSKXSec.cxx.

152 {
154  this->LoadConfig();
155 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double AlamSimoAtharVacasSKXSec::Integrate ( const XSecAlgorithmI model,
const Interaction i 
) const
virtual

Implements genie::XSecIntegratorI.

Definition at line 57 of file AlamSimoAtharVacasSKXSec.cxx.

59 {
60  LOG("SKXSec", pDEBUG) << "Integrating the Alam Simo Athar Vacas model";
61 
62  const InitialState & init_state = in -> InitState();
63 
64  if(! model->ValidProcess(in) ) return 0.;
65 
66  const KPhaseSpace & kps = in->PhaseSpace(); // only OK phase space for this
67  if(!kps.IsAboveThreshold()) {
68  LOG("SKXSec", pDEBUG) << "*** Below energy threshold";
69  return 0;
70  }
71 
72  // If the input interaction is off a nuclear target, then chek whether
73  // the corresponding free nucleon cross section already exists at the
74  // cross section spline list.
75  // Cross section for PP scales with number of protons, NP and NN scale
76  // with number of neutrons
77  int nucpdgc = init_state.Tgt().HitNucPdg();
78  int NNucl = (pdg::IsProton(nucpdgc)) ?
79  init_state.Tgt().Z() : init_state.Tgt().N();
80  double Ev = init_state.ProbeE(kRfHitNucRest);
81 
83  if(init_state.Tgt().IsNucleus() && !xsl->IsEmpty() ) {
84  Interaction * interaction = new Interaction(*in);
85  Target * target = interaction->InitStatePtr()->TgtPtr();
86  if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); }
87  else { target->SetId(kPdgTgtFreeN); }
88  if(xsl->SplineExists(model,interaction)) {
89  const Spline * spl = xsl->GetSpline(model, interaction);
90  double xsec = spl->Evaluate(Ev);
91  LOG("SKXSec", pINFO)
92  << "From XSecSplineList: XSec[SK,free nucleon] (E = " << Ev << " GeV) = " << xsec;
93  if(! interaction->TestBit(kIAssumeFreeNucleon) ) {
94  xsec *= NNucl;
95  LOG("SKXSec", pINFO) << "XSec[SK] (E = " << Ev << " GeV) = " << xsec;
96  }
97  delete interaction;
98  return xsec;
99  }
100  delete interaction;
101  }
102 
103  // no free nucelon spline exists -- do the integration
104 
105  // Check this
106  double Enu = init_state.ProbeE(kRfLab);
107  int kpdg = in->ExclTag().StrangeHadronPdg();
108  double mk = PDGLibrary::Instance()->Find(kpdg)->Mass();
109  double ml = PDGLibrary::Instance()->Find(in->FSPrimLeptonPdg())->Mass();
110 
111  // integration bounds for T (kinetic energy)
112  double zero = 0.0;
113  double tmax = Enu - mk - ml;
114 
115  LOG("SKXSec", pDEBUG)
116  << "Lepton/Kaon KE integration range = [" << 0.0 << ", " << tmax << "]";
117 
118  Interaction * interaction = new Interaction(*in);
119  interaction->SetBit(kISkipProcessChk);
120  interaction->SetBit(kISkipKinematicChk);
121 
122  double xsec = 0;
123 
124  // do the integration over log(1-costheta) so it's not so sharply peaked
125 
126  ROOT::Math::IBaseFunctionMultiDim * func =
127  new utils::gsl::d3Xsec_dTldTkdCosThetal(model, interaction);
128  double kine_min[3] = { zero, zero, -20 }; // Tlep, Tkaon, cosine theta lep
129  double kine_max[3] = { tmax, tmax, 0.69314718056 }; // Tlep, Tkaon, cosine theta lep
130 
133 
134  double abstol = 1; //We mostly care about relative tolerance.
135  ROOT::Math::IntegratorMultiDim ig(*func, ig_type, abstol, fGSLRelTol, fGSLMaxEval);
136 
137  xsec = ig.Integral(kine_min, kine_max) * (1E-38 * units::cm2);
138  delete func;
139 
140  delete interaction;
141 
142  return xsec;
143 }
string fGSLIntgType
name of GSL numerical integrator
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition: GSLUtils.cxx:59
int Type
Definition: 018_def.c:12
int HitNucPdg(void) const
Definition: Target.cxx:304
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:46
bool IsNucleus(void) const
Definition: Target.cxx:272
double Mass(Resonance_t res)
resonance mass (GeV)
static XSecSplineList * Instance()
double Evaluate(double x) const
Definition: Spline.cxx:361
void SetId(int pdgc)
Definition: Target.cxx:149
Summary information for an interaction.
Definition: Interaction.h:56
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
#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
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition: Interaction.h:48
int fGSLMaxEval
GSL max evaluations.
int N(void) const
Definition: Target.h:69
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:49
Target * TgtPtr(void) const
Definition: InitialState.h:67
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?
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const Target & Tgt(void) const
Definition: InitialState.h:66
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
List of cross section vs energy splines.
double ProbeE(RefFrame_t rf) const
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 AlamSimoAtharVacasSKXSec::LoadConfig ( void  )
private

Definition at line 157 of file AlamSimoAtharVacasSKXSec.cxx.

158 {
159  // Get GSL integration type & relative tolerance
160  this->GetParamDef("gsl-integration-type" , fGSLIntgType, string("vegas") );
161  this->GetParamDef("gsl-max-evals", fGSLMaxEval, 20000);
162  this->GetParamDef("gsl-relative-tolerance", fGSLRelTol, 0.01);
163  this->GetParamDef("split-integral", fSplitIntegral, true);
164 }
string fGSLIntgType
name of GSL numerical integrator
int fGSLMaxEval
GSL max evaluations.
bool GetParamDef(const RgKey &name, T &p, const T &def) const
double fGSLRelTol
required relative tolerance (error)

Member Data Documentation

bool genie::AlamSimoAtharVacasSKXSec::fSplitIntegral
protected

Definition at line 49 of file AlamSimoAtharVacasSKXSec.h.


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