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

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

Protected Attributes

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

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

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
Created:\n March 20, 2014
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 34 of file AlamSimoAtharVacasSKXSec.h.

Constructor & Destructor Documentation

◆ AlamSimoAtharVacasSKXSec() [1/2]

AlamSimoAtharVacasSKXSec::AlamSimoAtharVacasSKXSec ( )

Definition at line 40 of file AlamSimoAtharVacasSKXSec.cxx.

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

References genie::XSecIntegratorI::XSecIntegratorI().

◆ AlamSimoAtharVacasSKXSec() [2/2]

AlamSimoAtharVacasSKXSec::AlamSimoAtharVacasSKXSec ( string config)

Definition at line 46 of file AlamSimoAtharVacasSKXSec.cxx.

46 :
47XSecIntegratorI("genie::AlamSimoAtharVacasSKXSec", config)
48{
49
50}

References genie::XSecIntegratorI::XSecIntegratorI().

◆ ~AlamSimoAtharVacasSKXSec()

AlamSimoAtharVacasSKXSec::~AlamSimoAtharVacasSKXSec ( )
virtual

Definition at line 52 of file AlamSimoAtharVacasSKXSec.cxx.

53{
54
55}

Member Function Documentation

◆ Configure() [1/2]

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

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

◆ Configure() [2/2]

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{
153 Algorithm::Configure(config);
154 this->LoadConfig();
155}

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

◆ Integrate()

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
82 XSecSplineList * xsl = XSecSplineList::Instance();
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
131 ROOT::Math::IntegrationMultiDim::Type ig_type =
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}
#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
const Target & Tgt(void) const
double ProbeE(RefFrame_t rf) const
Target * TgtPtr(void) const
InitialState * InitStatePtr(void) const
Definition Interaction.h:74
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
double Evaluate(double x) const
Definition Spline.cxx:363
void SetId(int pdgc)
Definition Target.cxx:149
int HitNucPdg(void) const
Definition Target.cxx:304
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
bool IsNucleus(void) const
Definition Target.cxx:272
virtual bool ValidProcess(const Interaction *i) const =0
Can this cross section algorithm handle the input process?
string fGSLIntgType
name of GSL numerical integrator
int fGSLMaxEval
GSL max evaluations.
double fGSLRelTol
required relative tolerance (error)
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
bool IsEmpty(void) const
static XSecSplineList * Instance()
double func(double x, double y)
bool IsProton(int pdgc)
Definition PDGUtils.cxx:336
static constexpr double cm2
Definition Units.h:69
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
Definition GSLUtils.cxx:59
const int kPdgTgtFreeN
Definition PDGCodes.h:200
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition Interaction.h:48
@ kRfHitNucRest
Definition RefFrame.h:30
@ kRfLab
Definition RefFrame.h:26
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition Interaction.h:47
const int kPdgTgtFreeP
Definition PDGCodes.h:199
const UInt_t kIAssumeFreeNucleon
Definition Interaction.h:49

References genie::units::cm2, genie::Spline::Evaluate(), genie::Interaction::ExclTag(), genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, genie::PDGLibrary::Find(), genie::Interaction::FSPrimLeptonPdg(), func(), genie::XSecSplineList::GetSpline(), genie::Target::HitNucPdg(), genie::Interaction::InitStatePtr(), genie::PDGLibrary::Instance(), genie::XSecSplineList::Instance(), genie::utils::gsl::IntegrationNDimTypeFromString(), genie::KPhaseSpace::IsAboveThreshold(), genie::XSecSplineList::IsEmpty(), genie::Target::IsNucleus(), genie::pdg::IsProton(), genie::kIAssumeFreeNucleon, genie::kISkipKinematicChk, genie::kISkipProcessChk, genie::kPdgTgtFreeN, genie::kPdgTgtFreeP, genie::kRfHitNucRest, genie::kRfLab, LOG, genie::Target::N(), pDEBUG, genie::Interaction::PhaseSpace(), pINFO, genie::InitialState::ProbeE(), genie::Target::SetId(), genie::XSecSplineList::SplineExists(), genie::XclsTag::StrangeHadronPdg(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), genie::XSecAlgorithmI::ValidProcess(), and genie::Target::Z().

◆ LoadConfig()

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

References genie::XSecIntegratorI::fGSLIntgType, genie::XSecIntegratorI::fGSLMaxEval, genie::XSecIntegratorI::fGSLRelTol, fSplitIntegral, and genie::Algorithm::GetParamDef().

Referenced by Configure(), and Configure().

Member Data Documentation

◆ fSplitIntegral

bool genie::AlamSimoAtharVacasSKXSec::fSplitIntegral
protected

Definition at line 49 of file AlamSimoAtharVacasSKXSec.h.

Referenced by LoadConfig().


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