GENIEGenerator
Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for genie::KNOTunedQPMDISPXSec:
[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.
double Integral (const Interaction *i) const
bool ValidProcess (const Interaction *i) const
 Can this cross section algorithm handle the input process?
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?
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.

Private Member Functions

void LoadConfig (void)
double DISRESJoinSuppressionFactor (const Interaction *in) const

Private Attributes

const AGKYLowW2019fHadronizationModel
 hadronic multip. model
const QPMDISPXSecfDISModel
const XSecIntegratorIfXSecIntegrator
 diff. xsec integrator
bool fUseCache
 cache reduction factors used in joining scheme
double fWcut
 apply DIS/RES joining scheme < Wcut
double fNRBEMScale
 apply NRB EM Scale factor

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

Detailed Description

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

References:\n E.A.Paschos and J.Y.Yu, Phys.Rev.D 65.03300
Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n May 05, 2004
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 32 of file KNOTunedQPMDISPXSec.h.

Constructor & Destructor Documentation

◆ KNOTunedQPMDISPXSec() [1/2]

KNOTunedQPMDISPXSec::KNOTunedQPMDISPXSec ( )

Definition at line 48 of file KNOTunedQPMDISPXSec.cxx.

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

References genie::XSecAlgorithmI::XSecAlgorithmI().

◆ KNOTunedQPMDISPXSec() [2/2]

KNOTunedQPMDISPXSec::KNOTunedQPMDISPXSec ( string config)

Definition at line 51 of file KNOTunedQPMDISPXSec.cxx.

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

References genie::XSecAlgorithmI::XSecAlgorithmI().

◆ ~KNOTunedQPMDISPXSec()

KNOTunedQPMDISPXSec::~KNOTunedQPMDISPXSec ( )
virtual

Definition at line 54 of file KNOTunedQPMDISPXSec.cxx.

55{
56
57}

Member Function Documentation

◆ Configure() [1/2]

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.

216{
217 Algorithm::Configure(config);
218 this->LoadConfig();
219}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

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.

222{
223 Algorithm::Configure(config);
224
225 this->LoadConfig();
226}

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

◆ DISRESJoinSuppressionFactor()

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 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() << "/"
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}
#define pNOTICE
Definition Messenger.h:61
#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
string Key(void) const
Definition AlgId.h:46
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition Algorithm.h:98
void CreateSpline(string type="TSpline3")
void AddValues(double x, double y)
string CacheBranchKey(string k0, string k1="", string k2="") const
Definition Cache.cxx:93
void AddCacheBranch(string key, CacheBranchI *branch)
Definition Cache.cxx:88
static Cache * Instance(void)
Definition Cache.cxx:67
CacheBranchI * FindCacheBranch(string key)
finding/adding cache branches
Definition Cache.cxx:80
const Target & Tgt(void) const
int ProbePdg(void) const
double ProbeE(RefFrame_t rf) const
const Kinematics & Kine(void) const
Definition Interaction.h:71
const ProcessInfo & ProcInfo(void) const
Definition Interaction.h:70
const InitialState & InitState(void) const
Definition Interaction.h:69
bool fUseCache
cache reduction factors used in joining scheme
double fWcut
apply DIS/RES joining scheme < Wcut
const AGKYLowW2019 * fHadronizationModel
hadronic multip. model
double fNRBEMScale
apply NRB EM Scale factor
double y(bool selected=false) const
double x(bool selected=false) const
bool IsEM(void) const
string InteractionTypeAsString(void) const
int HitNucPdg(void) const
Definition Target.cxx:304
double HitNucMass(void) const
Definition Target.cxx:233
double W(const Interaction *const i)
double XYtoW(double Ev, double M, double x, double y)
@ kRfHitNucRest
Definition RefFrame.h:30

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, pDEBUG, pNOTICE, genie::InitialState::ProbeE(), genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), genie::Kinematics::SetW(), genie::InitialState::Tgt(), genie::Kinematics::x(), genie::utils::kinematics::XYtoW(), and genie::Kinematics::y().

Referenced by XSec().

◆ Integral()

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

References fXSecIntegrator.

◆ LoadConfig()

void KNOTunedQPMDISPXSec::LoadConfig ( void )
private

Definition at line 228 of file KNOTunedQPMDISPXSec.cxx.

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 }
#define pFATAL
Definition Messenger.h:56
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool GetParamDef(const RgKey &name, T &p, const T &def) const
const Algorithm * SubAlg(const RgKey &registry_key) const
bool BareXSecPreCalc(void) const
Definition RunOpt.h:53
static RunOpt * Instance(void)
Definition RunOpt.cxx:54

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(), and Configure().

◆ ValidProcess()

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{
93 return fDISModel -> ValidProcess(interaction) ;
94}
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?

References fDISModel, and ValidProcess().

Referenced by ValidProcess().

◆ XSec()

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
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}
#define pINFO
Definition Messenger.h:62
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
double DISRESJoinSuppressionFactor(const Interaction *in) const

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

Referenced by XSec().

Member Data Documentation

◆ fDISModel

const QPMDISPXSec* genie::KNOTunedQPMDISPXSec::fDISModel
private

Definition at line 54 of file KNOTunedQPMDISPXSec.h.

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

◆ fHadronizationModel

const AGKYLowW2019* genie::KNOTunedQPMDISPXSec::fHadronizationModel
private

hadronic multip. model

Definition at line 53 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

◆ fNRBEMScale

double genie::KNOTunedQPMDISPXSec::fNRBEMScale
private

apply NRB EM Scale factor

Definition at line 59 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

◆ fUseCache

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

◆ fWcut

double genie::KNOTunedQPMDISPXSec::fWcut
private

apply DIS/RES joining scheme < Wcut

Definition at line 58 of file KNOTunedQPMDISPXSec.h.

Referenced by DISRESJoinSuppressionFactor(), and LoadConfig().

◆ fXSecIntegrator

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: