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

Computes DIS differential cross sections. Is a concrete implementation of the XSecAlgorithmI interface. More...

#include <KNOTunedQPMDISPXSec.h>

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

Public Member Functions

 KNOTunedQPMDISPXSec ()
 
 KNOTunedQPMDISPXSec (string config)
 
virtual ~KNOTunedQPMDISPXSec ()
 
double XSec (const Interaction *i, KinePhaseSpace_t k) const
 Compute the cross section for the input interaction. More...
 
double Integral (const Interaction *i) const
 
bool ValidProcess (const Interaction *i) const
 Can this cross section algorithm handle the input process? More...
 
void Configure (const Registry &config)
 
void Configure (string config)
 
- Public Member Functions inherited from genie::XSecAlgorithmI
virtual ~XSecAlgorithmI ()
 
virtual bool ValidKinematics (const Interaction *i) const
 Is the input kinematical point a physically allowed one? More...
 
- 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)
 
double DISRESJoinSuppressionFactor (const Interaction *in) const
 

Private Attributes

const AGKYLowW2019fHadronizationModel
 hadronic multip. model More...
 
const QPMDISPXSecfDISModel
 
const XSecIntegratorIfXSecIntegrator
 diff. xsec integrator More...
 
bool fUseCache
 cache reduction factors used in joining scheme More...
 
double fWcut
 apply DIS/RES joining scheme < Wcut More...
 
double fNRBEMScale
 apply NRB EM Scale factor 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::XSecAlgorithmI
 XSecAlgorithmI ()
 
 XSecAlgorithmI (string name)
 
 XSecAlgorithmI (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::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 DIS differential cross sections. Is a concrete implementation of the XSecAlgorithmI interface.

References:
E.A.Paschos and J.Y.Yu, Phys.Rev.D 65.03300
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
May 05, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 32 of file KNOTunedQPMDISPXSec.h.

Constructor & Destructor Documentation

KNOTunedQPMDISPXSec::KNOTunedQPMDISPXSec ( )

Definition at line 48 of file KNOTunedQPMDISPXSec.cxx.

48  :
49 XSecAlgorithmI("genie::KNOTunedQPMDISPXSec") { ; }
KNOTunedQPMDISPXSec::KNOTunedQPMDISPXSec ( string  config)

Definition at line 51 of file KNOTunedQPMDISPXSec.cxx.

51  :
52 XSecAlgorithmI("genie::KNOTunedQPMDISPXSec", config) { ; }
KNOTunedQPMDISPXSec::~KNOTunedQPMDISPXSec ( )
virtual

Definition at line 54 of file KNOTunedQPMDISPXSec.cxx.

55 {
56 
57 }

Member Function Documentation

void KNOTunedQPMDISPXSec::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 215 of file KNOTunedQPMDISPXSec.cxx.

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

216 {
217  Algorithm::Configure(config);
218  this->LoadConfig();
219 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void KNOTunedQPMDISPXSec::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 221 of file KNOTunedQPMDISPXSec.cxx.

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

222 {
223  Algorithm::Configure(config);
224 
225  this->LoadConfig();
226 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double KNOTunedQPMDISPXSec::DISRESJoinSuppressionFactor ( const Interaction in) const
private

Definition at line 96 of file KNOTunedQPMDISPXSec.cxx.

References genie::Cache::AddCacheBranch(), genie::CacheBranchFx::AddValues(), genie::Cache::CacheBranchKey(), genie::CacheBranchFx::CreateSpline(), fHadronizationModel, genie::Cache::FindCacheBranch(), fNRBEMScale, fUseCache, fWcut, genie::Target::HitNucMass(), genie::Target::HitNucPdg(), genie::Algorithm::Id(), genie::Interaction::InitState(), genie::Cache::Instance(), genie::ProcessInfo::InteractionTypeAsString(), genie::ProcessInfo::IsEM(), genie::AlgId::Key(), genie::Interaction::Kine(), genie::Interaction::KinePtr(), genie::constants::kNeutronMass, genie::constants::kPionMass, genie::kRfHitNucRest, LOG, genie::AGKYLowW2019::MultiplicityProb(), pDEBUG, pNOTICE, genie::InitialState::ProbeE(), genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), genie::Kinematics::SetW(), genie::InitialState::Tgt(), genie::utils::kinematics::W(), genie::Kinematics::x(), genie::utils::kinematics::XYtoW(), and genie::Kinematics::y().

Referenced by XSec().

98 {
99 // Computes suppression factors for the DIS xsec under the used DIS/RES join
100 // scheme. Since this is a 'low-level' algorithm that is being called many
101 // times per generated event or computed cross section spline, the suppression
102 // factors would be cached to avoid calling the hadronization model too often.
103 //
104  double R=0, Ro=0;
105 
106  const double Wmin = kNeutronMass + kPionMass + 1E-3;
107 
108  const InitialState & ist = in->InitState();
109  const ProcessInfo & pi = in->ProcInfo();
110  const bool is_EM = pi.IsEM();
111 
112  double E = ist.ProbeE(kRfHitNucRest);
113  double Mnuc = ist.Tgt().HitNucMass();
114  double x = in->Kine().x();
115  double y = in->Kine().y();
116  double Wo = utils::kinematics::XYtoW(E,Mnuc,x,y);
117 
118  TH1D * mprob = 0;
119 
120  if(!fUseCache) {
121  // ** Compute the reduction factor at each call - no caching
122  //
123  mprob = fHadronizationModel->MultiplicityProb(in,"+LowMultSuppr");
124  R = 1;
125  if(mprob) {
126  R = mprob->Integral("width");
127  delete mprob;
128  }
129  }
130  else {
131 
132  // ** Precompute/cache the reduction factors and then use the
133  // ** cache to evaluate these factors
134 
135  // Access the cache branch. The branch key is formed as:
136  // algid/DIS-RES-Join/nu-pdg:N;hit-nuc-pdg:N/inttype
137  Cache * cache = Cache::Instance();
138  string algkey = this->Id().Key() + "/DIS-RES-Join";
139 
140  ostringstream ikey;
141  ikey << "nu-pdgc:" << ist.ProbePdg()
142  << ";hit-nuc-pdg:"<< ist.Tgt().HitNucPdg() << "/"
143  << pi.InteractionTypeAsString();
144 
145  string key = cache->CacheBranchKey(algkey, ikey.str());
146 
147  CacheBranchFx * cbr =
148  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
149 
150  // If it does't exist then create a new one
151  // and cache DIS xsec suppression factors
152  bool non_zero=false;
153  if(!cbr) {
154  LOG("DISXSec", pNOTICE)
155  << "\n ** Creating cache branch - key = " << key;
156 
157  cbr = new CacheBranchFx("DIS Suppr. Factors in DIS/RES Join Scheme");
158  Interaction interaction(*in);
159 
160  const int kN = 300;
161  double WminSpl = Wmin;
162  double WmaxSpl = fWcut + 0.1; // well into the area where scaling factor = 1
163  double dW = (WmaxSpl-WminSpl)/(kN-1);
164 
165  for(int i=0; i<kN; i++) {
166  double W = WminSpl+i*dW;
167  interaction.KinePtr()->SetW(W);
168  mprob = fHadronizationModel->MultiplicityProb(&interaction,"+LowMultSuppr");
169  R = 1;
170  if(mprob) {
171  R = mprob->Integral("width");
172  delete mprob;
173  }
174  // make sure that it takes enough samples where it is non-zero:
175  // modify the step and the sample counter once I've hit the first
176  // non-zero value
177  if(!non_zero && R>0) {
178  non_zero=true;
179  WminSpl=W;
180  i = 0;
181  dW = (WmaxSpl-WminSpl)/(kN-1);
182  }
183  LOG("DISXSec", pNOTICE)
184  << "Cached DIS XSec Suppr. factor (@ W=" << W << ") = " << R;
185 
186  cbr->AddValues(W,R);
187  }
188  cbr->CreateSpline();
189 
190  cache->AddCacheBranch(key, cbr);
191  assert(cbr);
192  } // cache data
193 
194  // get the reduction factor from the cache branch
195  if(Wo > Wmin && Wo < fWcut) {
196  const CacheBranchFx & cache_branch = (*cbr);
197  R = cache_branch(Wo);
198  }
199  }
200 
201  // Now return the suppression factor
202  if (Wo > Wmin && Wo < fWcut) {
203  Ro = R;
204  if ( is_EM ) Ro *= fNRBEMScale ; // Additional scaling
205  }
206  else if (Wo <= Wmin) Ro = 0.0;
207  else Ro = 1.0;
208 
209  LOG("DISXSec", pDEBUG)
210  << "DIS/RES Join: DIS xsec suppr. (W=" << Wo << ") = " << Ro;
211 
212  return Ro;
213 }
double fWcut
apply DIS/RES joining scheme &lt; Wcut
TH1D * MultiplicityProb(const Interaction *, Option_t *opt="") const
double fNRBEMScale
apply NRB EM Scale factor
int HitNucPdg(void) const
Definition: Target.cxx:304
double HitNucMass(void) const
Definition: Target.cxx:233
void CreateSpline(string type="TSpline3")
double x(bool selected=false) const
Definition: Kinematics.cxx:99
double XYtoW(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1192
void AddCacheBranch(string key, CacheBranchI *branch)
Definition: Cache.cxx:88
double y(bool selected=false) const
Definition: Kinematics.cxx:112
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
Summary information for an interaction.
Definition: Interaction.h:56
void AddValues(double x, double y)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool fUseCache
cache reduction factors used in joining scheme
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
string CacheBranchKey(string k0, string k1="", string k2="") const
Definition: Cache.cxx:93
const Kinematics & Kine(void) const
Definition: Interaction.h:71
int ProbePdg(void) const
Definition: InitialState.h:64
static const double kNeutronMass
string InteractionTypeAsString(void) const
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
Definition: Cache.cxx:80
bool IsEM(void) const
GENIE Cache Memory.
Definition: Cache.h:38
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
#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
double ProbeE(RefFrame_t rf) const
string Key(void) const
Definition: AlgId.h:46
const AGKYLowW2019 * fHadronizationModel
hadronic multip. model
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63
double KNOTunedQPMDISPXSec::Integral ( const Interaction i) const
virtual

Integrate the model over the kinematic phase space available to the input interaction (kinematical cuts can be included)

Implements genie::XSecAlgorithmI.

Definition at line 85 of file KNOTunedQPMDISPXSec.cxx.

References fXSecIntegrator, and genie::XSecIntegratorI::Integrate().

86 {
87  double xsec = fXSecIntegrator->Integrate(this,interaction);
88  return xsec;
89 }
const XSecIntegratorI * fXSecIntegrator
diff. xsec integrator
virtual double Integrate(const XSecAlgorithmI *model, const Interaction *interaction) const =0
void KNOTunedQPMDISPXSec::LoadConfig ( void  )
private

Definition at line 228 of file KNOTunedQPMDISPXSec.cxx.

References genie::RunOpt::BareXSecPreCalc(), fDISModel, fHadronizationModel, fNRBEMScale, fUseCache, fWcut, fXSecIntegrator, genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), genie::RunOpt::Instance(), LOG, pFATAL, and genie::Algorithm::SubAlg().

Referenced by Configure().

229 {
230 
231  fHadronizationModel = nullptr ;
232 
234  dynamic_cast<const AGKYLowW2019 *> (this->SubAlg("Hadronizer"));
235  assert(fHadronizationModel);
236 
237  GetParam( "Wcut", fWcut ) ;
238  GetParam( "NRB-EM-XSecScale", fNRBEMScale );
239 
240  if ( fWcut <= 0. ) {
241 
242  LOG("KNOTunedQPMDISPXSec", pFATAL)
243  << "Input configuration value for Wcut is not physical: Exiting" ;
244 
245  // From the FreeBSD Library Functions Manual
246  //
247  // EX_CONFIG (78) Something was found in an unconfigured or miscon-
248  // figured state.
249 
250  exit( 78 ) ;
251 
252  }
253 
254  // load the pure E.A.Paschos and J.Y.Yu model
255  fDISModel = nullptr ;
256  fDISModel = dynamic_cast<const QPMDISPXSec *>(this->SubAlg("DISModel") ) ;
257  assert( fDISModel ) ;
258 
259  //-- load the differential cross section integrator
261  dynamic_cast<const XSecIntegratorI *> (this->SubAlg("XSec-Integrator"));
262  assert(fXSecIntegrator);
263 
264  // Caching the reduction factors used in the DIS/RES joing scheme?
265  // In normal event generation (1 config -> many calls) it is worth caching
266  // these suppression factors.
267  // Depending on the way this algorithm is used during event reweighting,
268  // precomputing (for all W's) & caching these factors might not be efficient.
269  // Here we provide the option to turn the caching off at run-time (default: on)
270 
271  bool cache_enabled = RunOpt::Instance()->BareXSecPreCalc();
272 
273  GetParamDef( "UseCache", fUseCache, true ) ;
274  fUseCache = fUseCache && cache_enabled;
275 
276 
277  }
double fWcut
apply DIS/RES joining scheme &lt; Wcut
double fNRBEMScale
apply NRB EM Scale factor
Cross Section Integrator Interface.
const QPMDISPXSec * fDISModel
A KNO-based hadronization model.
Definition: AGKYLowW2019.h:58
#define pFATAL
Definition: Messenger.h:56
Computes DIS differential cross sections. Is a concrete implementation of the XSecAlgorithmI interfac...
Definition: QPMDISPXSec.h:33
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 fUseCache
cache reduction factors used in joining scheme
const XSecIntegratorI * fXSecIntegrator
diff. xsec integrator
static RunOpt * Instance(void)
Definition: RunOpt.cxx:54
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const AGKYLowW2019 * fHadronizationModel
hadronic multip. model
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345
bool KNOTunedQPMDISPXSec::ValidProcess ( const Interaction i) const
virtual

Can this cross section algorithm handle the input process?

Implements genie::XSecAlgorithmI.

Definition at line 91 of file KNOTunedQPMDISPXSec.cxx.

References fDISModel.

92 {
93  return fDISModel -> ValidProcess(interaction) ;
94 }
const QPMDISPXSec * fDISModel
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
double KNOTunedQPMDISPXSec::XSec ( const Interaction i,
KinePhaseSpace_t  k 
) const
virtual

Compute the cross section for the input interaction.

Implements genie::XSecAlgorithmI.

Definition at line 59 of file KNOTunedQPMDISPXSec.cxx.

References DISRESJoinSuppressionFactor(), fDISModel, LOG, and pINFO.

61 {
62 
63  double xsec = fDISModel -> XSec(interaction, kps) ;
64 
65 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
66  LOG("DISPXSec", pINFO)
67  << "d2xsec/dxdy[FreeN] (E= " << E
68  << ", x= " << x << ", y= " << y << ") = " << xsec;
69 #endif
70 
71  double R = this->DISRESJoinSuppressionFactor(interaction);
72 
73  xsec*=R;
74 
75 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
76  LOG("DISPXSec", pINFO) << "D/R Join scheme - suppression factor R = " << R;;
77  LOG("DISPXSec", pINFO) << "d2xsec/dxdy[FreeN, D/R Join] " << xsec;
78 #endif
79 
80  xsec = TMath::Max(0., xsec ) ;
81 
82  return xsec;
83 }
const QPMDISPXSec * fDISModel
double DISRESJoinSuppressionFactor(const Interaction *in) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.

Member Data Documentation

const QPMDISPXSec* genie::KNOTunedQPMDISPXSec::fDISModel
private

Definition at line 54 of file KNOTunedQPMDISPXSec.h.

Referenced by LoadConfig(), ValidProcess(), and XSec().

const AGKYLowW2019* genie::KNOTunedQPMDISPXSec::fHadronizationModel
private

hadronic multip. model

Definition at line 53 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

double genie::KNOTunedQPMDISPXSec::fNRBEMScale
private

apply NRB EM Scale factor

Definition at line 59 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

bool genie::KNOTunedQPMDISPXSec::fUseCache
private

cache reduction factors used in joining scheme

Definition at line 57 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

double genie::KNOTunedQPMDISPXSec::fWcut
private

apply DIS/RES joining scheme < Wcut

Definition at line 58 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

const XSecIntegratorI* genie::KNOTunedQPMDISPXSec::fXSecIntegrator
private

diff. xsec integrator

Definition at line 55 of file KNOTunedQPMDISPXSec.h.

Referenced by Integral(), and LoadConfig().


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