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:
genie::XSecAlgorithmI genie::Algorithm

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

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

Detailed Description

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

E.A.Paschos and J.Y.Yu, Phys.Rev.D 65.03300

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

May 05, 2004

Copyright (c) 2003-2020, 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) { ; }
static Config * config
Definition: config.cpp:1054
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 211 of file KNOTunedQPMDISPXSec.cxx.

212 {
213  Algorithm::Configure(config);
214  this->LoadConfig();
215 }
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 217 of file KNOTunedQPMDISPXSec.cxx.

218 {
220 
221  this->LoadConfig();
222 }
static Config * config
Definition: config.cpp:1054
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.

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 
111  double E = ist.ProbeE(kRfHitNucRest);
112  double Mnuc = ist.Tgt().HitNucMass();
113  double x = in->Kine().x();
114  double y = in->Kine().y();
115  double Wo = utils::kinematics::XYtoW(E,Mnuc,x,y);
116 
117  TH1D * mprob = 0;
118 
119  if(!fUseCache) {
120  // ** Compute the reduction factor at each call - no caching
121  //
122  mprob = fHadronizationModel->MultiplicityProb(in,"+LowMultSuppr");
123  R = 1;
124  if(mprob) {
125  R = mprob->Integral("width");
126  delete mprob;
127  }
128  }
129  else {
130 
131  // ** Precompute/cache the reduction factors and then use the
132  // ** cache to evaluate these factors
133 
134  // Access the cache branch. The branch key is formed as:
135  // algid/DIS-RES-Join/nu-pdg:N;hit-nuc-pdg:N/inttype
136  Cache * cache = Cache::Instance();
137  string algkey = this->Id().Key() + "/DIS-RES-Join";
138 
139  ostringstream ikey;
140  ikey << "nu-pdgc:" << ist.ProbePdg()
141  << ";hit-nuc-pdg:"<< ist.Tgt().HitNucPdg() << "/"
142  << pi.InteractionTypeAsString();
143 
144  string key = cache->CacheBranchKey(algkey, ikey.str());
145 
146  CacheBranchFx * cbr =
147  dynamic_cast<CacheBranchFx *> (cache->FindCacheBranch(key));
148 
149  // If it does't exist then create a new one
150  // and cache DIS xsec suppression factors
151  bool non_zero=false;
152  if(!cbr) {
153  LOG("DISXSec", pNOTICE)
154  << "\n ** Creating cache branch - key = " << key;
155 
156  cbr = new CacheBranchFx("DIS Suppr. Factors in DIS/RES Join Scheme");
158 
159  const int kN = 300;
160  double WminSpl = Wmin;
161  double WmaxSpl = fWcut + 0.1; // well into the area where scaling factor = 1
162  double dW = (WmaxSpl-WminSpl)/(kN-1);
163 
164  for(int i=0; i<kN; i++) {
165  double W = WminSpl+i*dW;
166  interaction.KinePtr()->SetW(W);
167  mprob = fHadronizationModel->MultiplicityProb(&interaction,"+LowMultSuppr");
168  R = 1;
169  if(mprob) {
170  R = mprob->Integral("width");
171  delete mprob;
172  }
173  // make sure that it takes enough samples where it is non-zero:
174  // modify the step and the sample counter once I've hit the first
175  // non-zero value
176  if(!non_zero && R>0) {
177  non_zero=true;
178  WminSpl=W;
179  i = 0;
180  dW = (WmaxSpl-WminSpl)/(kN-1);
181  }
182  LOG("DISXSec", pNOTICE)
183  << "Cached DIS XSec Suppr. factor (@ W=" << W << ") = " << R;
184 
185  cbr->AddValues(W,R);
186  }
187  cbr->CreateSpline();
188 
189  cache->AddCacheBranch(key, cbr);
190  assert(cbr);
191  } // cache data
192 
193  // get the reduction factor from the cache branch
194  if(Wo > Wmin && Wo < fWcut-1E-2) {
195  const CacheBranchFx & cache_branch = (*cbr);
196  R = cache_branch(Wo);
197  }
198  }
199 
200  // Now return the suppression factor
201  if (Wo > Wmin && Wo < fWcut-1E-2) Ro = R;
202  else if (Wo <= Wmin) Ro = 0.0;
203  else Ro = 1.0;
204 
205  LOG("DISXSec", pDEBUG)
206  << "DIS/RES Join: DIS xsec suppr. (W=" << Wo << ") = " << Ro;
207 
208  return Ro;
209 }
double fWcut
apply DIS/RES joining scheme < Wcut
TH1D * MultiplicityProb(const Interaction *, Option_t *opt="") const
int HitNucPdg(void) const
Definition: Target.cxx:304
double HitNucMass(void) const
Definition: Target.cxx:233
double x(bool selected=false) const
Definition: Kinematics.cxx:99
double XYtoW(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1179
void AddCacheBranch(string key, CacheBranchI *branch)
Definition: Cache.cxx:88
double y(bool selected=false) const
Definition: Kinematics.cxx:112
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
def key(type, name=None)
Definition: graph.py:13
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
Definition: Constants.h:76
string InteractionTypeAsString(void) const
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
Definition: Cache.cxx:80
GENIE Cache Memory.
Definition: Cache.h:38
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:97
static const double kPionMass
Definition: Constants.h:73
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
list x
Definition: train.py:276
float pi
Definition: units.py:11
#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:37
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.

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 224 of file KNOTunedQPMDISPXSec.cxx.

225 {
226 
227  fHadronizationModel = nullptr ;
228 
230  dynamic_cast<const AGKYLowW2019 *> (this->SubAlg("Hadronizer"));
231  assert(fHadronizationModel);
232 
233  GetParam( "Wcut", fWcut ) ;
234 
235  if ( fWcut <= 0. ) {
236 
237  LOG("KNOTunedQPMDISPXSec", pFATAL)
238  << "Input configuration value for Wcut is not physical: Exiting" ;
239 
240  // From the FreeBSD Library Functions Manual
241  //
242  // EX_CONFIG (78) Something was found in an unconfigured or miscon-
243  // figured state.
244 
245  exit( 78 ) ;
246 
247  }
248 
249  // load the pure E.A.Paschos and J.Y.Yu model
250  fDISModel = nullptr ;
251  fDISModel = dynamic_cast<const QPMDISPXSec *>(this->SubAlg("DISModel") ) ;
252  assert( fDISModel ) ;
253 
254  //-- load the differential cross section integrator
256  dynamic_cast<const XSecIntegratorI *> (this->SubAlg("XSec-Integrator"));
257  assert(fXSecIntegrator);
258 
259  // Caching the reduction factors used in the DIS/RES joing scheme?
260  // In normal event generation (1 config -> many calls) it is worth caching
261  // these suppression factors.
262  // Depending on the way this algorithm is used during event reweighting,
263  // precomputing (for all W's) & caching these factors might not be efficient.
264  // Here we provide the option to turn the caching off at run-time (default: on)
265 
266  bool cache_enabled = RunOpt::Instance()->BareXSecPreCalc();
267 
268  GetParamDef( "UseCache", fUseCache, true ) ;
269  fUseCache = fUseCache && cache_enabled;
270 
271 
272  }
double fWcut
apply DIS/RES joining scheme < Wcut
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:51
#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.

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

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 
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.
list x
Definition: train.py:276

Member Data Documentation

const QPMDISPXSec* genie::KNOTunedQPMDISPXSec::fDISModel
private

Definition at line 54 of file KNOTunedQPMDISPXSec.h.

const AGKYLowW2019* genie::KNOTunedQPMDISPXSec::fHadronizationModel
private

hadronic multip. model

Definition at line 53 of file KNOTunedQPMDISPXSec.h.

bool genie::KNOTunedQPMDISPXSec::fUseCache
private

cache reduction factors used in joining scheme

Definition at line 57 of file KNOTunedQPMDISPXSec.h.

double genie::KNOTunedQPMDISPXSec::fWcut
private

apply DIS/RES joining scheme < Wcut

Definition at line 58 of file KNOTunedQPMDISPXSec.h.

const XSecIntegratorI* genie::KNOTunedQPMDISPXSec::fXSecIntegrator
private

diff. xsec integrator

Definition at line 55 of file KNOTunedQPMDISPXSec.h.


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