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

Bodek Yang structure function model. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Physics/DeepInelastic/XSection/BYStrucFunc.h"

Inheritance diagram for genie::BYStrucFunc:
genie::QPMDISStrucFuncBase genie::DISStructureFuncModelI genie::Algorithm

Public Member Functions

 BYStrucFunc ()
 
 BYStrucFunc (string config)
 
virtual ~BYStrucFunc ()
 
void Configure (const Registry &config)
 
void Configure (string param_set)
 
virtual double F1 (void) const
 Get the computed structure function F1. More...
 
virtual double F2 (void) const
 Get the computed structure function F2. More...
 
virtual double F3 (void) const
 Get the computed structure function F3. More...
 
virtual double F4 (void) const
 Get the computed structure function F4. More...
 
virtual double F5 (void) const
 Get the computed structure function F5. More...
 
virtual double F6 (void) const
 Get the computed structure function F6. More...
 
virtual void Calculate (const Interaction *interaction) const
 Calculate the structure functions F1-F6 for the input interaction. More...
 
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 Member Functions

void Init (void)
 
void ReadBYParams (void)
 
double ScalingVar (const Interaction *i) const
 
void KFactors (const Interaction *i, double &kuv, double &kdv, double &kus, double &kds) const
 
virtual void LoadConfig (void)
 
virtual void InitPDF (void)
 
virtual double Q2 (const Interaction *i) const
 
virtual void CalcPDFs (const Interaction *i) const
 
virtual double NuclMod (const Interaction *i) const
 
virtual double R (const Interaction *i) const
 
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 >
bool GetParamVect (const std::string &comm_name, std::vector< T > &v, unsigned int max, 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

double fA
 better scaling var parameter A More...
 
double fB
 better scaling var parameter B More...
 
double fCsU
 U-sea K factor parameter. More...
 
double fCsD
 D-sea K factor parameter. More...
 
double fCv1U
 U-val K factor parameter. More...
 
double fCv2U
 U-val K factor parameter. More...
 
double fCv1D
 D-val K factor parameter. More...
 
double fCv2D
 D-val K factor parameter. More...
 
double fQ2min
 min Q^2 allowed for PDFs: PDF(Q2<Q2min):=PDF(Q2min) More...
 
bool fCharmOff
 turn charm production off? More...
 
bool fIncludeR
 include R (~FL) in DIS SF calculation? More...
 
bool fIncludeNuclMod
 include nuclear factor (shadowing, anti-shadowing,...)? More...
 
double fMc
 charm mass used More...
 
double fVcd
 CKM element Vcd used. More...
 
double fVcs
 CKM element Vcs used. More...
 
double fVud
 CKM element Vud used. More...
 
double fVus
 CKM element Vcs used. More...
 
double fVcd2
 
double fVcs2
 
double fVud2
 
double fVus2
 
double fSin2thw
 
bool fUse2016Corrections
 Use 2016 SF relation corrections. More...
 
double fLowQ2CutoffF1F2
 Set min for relation between 2xF1 and F2. More...
 
double fF1
 
double fF2
 
double fF3
 
double fF4
 
double fF5
 
double fF6
 
PDFfPDF
 computed PDFs @ (x,Q2) More...
 
PDFfPDFc
 computed PDFs @ (slow-rescaling-var,Q2) More...
 
double fuv
 
double fus
 
double fdv
 
double fds
 
double fs
 
double fc
 
double fuv_c
 
double fus_c
 
double fdv_c
 
double fds_c
 
double fs_c
 
double fc_c
 
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

Bodek Yang structure function model.

hep-ph/0411202

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

September 28, 2004

Definition at line 27 of file BYStrucFunc.h.

Constructor & Destructor Documentation

BYStrucFunc::BYStrucFunc ( )

Definition at line 31 of file BYStrucFunc.cxx.

References Init().

31  :
32 QPMDISStrucFuncBase("genie::BYStrucFunc")
33 {
34  this->Init();
35 }
BYStrucFunc::BYStrucFunc ( string  config)

Definition at line 37 of file BYStrucFunc.cxx.

References Init().

37  :
38 QPMDISStrucFuncBase("genie::BYStrucFunc", config)
39 {
40  this->Init();
41 }
Definition: config.py:1
BYStrucFunc::~BYStrucFunc ( )
virtual

Definition at line 43 of file BYStrucFunc.cxx.

44 {
45 
46 }

Member Function Documentation

int Algorithm::AddLowRegistry ( Registry rp,
bool  owns = true 
)
protectedinherited

add registry with lowest priority, also update ownership

Definition at line 601 of file Algorithm.cxx.

Referenced by genie::EventGenerator::Configure().

601  {
602 
603  fConfVect.push_back( rp ) ;
604  fOwnerships.push_back( own ) ;
605 
606  if ( fConfig ) {
607  delete fConfig ;
608  fConfig = 0 ;
609  }
610 
611  return fConfVect.size() ;
612 
613 }
vector< Registry * > fConfVect
Definition: Algorithm.h:161
vector< bool > fOwnerships
ownership for every registry in fConfVect
Definition: Algorithm.h:164
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
int Algorithm::AddTopRegisties ( const vector< Registry * > &  rs,
bool  owns = false 
)
protectedinherited

Add registries with top priority, also udated Ownerships.

Definition at line 653 of file Algorithm.cxx.

653  {
654 
655  fConfVect.insert( fConfVect.begin(), rs.begin(), rs.end() ) ;
656 
657  fOwnerships.insert( fOwnerships.begin(), rs.size(), own ) ;
658 
659  if ( fConfig ) {
660  delete fConfig ;
661  fConfig = 0 ;
662  }
663 
664  return fConfVect.size() ;
665 
666 }
vector< Registry * > fConfVect
Definition: Algorithm.h:161
vector< bool > fOwnerships
ownership for every registry in fConfVect
Definition: Algorithm.h:164
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
int Algorithm::AddTopRegistry ( Registry rp,
bool  owns = true 
)
protectedinherited

add registry with top priority, also update ownership

Definition at line 585 of file Algorithm.cxx.

Referenced by genie::EventGeneratorListAssembler::AssembleGeneratorList().

585  {
586 
587  fConfVect.insert( fConfVect.begin(), rp ) ;
588  fOwnerships.insert( fOwnerships.begin(), own ) ;
589 
590  if ( fConfig ) {
591  delete fConfig ;
592  fConfig = 0 ;
593  }
594 
595  return fConfVect.size() ;
596 
597 }
vector< Registry * > fConfVect
Definition: Algorithm.h:161
vector< bool > fOwnerships
ownership for every registry in fConfVect
Definition: Algorithm.h:164
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
void Algorithm::AdoptConfig ( void  )
inherited

Clone the configuration registry looked up from the configuration pool and take its ownership

Definition at line 394 of file Algorithm.cxx.

References Configure(), GetConfig(), LOG, and pNOTICE.

Referenced by genie::Algorithm::AllowReconfig().

394  {
395 
396  LOG("Algorithm", pNOTICE)
397  << this->Id().Key() << " is taking ownership of its configuration";
398 
399  // if(fOwnsConfig) {
400  // LOG("Algorithm", pWARN)
401  // << this->Id().Key() << " already owns its configuration!";
402  // return;
403  // }
404 
405  this->Configure( GetConfig() );
406 }
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
#define pNOTICE
Definition: Messenger.h:62
string Key(void) const
Definition: AlgId.h:47
void Algorithm::AdoptSubstructure ( void  )
inherited

Take ownership of the algorithms subtructure (sub-algorithms,...) by copying them from the AlgFactory pool to the local pool Also bring all the configuration variables to the top level config Registry. This can be used to group together a series of algorithms & their configurations and extract (a clone of) this group from the shared pools. Having a series of algorithms/configurations behaving as a monolithic block, with a single point of configuration (the top level) is to be used when bits & pieces of GENIE are used in isolation for data fitting or reweighting

Definition at line 408 of file Algorithm.cxx.

References genie::AlgFactory::AdoptAlgorithm(), genie::Algorithm::AdoptSubstructure(), GetConfig(), genie::AlgFactory::Instance(), genie::kRgAlg, LOG, pDEBUG, pNOTICE, and genie::RegistryItemI::TypeInfo().

Referenced by genie::Algorithm::AdoptSubstructure(), genie::Algorithm::AllowReconfig(), main(), and testReconfigInOwnedModules().

409 {
410 // Take ownership of the algorithms subtructure (sub-algorithms,..) by copying
411 // them from the AlgFactory pool to the local pool. Also bring all the
412 // configuration variables to the top level. See the header for more details.
413 // A secial naming convention is required for configuration parameter keys
414 // for parameters belonging to sub-algorithms (or sub-algorithms of these
415 // sub-algorithms and so on...).
416 // The convention is: "sub-alg-key/sub-sub-alg-key/.../original name"
417 // This is a recursive method: The AdoptSubtructure()of all sub-algorithms is
418 // invoked.
419 //
420  LOG("Algorithm", pNOTICE)
421  << "Algorithm: " << this->Id().Key() << " is adopting its substructure";
422 
423 // Registry deep_config;
424 // deep_config.UnLock();
425 // deep_config.SetName(this->Id().Key());
426 
427  // deep_config.SetName(this->Id().Config() + ";D");
428  // fID.SetConfig(this->Id().Config() + ";D");
429 
430  if(fOwnsSubstruc) this->DeleteSubstructure();
431 
432  fOwnedSubAlgMp = new AlgMap;
433  fOwnsSubstruc = true;
434 
435  AlgFactory * algf = AlgFactory::Instance();
436 
437  const RgIMap & rgmap = GetConfig().GetItemMap();
438 
439  RgIMapConstIter iter = rgmap.begin();
440  for( ; iter != rgmap.end(); ++iter) {
441 
442  RgKey reg_key = iter->first;
443  RegistryItemI * ri = iter->second;
444 
445  if(ri->TypeInfo() == kRgAlg) {
446  LOG("Algorithm", pDEBUG)
447  << "Found sub-algorithm pointed to by " << reg_key;
448  RgAlg reg_alg = fConfig->GetAlg(reg_key);
449  AlgId id(reg_alg);
450 
451  LOG("Algorithm", pDEBUG) << "Adopting sub-algorithm = " << id.Key();
452  Algorithm * subalg = algf->AdoptAlgorithm(id.Name(),id.Config());
453  subalg->AdoptSubstructure();
454 
455  LOG("Algorithm", pDEBUG) << "Adding sub-algorithm to local pool";
456  AlgMapPair key_alg_pair(reg_key, subalg);
457  fOwnedSubAlgMp->insert(key_alg_pair);
458 
459  }
460 
461  }
462 
463 
464  if ( fConfig ) {
465  delete fConfig ;
466  fConfig = 0 ;
467  }
468 
469 }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
void DeleteSubstructure(void)
Definition: Algorithm.cxx:496
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Algorithm abstract base class.
Definition: Algorithm.h:54
map< string, Algorithm * > AlgMap
Definition: Algorithm.h:49
Registry item pABC.
Definition: RegistryItemI.h:30
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
virtual RgType_t TypeInfo(void) const =0
map< RgKey, RegistryItemI * >::const_iterator RgIMapConstIter
Definition: Registry.h:50
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const RgIMap & GetItemMap(void) const
Definition: Registry.h:162
void AdoptSubstructure(void)
Definition: Algorithm.cxx:408
pair< string, Algorithm * > AlgMapPair
Definition: Algorithm.h:52
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Definition: AlgFactory.cxx:127
Algorithm ID (algorithm name + configuration set name)
Definition: AlgId.h:35
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
string RgKey
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
#define pNOTICE
Definition: Messenger.h:62
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
string Key(void) const
Definition: AlgId.h:47
RgAlg GetAlg(RgKey key) const
Definition: Registry.cxx:503
#define pDEBUG
Definition: Messenger.h:64
map< RgKey, RegistryItemI * > RgIMap
Definition: Registry.h:46
virtual bool genie::Algorithm::AllowReconfig ( void  ) const
inlinevirtualinherited
void QPMDISStrucFuncBase::CalcPDFs ( const Interaction i) const
protectedvirtualinherited

Definition at line 497 of file QPMDISStrucFuncBase.cxx.

References ana::assert(), genie::PDF::Calculate(), genie::QPMDISStrucFuncBase::fc_c, genie::QPMDISStrucFuncBase::fCharmOff, genie::QPMDISStrucFuncBase::fds, genie::QPMDISStrucFuncBase::fds_c, genie::QPMDISStrucFuncBase::fdv, genie::QPMDISStrucFuncBase::fdv_c, genie::QPMDISStrucFuncBase::fMc, genie::QPMDISStrucFuncBase::fPDF, genie::QPMDISStrucFuncBase::fPDFc, genie::QPMDISStrucFuncBase::fQ2min, genie::QPMDISStrucFuncBase::fs, genie::QPMDISStrucFuncBase::fs_c, genie::QPMDISStrucFuncBase::fus, genie::QPMDISStrucFuncBase::fus_c, genie::QPMDISStrucFuncBase::fuv, genie::QPMDISStrucFuncBase::fuv_c, genie::Target::HitNucP4(), genie::Target::HitNucPdg(), genie::Interaction::InitState(), genie::utils::kinematics::IsAboveCharmThreshold(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::QPMDISStrucFuncBase::KFactors(), LOG, pDEBUG, pINFO, genie::QPMDISStrucFuncBase::Q2(), slidt::Reset(), genie::PDF::ScaleCharm(), genie::PDF::ScaleDownSea(), genie::PDF::ScaleDownValence(), genie::PDF::ScaleStrange(), genie::PDF::ScaleUpSea(), genie::PDF::ScaleUpValence(), genie::QPMDISStrucFuncBase::ScalingVar(), genie::utils::kinematics::SlowRescalingVar(), genie::InitialState::Tgt(), tmp, and submit_syst::x.

Referenced by genie::QPMDISStrucFuncBase::Calculate(), and genie::QPMDISStrucFuncBase::F6().

498 {
499  // Clean-up previous calculation
500  fPDF -> Reset();
501  fPDFc -> Reset();
502 
503  // Get the kinematical variables x,Q2 (could include corrections)
504  double x = this->ScalingVar(interaction);
505  double Q2val = this->Q2(interaction);
506 
507  // Get the hit nucleon mass (could be off-shell)
508  const Target & tgt = interaction->InitState().Tgt();
509  double M = tgt.HitNucP4().M();
510 
511  // Get the Q2 for which PDFs will be evaluated
512  double Q2pdf = TMath::Max(Q2val, fQ2min);
513 
514  // Compute PDFs at (x,Q2)
515 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
516  LOG("DISSF", pDEBUG) << "Calculating PDFs @ x = " << x << ", Q2 = " << Q2pdf;
517 #endif
518  fPDF->Calculate(x, Q2pdf);
519 
520  // Check whether it is above charm threshold
521  bool above_charm =
523  if(above_charm) {
524 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
525  LOG("DISSF", pDEBUG)
526  << "The event is above the charm threshold (mcharm = " << fMc << ")";
527 #endif
528  if(fCharmOff) {
529  LOG("DISSF", pINFO) << "Charm production is turned off";
530  } else {
531  // compute the slow rescaling var
532  double xc = utils::kinematics::SlowRescalingVar(x, Q2val, M, fMc);
533  if(xc<0 || xc>1) {
534  LOG("DISSF", pINFO) << "Unphys. slow rescaling var: xc = " << xc;
535  } else {
536  // compute PDFs at (xc,Q2)
537 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
538  LOG("DISSF", pDEBUG)
539  << "Calculating PDFs @ xc (slow rescaling) = " << x << ", Q2 = " << Q2val;
540 #endif
541  fPDFc->Calculate(xc, Q2pdf);
542  }
543  }// charm off?
544  }//above charm thr?
545  else {
546  LOG("DISSF", pDEBUG)
547  << "The event is below the charm threshold (mcharm = " << fMc << ")";
548  }
549 
550  // Compute the K factors
551  double kval_u = 1.;
552  double kval_d = 1.;
553  double ksea_u = 1.;
554  double ksea_d = 1.;
555 
556  this->KFactors(interaction, kval_u, kval_d, ksea_u, ksea_d);
557 
558 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
559  LOG("DISSF", pDEBUG) << "K-Factors:";
560  LOG("DISSF", pDEBUG) << "U: Kval = " << kval_u << ", Ksea = " << ksea_u;
561  LOG("DISSF", pDEBUG) << "D: Kval = " << kval_d << ", Ksea = " << ksea_d;
562 #endif
563 
564  // Apply the K factors
565  //
566  // Always scale d pdfs with d kfactors and u pdfs with u kfactors.
567  // Don't swap the applied kfactors for neutrons.
568  // Debdatta & Donna noted (Sep.2006) that a similar swap in the neugen
569  // implementation was the cause of the difference in nu and nubar F2
570  //
571  fPDF->ScaleUpValence (kval_u);
572  fPDF->ScaleDownValence (kval_d);
573  fPDF->ScaleUpSea (ksea_u);
574  fPDF->ScaleDownSea (ksea_d);
575  fPDF->ScaleStrange (ksea_d);
576  fPDF->ScaleCharm (ksea_u);
577  if(above_charm) {
578  fPDFc->ScaleUpValence (kval_u);
579  fPDFc->ScaleDownValence (kval_d);
580  fPDFc->ScaleUpSea (ksea_u);
581  fPDFc->ScaleDownSea (ksea_d);
582  fPDFc->ScaleStrange (ksea_d);
583  fPDFc->ScaleCharm (ksea_u);
584  }
585 
586  // Rules of thumb
587  // ---------------------------------------
588  // - For W+ exchange use: -1/3|e| quarks and -2/3|e| antiquarks
589  // - For W- exchange use: 2/3|e| quarks and 1/3|e| antiquarks
590  // - For each qi -> qj transition multiply with the (ij CKM element)^2
591  // - Use isospin symmetry to get neutron's u,d from proton's u,d
592  // -- neutron d = proton u
593  // -- neutron u = proton d
594  // - Use u = usea + uvalence. Same for d
595  // - For s,c use q=qbar
596  // - For t,b use q=qbar=0
597 
598  fuv = fPDF -> UpValence();
599  fus = fPDF -> UpSea();
600  fdv = fPDF -> DownValence();
601  fds = fPDF -> DownSea();
602  fs = fPDF -> Strange();
603  fc = 0.;
604  fuv_c = fPDFc -> UpValence(); // will be 0 if < charm threshold
605  fus_c = fPDFc -> UpSea(); // ...
606  fdv_c = fPDFc -> DownValence(); // ...
607  fds_c = fPDFc -> DownSea(); // ...
608  fs_c = fPDFc -> Strange(); // ...
609  fc_c = fPDFc -> Charm(); // ...
610 
611  // The above are the proton parton density function. Get the PDFs for the
612  // hit nucleon (p or n) by swapping u<->d if necessary
613 
614  int nuc_pdgc = tgt.HitNucPdg();
615  bool isP = pdg::IsProton (nuc_pdgc);
616  bool isN = pdg::IsNeutron (nuc_pdgc);
617  assert(isP || isN);
618 
619  double tmp = 0;
620  if (isN) { // swap u <-> d
621  tmp = fuv; fuv = fdv; fdv = tmp;
622  tmp = fus; fus = fds; fds = tmp;
623  tmp = fuv_c; fuv_c = fdv_c; fdv_c = tmp;
624  tmp = fus_c; fus_c = fds_c; fds_c = tmp;
625  }
626 
627 }
double fQ2min
min Q^2 allowed for PDFs: PDF(Q2<Q2min):=PDF(Q2min)
int HitNucPdg(void) const
Definition: Target.cxx:321
PDF * fPDFc
computed PDFs @ (slow-rescaling-var,Q2)
double fMc
charm mass used
Float_t tmp
Definition: plot.C:36
PDF * fPDF
computed PDFs @ (x,Q2)
void ScaleDownValence(double kscale)
Definition: PDF.cxx:92
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:92
double SlowRescalingVar(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1152
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:299
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual double Q2(const Interaction *i) const
void Reset()
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
bool IsAboveCharmThreshold(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1133
bool fCharmOff
turn charm production off?
#define pINFO
Definition: Messenger.h:63
virtual double ScalingVar(const Interaction *i) const
void Calculate(double x, double q2)
Definition: PDF.cxx:55
virtual void KFactors(const Interaction *i, double &kuv, double &kdv, double &kus, double &kds) const
void ScaleUpValence(double kscale)
Definition: PDF.cxx:87
assert(nhit_max >=nhit_nbins)
void ScaleUpSea(double kscale)
Definition: PDF.cxx:97
void ScaleCharm(double kscale)
Definition: PDF.cxx:112
void ScaleDownSea(double kscale)
Definition: PDF.cxx:102
#define pDEBUG
Definition: Messenger.h:64
void ScaleStrange(double kscale)
Definition: PDF.cxx:107
void QPMDISStrucFuncBase::Calculate ( const Interaction interaction) const
virtualinherited

Calculate the structure functions F1-F6 for the input interaction.

Implements genie::DISStructureFuncModelI.

Definition at line 139 of file QPMDISStrucFuncBase.cxx.

References a, plot_validation_datamc::c, genie::QPMDISStrucFuncBase::CalcPDFs(), MakeMiniprodValidationCuts::f, genie::QPMDISStrucFuncBase::fc, genie::QPMDISStrucFuncBase::fc_c, genie::QPMDISStrucFuncBase::fds, genie::QPMDISStrucFuncBase::fds_c, genie::QPMDISStrucFuncBase::fdv, genie::QPMDISStrucFuncBase::fdv_c, genie::QPMDISStrucFuncBase::fF1, genie::QPMDISStrucFuncBase::fF2, genie::QPMDISStrucFuncBase::fF3, genie::QPMDISStrucFuncBase::fF4, genie::QPMDISStrucFuncBase::fF5, genie::QPMDISStrucFuncBase::fF6, genie::QPMDISStrucFuncBase::fLowQ2CutoffF1F2, genie::QPMDISStrucFuncBase::fs, genie::QPMDISStrucFuncBase::fs_c, genie::QPMDISStrucFuncBase::fSin2thw, genie::QPMDISStrucFuncBase::fus, genie::QPMDISStrucFuncBase::fUse2016Corrections, genie::QPMDISStrucFuncBase::fuv, genie::QPMDISStrucFuncBase::fVcd2, genie::QPMDISStrucFuncBase::fVcs2, genie::QPMDISStrucFuncBase::fVud2, genie::QPMDISStrucFuncBase::fVus2, genie::Target::HitNucPdg(), genie::Target::HitQrkIsSet(), genie::Target::HitQrkPdg(), genie::Target::HitSeaQrk(), genie::Interaction::InitState(), genie::pdg::IsAntiCQuark(), genie::pdg::IsAntiDQuark(), genie::pdg::IsAntiNeutrino(), genie::pdg::IsAntiSQuark(), genie::pdg::IsAntiUQuark(), genie::pdg::IsChargedLepton(), genie::pdg::IsCQuark(), genie::pdg::IsDarkMatter(), genie::ProcessInfo::IsDarkMatter(), genie::pdg::IsDQuark(), genie::ProcessInfo::IsEM(), genie::pdg::IsLepton(), genie::pdg::IsNeutrino(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::pdg::IsSQuark(), genie::pdg::IsUQuark(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), genie::Interaction::Kine(), kinematics(), genie::constants::kNucleonMass2, LOG, genie::Target::N(), genie::QPMDISStrucFuncBase::NuclMod(), pDEBUG, pINFO, genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), genie::QPMDISStrucFuncBase::Q2(), q2, r(), genie::QPMDISStrucFuncBase::R(), genie::QPMDISStrucFuncBase::ScalingVar(), genie::InitialState::Tgt(), genie::Kinematics::x(), submit_syst::x, and genie::Target::Z().

Referenced by genie::QPMDISStrucFuncBase::F6().

140 {
141  // Reset mutable members
142  fF1 = 0;
143  fF2 = 0;
144  fF3 = 0;
145  fF4 = 0;
146  fF5 = 0;
147  fF6 = 0;
148 
149  // Get process info & perform various checks
150  const ProcessInfo & proc_info = interaction->ProcInfo();
151  const InitialState & init_state = interaction->InitState();
152  const Target & tgt = init_state.Tgt();
153 
154  int nuc_pdgc = tgt.HitNucPdg();
155  int probe_pdgc = init_state.ProbePdg();
156  bool is_p = pdg::IsProton ( nuc_pdgc );
157  bool is_n = pdg::IsNeutron ( nuc_pdgc );
158  bool is_nu = pdg::IsNeutrino ( probe_pdgc );
159  bool is_nubar = pdg::IsAntiNeutrino ( probe_pdgc );
160  bool is_lepton = pdg::IsLepton ( probe_pdgc );
161  bool is_dm = pdg::IsDarkMatter ( probe_pdgc );
162  bool is_CC = proc_info.IsWeakCC();
163  bool is_NC = proc_info.IsWeakNC();
164  bool is_EM = proc_info.IsEM();
165  bool is_dmi = proc_info.IsDarkMatter();
166 
167  if ( !is_lepton && !is_dm ) return;
168  if ( !is_p && !is_n ) return;
169  if ( tgt.N() == 0 && is_n ) return;
170  if ( tgt.Z() == 0 && is_p ) return;
171 
172  // Flags switching on/off quark contributions so that this algorithm can be
173  // used for both l + N -> l' + X, and l + q -> l' + q' level calculations
174 
175  double switch_uv = 1.;
176  double switch_us = 1.;
177  double switch_ubar = 1.;
178  double switch_dv = 1.;
179  double switch_ds = 1.;
180  double switch_dbar = 1.;
181  double switch_s = 1.;
182  double switch_sbar = 1.;
183  double switch_c = 1.;
184  double switch_cbar = 1.;
185 
186  if(tgt.HitQrkIsSet()) {
187 
188  switch_uv = 0.;
189  switch_us = 0.;
190  switch_ubar = 0.;
191  switch_dv = 0.;
192  switch_ds = 0.;
193  switch_dbar = 0.;
194  switch_s = 0.;
195  switch_sbar = 0.;
196  switch_c = 0.;
197  switch_cbar = 0.;
198 
199  int qpdg = tgt.HitQrkPdg();
200  bool sea = tgt.HitSeaQrk();
201 
202  bool is_u = pdg::IsUQuark (qpdg);
203  bool is_ubar = pdg::IsAntiUQuark (qpdg);
204  bool is_d = pdg::IsDQuark (qpdg);
205  bool is_dbar = pdg::IsAntiDQuark (qpdg);
206  bool is_s = pdg::IsSQuark (qpdg);
207  bool is_sbar = pdg::IsAntiSQuark (qpdg);
208  bool is_c = pdg::IsCQuark (qpdg);
209  bool is_cbar = pdg::IsAntiCQuark (qpdg);
210 
211  if (!sea && is_u ) { switch_uv = 1; }
212  else if ( sea && is_u ) { switch_us = 1; }
213  else if ( sea && is_ubar) { switch_ubar = 1; }
214  else if (!sea && is_d ) { switch_dv = 1; }
215  else if ( sea && is_d ) { switch_ds = 1; }
216  else if ( sea && is_dbar) { switch_dbar = 1; }
217  else if ( sea && is_s ) { switch_s = 1; }
218  else if ( sea && is_sbar) { switch_sbar = 1; }
219  else if ( sea && is_c ) { switch_c = 1; }
220  else if ( sea && is_cbar) { switch_cbar = 1; }
221  else return;
222 
223  // make sure user inputs make sense
224  if(is_nu && is_CC && is_u ) return;
225  if(is_nu && is_CC && is_c ) return;
226  if(is_nu && is_CC && is_dbar) return;
227  if(is_nu && is_CC && is_sbar) return;
228  if(is_nubar && is_CC && is_ubar) return;
229  if(is_nubar && is_CC && is_cbar) return;
230  if(is_nubar && is_CC && is_d ) return;
231  if(is_nubar && is_CC && is_s ) return;
232  }
233 
234  // Compute PDFs [both at (scaling-var,Q2) and (slow-rescaling-var,Q2)
235  // Applying all PDF K-factors abd scaling variable corrections
236 
237  this -> CalcPDFs (interaction);
238 
239  //
240  // Compute structure functions for the EM, NC and CC cases
241  //
242 
243  double F2val=0, xF3val=0;
244 
245  // *** NEUTRAL CURRENT
246 
247  // Include DM in NC
248  if(is_NC || is_dmi) {
249 
250  if(!is_nu && !is_nubar && !is_dm) return;
251 
252  double GL = (is_nu) ? ( 0.5 - (2./3.)*fSin2thw) : ( - (2./3.)*fSin2thw); // clu
253  double GR = (is_nu) ? ( - (2./3.)*fSin2thw) : ( 0.5 - (2./3.)*fSin2thw); // cru
254  double GLp = (is_nu) ? (-0.5 + (1./3.)*fSin2thw) : ( (1./3.)*fSin2thw); // cld
255  double GRp = (is_nu) ? ( (1./3.)*fSin2thw) : (-0.5 + (1./3.)*fSin2thw); // crd
256  // Set the couplings to up and down quarks to be axial for DM
257  if (is_dm) {
258  GL = -1.;
259  GR = 1.;
260  GLp = -1.;
261  GRp = 1.;
262  }
263  double gvu = GL + GR;
264  double gau = GL - GR;
265  double gvd = GLp + GRp;
266  double gad = GLp - GRp;
267  double gvu2 = TMath::Power(gvu, 2.);
268  double gau2 = TMath::Power(gau, 2.);
269  double gvd2 = TMath::Power(gvd, 2.);
270  double gad2 = TMath::Power(gad, 2.);
271 
272  double q2 = (switch_uv * fuv + switch_us * fus + switch_c * fc) * (gvu2+gau2) +
273  (switch_dv * fdv + switch_ds * fds + switch_s * fs) * (gvd2+gad2);
274  double q3 = (switch_uv * fuv + switch_us * fus + switch_c * fc) * (2*gvu*gau) +
275  (switch_dv * fdv + switch_ds * fds + switch_s * fs) * (2*gvd*gad);
276 
277  double qb2 = (switch_ubar * fus + switch_cbar * fc) * (gvu2+gau2) +
278  (switch_dbar * fds + switch_sbar * fs) * (gvd2+gad2);
279  double qb3 = (switch_ubar * fus + switch_cbar * fc) * (2*gvu*gau) +
280  (switch_dbar * fds + switch_sbar * fs) * (2*gvd*gad);
281 
282 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
283  LOG("DISSF", pINFO) << "f2 : q = " << q2 << ", bar{q} = " << qb2;
284  LOG("DISSF", pINFO) << "xf3: q = " << q3 << ", bar{q} = " << qb3;
285 #endif
286 
287  F2val = q2+qb2;
288  xF3val = q3-qb3;
289  }
290 
291  // *** CHARGED CURRENT
292 
293  if(is_CC) {
294  double q=0, qbar=0;
295 
296  if (is_nu) {
297  q = ( switch_dv * fdv + switch_ds * fds ) * fVud2 +
298  ( switch_s * fs ) * fVus2 +
299  ( switch_dv * fdv_c + switch_ds * fds_c ) * fVcd2 +
300  ( switch_s * fs_c ) * fVcs2;
301 
302  qbar = ( switch_ubar * fus ) * fVud2 +
303  ( switch_ubar * fus ) * fVus2 +
304  ( switch_cbar * fc_c ) * fVcd2 +
305  ( switch_cbar * fc_c ) * fVcs2;
306  }
307  else
308  if (is_nubar) {
309  q = ( switch_uv * fuv + switch_us * fus ) * fVud2 +
310  ( switch_uv * fuv + switch_us * fus ) * fVus2 +
311  ( switch_c * fc_c ) * fVcd2 +
312  ( switch_c * fc_c ) * fVcs2;
313 
314  qbar = ( switch_dbar * fds_c ) * fVcd2 +
315  ( switch_dbar * fds ) * fVud2 +
316  ( switch_sbar * fs ) * fVus2 +
317  ( switch_sbar * fs_c ) * fVcs2;
318  }
319  else {
320  return;
321  }
322 
323  F2val = 2*(q+qbar);
324  xF3val = 2*(q-qbar);
325  }
326 
327  // *** ELECTROMAGNETIC
328 
329  if(is_EM) {
330 
331  if(!pdg::IsChargedLepton(probe_pdgc)) return;
332 
333  double sq23 = TMath::Power(2./3., 2.);
334  double sq13 = TMath::Power(1./3., 2.);
335 
336  double qu = sq23 * ( switch_uv * fuv + switch_us * fus );
337  double qd = sq13 * ( switch_dv * fdv + switch_ds * fds );
338  double qs = sq13 * ( switch_s * fs );
339  double qbu = sq23 * ( switch_ubar * fus );
340  double qbd = sq13 * ( switch_dbar * fds );
341  double qbs = sq13 * ( switch_sbar * fs );
342 
343  double q = qu + qd + qs;
344  double qbar = qbu + qbd + qbs;
345 
346  F2val = q + qbar;;
347  xF3val = 0.;
348 
349  }
350 
351  double Q2val = this->Q2 (interaction);
352  double x = this->ScalingVar(interaction);
353  double f = this->NuclMod (interaction); // nuclear modification
354  double r = this->R (interaction); // R ~ FL
355 
356 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
357  LOG("DISSF", pDEBUG) << "Nucl. mod = " << f;
358  LOG("DISSF", pDEBUG) << "R(=FL/2xF1) = " << r;
359 #endif
360 
361  if(fUse2016Corrections) {
362  //It was confirmed by A.Bodek that the modified scaling variable
363  //should just be used to compute the strucure functions F2 and xF3,
364  //but that the usual Bjorken x should be used for the relations
365  //between the structure functions.
366  //For the same reason remove the freezing of Q2 at 0.8 for those relations,
367  //although it has not been explicitly asked to A.Bodek if it should be done.
368 
369  const Kinematics & kinematics = interaction->Kine();
370  double bjx = kinematics.x();
371 
372  double a = TMath::Power(bjx,2.) / TMath::Max(Q2val, fLowQ2CutoffF1F2);
373  double c = (1. + 4. * kNucleonMass2 * a) / (1.+r);
374 
375  fF3 = f * xF3val/bjx;
376  fF2 = f * F2val;
377  fF1 = fF2 * 0.5*c/bjx;
378  fF5 = fF2/bjx; // Albright-Jarlskog relation
379  fF4 = 0.; // Nucl.Phys.B 84, 467 (1975)
380  }
381  else {
382  double a = TMath::Power(x,2.) / TMath::Max(Q2val, fLowQ2CutoffF1F2);
383  double c = (1. + 4. * kNucleonMass2 * a) / (1.+r);
384  //double a = TMath::Power(x,2.) / Q2val;
385  //double c = (1. + 4. * kNucleonMass * a) / (1.+r);
386 
387  fF3 = f * xF3val / x;
388  fF2 = f * F2val;
389  fF1 = fF2 * 0.5 * c / x;
390  fF5 = fF2 / x; // Albright-Jarlskog relation
391  fF4 = 0.; // Nucl.Phys.B 84, 467 (1975)
392  }
393 
394 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
395  LOG("DISSF", pDEBUG)
396  << "F1-F5 = "
397  << fF1 << ", " << fF2 << ", " << fF3 << ", " << fF4 << ", " << fF5;
398 #endif
399 }
bool HitSeaQrk(void) const
Definition: Target.cxx:316
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:108
bool IsUQuark(int pdgc)
Definition: PDGUtils.cxx:249
int HitNucPdg(void) const
Definition: Target.cxx:321
int HitQrkPdg(void) const
Definition: Target.cxx:259
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:125
bool IsChargedLepton(int pdgc)
Definition: PDGUtils.cxx:99
double x(bool selected=false) const
Definition: Kinematics.cxx:109
bool IsSQuark(int pdgc)
Definition: PDGUtils.cxx:259
bool IsAntiSQuark(int pdgc)
Definition: PDGUtils.cxx:279
bool IsAntiDQuark(int pdgc)
Definition: PDGUtils.cxx:274
Double_t q2[12][num]
Definition: f2_nu.C:137
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
virtual double NuclMod(const Interaction *i) const
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:299
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual double Q2(const Interaction *i) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
const double a
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:116
const Kinematics & Kine(void) const
Definition: Interaction.h:71
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
int ProbePdg(void) const
Definition: InitialState.h:65
int Z(void) const
Definition: Target.h:69
#define pINFO
Definition: Messenger.h:63
static const double kNucleonMass2
Definition: Constants.h:90
virtual double ScalingVar(const Interaction *i) const
double fLowQ2CutoffF1F2
Set min for relation between 2xF1 and F2.
bool IsEM(void) const
int N(void) const
Definition: Target.h:70
bool IsCQuark(int pdgc)
Definition: PDGUtils.cxx:264
bool HitQrkIsSet(void) const
Definition: Target.cxx:309
bool IsDarkMatter(void) const
bool IsAntiCQuark(int pdgc)
Definition: PDGUtils.cxx:284
virtual double R(const Interaction *i) const
bool IsDQuark(int pdgc)
Definition: PDGUtils.cxx:254
TRandom3 r(0)
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
const Target & Tgt(void) const
Definition: InitialState.h:67
virtual void CalcPDFs(const Interaction *i) const
bool fUse2016Corrections
Use 2016 SF relation corrections.
void kinematics()
Definition: kinematics.C:10
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:84
bool IsAntiUQuark(int pdgc)
Definition: PDGUtils.cxx:269
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64
AlgCmp_t Algorithm::Compare ( const Algorithm alg) const
virtualinherited

Compare with input algorithm.

Definition at line 294 of file Algorithm.cxx.

References genie::AlgId::Config(), genie::Algorithm::Id(), genie::kAlgCmpDiffAlg, genie::kAlgCmpDiffConfig, genie::kAlgCmpIdentical, genie::kAlgCmpUnknown, and genie::AlgId::Name().

Referenced by genie::Algorithm::AllowReconfig().

295 {
296 // Compares itself with the input algorithm
297 
298  string alg1 = this->Id().Name();
299  string config1 = this->Id().Config();
300  string alg2 = algo->Id().Name();
301  string config2 = algo->Id().Config();
302 
303  if(alg1 == alg2)
304  {
305  if(config1 == config2) return kAlgCmpIdentical;
306  else return kAlgCmpDiffConfig;
307  }
308  else return kAlgCmpDiffAlg;
309 
310  return kAlgCmpUnknown;
311 }
string Name(void) const
Definition: AlgId.h:45
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
string Config(void) const
Definition: AlgId.h:46
void BYStrucFunc::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 48 of file BYStrucFunc.cxx.

References genie::QPMDISStrucFuncBase::Configure(), and ReadBYParams().

49 {
50 // Overload Algorithm::Configure() to read the config. registry and set
51 // private data members.
52 // QPMDISStrucFuncBase::Configure() creates the owned PDF object that gets
53 // configured with the specified PDFModelI
54 // For the ReadBYParams() method see below
55 
57  this->ReadBYParams();
58 }
void ReadBYParams(void)
Definition: BYStrucFunc.cxx:66
void Configure(const Registry &config)
void BYStrucFunc::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 60 of file BYStrucFunc.cxx.

References genie::QPMDISStrucFuncBase::Configure(), and ReadBYParams().

61 {
63  this->ReadBYParams();
64 }
void ReadBYParams(void)
Definition: BYStrucFunc.cxx:66
void Configure(const Registry &config)
void Algorithm::DeleteConfig ( void  )
protectedinherited

Definition at line 471 of file Algorithm.cxx.

References MECModelEnuComparisons::i.

Referenced by genie::Algorithm::AllowReconfig().

472 {
473  // there is nothing to delete if the configuration is not owned but is
474  // rather looked up from the configuration pool
475  //
476 
477  for ( unsigned int i = 0 ; i < fConfVect.size() ; ++i ) {
478  if ( fOwnerships[i] ) {
479  delete fConfVect[i] ;
480  }
481  }
482 
483  fConfVect.clear() ;
484  fOwnerships.clear() ;
485 
486  // delete owned configuration registry
487 
488  if(fConfig) {
489  delete fConfig;
490  fConfig=0;
491  }
492 
493 }
vector< Registry * > fConfVect
Definition: Algorithm.h:161
vector< bool > fOwnerships
ownership for every registry in fConfVect
Definition: Algorithm.h:164
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
void Algorithm::DeleteSubstructure ( void  )
protectedinherited

Definition at line 496 of file Algorithm.cxx.

Referenced by genie::Algorithm::AllowReconfig().

497 {
498  // there is nothing to delete if the sub-algorithms are not owned but rather
499  // taken from the AlgFactory's pool
500  //
501  if(!fOwnsSubstruc) return;
502 
503  // delete local algorithm pool
504  //
505  AlgMapIter iter = fOwnedSubAlgMp->begin();
506  for( ; iter != fOwnedSubAlgMp->end(); ++iter) {
507  Algorithm * alg = iter->second;
508  if(alg) {
509  delete alg;
510  alg=0;
511  }
512  }
513  delete fOwnedSubAlgMp;
514  fOwnedSubAlgMp = 0;
515 }
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Algorithm abstract base class.
Definition: Algorithm.h:54
map< string, Algorithm * >::iterator AlgMapIter
Definition: Algorithm.h:50
Registry * Algorithm::ExtractLocalConfig ( const Registry in) const
protectedinherited

Split an incoming configuration Registry into a block valid for this algorithm Ownership of the returned registry belongs to the algo

Definition at line 518 of file Algorithm.cxx.

References genie::RegistryItemI::Clone(), genie::Registry::GetItemMap(), genie::Registry::Name(), and confusionMatrixTree::out.

Referenced by genie::Algorithm::AllowReconfig().

518  {
519 
520  const RgIMap & rgmap = in.GetItemMap();
521  Registry * out = new Registry( in.Name(), false );
522 
523  for( RgIMapConstIter reg_iter = rgmap.begin();
524  reg_iter != rgmap.end(); ++reg_iter ) {
525 
526  RgKey reg_key = reg_iter->first;
527  if( reg_key.find( '/' ) != string::npos) continue;
528 
529  // at this point
530  // this key is referred to the local algorithm
531  // it has to be copied in out;
532 
533  RegistryItemI * ri = reg_iter->second;
534  RgIMapPair key_item_pair( reg_key, ri->Clone() );
535  out -> Set(key_item_pair);
536 
537  }
538 
539  if ( out -> NEntries() <= 0 ) {
540  delete out ;
541  out = 0 ;
542  }
543 
544  return out ;
545 }
Registry item pABC.
Definition: RegistryItemI.h:30
string Name(void) const
get the registry name
Definition: Registry.cxx:612
map< RgKey, RegistryItemI * >::const_iterator RgIMapConstIter
Definition: Registry.h:50
const RgIMap & GetItemMap(void) const
Definition: Registry.h:162
pair< RgKey, RegistryItemI * > RgIMapPair
Definition: Registry.h:47
string RgKey
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
virtual RegistryItemI * Clone(void) const =0
map< RgKey, RegistryItemI * > RgIMap
Definition: Registry.h:46
Registry * Algorithm::ExtractLowerConfig ( const Registry in,
const string alg_key 
) const
protectedinherited

Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.

Definition at line 549 of file Algorithm.cxx.

References genie::RegistryItemI::Clone(), genie::Registry::GetItemMap(), genie::Registry::Name(), and confusionMatrixTree::out.

Referenced by genie::Algorithm::AllowReconfig().

549  {
550 
551  const RgIMap & rgmap = in.GetItemMap();
552  Registry * out = new Registry( in.Name(), false );
553 
554  for( RgIMapConstIter reg_iter = rgmap.begin();
555  reg_iter != rgmap.end(); ++reg_iter ) {
556 
557  RgKey reg_key = reg_iter->first;
558  if( reg_key.find(alg_key+"/") == string::npos) continue;
559 
560  // at this point
561  // this key is referred to the sub-algorithm
562  // indicated by alg_key: it has to be copied in out;
563 
564  int new_key_start = reg_key.find_first_of('/')+1;
565  RgKey new_reg_key = reg_key.substr( new_key_start, reg_key.length() );
566 
567  RegistryItemI * ri = reg_iter->second;
568  RgIMapPair key_item_pair(new_reg_key, ri->Clone());
569  out -> Set(key_item_pair);
570 
571  }
572 
573  if ( out -> NEntries() <= 0 ) {
574  delete out ;
575  out = 0 ;
576  }
577 
578  return out ;
579 
580 }
Registry item pABC.
Definition: RegistryItemI.h:30
string Name(void) const
get the registry name
Definition: Registry.cxx:612
map< RgKey, RegistryItemI * >::const_iterator RgIMapConstIter
Definition: Registry.h:50
const RgIMap & GetItemMap(void) const
Definition: Registry.h:162
pair< RgKey, RegistryItemI * > RgIMapPair
Definition: Registry.h:47
string RgKey
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
virtual RegistryItemI * Clone(void) const =0
map< RgKey, RegistryItemI * > RgIMap
Definition: Registry.h:46
virtual double genie::QPMDISStrucFuncBase::F1 ( void  ) const
inlinevirtualinherited

Get the computed structure function F1.

Implements genie::DISStructureFuncModelI.

Definition at line 43 of file QPMDISStrucFuncBase.h.

References genie::QPMDISStrucFuncBase::fF1.

43 { return fF1; }
virtual double genie::QPMDISStrucFuncBase::F2 ( void  ) const
inlinevirtualinherited

Get the computed structure function F2.

Implements genie::DISStructureFuncModelI.

Definition at line 44 of file QPMDISStrucFuncBase.h.

References genie::QPMDISStrucFuncBase::fF2.

44 { return fF2; }
virtual double genie::QPMDISStrucFuncBase::F3 ( void  ) const
inlinevirtualinherited

Get the computed structure function F3.

Implements genie::DISStructureFuncModelI.

Definition at line 45 of file QPMDISStrucFuncBase.h.

References genie::QPMDISStrucFuncBase::fF3.

45 { return fF3; }
virtual double genie::QPMDISStrucFuncBase::F4 ( void  ) const
inlinevirtualinherited

Get the computed structure function F4.

Implements genie::DISStructureFuncModelI.

Definition at line 46 of file QPMDISStrucFuncBase.h.

References genie::QPMDISStrucFuncBase::fF4.

46 { return fF4; }
virtual double genie::QPMDISStrucFuncBase::F5 ( void  ) const
inlinevirtualinherited

Get the computed structure function F5.

Implements genie::DISStructureFuncModelI.

Definition at line 47 of file QPMDISStrucFuncBase.h.

References genie::QPMDISStrucFuncBase::fF5.

47 { return fF5; }
virtual double genie::QPMDISStrucFuncBase::F6 ( void  ) const
inlinevirtualinherited
void Algorithm::FindConfig ( void  )
virtualinherited

Lookup configuration from the config pool Similar logic from void Configure(string)

Definition at line 135 of file Algorithm.cxx.

References gen_flatrecord::config, exit(), genie::AlgConfigPool::FindRegistry(), genie::Registry::GetItemMap(), genie::Registry::GetString(), MECModelEnuComparisons::i, genie::AlgConfigPool::Instance(), it, genie::Registry::ItemIsLocal(), parse_dependency_file_t::list, LOG, pDEBUG, pFATAL, time_estimates::pool, pWARN, moon_position_table_new3::second, genie::utils::str::Split(), string, and APDHVSetting::temp.

136 {
137 // Finds its configration Registry from the ConfigPool and gets a pointer to
138 // it. If the Registry comes from the ConfigPool then the Algorithm does not
139 // own its configuration (the ConfigPool singleton keeps the ownership and the
140 // responsibility to -eventually- delete all the Registries it instantiates
141 // by parsing the XML config files).
142 
143  DeleteConfig() ;
144 
146 
147  Registry * config = 0 ;
148 
149  // load the Default config if config is not the default
150  if ( fID.Config() != "Default" ) {
151  config = pool -> FindRegistry( fID.Name(), "Default" );
152  if ( config ) {
153  if ( config -> NEntries() > 0 ) {
154  AddTopRegistry( config, false ) ;
155  LOG("Algorithm", pDEBUG) << "\n" << *config;
156  }
157  }
158  }
159 
160  // Load the right config
161  config = pool->FindRegistry(this);
162 
163  if(!config)
164  // notify & keep whatever config Registry was used before.
165  LOG("Algorithm", pWARN)
166  << "No Configuration available for "
167  << this->Id().Key() << " at the ConfigPool";
168  else {
169  if ( config -> NEntries() > 0 ) {
170  AddTopRegistry( config, false ) ;
171  LOG("Algorithm", pDEBUG) << "\n" << config;
172  }
173  }
174 
175  const string common_key_root = "Common" ;
176  std::map<string, string> common_lists;
177 
178  // Load Common Parameters if key that start with "Common" is found
179  for ( unsigned int i = 0 ; i < fConfVect.size() ; ++i ) {
180  const Registry & temp = * fConfVect[i] ;
181  for ( RgIMapConstIter it = temp.GetItemMap().begin() ; it != temp.GetItemMap().end() ; ++it ) {
182 
183  // check if it is a "Common" entry
184  if ( it -> first.find( common_key_root ) == 0 ) {
185  // retrieve the type of the common entry
186  std::string type = it -> first.substr(common_key_root.size() ) ;
187 
188  if ( temp.ItemIsLocal( it -> first ) ) {
189 
190  string temp_list = temp.GetString( it -> first ) ;
191  if ( temp_list.length() > 0 ) {
192  common_lists[type] = temp_list ;
193  }
194  }
195  }
196 
197  }
198 
199  } // loop over the local registries
200 
201 
202  for ( std::map<string, string>::const_iterator it = common_lists.begin() ;
203  it != common_lists.end() ; ++it ) {
204 
205  vector<string> list = str::Split( it -> second , "," ) ;
206 
207  for ( unsigned int i = 0; i < list.size(); ++i ) {
208 
209  config = pool -> CommonList( it -> first, list[i] ) ;
210 
211  if ( ! config ) {
212  LOG("Algorithm", pFATAL)
213  << "No Commom parameters available for " << it -> first << " list "
214  << list[i] << " at the ConfigPool";
215 
216  exit( 78 ) ;
217  }
218  else {
219  AddLowRegistry( config, false ) ;
220  LOG("Algorithm", pDEBUG) << "Loading "
221  << it -> first << " registry "
222  << list[i] << " \n" << config;
223  }
224 
225  }
226 
227  }
228 
229 
230  // Load Tunable from CommonParameters
231  // only if the option is specified in RunOpt
232  config = pool -> CommonList( "Param", "Tunable" ) ;
233  if ( config ) {
234  if ( config -> NEntries() > 0 ) {
235  AddTopRegistry( config, false ) ;
236  LOG("Algorithm", pDEBUG) << "Loading Tunable registry \n" << config;
237  }
238  }
239  else {
240  // notify & keep whatever config Registry was used before.
241  LOG("Algorithm", pWARN)
242  << "No Tunable parameter set available at the ConfigPool";
243  }
244 
245  if ( fConfig ) {
246  delete fConfig ;
247  fConfig = 0 ;
248  }
249 
250 }
set< int >::iterator it
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
#define pFATAL
Definition: Messenger.h:57
Definition: config.py:1
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
map< RgKey, RegistryItemI * >::const_iterator RgIMapConstIter
Definition: Registry.h:50
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const RgIMap & GetItemMap(void) const
Definition: Registry.h:162
string Name(void) const
Definition: AlgId.h:45
bool ItemIsLocal(RgKey key) const
local or global?
Definition: Registry.cxx:193
int AddTopRegistry(Registry *rp, bool owns=true)
add registry with top priority, also update ownership
Definition: Algorithm.cxx:585
#define pWARN
Definition: Messenger.h:61
void DeleteConfig(void)
Definition: Algorithm.cxx:471
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
RgStr GetString(RgKey key) const
Definition: Registry.cxx:496
vector< Registry * > fConfVect
Definition: Algorithm.h:161
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
exit(0)
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
Registry * FindRegistry(string key) const
int AddLowRegistry(Registry *rp, bool owns=true)
add registry with lowest priority, also update ownership
Definition: Algorithm.cxx:601
string Key(void) const
Definition: AlgId.h:47
static AlgConfigPool * Instance()
#define pDEBUG
Definition: Messenger.h:64
string Config(void) const
Definition: AlgId.h:46
enum BeamMode string
const Registry & Algorithm::GetConfig ( void  ) const
virtualinherited

Get configuration registry Evaluate the summary of the configuration and returns it The summary of a configuration is a merge of all the registries known to the algorithm (see Configure() methods) but every parameter is appearing only once and in case of repetitions, only the parameter from the registry with the highest prioriry is considered.

Definition at line 254 of file Algorithm.cxx.

References febshutoff_auto::end, genie::Algorithm::GetConfig(), MECModelEnuComparisons::i, LOG, pDEBUG, r(), and moon_position_table_new3::second.

Referenced by genie::EventGeneratorListAssembler::AssembleGeneratorList(), GetAlgorithms(), genie::Algorithm::GetConfig(), genie::GRV98LO::GRV98LO(), genie::NewQELXSec::Integrate(), genie::LHAPDF5::LHAPDF5(), genie::IBDXSecMap::LoadConfig(), genie::Decayer::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::SmithMonizUtils::LoadConfig(), main(), genie::AlgFactory::Print(), TestPythiaTauDecays(), testReconfigInOwnedModules(), and genie::P33PaschosLalakulichPXSec::XSec().

254  {
255 
256  if ( fConfig ) return * fConfig ;
257 
258  const_cast<Algorithm*>( this ) -> fConfig = new Registry( fID.Key() + "_summary", false ) ;
259 
260  // loop and append
261  // understand the append mechanism
262  for ( unsigned int i = 0 ; i < fConfVect.size(); ++i ) {
263  fConfig -> Append( * fConfVect[i] ) ;
264  }
265 
266  if ( fOwnsSubstruc ) {
267 
268  for ( AlgMapConstIter iter = fOwnedSubAlgMp -> begin() ;
269  iter != fOwnedSubAlgMp -> end() ; ++iter ) {
270 
271  Algorithm * subalg = iter -> second ;
272 
273  LOG("Algorithm", pDEBUG) << "Appending config from " << iter -> first << " -> " << subalg -> Id() ;
274  const Registry & r = subalg->GetConfig();
275  RgKey prefix = iter -> first + "/";
276  fConfig -> Append(r,prefix);
277 
278  }
279 
280  } //if owned substructure
281 
282  return * fConfig ;
283 }
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Algorithm abstract base class.
Definition: Algorithm.h:54
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const XML_Char * prefix
Definition: expat.h:380
map< string, Algorithm * >::const_iterator AlgMapConstIter
Definition: Algorithm.h:51
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
vector< Registry * > fConfVect
Definition: Algorithm.h:161
string RgKey
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
TRandom3 r(0)
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
string Key(void) const
Definition: AlgId.h:47
#define pDEBUG
Definition: Messenger.h:64
Registry * Algorithm::GetOwnedConfig ( void  )
inherited

Returns the pointer of the summary registry, see previous method Gives access to the summary so it could be changed. The usage of this method is deprecated as it is mantained only for back compatibility. If you need to add or chage a parter (or more), use the AddTopRegistry() instead

Definition at line 287 of file Algorithm.cxx.

References GetConfig().

Referenced by genie::TransverseEnhancementFFModel::LoadConfig(), and genie::EffectiveSF::LoadConfig().

288 {
289 
290  GetConfig() ;
291  return fConfig;
292 }
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
template<class T >
bool genie::Algorithm::GetParam ( const RgKey name,
T p,
bool  is_top_call = true 
) const
protectedinherited

Ideal access to a parameter value from the vector of registries Returns true if the value is found and the parameters is set

Referenced by genie::CollinsSpillerFragm::BuildFunction(), genie::PetersonFragm::BuildFunction(), genie::DISXSec::LoadConfig(), genie::INukeDeltaPropg::LoadConfig(), genie::COHXSec::LoadConfig(), genie::HadronTransporter::LoadConfig(), genie::DFRKinematicsGenerator::LoadConfig(), genie::RSHelicityAmplModelNCn::LoadConfig(), genie::RSHelicityAmplModelNCp::LoadConfig(), genie::BaryonResonanceDecayer::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::DMDISXSec::LoadConfig(), genie::DipoleAxialFormFactorModel::LoadConfig(), genie::DipoleELFormFactorsModel::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::VertexGenerator::LoadConfig(), genie::H3AMNuGammaPXSec::LoadConfig(), genie::RSPPResonanceSelector::LoadConfig(), genie::IBDXSecMap::LoadConfig(), genie::Decayer::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::COHElasticPXSec::LoadConfig(), genie::KuzminNaumov2016AxialFormFactorModel::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::DFRXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::KNOPythiaHadronization::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::MECXSec::LoadConfig(), genie::AivazisCharmPXSecLO::LoadConfig(), genie::BergerSehgalFMCOHPiPXSec2015::LoadConfig(), genie::ZExpAxialFormFactorModel::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::BBA03ELFormFactorsModel::LoadConfig(), genie::BBA05ELFormFactorsModel::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::PrimaryLeptonGenerator::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::SpectralFunc1d::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::OutgoingDarkGenerator::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::LHAPDF6::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), genie::QPMDISStrucFuncBase::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), genie::BBA07ELFormFactorsModel::LoadConfig(), genie::HAIntranuke::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), genie::LocalFGM::LoadConfig(), genie::HNIntranuke2018::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::EffectiveSF::LoadConfig(), genie::ReinSehgalSPPPXSec::LoadConfig(), genie::KNOHadronization::LoadConfig(), genie::SmithMonizUtils::LoadConfig(), genie::MECInteractionListGenerator::LoadConfigData(), genie::PhysInteractionSelector::LoadConfigData(), genie::RESInteractionListGenerator::LoadConfigData(), genie::PauliBlocker::LoadModelType(), ReadBYParams(), and genie::LHAPDF5::SetPDFSetFromConfig().

template<class T >
bool genie::Algorithm::GetParamDef ( const RgKey name,
T p,
const T def 
) const
protectedinherited

Ideal access to a parameter value from the vector of registries, With default value. Returns true if the value is set from the registries, false if the value is the default

Referenced by genie::IMDXSec::LoadConfig(), genie::COHXSec::LoadConfig(), genie::DISXSec::LoadConfig(), genie::RESXSec::LoadConfig(), genie::DFRKinematicsGenerator::LoadConfig(), genie::COHXSecAR::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::COHElKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::QELXSec::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::DMDISXSec::LoadConfig(), genie::BaryonResonanceDecayer::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::IBDKinematicsGenerator::LoadConfig(), genie::NuEInteractionListGenerator::LoadConfig(), genie::QELKinematicsGenerator::LoadConfig(), genie::DMELXSec::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::DISKinematicsGenerator::LoadConfig(), genie::NucBindEnergyAggregator::LoadConfig(), genie::DMELKinematicsGenerator::LoadConfig(), genie::DMDISKinematicsGenerator::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::DFRXSec::LoadConfig(), genie::FermiMover::LoadConfig(), genie::AlamSimoAtharVacasSKXSec::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::NuElectronXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::MECXSec::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::KovalenkoQELCharmPXSec::LoadConfig(), genie::SmithMonizQELCCXSec::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), genie::QPMDISStrucFuncBase::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::HAIntranuke::LoadConfig(), genie::LocalFGM::LoadConfig(), genie::HNIntranuke2018::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::EffectiveSF::LoadConfig(), genie::KNOHadronization::LoadConfig(), genie::NewQELXSec::LoadConfig(), genie::DFRInteractionListGenerator::LoadConfigData(), genie::MECInteractionListGenerator::LoadConfigData(), genie::QELInteractionListGenerator::LoadConfigData(), genie::RESInteractionListGenerator::LoadConfigData(), genie::SKInteractionListGenerator::LoadConfigData(), genie::COHInteractionListGenerator::LoadConfigData(), genie::DMELInteractionListGenerator::LoadConfigData(), genie::RSPPInteractionListGenerator::LoadConfigData(), genie::DISInteractionListGenerator::LoadConfigData(), and genie::DMDISInteractionListGenerator::LoadConfigData().

template<class T >
bool genie::Algorithm::GetParamVect ( const std::string comm_name,
std::vector< T > &  v,
unsigned int  max,
bool  is_top_call = true 
) const
protectedinherited

Handle to load vectors of parameters It looks for different registry item with name comm_name0, comm_name1, etc...

virtual AlgStatus_t genie::Algorithm::GetStatus ( void  ) const
inlinevirtualinherited

Get algorithm status.

Definition at line 101 of file Algorithm.h.

References genie::Algorithm::fStatus.

101 { return fStatus; }
AlgStatus_t fStatus
algorithm execution status
Definition: Algorithm.h:166
virtual const AlgId& genie::Algorithm::Id ( void  ) const
inlinevirtualinherited

Get algorithm ID.

Definition at line 98 of file Algorithm.h.

References genie::Algorithm::fID.

Referenced by genie::KineGeneratorWithCache::AccessCacheBranch(), genie::QELEventGeneratorSM::AccessCacheBranch2(), genie::QELEventGeneratorSM::AccessCacheBranchDiffv(), genie::InteractionListAssembler::AssembleInteractionList(), genie::XSecAlgorithmMap::BuildMap(), genie::InteractionGeneratorMap::BuildMap(), genie::XSecSplineList::BuildSplineKey(), genie::DISXSec::CacheBranchName(), genie::ReinSehgalRESXSecWithCache::CacheBranchName(), genie::DMDISXSec::CacheBranchName(), genie::ReinSehgalRESXSecWithCacheFast::CacheBranchName(), genie::Algorithm::Compare(), genie::RESKinematicsGenerator::ComputeMaxXSec(), genie::COHElKinematicsGenerator::ComputeMaxXSec(), genie::SKKinematicsGenerator::ComputeMaxXSec(), genie::COHKinematicsGenerator::ComputeMaxXSec(), genie::Algorithm::Configure(), genie::GEVGDriver::CreateSplines(), genie::QPMDISPXSec::DISRESJoinSuppressionFactor(), genie::QPMDMDISPXSec::DMDISRESJoinSuppressionFactor(), genie::AlgConfigPool::FindRegistry(), genie::AlgFactory::ForceReconfiguration(), genie::GEVGDriver::GenerateEvent(), GetAlgorithms(), genie::LwlynSmithQELCCPXSec::Integral(), genie::NievesQELCCPXSec::Integral(), genie::COHXSec::Integrate(), genie::QPMDISPXSec::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::EventGeneratorListAssembler::LoadGenerator(), main(), genie::COHKinematicsGenerator::MaxXSec_AlvarezRuso(), genie::XSecAlgorithmMap::Print(), genie::InteractionGeneratorMap::Print(), genie::AlgFactory::Print(), genie::COHHadronicSystemGenerator::ProcessEventRecord(), genie::COHPrimaryLeptonGenerator::ProcessEventRecord(), genie::COHKinematicsGenerator::ProcessEventRecord(), genie::MECGenerator::ProcessEventRecord(), genie::EventGenerator::ProcessEventRecord(), genie::KNOPythiaHadronization::SelectHadronizer(), TestPythiaTauDecays(), and genie::GEVGDriver::UseSplines().

98 { return fID; }
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
void BYStrucFunc::Init ( void  )
protected

Definition at line 83 of file BYStrucFunc.cxx.

References fA, fB, fCsD, fCsU, fCv1D, fCv1U, fCv2D, and fCv2U.

Referenced by BYStrucFunc().

84 {
85  fA = 0;
86  fB = 0;
87  fCsU = 0;
88  fCsD = 0;
89  fCv1U = 0;
90  fCv2U = 0;
91  fCv1D = 0;
92  fCv2D = 0;
93 }
double fCv1U
U-val K factor parameter.
Definition: BYStrucFunc.h:56
double fCv2D
D-val K factor parameter.
Definition: BYStrucFunc.h:59
double fCv2U
U-val K factor parameter.
Definition: BYStrucFunc.h:57
double fCv1D
D-val K factor parameter.
Definition: BYStrucFunc.h:58
double fB
better scaling var parameter B
Definition: BYStrucFunc.h:53
double fCsU
U-sea K factor parameter.
Definition: BYStrucFunc.h:54
double fA
better scaling var parameter A
Definition: BYStrucFunc.h:52
double fCsD
D-sea K factor parameter.
Definition: BYStrucFunc.h:55
void Algorithm::Initialize ( void  )
protectedinherited

Definition at line 343 of file Algorithm.cxx.

Referenced by genie::Algorithm::AllowReconfig().

344 {
345 // Algorithm initialization
346 //
347  fAllowReconfig = true;
348  fOwnsSubstruc = false;
349  fConfig = 0;
350  fOwnedSubAlgMp = 0;
351 }
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
void QPMDISStrucFuncBase::InitPDF ( void  )
protectedvirtualinherited

Definition at line 132 of file QPMDISStrucFuncBase.cxx.

References genie::QPMDISStrucFuncBase::fPDF, and genie::QPMDISStrucFuncBase::fPDFc.

Referenced by genie::QPMDISStrucFuncBase::F6(), and genie::QPMDISStrucFuncBase::QPMDISStrucFuncBase().

133 {
134  // evaluated at:
135  fPDF = new PDF(); // x = computed (+/-corrections) scaling var, Q2
136  fPDFc = new PDF(); // x = computed charm slow re-scaling var, Q2
137 }
PDF * fPDFc
computed PDFs @ (slow-rescaling-var,Q2)
A class to store PDFs.
Definition: PDF.h:38
PDF * fPDF
computed PDFs @ (x,Q2)
void BYStrucFunc::KFactors ( const Interaction i,
double &  kuv,
double &  kdv,
double &  kus,
double &  kds 
) const
protectedvirtual

Reimplemented from genie::QPMDISStrucFuncBase.

Definition at line 110 of file BYStrucFunc.cxx.

References fCsD, fCsU, fCv1D, fCv1U, fCv2D, fCv2U, and genie::QPMDISStrucFuncBase::Q2().

112 {
113 // Overrides QPMDISStrucFuncBase::KFactors() to compute the BY K factors for
114 // u(valence), d(valence), u(sea), d(sea);
115 
116  double myQ2 = this->Q2(interaction);
117  double GD = 1. / TMath::Power(1.+myQ2/0.71, 2); // p elastic form factor
118  double GD2 = TMath::Power(GD,2);
119 
120  kuv = (1.-GD2)*(myQ2+fCv2U)/(myQ2+fCv1U); // K - u(valence)
121  kdv = (1.-GD2)*(myQ2+fCv2D)/(myQ2+fCv1D); // K - d(valence)
122  kus = myQ2/(myQ2+fCsU); // K - u(sea)
123  kds = myQ2/(myQ2+fCsD); // K - d(sea)
124 }
double fCv1U
U-val K factor parameter.
Definition: BYStrucFunc.h:56
virtual double Q2(const Interaction *i) const
double fCv2D
D-val K factor parameter.
Definition: BYStrucFunc.h:59
double fCv2U
U-val K factor parameter.
Definition: BYStrucFunc.h:57
double fCv1D
D-val K factor parameter.
Definition: BYStrucFunc.h:58
double fCsU
U-sea K factor parameter.
Definition: BYStrucFunc.h:54
double fCsD
D-sea K factor parameter.
Definition: BYStrucFunc.h:55
void QPMDISStrucFuncBase::LoadConfig ( void  )
protectedvirtualinherited

Definition at line 82 of file QPMDISStrucFuncBase.cxx.

References genie::QPMDISStrucFuncBase::fCharmOff, genie::QPMDISStrucFuncBase::fIncludeNuclMod, genie::QPMDISStrucFuncBase::fIncludeR, genie::QPMDISStrucFuncBase::fLowQ2CutoffF1F2, genie::QPMDISStrucFuncBase::fMc, genie::QPMDISStrucFuncBase::fPDF, genie::QPMDISStrucFuncBase::fPDFc, genie::QPMDISStrucFuncBase::fQ2min, genie::QPMDISStrucFuncBase::fSin2thw, genie::QPMDISStrucFuncBase::fUse2016Corrections, genie::QPMDISStrucFuncBase::fVcd, genie::QPMDISStrucFuncBase::fVcd2, genie::QPMDISStrucFuncBase::fVcs, genie::QPMDISStrucFuncBase::fVcs2, genie::QPMDISStrucFuncBase::fVud, genie::QPMDISStrucFuncBase::fVud2, genie::QPMDISStrucFuncBase::fVus, genie::QPMDISStrucFuncBase::fVus2, genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), LOG, pDEBUG, and genie::Algorithm::SubAlg().

Referenced by genie::QPMDISStrucFuncBase::Configure(), and genie::QPMDISStrucFuncBase::F6().

83 {
84  LOG("DISSF", pDEBUG) << "Loading configuration...";
85 
86  //-- pdf
87  const PDFModelI * pdf_model =
88  dynamic_cast<const PDFModelI *> (this->SubAlg("PDF-Set"));
89  fPDF -> SetModel(pdf_model);
90  fPDFc -> SetModel(pdf_model);
91 
92  //-- get CKM elements
93  GetParam( "CKM-Vcd", fVcd ) ;
94  GetParam( "CKM-Vcs", fVcs ) ;
95  GetParam( "CKM-Vud", fVud ) ;
96  GetParam( "CKM-Vus", fVus ) ;
97 
98  fVcd2 = TMath::Power( fVcd, 2 );
99  fVcs2 = TMath::Power( fVcs, 2 );
100  fVud2 = TMath::Power( fVud, 2 );
101  fVus2 = TMath::Power( fVus, 2 );
102 
103  //-- charm mass
104  GetParam( "Charm-Mass", fMc ) ;
105 
106  //-- min Q2 for PDF evaluation
107  GetParam( "PDF-Q2min", fQ2min ) ;
108 
109  //-- include R (~FL)?
110  GetParam( "IncludeR", fIncludeR ) ;
111 
112  //-- include nuclear factor (shadowing / anti-shadowing / ...)
113  GetParam( "IncludeNuclMod", fIncludeNuclMod ) ;
114 
115  //-- Use 2016 SF relation corrections
116  GetParam( "Use2016Corrections", fUse2016Corrections ) ;
117 
118  //-- Set min for relation between 2xF1 and F2
119  GetParam( "LowQ2CutoffF1F2", fLowQ2CutoffF1F2 ) ;
120 
121  //-- turn charm production off?
122  GetParamDef( "Charm-Prod-Off", fCharmOff, false ) ;
123 
124  //-- weinberg angle
125  double thw ;
126  GetParam( "WeinbergAngle", thw ) ;
127  fSin2thw = TMath::Power(TMath::Sin(thw), 2);
128 
129  LOG("DISSF", pDEBUG) << "Done loading configuration";
130 }
double fVcd
CKM element Vcd used.
double fQ2min
min Q^2 allowed for PDFs: PDF(Q2<Q2min):=PDF(Q2min)
PDF * fPDFc
computed PDFs @ (slow-rescaling-var,Q2)
double fVud
CKM element Vud used.
bool fIncludeNuclMod
include nuclear factor (shadowing, anti-shadowing,...)?
double fMc
charm mass used
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
Definition: PDFModelI.h:29
PDF * fPDF
computed PDFs @ (x,Q2)
bool fIncludeR
include R (~FL) in DIS SF calculation?
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool fCharmOff
turn charm production off?
double fLowQ2CutoffF1F2
Set min for relation between 2xF1 and F2.
double fVus
CKM element Vcs used.
double fVcs
CKM element Vcs used.
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool fUse2016Corrections
Use 2016 SF relation corrections.
#define pDEBUG
Definition: Messenger.h:64
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:353
int Algorithm::MergeTopRegistry ( const Registry r)
protectedinherited

Merge with top level registry if first reg of the vector is owned Otherwise an owned copy is added as a top registry

Definition at line 618 of file Algorithm.cxx.

618  {
619 
620  if ( fOwnerships.empty() ) {
621 
622  // this algorithm is not configured right now, the incoming registry is the only configuration
623  Registry * p = new Registry( r ) ;
624  AddTopRegistry( p ) ;
625 
626  return 1 ;
627  }
628 
629  if ( fOwnerships[0] ) {
630  //the top registry is owned: it can be changed with no consequences for other algorithms
631  fConfVect[0] -> Merge( r ) ;
632  }
633  else {
634  // The top registry is not owned so it cannot be changed
635  // The registry will be added with top priority
636 
637  Registry * p = new Registry( r ) ;
638  AddTopRegistry( p ) ;
639  }
640 
641  // The configuration has changed so the summary is not updated anymore and must be deleted
642  if ( fConfig ) {
643  delete fConfig ;
644  fConfig = 0 ;
645  }
646 
647  return fConfVect.size() ;
648 }
const char * p
Definition: xmltok.h:285
int AddTopRegistry(Registry *rp, bool owns=true)
add registry with top priority, also update ownership
Definition: Algorithm.cxx:585
vector< Registry * > fConfVect
Definition: Algorithm.h:161
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
vector< bool > fOwnerships
ownership for every registry in fConfVect
Definition: Algorithm.h:164
Registry * fConfig
Summary configuration derived from fConvVect, not necessarily allocated.
Definition: Algorithm.h:194
double QPMDISStrucFuncBase::NuclMod ( const Interaction i) const
protectedvirtualinherited

Definition at line 449 of file QPMDISStrucFuncBase.cxx.

References genie::Target::A(), genie::units::A, genie::utils::nuclear::DISNuclFactor(), MakeMiniprodValidationCuts::f, genie::QPMDISStrucFuncBase::fIncludeNuclMod, genie::Interaction::InitState(), genie::kIAssumeFreeNucleon, genie::Interaction::Kine(), genie::kINoNuclearCorrection, LOG, pDEBUG, genie::InitialState::Tgt(), genie::Kinematics::x(), and submit_syst::x.

Referenced by genie::QPMDISStrucFuncBase::Calculate(), and genie::QPMDISStrucFuncBase::F6().

450 {
451 // Nuclear modification to Fi
452 // The scaling variable can be overwritten to include corrections
453 
454  if( interaction->TestBit(kIAssumeFreeNucleon) ) return 1.0;
455  if( interaction->TestBit(kINoNuclearCorrection) ) return 1.0;
456 
457  double f = 1.;
458  if(fIncludeNuclMod) {
459  const Target & tgt = interaction->InitState().Tgt();
460 
461 // The x used for computing the DIS Nuclear correction factor should be the
462 // experimental x, not the rescaled x or off-shell-rest-frame version of x
463 // (i.e. selected x). Since we do not have access to experimental x at this
464 // point in the calculation, just use selected x.
465  const Kinematics & kine = interaction->Kine();
466  double x = kine.x();
467  int A = tgt.A();
469 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
470  LOG("DISSF", pDEBUG) << "Nuclear factor for x of " << x << " = " << f;
471 #endif
472  }
473 
474  return f;
475 }
int A(void) const
Definition: Target.h:71
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
double x(bool selected=false) const
Definition: Kinematics.cxx:109
bool fIncludeNuclMod
include nuclear factor (shadowing, anti-shadowing,...)?
const UInt_t kINoNuclearCorrection
if set, inhibit nuclear corrections
Definition: Interaction.h:51
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
static const double A
Definition: Units.h:82
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:49
double DISNuclFactor(double x, int A)
#define pDEBUG
Definition: Messenger.h:64
void Algorithm::Print ( ostream &  stream) const
virtualinherited

Print algorithm info.

Definition at line 323 of file Algorithm.cxx.

References GetConfig(), and r().

Referenced by genie::Algorithm::AllowReconfig(), and genie::operator<<().

324 {
325  // print algorithm name & parameter-set
326  stream << "\nAlgorithm Key: " << this->fID.Key();
327  stream << " - Owns Substruc: " << ((fOwnsSubstruc) ? "[true]" : "[false]");
328 
329  // print algorithm configuration
330  const Registry & r = this->GetConfig();
331  stream << r;
332 
333  if(fOwnsSubstruc) {
334  AlgMapConstIter iter = fOwnedSubAlgMp->begin();
335  for(; iter!=fOwnedSubAlgMp->end(); ++iter) {
336  Algorithm * alg = iter->second;
337  stream << "<Next algorithm is owned by : " << this->fID.Key() << ">";
338  stream << *alg;
339  }
340  }
341 }
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Algorithm abstract base class.
Definition: Algorithm.h:54
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
map< string, Algorithm * >::const_iterator AlgMapConstIter
Definition: Algorithm.h:51
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
TRandom3 r(0)
string Key(void) const
Definition: AlgId.h:47
double QPMDISStrucFuncBase::Q2 ( const Interaction i) const
protectedvirtualinherited

Definition at line 401 of file QPMDISStrucFuncBase.cxx.

References genie::Target::HitNucP4Ptr(), genie::Interaction::InitState(), genie::Interaction::Kine(), kinematics(), genie::kKVQ2, genie::kKVq2, genie::kKVy, genie::kRfHitNucRest, genie::Kinematics::KVSet(), LOG, pERROR, genie::InitialState::ProbeE(), genie::Kinematics::Q2(), genie::InitialState::Tgt(), genie::Kinematics::x(), submit_syst::x, genie::Kinematics::y(), and submit_syst::y.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs(), genie::QPMDISStrucFuncBase::Calculate(), genie::QPMDISStrucFuncBase::F6(), KFactors(), genie::QPMDISStrucFuncBase::R(), and ScalingVar().

402 {
403 // Return Q2 from the kinematics or, if not set, compute it from x,y
404 // The x might be corrected
405 
406  const Kinematics & kinematics = interaction->Kine();
407 
408  // if Q2 (or q2) is set then prefer this value
409  if (kinematics.KVSet(kKVQ2) || kinematics.KVSet(kKVq2)) {
410  double Q2val = kinematics.Q2();
411  return Q2val;
412  }
413  // if Q2 was not set, then compute it from x,y,Ev,Mnucleon
414  if (kinematics.KVSet(kKVy)) {
415  const InitialState & init_state = interaction->InitState();
416  double Mn = init_state.Tgt().HitNucP4Ptr()->M(); // could be off-shell
417  //double x = this->ScalingVar(interaction); // could be redefined
418  double x = kinematics.x();
419  double y = kinematics.y();
420  double Ev = init_state.ProbeE(kRfHitNucRest);
421  double Q2val = 2*Mn*Ev*x*y;
422  return Q2val;
423  }
424  LOG("DISSF", pERROR) << "Could not compute Q2!";
425  return 0;
426 }
#define pERROR
Definition: Messenger.h:60
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
double x(bool selected=false) const
Definition: Kinematics.cxx:109
double y(bool selected=false) const
Definition: Kinematics.cxx:122
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool KVSet(KineVar_t kv) const
Definition: Kinematics.cxx:327
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:264
double Q2(bool selected=false) const
Definition: Kinematics.cxx:135
const Target & Tgt(void) const
Definition: InitialState.h:67
void kinematics()
Definition: kinematics.C:10
double ProbeE(RefFrame_t rf) const
Initial State information.
Definition: InitialState.h:49
double QPMDISStrucFuncBase::R ( const Interaction i) const
protectedvirtualinherited

Definition at line 477 of file QPMDISStrucFuncBase.cxx.

References genie::QPMDISStrucFuncBase::fIncludeR, genie::Interaction::Kine(), genie::QPMDISStrucFuncBase::Q2(), genie::utils::phys::RWhitlow(), genie::Kinematics::x(), and submit_syst::x.

Referenced by genie::QPMDISStrucFuncBase::Calculate(), and genie::QPMDISStrucFuncBase::F6().

478 {
479 // Computes R ( ~ longitudinal structure function FL = R * 2xF1)
480 // The scaling variable can be overwritten to include corrections
481 
482 // The x used for computing the DIS Nuclear correction factor should be the
483 // experimental x, not the rescaled x or off-shell-rest-frame version of x
484 // (i.e. selected x). Since we do not have access to experimental x at this
485 // point in the calculation, just use selected x.
486  if(fIncludeR) {
487  const Kinematics & kine = interaction->Kine();
488  double x = kine.x();
489 // double x = this->ScalingVar(interaction);
490  double Q2val = this->Q2(interaction);
491  double Rval = utils::phys::RWhitlow(x, Q2val);
492  return Rval;
493  }
494  return 0;
495 }
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
double x(bool selected=false) const
Definition: Kinematics.cxx:109
bool fIncludeR
include R (~FL) in DIS SF calculation?
virtual double Q2(const Interaction *i) const
double RWhitlow(double x, double Q2)
Definition: PhysUtils.cxx:86
void BYStrucFunc::ReadBYParams ( void  )
protected

Definition at line 66 of file BYStrucFunc.cxx.

References fA, fB, fCsD, fCsU, fCv1D, fCv1U, fCv2D, fCv2U, and genie::Algorithm::GetParam().

Referenced by Configure().

67 {
68 // Get the Bodek-Yang model parameters A,B,Csea,Cv1,Cv2 from the config.
69 // registry and set some private data members so as not to accessing the
70 // registry at every calculation.
71 //
72  GetParam( "BY-A", fA ) ;
73  GetParam( "BY-B", fB ) ;
74  GetParam( "BY-CsU", fCsU ) ;
75  GetParam( "BY-CsD", fCsD ) ;
76  GetParam( "BY-Cv1U", fCv1U ) ;
77  GetParam( "BY-Cv2U", fCv2U ) ;
78  GetParam( "BY-Cv1D", fCv1D ) ;
79  GetParam( "BY-Cv2D", fCv2D ) ;
80 
81 }
double fCv1U
U-val K factor parameter.
Definition: BYStrucFunc.h:56
double fCv2D
D-val K factor parameter.
Definition: BYStrucFunc.h:59
double fCv2U
U-val K factor parameter.
Definition: BYStrucFunc.h:57
double fCv1D
D-val K factor parameter.
Definition: BYStrucFunc.h:58
double fB
better scaling var parameter B
Definition: BYStrucFunc.h:53
double fCsU
U-sea K factor parameter.
Definition: BYStrucFunc.h:54
double fA
better scaling var parameter A
Definition: BYStrucFunc.h:52
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fCsD
D-sea K factor parameter.
Definition: BYStrucFunc.h:55
double BYStrucFunc::ScalingVar ( const Interaction i) const
protectedvirtual

Reimplemented from genie::QPMDISStrucFuncBase.

Definition at line 95 of file BYStrucFunc.cxx.

References a, fA, fB, genie::Interaction::Kine(), genie::constants::kProtonMass, LOG, pDEBUG, genie::QPMDISStrucFuncBase::Q2(), ana::Sqrt(), genie::Kinematics::x(), and submit_syst::x.

96 {
97 // Overrides QPMDISStrucFuncBase::ScalingVar() to compute the BY scaling var
98 
99  const Kinematics & kine = interaction->Kine();
100  double x = kine.x();
101  double myQ2 = this->Q2(interaction);
102  //myQ2 = TMath::Max(Q2,fQ2min);
103  LOG("BodekYang", pDEBUG) << "Q2 at scaling var calculation = " << myQ2;
104 
105  double a = TMath::Power( 2*kProtonMass*x, 2 ) / myQ2;
106  double xw = 2*x*(myQ2+fB) / (myQ2*(1.+TMath::Sqrt(1+a)) + 2*fA*x);
107  return xw;
108 }
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
double x(bool selected=false) const
Definition: Kinematics.cxx:109
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual double Q2(const Interaction *i) const
const double a
double fB
better scaling var parameter B
Definition: BYStrucFunc.h:53
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
double fA
better scaling var parameter A
Definition: BYStrucFunc.h:52
static const double kProtonMass
Definition: Constants.h:76
#define pDEBUG
Definition: Messenger.h:64
void Algorithm::SetId ( const AlgId id)
virtualinherited

Set algorithm ID.

Definition at line 313 of file Algorithm.cxx.

Referenced by genie::Algorithm::AllowReconfig().

314 {
315  fID.Copy(id);
316 }
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
void Copy(const AlgId &id)
Definition: AlgId.cxx:78
void Algorithm::SetId ( string  name,
string  config 
)
virtualinherited

Definition at line 318 of file Algorithm.cxx.

319 {
320  fID.SetId(name, config);
321 }
const XML_Char * name
Definition: expat.h:151
Definition: config.py:1
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
void SetId(string name, string config="")
Definition: AlgId.cxx:70
const Algorithm * Algorithm::SubAlg ( const RgKey registry_key) const
inherited

Access the sub-algorithm pointed to by the input key, either from the local pool or from AlgFactory's pool

Definition at line 353 of file Algorithm.cxx.

References ana::assert(), genie::AlgFactory::GetAlgorithm(), genie::AlgFactory::Instance(), LOG, pERROR, and pINFO.

Referenced by genie::Algorithm::AllowReconfig(), genie::utils::gsl::FullQELdXSec::FullQELdXSec(), genie::NewQELXSec::Integrate(), genie::HadronTransporter::LoadConfig(), genie::NucleonDecayPrimaryVtxGenerator::LoadConfig(), genie::IBDXSecMap::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::COHElasticPXSec::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::AlvarezRusoCOHPiPXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::NNBarOscPrimaryVtxGenerator::LoadConfig(), genie::FermiMover::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::IMDAnnihilationPXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::KNOPythiaHadronization::LoadConfig(), genie::AivazisCharmPXSecLO::LoadConfig(), genie::RESHadronicSystemGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::BergerSehgalFMCOHPiPXSec2015::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::KovalenkoQELCharmPXSec::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::SmithMonizQELCCXSec::LoadConfig(), genie::BardinIMDRadCorPXSec::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), genie::MartiniEricsonChanfrayMarteauMECPXSec2016::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), genie::QPMDISStrucFuncBase::LoadConfig(), genie::HAIntranuke::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), genie::HNIntranuke2018::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::ReinSehgalSPPPXSec::LoadConfig(), genie::KNOHadronization::LoadConfig(), and genie::EventGeneratorListAssembler::LoadGenerator().

354 {
355 // Returns the sub-algorithm pointed to this algorithm's XML config file using
356 // the the values of the key.
357 // This method asserts the existence of these keys in the XML config.
358 // Note: Since only 1 parameter is used, the key value should contain both the
359 // algorithm name and its configuration set according to the usual scheme:
360 // namespace::algorithm_name/configuration_set
361 //
362  LOG("Algorithm", pINFO)
363  << "Fetching sub-alg within alg: " << this->Id().Key()
364  << " pointed to by key: " << registry_key;
365 
366  //-- if the algorithm owns its substructure:
367  // return the sub-algorithm from the local pool
368  //
369  if(fOwnsSubstruc) {
370  AlgMapConstIter iter = fOwnedSubAlgMp->find(registry_key);
371  if(iter!=fOwnedSubAlgMp->end()) return iter->second;
372  LOG("Algorithm", pERROR)
373  << "Owned sub-alg pointed to by key: " << registry_key
374  << " was not found within alg: " << this->Id().Key();
375  return 0;
376  }
377 
378  //-- if the algorithm does not own its substructure:
379  // return the sub-algorithm from the AlgFactory's pool
380  RgAlg alg ;
381  GetParam( registry_key, alg ) ;
382 
383  LOG("Algorithm", pINFO)
384  << "Registry key: " << registry_key << " points to algorithm: " << alg;
385 
386  // retrieve the Algorithm object from the the Algorithm factory
387  AlgFactory * algf = AlgFactory::Instance();
388  const Algorithm * algbase = algf->GetAlgorithm(alg.name, alg.config);
389  assert(algbase);
390 
391  return algbase;
392 }
#define pERROR
Definition: Messenger.h:60
AlgMap * fOwnedSubAlgMp
local pool for owned sub-algs (taken out of the factory pool)
Definition: Algorithm.h:167
bool fOwnsSubstruc
true if it owns its substructure (sub-algs,...)
Definition: Algorithm.h:155
Algorithm abstract base class.
Definition: Algorithm.h:54
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:86
#define pINFO
Definition: Messenger.h:63
map< string, Algorithm * >::const_iterator AlgMapConstIter
Definition: Algorithm.h:51
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
assert(nhit_max >=nhit_nbins)
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
string Key(void) const
Definition: AlgId.h:47

Member Data Documentation

double genie::BYStrucFunc::fA
protected

better scaling var parameter A

Definition at line 52 of file BYStrucFunc.h.

Referenced by Init(), ReadBYParams(), and ScalingVar().

bool genie::Algorithm::fAllowReconfig
protectedinherited
double genie::BYStrucFunc::fB
protected

better scaling var parameter B

Definition at line 53 of file BYStrucFunc.h.

Referenced by Init(), ReadBYParams(), and ScalingVar().

double genie::QPMDISStrucFuncBase::fc
mutableprotectedinherited

Definition at line 105 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::Calculate().

double genie::QPMDISStrucFuncBase::fc_c
mutableprotectedinherited
bool genie::QPMDISStrucFuncBase::fCharmOff
protectedinherited

turn charm production off?

Definition at line 76 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs(), and genie::QPMDISStrucFuncBase::LoadConfig().

vector<Registry*> genie::Algorithm::fConfVect
protectedinherited

ideally these members should go private Registry will be access only through the GetParam method configurations registries from various sources the order of the vector is the precedence in case of repeated parameters position 0 -> Highest precedence

Definition at line 161 of file Algorithm.h.

double genie::BYStrucFunc::fCsD
protected

D-sea K factor parameter.

Definition at line 55 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::BYStrucFunc::fCsU
protected

U-sea K factor parameter.

Definition at line 54 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::BYStrucFunc::fCv1D
protected

D-val K factor parameter.

Definition at line 58 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::BYStrucFunc::fCv1U
protected

U-val K factor parameter.

Definition at line 56 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::BYStrucFunc::fCv2D
protected

D-val K factor parameter.

Definition at line 59 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::BYStrucFunc::fCv2U
protected

U-val K factor parameter.

Definition at line 57 of file BYStrucFunc.h.

Referenced by Init(), KFactors(), and ReadBYParams().

double genie::QPMDISStrucFuncBase::fds
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fds_c
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fdv
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fdv_c
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF1
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF2
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF3
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF4
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF5
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fF6
mutableprotectedinherited
AlgId genie::Algorithm::fID
protectedinherited

algorithm name and configuration set

Definition at line 156 of file Algorithm.h.

Referenced by genie::Algorithm::Id().

bool genie::QPMDISStrucFuncBase::fIncludeNuclMod
protectedinherited

include nuclear factor (shadowing, anti-shadowing,...)?

Definition at line 78 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig(), and genie::QPMDISStrucFuncBase::NuclMod().

bool genie::QPMDISStrucFuncBase::fIncludeR
protectedinherited

include R (~FL) in DIS SF calculation?

Definition at line 77 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig(), and genie::QPMDISStrucFuncBase::R().

double genie::QPMDISStrucFuncBase::fLowQ2CutoffF1F2
protectedinherited

Set min for relation between 2xF1 and F2.

Definition at line 90 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::Calculate(), and genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fMc
protectedinherited

charm mass used

Definition at line 79 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs(), and genie::QPMDISStrucFuncBase::LoadConfig().

AlgMap* genie::Algorithm::fOwnedSubAlgMp
protectedinherited

local pool for owned sub-algs (taken out of the factory pool)

Definition at line 167 of file Algorithm.h.

vector<bool> genie::Algorithm::fOwnerships
protectedinherited

ownership for every registry in fConfVect

Definition at line 164 of file Algorithm.h.

bool genie::Algorithm::fOwnsSubstruc
protectedinherited

true if it owns its substructure (sub-algs,...)

Definition at line 155 of file Algorithm.h.

PDF* genie::QPMDISStrucFuncBase::fPDF
protectedinherited
PDF* genie::QPMDISStrucFuncBase::fPDFc
protectedinherited
double genie::QPMDISStrucFuncBase::fQ2min
protectedinherited

min Q^2 allowed for PDFs: PDF(Q2<Q2min):=PDF(Q2min)

Definition at line 75 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs(), and genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fs
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fs_c
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fSin2thw
protectedinherited
AlgStatus_t genie::Algorithm::fStatus
protectedinherited

algorithm execution status

Definition at line 166 of file Algorithm.h.

Referenced by genie::Algorithm::GetStatus().

double genie::QPMDISStrucFuncBase::fus
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fus_c
mutableprotectedinherited

Definition at line 107 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs().

bool genie::QPMDISStrucFuncBase::fUse2016Corrections
protectedinherited

Use 2016 SF relation corrections.

Definition at line 89 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::Calculate(), and genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fuv
mutableprotectedinherited
double genie::QPMDISStrucFuncBase::fuv_c
mutableprotectedinherited

Definition at line 106 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::CalcPDFs().

double genie::QPMDISStrucFuncBase::fVcd
protectedinherited

CKM element Vcd used.

Definition at line 80 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fVcd2
protectedinherited
double genie::QPMDISStrucFuncBase::fVcs
protectedinherited

CKM element Vcs used.

Definition at line 81 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fVcs2
protectedinherited
double genie::QPMDISStrucFuncBase::fVud
protectedinherited

CKM element Vud used.

Definition at line 82 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fVud2
protectedinherited
double genie::QPMDISStrucFuncBase::fVus
protectedinherited

CKM element Vcs used.

Definition at line 83 of file QPMDISStrucFuncBase.h.

Referenced by genie::QPMDISStrucFuncBase::LoadConfig().

double genie::QPMDISStrucFuncBase::fVus2
protectedinherited

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