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

Provides access to the PYTHIA hadronization models.
Is a concrete implementation of the HadronizationModelI interface. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+3.10-2.17-e17-debug/GENIE-Generator/src/Physics/Hadronization/PythiaHadronization.h"

Inheritance diagram for genie::PythiaHadronization:
genie::HadronizationModelBase genie::HadronizationModelI genie::Algorithm

Public Member Functions

 PythiaHadronization ()
 
 PythiaHadronization (string config)
 
virtual ~PythiaHadronization ()
 
void Initialize (void) const
 
TClonesArray * Hadronize (const Interaction *) const
 
double Weight (void) const
 
PDGCodeListSelectParticles (const Interaction *) const
 
TH1D * MultiplicityProb (const Interaction *, Option_t *opt="") const
 
void Configure (const Registry &config)
 
void Configure (string config)
 
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 Initialize (void)
 
double Wmin (void) const
 Various utility methods common to hadronization models. More...
 
double MaxMult (const Interaction *i) const
 
void ApplyRijk (const Interaction *i, bool norm, TH1D *mp) const
 
TH1D * CreateMultProbHist (double maxmult) const
 
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 fWcut
 configuration data common to all hadronizers More...
 
double fRvpCCm2
 neugen's Rijk: vp, CC, multiplicity = 2 More...
 
double fRvpCCm3
 neugen's Rijk: vp, CC, multiplicity = 3 More...
 
double fRvpNCm2
 neugen's Rijk: vp, NC, multiplicity = 2 More...
 
double fRvpNCm3
 neugen's Rijk: vp, NC, multiplicity = 3 More...
 
double fRvnCCm2
 neugen's Rijk: vn, CC, multiplicity = 2 More...
 
double fRvnCCm3
 neugen's Rijk: vn, CC, multiplicity = 3 More...
 
double fRvnNCm2
 neugen's Rijk: vn, NC, multiplicity = 2 More...
 
double fRvnNCm3
 neugen's Rijk: vn, NC, multiplicity = 3 More...
 
double fRvbpCCm2
 neugen's Rijk: vbp, CC, multiplicity = 2 More...
 
double fRvbpCCm3
 neugen's Rijk: vbp, CC, multiplicity = 3 More...
 
double fRvbpNCm2
 neugen's Rijk: vbp, NC, multiplicity = 2 More...
 
double fRvbpNCm3
 neugen's Rijk: vbp, NC, multiplicity = 3 More...
 
double fRvbnCCm2
 neugen's Rijk: vbn, CC, multiplicity = 2 More...
 
double fRvbnCCm3
 neugen's Rijk: vbn, CC, multiplicity = 3 More...
 
double fRvbnNCm2
 neugen's Rijk: vbn, NC, multiplicity = 2 More...
 
double fRvbnNCm3
 neugen's Rijk: vbn, NC, multiplicity = 3 More...
 
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...
 

Private Member Functions

void LoadConfig (void)
 
bool AssertValidity (const Interaction *i) const
 

Private Attributes

TPythia6 * fPythia
 PYTHIA6 wrapper class. More...
 
const DecayModelIfDecayer
 
double fSSBarSuppression
 ssbar suppression More...
 
double fGaussianPt2
 gaussian pt2 distribution width More...
 
double fNonGaussianPt2Tail
 non gaussian pt2 tail parameterization More...
 
double fRemainingECutoff
 remaining E cutoff for stopping fragmentation More...
 

Detailed Description

Provides access to the PYTHIA hadronization models.
Is a concrete implementation of the HadronizationModelI interface.

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

August 17, 2004

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 30 of file PythiaHadronization.h.

Constructor & Destructor Documentation

PythiaHadronization::PythiaHadronization ( )

Definition at line 46 of file PythiaHadronization.cxx.

References Initialize().

46  :
47 HadronizationModelBase("genie::PythiaHadronization")
48 {
49  this->Initialize();
50 }
PythiaHadronization::PythiaHadronization ( string  config)

Definition at line 52 of file PythiaHadronization.cxx.

References Initialize().

52  :
53 HadronizationModelBase("genie::PythiaHadronization", config)
54 {
55  this->Initialize();
56 }
Definition: config.py:1
PythiaHadronization::~PythiaHadronization ( )
virtual

Definition at line 58 of file PythiaHadronization.cxx.

59 {
60 
61 }

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 HadronizationModelBase::ApplyRijk ( const Interaction i,
bool  norm,
TH1D *  mp 
) const
protectedinherited

Definition at line 80 of file HadronizationModelBase.cxx.

References genie::HadronizationModelBase::fRvbnCCm2, genie::HadronizationModelBase::fRvbnCCm3, genie::HadronizationModelBase::fRvbnNCm2, genie::HadronizationModelBase::fRvbnNCm3, genie::HadronizationModelBase::fRvbpCCm2, genie::HadronizationModelBase::fRvbpCCm3, genie::HadronizationModelBase::fRvbpNCm2, genie::HadronizationModelBase::fRvbpNCm3, genie::HadronizationModelBase::fRvnCCm2, genie::HadronizationModelBase::fRvnCCm3, genie::HadronizationModelBase::fRvnNCm2, genie::HadronizationModelBase::fRvnNCm3, genie::HadronizationModelBase::fRvpCCm2, genie::HadronizationModelBase::fRvpCCm3, genie::HadronizationModelBase::fRvpNCm2, genie::HadronizationModelBase::fRvpNCm3, genie::Target::HitNucPdg(), MECModelEnuComparisons::i, genie::Interaction::InitState(), genie::pdg::IsAntiNeutrino(), genie::pdg::IsDarkMatter(), genie::ProcessInfo::IsDarkMatter(), genie::ProcessInfo::IsEM(), genie::pdg::IsNegChargedLepton(), genie::pdg::IsNeutrino(), genie::pdg::IsNeutron(), genie::pdg::IsPosChargedLepton(), genie::pdg::IsProton(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), LOG, getGoodRuns4SAM::n, nbins, P, pDEBUG, pERROR, genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), R, and genie::InitialState::Tgt().

Referenced by MultiplicityProb(), and genie::KNOHadronization::MultiplicityProb().

82 {
83 // Apply the NEUGEN multiplicity probability scaling factors
84 //
85  if(!mp) return;
86 
87  const InitialState & init_state = interaction->InitState();
88  int probe_pdg = init_state.ProbePdg();
89  int nuc_pdg = init_state.Tgt().HitNucPdg();
90 
91  const ProcessInfo & proc_info = interaction->ProcInfo();
92  bool is_CC = proc_info.IsWeakCC();
93  bool is_NC = proc_info.IsWeakNC();
94  bool is_EM = proc_info.IsEM();
95  // EDIT
96  bool is_dm = proc_info.IsDarkMatter();
97 
98  //
99  // get the R2, R3 factors
100  //
101 
102  double R2=1., R3=1.;
103 
104  // weak CC or NC case
105  // EDIT
106  if(is_CC || is_NC || is_dm) {
107  bool is_nu = pdg::IsNeutrino (probe_pdg);
108  bool is_nubar = pdg::IsAntiNeutrino (probe_pdg);
109  bool is_p = pdg::IsProton (nuc_pdg);
110  bool is_n = pdg::IsNeutron (nuc_pdg);
111  bool is_dmi = pdg::IsDarkMatter (probe_pdg); // EDIT
112  if((is_nu && is_p) || (is_dmi && is_p)) {
113  R2 = (is_CC) ? fRvpCCm2 : fRvpNCm2;
114  R3 = (is_CC) ? fRvpCCm3 : fRvpNCm3;
115  } else
116  if((is_nu && is_n) || (is_dmi && is_n)) {
117  R2 = (is_CC) ? fRvnCCm2 : fRvnNCm2;
118  R3 = (is_CC) ? fRvnCCm3 : fRvnNCm3;
119  } else
120  if(is_nubar && is_p) {
121  R2 = (is_CC) ? fRvbpCCm2 : fRvbpNCm2;
122  R3 = (is_CC) ? fRvbpCCm3 : fRvbpNCm3;
123  } else
124  if(is_nubar && is_n) {
125  R2 = (is_CC) ? fRvbnCCm2 : fRvbnNCm2;
126  R3 = (is_CC) ? fRvbnCCm3 : fRvbnNCm3;
127  } else {
128  LOG("BaseHad", pERROR)
129  << "Invalid initial state: " << init_state;
130  }
131  }//cc||nc?
132 
133  // EM case (apply the NC tuning factors)
134 
135  if(is_EM) {
136  bool is_l = pdg::IsNegChargedLepton (probe_pdg);
137  bool is_lbar = pdg::IsPosChargedLepton (probe_pdg);
138  bool is_p = pdg::IsProton (nuc_pdg);
139  bool is_n = pdg::IsNeutron (nuc_pdg);
140  if(is_l && is_p) {
141  R2 = fRvpNCm2;
142  R3 = fRvpNCm3;
143  } else
144  if(is_l && is_n) {
145  R2 = fRvnNCm2;
146  R3 = fRvnNCm3;
147  } else
148  if(is_lbar && is_p) {
149  R2 = fRvbpNCm2;
150  R3 = fRvbpNCm3;
151  } else
152  if(is_lbar && is_n) {
153  R2 = fRvbnNCm2;
154  R3 = fRvbnNCm3;
155  } else {
156  LOG("BaseHad", pERROR)
157  << "Invalid initial state: " << init_state;
158  }
159  }//em?
160 
161  //
162  // Apply to the multiplicity probability distribution
163  //
164 
165  int nbins = mp->GetNbinsX();
166  for(int i = 1; i <= nbins; i++) {
167  int n = TMath::Nint( mp->GetBinCenter(i) );
168 
169  double R=1;
170  if (n==2) R=R2;
171  else if (n==3) R=R3;
172 
173  if(n==2 || n==3) {
174  double P = mp->GetBinContent(i);
175  double Psc = R*P;
176  LOG("BaseHad", pDEBUG)
177  << "n=" << n << "/ Scaling factor R = "
178  << R << "/ P " << P << " --> " << Psc;
179  mp->SetBinContent(i, Psc);
180  }
181  if(n>3) break;
182  }
183 
184  // renormalize the histogram?
185  if(norm) {
186  double histo_norm = mp->Integral("width");
187  if(histo_norm>0) mp->Scale(1.0/histo_norm);
188  }
189 }
double fRvnCCm3
neugen&#39;s Rijk: vn, CC, multiplicity = 3
double fRvbpCCm3
neugen&#39;s Rijk: vbp, CC, multiplicity = 3
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:108
#define pERROR
Definition: Messenger.h:60
int HitNucPdg(void) const
Definition: Target.cxx:321
double fRvnNCm2
neugen&#39;s Rijk: vn, NC, multiplicity = 2
double fRvbpCCm2
neugen&#39;s Rijk: vbp, CC, multiplicity = 2
double fRvpCCm2
neugen&#39;s Rijk: vp, CC, multiplicity = 2
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:125
double fRvbnNCm3
neugen&#39;s Rijk: vbn, NC, multiplicity = 3
double fRvpNCm2
neugen&#39;s Rijk: vp, NC, multiplicity = 2
#define P(a, b, c, d, e, x)
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
bool IsPosChargedLepton(int pdgc)
Definition: PDGUtils.cxx:140
const int nbins
Definition: cellShifts.C:15
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
double fRvpNCm3
neugen&#39;s Rijk: vp, NC, multiplicity = 3
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:116
int ProbePdg(void) const
Definition: InitialState.h:65
double fRvbnNCm2
neugen&#39;s Rijk: vbn, NC, multiplicity = 2
TString mp
Definition: loadincs.C:4
#define R(x)
double fRvpCCm3
neugen&#39;s Rijk: vp, CC, multiplicity = 3
double fRvbpNCm2
neugen&#39;s Rijk: vbp, NC, multiplicity = 2
bool IsEM(void) const
double fRvnNCm3
neugen&#39;s Rijk: vn, NC, multiplicity = 3
Float_t norm
bool IsDarkMatter(void) const
double fRvbnCCm3
neugen&#39;s Rijk: vbn, CC, multiplicity = 3
const Target & Tgt(void) const
Definition: InitialState.h:67
bool IsNegChargedLepton(int pdgc)
Definition: PDGUtils.cxx:131
double fRvbpNCm3
neugen&#39;s Rijk: vbp, NC, multiplicity = 3
double fRvnCCm2
neugen&#39;s Rijk: vn, CC, multiplicity = 2
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64
double fRvbnCCm2
neugen&#39;s Rijk: vbn, CC, multiplicity = 2
bool PythiaHadronization::AssertValidity ( const Interaction i) const
private

Definition at line 486 of file PythiaHadronization.cxx.

References genie::Interaction::ExclTag(), genie::Target::HitNucPdg(), genie::Target::HitQrkIsSet(), genie::Target::HitQrkPdg(), genie::Interaction::InitState(), genie::pdg::IsAntiDQuark(), genie::pdg::IsAntiNeutrino(), genie::pdg::IsAntiSQuark(), genie::pdg::IsAntiUQuark(), iscc, genie::XclsTag::IsCharmEvent(), genie::pdg::IsDarkMatter(), genie::ProcessInfo::IsDarkMatter(), genie::pdg::IsDQuark(), genie::ProcessInfo::IsEM(), genie::pdg::IsNegChargedLepton(), genie::pdg::IsNeutrino(), genie::pdg::IsNeutron(), genie::pdg::IsPosChargedLepton(), genie::pdg::IsProton(), genie::pdg::IsSQuark(), genie::pdg::IsUQuark(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), LOG, genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), pWARN, genie::InitialState::Tgt(), W, genie::utils::kinematics::W(), and genie::HadronizationModelBase::Wmin().

Referenced by Hadronize(), and MultiplicityProb().

487 {
488  // check that there is no charm production
489  // (GENIE uses a special model for these cases)
490  if(interaction->ExclTag().IsCharmEvent()) {
491  LOG("PythiaHad", pWARN) << "Can't hadronize charm events";
492  return false;
493  }
494  // check the available mass
495  double W = utils::kinematics::W(interaction);
496  if(W < this->Wmin()) {
497  LOG("PythiaHad", pWARN) << "Low invariant mass, W = " << W << " GeV!!";
498  return false;
499  }
500 
501  const InitialState & init_state = interaction->InitState();
502  const ProcessInfo & proc_info = interaction->ProcInfo();
503  const Target & target = init_state.Tgt();
504 
505  if( ! target.HitQrkIsSet() ) {
506  LOG("PythiaHad", pWARN) << "Hit quark was not set!";
507  return false;
508  }
509 
510  int probe = init_state.ProbePdg();
511  int hit_nucleon = target.HitNucPdg();
512  int hit_quark = target.HitQrkPdg();
513 //bool from_sea = target.HitSeaQrk();
514 
515  // check hit-nucleon assignment, input neutrino & weak current
516  bool isp = pdg::IsProton (hit_nucleon);
517  bool isn = pdg::IsNeutron (hit_nucleon);
518  bool isv = pdg::IsNeutrino (probe);
519  bool isvb = pdg::IsAntiNeutrino (probe);
520  bool isdm = pdg::IsDarkMatter (probe);
521  bool isl = pdg::IsNegChargedLepton (probe);
522  bool islb = pdg::IsPosChargedLepton (probe);
523  bool iscc = proc_info.IsWeakCC ();
524  bool isnc = proc_info.IsWeakNC ();
525  bool isdmi = proc_info.IsDarkMatter ();
526  bool isem = proc_info.IsEM ();
527  if( !(iscc||isnc||isem||isdmi) ) {
528  LOG("PythiaHad", pWARN)
529  << "Can only handle electro-weak interactions";
530  return false;
531  }
532  if( !(isp||isn) || !(isv||isvb||isl||islb||isdm) ) {
533  LOG("PythiaHad", pWARN)
534  << "Invalid initial state: probe = "
535  << probe << ", hit_nucleon = " << hit_nucleon;
536  return false;
537  }
538 
539  // assert that the interaction mode is allowed
540  bool isu = pdg::IsUQuark (hit_quark);
541  bool isd = pdg::IsDQuark (hit_quark);
542  bool iss = pdg::IsSQuark (hit_quark);
543  bool isub = pdg::IsAntiUQuark (hit_quark);
544  bool isdb = pdg::IsAntiDQuark (hit_quark);
545  bool issb = pdg::IsAntiSQuark (hit_quark);
546 
547  bool allowed = (iscc && isv && (isd||isub||iss)) ||
548  (iscc && isvb && (isu||isdb||issb)) ||
549  (isnc && (isv||isvb) && (isu||isd||isub||isdb||iss||issb)) ||
550  (isdmi && isdm && (isu||isd||isub||isdb||iss||issb)) ||
551  (isem && (isl||islb) && (isu||isd||isub||isdb||iss||issb));
552  if(!allowed) {
553  LOG("PythiaHad", pWARN)
554  << "Impossible interaction type / probe / hit quark combination!";
555  return false;
556  }
557 
558  return true;
559 }
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:108
const XML_Char * target
Definition: expat.h:268
bool IsUQuark(int pdgc)
Definition: PDGUtils.cxx:249
int HitNucPdg(void) const
Definition: Target.cxx:321
int HitQrkPdg(void) const
Definition: Target.cxx:259
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:125
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 W(const Interaction *const i)
Definition: KineUtils.cxx:1015
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
bool IsPosChargedLepton(int pdgc)
Definition: PDGUtils.cxx:140
int iscc
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
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:116
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
#define pWARN
Definition: Messenger.h:61
bool IsEM(void) const
double Wmin(void) const
Various utility methods common to hadronization models.
bool HitQrkIsSet(void) const
Definition: Target.cxx:309
bool IsDarkMatter(void) const
bool IsDQuark(int pdgc)
Definition: PDGUtils.cxx:254
const Target & Tgt(void) const
Definition: InitialState.h:67
#define W(x)
bool IsNegChargedLepton(int pdgc)
Definition: PDGUtils.cxx:131
bool IsAntiUQuark(int pdgc)
Definition: PDGUtils.cxx:269
Initial State information.
Definition: InitialState.h:49
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 PythiaHadronization::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 423 of file PythiaHadronization.cxx.

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

424 {
425  Algorithm::Configure(config);
426  this->LoadConfig();
427 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
void PythiaHadronization::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 429 of file PythiaHadronization.cxx.

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

430 {
432  this->LoadConfig();
433 }
Definition: config.py:1
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
TH1D * HadronizationModelBase::CreateMultProbHist ( double  maxmult) const
protectedinherited

Definition at line 68 of file HadronizationModelBase.cxx.

References nbins.

Referenced by MultiplicityProb(), and genie::KNOHadronization::MultiplicityProb().

69 {
70  double minmult = 2;
71  int nbins = TMath::Nint(maxmult-minmult+1);
72 
73  TH1D * mult_prob = new TH1D("mult_prob",
74  "hadronic multiplicity distribution", nbins, minmult-0.5, maxmult+0.5);
75  mult_prob->SetDirectory(0);
76 
77  return mult_prob;
78 }
const int nbins
Definition: cellShifts.C:15
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
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_hdf5record::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(), 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::INukeDeltaPropg::LoadConfig(), genie::COHXSec::LoadConfig(), genie::DISXSec::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(), LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::DFRXSec::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::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::BBA03ELFormFactorsModel::LoadConfig(), genie::BBA05ELFormFactorsModel::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::PrimaryLeptonGenerator::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::SpectralFunc1d::LoadConfig(), genie::OutgoingDarkGenerator::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::LHAPDF6::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::NuclearModelMap::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(), genie::BYStrucFunc::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::BaryonResonanceDecayer::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::COHElKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::QELXSec::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::DMDISXSec::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::AlamSimoAtharVacasSKXSec::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::NuElectronXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::MECXSec::LoadConfig(), genie::FermiMover::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::SKInteractionListGenerator::LoadConfigData(), genie::COHInteractionListGenerator::LoadConfigData(), genie::RESInteractionListGenerator::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
TClonesArray * PythiaHadronization::Hadronize ( const Interaction interaction) const
virtual

Implements genie::HadronizationModelBase.

Definition at line 72 of file PythiaHadronization.cxx.

References ana::assert(), AssertValidity(), fPythia, genie::Target::HitNucPdg(), genie::Target::HitQrkIsSet(), genie::Target::HitQrkPdg(), genie::Target::HitSeaQrk(), MECModelEnuComparisons::i, genie::Interaction::InitState(), genie::RandomGen::Instance(), ip, genie::pdg::IsAntiDQuark(), genie::pdg::IsAntiNeutrino(), genie::pdg::IsAntiSQuark(), genie::pdg::IsAntiUQuark(), iscc, genie::ProcessInfo::IsDarkMatter(), genie::pdg::IsDiQuark(), genie::pdg::IsDQuark(), genie::ProcessInfo::IsEM(), genie::pdg::IsNeutrino(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::pdg::IsQuark(), genie::pdg::IsSQuark(), genie::pdg::IsUQuark(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), genie::Interaction::Kine(), kinematics(), genie::kPdgAntiDQuark, genie::kPdgAntiK0, genie::kPdgAntiLambda, genie::kPdgAntiUQuark, genie::kPdgDDDiquarkS1, genie::kPdgDQuark, genie::kPdgK0, genie::kPdgLambda, genie::kPdgP33m1232_Delta0, genie::kPdgP33m1232_DeltaM, genie::kPdgP33m1232_DeltaP, genie::kPdgP33m1232_DeltaPP, genie::kPdgPi0, genie::kPdgUDDiquarkS0, genie::kPdgUDDiquarkS1, genie::kPdgUQuark, genie::kPdgUUDiquarkS1, LOG, pDEBUG, pERROR, pNOTICE, genie::utils::fragmrec::Print(), genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), py2ent_(), generate_hists::rnd, genie::RandomGen::RndHadro(), genie::InitialState::Tgt(), W, and genie::Kinematics::W().

Referenced by MultiplicityProb(), and SelectParticles().

74 {
75  LOG("PythiaHad", pNOTICE) << "Running PYTHIA hadronizer";
76 
77  if(!this->AssertValidity(interaction)) {
78  LOG("PythiaHad", pERROR) << "Returning a null particle list!";
79  return 0;
80  }
81 
82  // get kinematics / init-state / process-info
83 
84  const Kinematics & kinematics = interaction->Kine();
85  const InitialState & init_state = interaction->InitState();
86  const ProcessInfo & proc_info = interaction->ProcInfo();
87  const Target & target = init_state.Tgt();
88 
89  assert(target.HitQrkIsSet());
90 
91  double W = kinematics.W();
92 
93  int probe = init_state.ProbePdg();
94  int hit_nucleon = target.HitNucPdg();
95  int hit_quark = target.HitQrkPdg();
96  bool from_sea = target.HitSeaQrk();
97 
98  LOG("PythiaHad", pNOTICE)
99  << "Hit nucleon pdgc = " << hit_nucleon << ", W = " << W;
100  LOG("PythiaHad", pNOTICE)
101  << "Selected hit quark pdgc = " << hit_quark
102  << ((from_sea) ? "[sea]" : "[valence]");
103 
104  // check hit-nucleon assignment, input neutrino & interaction type
105  bool isp = pdg::IsProton (hit_nucleon);
106  bool isn = pdg::IsNeutron (hit_nucleon);
107  bool isv = pdg::IsNeutrino (probe);
108  bool isvb = pdg::IsAntiNeutrino (probe);
109 //bool isl = pdg::IsNegChargedLepton (probe);
110 //bool islb = pdg::IsPosChargedLepton (probe);
111  bool iscc = proc_info.IsWeakCC ();
112  bool isnc = proc_info.IsWeakNC ();
113  bool isdm = proc_info.IsDarkMatter ();
114  bool isem = proc_info.IsEM ();
115  bool isu = pdg::IsUQuark (hit_quark);
116  bool isd = pdg::IsDQuark (hit_quark);
117  bool iss = pdg::IsSQuark (hit_quark);
118  bool isub = pdg::IsAntiUQuark (hit_quark);
119  bool isdb = pdg::IsAntiDQuark (hit_quark);
120  bool issb = pdg::IsAntiSQuark (hit_quark);
121 
122  //
123  // Generate the quark system (q + qq) initiating the hadronization
124  //
125 
126  int final_quark = 0; // leading quark (hit quark after the interaction)
127  int diquark = 0; // remnant diquark (xF<0 at hadronic CMS)
128 
129  // Figure out the what happens to the hit quark after the interaction
130  if (isnc || isem || isdm) {
131  // NC, EM
132  final_quark = hit_quark;
133  } else {
134  // CC
135  if (isv && isd ) final_quark = kPdgUQuark;
136  else if (isv && iss ) final_quark = kPdgUQuark;
137  else if (isv && isub) final_quark = kPdgAntiDQuark;
138  else if (isvb && isu ) final_quark = kPdgDQuark;
139  else if (isvb && isdb) final_quark = kPdgAntiUQuark;
140  else if (isvb && issb) final_quark = kPdgAntiUQuark;
141  else {
142  LOG("PythiaHad", pERROR)
143  << "Not allowed mode. Refused to make a final quark assignment!";
144  return 0;
145  }
146  }//CC
147 
148  // Figure out what the remnant diquark is.
149  // Note from Hugh, following a conversation with his local HEP theorist
150  // (Gary Goldstein): "I am told that the probability of finding the diquark
151  // in the singlet vs. triplet states is 50-50."
152 
153  // hit quark = valence quark
154  if(!from_sea) {
155  if (isp && isu) diquark = kPdgUDDiquarkS1; /* u(->q) + ud */
156  if (isp && isd) diquark = kPdgUUDiquarkS1; /* d(->q) + uu */
157  if (isn && isu) diquark = kPdgDDDiquarkS1; /* u(->q) + dd */
158  if (isn && isd) diquark = kPdgUDDiquarkS1; /* d(->q) + ud */
159  }
160  // hit quark = sea quark
161  else {
162  if(isp && isu) diquark = kPdgUDDiquarkS1; /* u(->q) + bar{u} uud (=ud) */
163  if(isp && isd) diquark = kPdgUUDiquarkS1; /* d(->q) + bar{d} uud (=uu) */
164  if(isn && isu) diquark = kPdgDDDiquarkS1; /* u(->q) + bar{u} udd (=dd) */
165  if(isn && isd) diquark = kPdgUDDiquarkS1; /* d(->q) + bar{d} udd (=ud) */
166 
167  // The following section needs revisiting.
168 
169  // The lepton is scattered off a sea antiquark, materializing its quark
170  // partner and leaving me with a 5q system ( <qbar + q> + qqq(valence) )
171  // I will force few qbar+q annhilations below to get my quark/diquark system
172  // Probably it is best to leave the qqq system in the final state and then
173  // just do the fragmentation of the qbar q system? But how do I figure out
174  // how to split the available energy?
175 
176  /* bar{u} (-> bar{d}) + u uud => u + uu */
177  if(isp && isub && iscc) {final_quark = kPdgUQuark; diquark = kPdgUUDiquarkS1;}
178  /* bar{u} (-> bar{u}) + u uud => u + ud */
179  if(isp && isub && (isnc||isem||isdm)) {final_quark = kPdgUQuark; diquark = kPdgUDDiquarkS1;}
180  /* bar{d} (-> bar{u}) + d uud => d + ud */
181  if(isp && isdb && iscc) {final_quark = kPdgDQuark; diquark = kPdgUDDiquarkS1;}
182  /* bar{d} (-> bar{d}) + d uud => d + uu */
183  if(isp && isdb && (isnc||isem||isdm)) {final_quark = kPdgDQuark; diquark = kPdgUUDiquarkS1;}
184  /* bar{u} (-> bar{d}) + u udd => u + ud */
185  if(isn && isub && iscc) {final_quark = kPdgUQuark; diquark = kPdgUDDiquarkS1;}
186  /* bar{u} (-> bar{u}) + u udd => u + dd */
187  if(isn && isub && (isnc||isem||isdm)) {final_quark = kPdgUQuark; diquark = kPdgDDDiquarkS1;}
188  /* bar{d} (-> bar{u}) + d udd => d + dd */
189  if(isn && isdb && iscc) {final_quark = kPdgDQuark; diquark = kPdgDDDiquarkS1;}
190  /* bar{d} (-> bar{d}) + d udd => d + ud */
191  if(isn && isdb && (isnc||isem||isdm)) {final_quark = kPdgDQuark; diquark = kPdgUDDiquarkS1;}
192 
193  // The neutrino is scatterred off s or sbar sea quarks
194  // For the time being I will handle s like d and sbar like dbar (copy & paste
195  // from above) so that I conserve charge.
196 
197  if(iss || issb) {
198  LOG("PythiaHad", pNOTICE)
199  << "Can not really handle a hit s or sbar quark / Faking it";
200 
201  if(isp && iss) { diquark = kPdgUUDiquarkS1; }
202  if(isn && iss) { diquark = kPdgUDDiquarkS1; }
203 
204  if(isp && issb && iscc) {final_quark = kPdgDQuark; diquark = kPdgUDDiquarkS1;}
205  if(isp && issb && (isnc||isem||isdm)) {final_quark = kPdgDQuark; diquark = kPdgUUDiquarkS1;}
206  if(isn && issb && iscc) {final_quark = kPdgDQuark; diquark = kPdgDDDiquarkS1;}
207  if(isn && issb && (isnc||isem||isdm)) {final_quark = kPdgDQuark; diquark = kPdgUDDiquarkS1;}
208  }
209 
210  // if the diquark is a ud, switch it to the singlet state with 50% probability
211  if(diquark == kPdgUDDiquarkS1) {
213  double Rqq = rnd->RndHadro().Rndm();
214  if(Rqq<0.5) diquark = kPdgUDDiquarkS0;
215  }
216  }
217  assert(diquark!=0);
218 
219  //
220  // PYTHIA -> HADRONIZATION
221  //
222 
223  LOG("PythiaHad", pNOTICE)
224  << "Fragmentation / Init System: "
225  << "q = " << final_quark << ", qq = " << diquark;
226  int ip = 0;
227 
228  // Determine how jetset treats un-stable particles appearing in hadronization
229 
230  int pi0_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgPi0), 1);
231  int K0_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgK0), 1);
232  int K0b_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgAntiK0), 1);
233  int L0_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgLambda), 1);
234  int L0b_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgAntiLambda), 1);
235  int Dm_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaM), 1);
236  int D0_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgP33m1232_Delta0), 1);
237  int Dp_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaP), 1);
238  int Dpp_decflag = fPythia->GetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaPP), 1);
239 
240 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
241  LOG("PythiaHad", pDEBUG) << "Original decay flag for pi0 = " << pi0_decflag;
242  LOG("PythiaHad", pDEBUG) << "Original decay flag for K0 = " << K0_decflag;
243  LOG("PythiaHad", pDEBUG) << "Original decay flag for \bar{K0} = " << K0b_decflag;
244  LOG("PythiaHad", pDEBUG) << "Original decay flag for Lambda = " << L0_decflag;
245  LOG("PythiaHad", pDEBUG) << "Original decay flag for \bar{Lambda0} = " << L0b_decflag;
246  LOG("PythiaHad", pDEBUG) << "Original decay flag for D- = " << Dm_decflag;
247  LOG("PythiaHad", pDEBUG) << "Original decay flag for D0 = " << D0_decflag;
248  LOG("PythiaHad", pDEBUG) << "Original decay flag for D+ = " << Dp_decflag;
249  LOG("PythiaHad", pDEBUG) << "Original decay flag for D++ = " << Dpp_decflag;
250 #endif
251 
252  fPythia->SetMDCY(fPythia->Pycomp(kPdgPi0), 1,0); // don't decay pi0
253  fPythia->SetMDCY(fPythia->Pycomp(kPdgK0), 1,0); // don't decay K0
254  fPythia->SetMDCY(fPythia->Pycomp(kPdgAntiK0), 1,0); // don't decay \bar{K0}
255  fPythia->SetMDCY(fPythia->Pycomp(kPdgLambda), 1,0); // don't decay Lambda0
256  fPythia->SetMDCY(fPythia->Pycomp(kPdgAntiLambda), 1,0); // don't decay \bar{Lambda0}
257  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaM), 1,1); // decay Delta-
258  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_Delta0), 1,1); // decay Delta0
259  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaP), 1,1); // decay Delta+
260  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaPP), 1,1); // decay Delta++
261 
262  // -- hadronize --
263  py2ent_(&ip, &final_quark, &diquark, &W); // hadronizer
264 
265  // restore pythia decay settings so as not to interfere with decayer
266  fPythia->SetMDCY(fPythia->Pycomp(kPdgPi0), 1, pi0_decflag);
267  fPythia->SetMDCY(fPythia->Pycomp(kPdgK0), 1, K0_decflag);
268  fPythia->SetMDCY(fPythia->Pycomp(kPdgAntiK0), 1, K0b_decflag);
269  fPythia->SetMDCY(fPythia->Pycomp(kPdgLambda), 1, L0_decflag);
270  fPythia->SetMDCY(fPythia->Pycomp(kPdgAntiLambda), 1, L0b_decflag);
271  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaM), 1, Dm_decflag);
272  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_Delta0), 1, D0_decflag);
273  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaP), 1, Dp_decflag);
274  fPythia->SetMDCY(fPythia->Pycomp(kPdgP33m1232_DeltaPP), 1, Dpp_decflag);
275 
276  // get LUJETS record
277  fPythia->GetPrimaries();
278  TClonesArray * pythia_particles =
279  (TClonesArray *) fPythia->ImportParticles("All");
280 
281  // copy PYTHIA container to a new TClonesArray so as to transfer ownership
282  // of the container and of its elements to the calling method
283 
284  int np = pythia_particles->GetEntries();
285  assert(np>0);
286  TClonesArray * particle_list = new TClonesArray("TMCParticle", np);
287  particle_list->SetOwner(true);
288 
289  unsigned int i = 0;
290  TMCParticle * particle = 0;
291  TIter particle_iter(pythia_particles);
292 
293  while( (particle = (TMCParticle *) particle_iter.Next()) ) {
294  LOG("PythiaHad", pDEBUG)
295  << "Adding final state particle pdgc = " << particle->GetKF()
296  << " with status = " << particle->GetKS();
297 
298  if(particle->GetKS() == 1) {
299  if( pdg::IsQuark (particle->GetKF()) ||
300  pdg::IsDiQuark(particle->GetKF()) ) {
301  LOG("PythiaHad", pERROR)
302  << "Hadronization failed! Bare quark/di-quarks appear in final state!";
303  particle_list->Delete();
304  delete particle_list;
305  return 0;
306  }
307  }
308 
309  // fix numbering scheme used for mother/daughter assignments
310  particle->SetParent (particle->GetParent() - 1);
311  particle->SetFirstChild (particle->GetFirstChild() - 1);
312  particle->SetLastChild (particle->GetLastChild() - 1);
313 
314  // insert the particle in the list
315  new ( (*particle_list)[i++] ) TMCParticle(*particle);
316  }
317 
318  utils::fragmrec::Print(particle_list);
319  return particle_list;
320 }
const int kPdgP33m1232_DeltaPP
Definition: PDGCodes.h:91
const int kPdgUUDiquarkS1
Definition: PDGCodes.h:58
double W(bool selected=false) const
Definition: Kinematics.cxx:167
bool HitSeaQrk(void) const
Definition: Target.cxx:316
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:108
const XML_Char * target
Definition: expat.h:268
#define pERROR
Definition: Messenger.h:60
const int kPdgLambda
Definition: PDGCodes.h:69
bool IsUQuark(int pdgc)
Definition: PDGUtils.cxx:249
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
int HitNucPdg(void) const
Definition: Target.cxx:321
int HitQrkPdg(void) const
Definition: Target.cxx:259
const int kPdgUQuark
Definition: PDGCodes.h:42
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
TString ip
Definition: loadincs.C:5
bool IsSQuark(int pdgc)
Definition: PDGUtils.cxx:259
void py2ent_(int *, int *, int *, double *)
bool IsAntiSQuark(int pdgc)
Definition: PDGUtils.cxx:279
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
bool IsAntiDQuark(int pdgc)
Definition: PDGUtils.cxx:274
const int kPdgP33m1232_DeltaP
Definition: PDGCodes.h:90
const int kPdgP33m1232_DeltaM
Definition: PDGCodes.h:88
const int kPdgK0
Definition: PDGCodes.h:151
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
int iscc
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
const int kPdgUDDiquarkS1
Definition: PDGCodes.h:57
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:116
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
bool IsDiQuark(int pdgc)
Definition: PDGUtils.cxx:223
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
const int kPdgPi0
Definition: PDGCodes.h:137
const int kPdgDQuark
Definition: PDGCodes.h:44
const int kPdgAntiK0
Definition: PDGCodes.h:152
const int kPdgUDDiquarkS0
Definition: PDGCodes.h:56
const int kPdgP33m1232_Delta0
Definition: PDGCodes.h:89
bool IsEM(void) const
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition: RandomGen.h:54
bool HitQrkIsSet(void) const
Definition: Target.cxx:309
TPythia6 * fPythia
PYTHIA6 wrapper class.
bool IsDarkMatter(void) const
bool IsQuark(int pdgc)
Definition: PDGUtils.cxx:233
bool IsDQuark(int pdgc)
Definition: PDGUtils.cxx:254
void Print(const TClonesArray *const part_list)
assert(nhit_max >=nhit_nbins)
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
bool AssertValidity(const Interaction *i) const
#define pNOTICE
Definition: Messenger.h:62
const Target & Tgt(void) const
Definition: InitialState.h:67
const int kPdgAntiLambda
Definition: PDGCodes.h:70
void kinematics()
Definition: kinematics.C:10
#define W(x)
bool IsAntiUQuark(int pdgc)
Definition: PDGUtils.cxx:269
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64
const int kPdgDDDiquarkS1
Definition: PDGCodes.h:55
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 PythiaHadronization::Initialize ( void  ) const
virtual

Don't implement the HadronizationModelI interface Leave it for the concrete implementations (KNO, Pythia,...)

Implements genie::HadronizationModelBase.

Definition at line 63 of file PythiaHadronization.cxx.

References fPythia, and genie::RandomGen::Instance().

Referenced by PythiaHadronization().

64 {
65  fPythia = TPythia6::Instance();
66 
67  // sync GENIE/PYTHIA6 seed number
69 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
TPythia6 * fPythia
PYTHIA6 wrapper class.
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 PythiaHadronization::LoadConfig ( void  )
private

Definition at line 435 of file PythiaHadronization.cxx.

References ana::assert(), fDecayer, fGaussianPt2, fNonGaussianPt2Tail, fPythia, fRemainingECutoff, genie::HadronizationModelBase::fRvbnCCm2, genie::HadronizationModelBase::fRvbnCCm3, genie::HadronizationModelBase::fRvbnNCm2, genie::HadronizationModelBase::fRvbnNCm3, genie::HadronizationModelBase::fRvbpCCm2, genie::HadronizationModelBase::fRvbpCCm3, genie::HadronizationModelBase::fRvbpNCm2, genie::HadronizationModelBase::fRvbpNCm3, genie::HadronizationModelBase::fRvnCCm2, genie::HadronizationModelBase::fRvnCCm3, genie::HadronizationModelBase::fRvnNCm2, genie::HadronizationModelBase::fRvnNCm3, genie::HadronizationModelBase::fRvpCCm2, genie::HadronizationModelBase::fRvpCCm3, genie::HadronizationModelBase::fRvpNCm2, genie::HadronizationModelBase::fRvpNCm3, fSSBarSuppression, genie::HadronizationModelBase::fWcut, genie::Algorithm::GetConfig(), genie::Algorithm::GetParam(), LOG, pDEBUG, and genie::Algorithm::SubAlg().

Referenced by Configure().

436 {
437  // the configurable PYTHIA parameters used here are the ones used by NUX
438  // (see A.Rubbia's talk @ NuINT-01)
439  // The defaults are the values used by PYTHIA
440  // Use the NUX config set to set the tuned values as used in NUX.
441 
442  GetParam( "PYTHIA-SSBarSuppression", fSSBarSuppression ) ;
443  GetParam( "PYTHIA-GaussianPt2", fGaussianPt2 ) ;
444  GetParam( "PYTHIA-NonGaussianPt2Tail", fNonGaussianPt2Tail ) ;
445  GetParam( "PYTHIA-RemainingEnergyCutoff", fRemainingECutoff ) ;
446 
447  fPythia->SetPARJ(2, fSSBarSuppression);
448  fPythia->SetPARJ(21, fGaussianPt2);
449  fPythia->SetPARJ(23, fNonGaussianPt2Tail);
450  fPythia->SetPARJ(33, fRemainingECutoff);
451 
452  // Load Wcut determining the phase space area where the multiplicity prob.
453  // scaling factors would be applied -if requested-
454  GetParam( "Wcut", fWcut ) ;
455 
456  // decayer
457  fDecayer = 0;
458  if( GetConfig().Exists("Decayer") ) {
459  fDecayer = dynamic_cast<const DecayModelI *> (this->SubAlg("Decayer"));
460  assert(fDecayer);
461  }
462 
463  // Load NEUGEN multiplicity probability scaling parameters Rijk
464  //neutrinos
465  GetParam( "DIS-HMultWgt-vp-CC-m2", fRvpCCm2 ) ;
466  GetParam( "DIS-HMultWgt-vp-CC-m3", fRvpCCm3 ) ;
467  GetParam( "DIS-HMultWgt-vp-NC-m2", fRvpNCm2 ) ;
468  GetParam( "DIS-HMultWgt-vp-NC-m3", fRvpNCm3 ) ;
469  GetParam( "DIS-HMultWgt-vn-CC-m2", fRvnCCm2 ) ;
470  GetParam( "DIS-HMultWgt-vn-CC-m3", fRvnCCm3 ) ;
471  GetParam( "DIS-HMultWgt-vn-NC-m2", fRvnNCm2 ) ;
472  GetParam( "DIS-HMultWgt-vn-NC-m3", fRvnNCm3 ) ;
473  //Anti-neutrinos
474  GetParam( "DIS-HMultWgt-vbp-CC-m2", fRvbpCCm2 ) ;
475  GetParam( "DIS-HMultWgt-vbp-CC-m3", fRvbpCCm3 ) ;
476  GetParam( "DIS-HMultWgt-vbp-NC-m2", fRvbpNCm2 ) ;
477  GetParam( "DIS-HMultWgt-vbp-NC-m3", fRvbpNCm3 ) ;
478  GetParam( "DIS-HMultWgt-vbn-CC-m2", fRvbnCCm2 ) ;
479  GetParam( "DIS-HMultWgt-vbn-CC-m3", fRvbnCCm3 ) ;
480  GetParam( "DIS-HMultWgt-vbn-NC-m2", fRvbnNCm2 ) ;
481  GetParam( "DIS-HMultWgt-vbn-NC-m3", fRvbnNCm3 ) ;
482 
483  LOG("PythiaHad", pDEBUG) << GetConfig() ;
484 }
double fRvnCCm3
neugen&#39;s Rijk: vn, CC, multiplicity = 3
double fRvbpCCm3
neugen&#39;s Rijk: vbp, CC, multiplicity = 3
double fSSBarSuppression
ssbar suppression
double fRvnNCm2
neugen&#39;s Rijk: vn, NC, multiplicity = 2
double fRvbpCCm2
neugen&#39;s Rijk: vbp, CC, multiplicity = 2
double fRvpCCm2
neugen&#39;s Rijk: vp, CC, multiplicity = 2
const DecayModelI * fDecayer
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
double fRvbnNCm3
neugen&#39;s Rijk: vbn, NC, multiplicity = 3
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:254
double fRvpNCm2
neugen&#39;s Rijk: vp, NC, multiplicity = 2
double fGaussianPt2
gaussian pt2 distribution width
Pure abstract base class. Defines the DecayModelI interface to be implemented by any algorithmic clas...
Definition: DecayModelI.h:31
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
double fRvpNCm3
neugen&#39;s Rijk: vp, NC, multiplicity = 3
double fRvbnNCm2
neugen&#39;s Rijk: vbn, NC, multiplicity = 2
double fRvpCCm3
neugen&#39;s Rijk: vp, CC, multiplicity = 3
double fRvbpNCm2
neugen&#39;s Rijk: vbp, NC, multiplicity = 2
double fRvnNCm3
neugen&#39;s Rijk: vn, NC, multiplicity = 3
double fRemainingECutoff
remaining E cutoff for stopping fragmentation
TPythia6 * fPythia
PYTHIA6 wrapper class.
assert(nhit_max >=nhit_nbins)
double fWcut
configuration data common to all hadronizers
double fRvbnCCm3
neugen&#39;s Rijk: vbn, CC, multiplicity = 3
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fRvbpNCm3
neugen&#39;s Rijk: vbp, NC, multiplicity = 3
double fRvnCCm2
neugen&#39;s Rijk: vn, CC, multiplicity = 2
#define pDEBUG
Definition: Messenger.h:64
double fRvbnCCm2
neugen&#39;s Rijk: vbn, CC, multiplicity = 2
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:353
double HadronizationModelBase::MaxMult ( const Interaction i) const
protectedinherited

Definition at line 60 of file HadronizationModelBase.cxx.

References genie::Interaction::Kine(), genie::constants::kNeutronMass, genie::constants::kPionMass, W, and genie::Kinematics::W().

Referenced by MultiplicityProb(), and genie::KNOHadronization::MultiplicityProb().

61 {
62  double W = interaction->Kine().W();
63 
64  double maxmult = TMath::Floor(1 + (W-kNeutronMass)/kPionMass);
65  return maxmult;
66 }
static const double kNeutronMass
Definition: Constants.h:77
static const double kPionMass
Definition: Constants.h:74
#define W(x)
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
TH1D * PythiaHadronization::MultiplicityProb ( const Interaction interaction,
Option_t *  opt = "" 
) const
virtual

Implements genie::HadronizationModelBase.

Definition at line 352 of file PythiaHadronization.cxx.

References genie::HadronizationModelBase::ApplyRijk(), AssertValidity(), genie::HadronizationModelBase::CreateMultProbHist(), genie::HadronizationModelBase::fWcut, Hadronize(), iev, febshutoff_auto::integral, genie::Interaction::Kine(), kinematics(), LOG, genie::HadronizationModelBase::MaxMult(), getGoodRuns4SAM::n, pDEBUG, pINFO, pWARN, SLOG, W, genie::Kinematics::W(), Weight(), and ana::weight.

354 {
355 // Similar comments apply as in SelectParticles()
356 
357  if(!this->AssertValidity(interaction)) {
358  LOG("PythiaHad", pWARN)
359  << "Returning a null multipicity probability distribution!";
360  return 0;
361  }
362  double maxmult = this->MaxMult(interaction);
363  TH1D * mult_prob = this->CreateMultProbHist(maxmult);
364 
365  const int nev=500;
366  TMCParticle * particle = 0;
367 
368  for(int iev=0; iev<nev; iev++) {
369 
370  TClonesArray * particle_list = this->Hadronize(interaction);
371  double weight = this->Weight();
372 
373  if(!particle_list) { iev--; continue; }
374 
375  int n = 0;
376  TIter particle_iter(particle_list);
377  while ((particle = (TMCParticle *) particle_iter.Next()))
378  {
379  if (particle->GetKS()==1) n++;
380  }
381  particle_list->Delete();
382  delete particle_list;
383  mult_prob->Fill( (double)n, weight);
384  }
385 
386  double integral = mult_prob->Integral("width");
387  if(integral>0) {
388  // Normalize the probability distribution
389  mult_prob->Scale(1.0/integral);
390  } else {
391  SLOG("PythiaHad", pWARN) << "probability distribution integral = 0";
392  return mult_prob;
393  }
394 
395  string option(opt);
396 
397  bool apply_neugen_Rijk = option.find("+LowMultSuppr") != string::npos;
398  bool renormalize = option.find("+Renormalize") != string::npos;
399 
400  // Apply the NeuGEN probability scaling factors -if requested-
401  if(apply_neugen_Rijk) {
402  SLOG("KNOHad", pINFO) << "Applying NeuGEN scaling factors";
403  // Only do so for W<Wcut
404  const Kinematics & kinematics = interaction->Kine();
405  double W = kinematics.W();
406  if(W<fWcut) {
407  this->ApplyRijk(interaction, renormalize, mult_prob);
408  } else {
409  SLOG("PythiaHad", pDEBUG)
410  << "W = " << W << " < Wcut = " << fWcut
411  << " - Will not apply scaling factors";
412  }//<wcut?
413  }//apply?
414 
415  return mult_prob;
416 }
int iev
Definition: runWimpSim.h:118
double W(bool selected=false) const
Definition: Kinematics.cxx:167
double MaxMult(const Interaction *i) const
const Var weight
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
TH1D * CreateMultProbHist(double maxmult) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:63
#define pWARN
Definition: Messenger.h:61
void ApplyRijk(const Interaction *i, bool norm, TH1D *mp) const
double fWcut
configuration data common to all hadronizers
bool AssertValidity(const Interaction *i) const
TClonesArray * Hadronize(const Interaction *) const
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
void kinematics()
Definition: kinematics.C:10
#define W(x)
#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
PDGCodeList * PythiaHadronization::SelectParticles ( const Interaction interaction) const
virtual

Implements genie::HadronizationModelBase.

Definition at line 323 of file PythiaHadronization.cxx.

References Hadronize(), and genie::PDGCodeList::push_back().

325 {
326 // Works the opposite way (compared with the KNO hadronization model)
327 // Rather than having this method as one of the hadronization model components,
328 // we extract the list of particles from the fragmentation record after the
329 // hadronization has been completed.
330 
331  TClonesArray * particle_list = this->Hadronize(interaction);
332 
333  if(!particle_list) return 0;
334 
335  bool allowdup=true;
336  PDGCodeList * pdgcv = new PDGCodeList(allowdup);
337  pdgcv->reserve(particle_list->GetEntries());
338 
339  TMCParticle * particle = 0;
340  TIter particle_iter(particle_list);
341 
342  while ((particle = (TMCParticle *) particle_iter.Next()))
343  {
344  if (particle->GetKS()==1) pdgcv->push_back(particle->GetKF());
345  }
346  particle_list->Delete();
347  delete particle_list;
348 
349  return pdgcv;
350 }
A list of PDG codes.
Definition: PDGCodeList.h:33
TClonesArray * Hadronize(const Interaction *) const
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
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::COHElasticPXSec::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), 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::MartiniEricsonChanfrayMarteauMECPXSec2016::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::LwlynSmithFF::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
double PythiaHadronization::Weight ( void  ) const
virtual

Implements genie::HadronizationModelBase.

Definition at line 418 of file PythiaHadronization.cxx.

Referenced by MultiplicityProb().

419 {
420  return 1.; // does not generate weighted events
421 }
double HadronizationModelBase::Wmin ( void  ) const
protectedinherited

Various utility methods common to hadronization models.

Definition at line 55 of file HadronizationModelBase.cxx.

References genie::constants::kNucleonMass, and genie::constants::kPionMass.

Referenced by AssertValidity(), and genie::KNOHadronization::AssertValidity().

56 {
57  return (kNucleonMass+kPionMass);
58 }
static const double kNucleonMass
Definition: Constants.h:78
static const double kPionMass
Definition: Constants.h:74

Member Data Documentation

bool genie::Algorithm::fAllowReconfig
protectedinherited
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.

const DecayModelI* genie::PythiaHadronization::fDecayer
private

Definition at line 59 of file PythiaHadronization.h.

Referenced by LoadConfig().

double genie::PythiaHadronization::fGaussianPt2
private

gaussian pt2 distribution width

Definition at line 65 of file PythiaHadronization.h.

Referenced by LoadConfig().

AlgId genie::Algorithm::fID
protectedinherited

algorithm name and configuration set

Definition at line 156 of file Algorithm.h.

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

double genie::PythiaHadronization::fNonGaussianPt2Tail
private

non gaussian pt2 tail parameterization

Definition at line 66 of file PythiaHadronization.h.

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

TPythia6* genie::PythiaHadronization::fPythia
mutableprivate

PYTHIA6 wrapper class.

Definition at line 57 of file PythiaHadronization.h.

Referenced by Hadronize(), Initialize(), and LoadConfig().

double genie::PythiaHadronization::fRemainingECutoff
private

remaining E cutoff for stopping fragmentation

Definition at line 67 of file PythiaHadronization.h.

Referenced by LoadConfig().

double genie::HadronizationModelBase::fRvbnCCm2
protectedinherited

neugen's Rijk: vbn, CC, multiplicity = 2

Definition at line 68 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbnCCm3
protectedinherited

neugen's Rijk: vbn, CC, multiplicity = 3

Definition at line 69 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbnNCm2
protectedinherited

neugen's Rijk: vbn, NC, multiplicity = 2

Definition at line 70 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbnNCm3
protectedinherited

neugen's Rijk: vbn, NC, multiplicity = 3

Definition at line 71 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbpCCm2
protectedinherited

neugen's Rijk: vbp, CC, multiplicity = 2

Definition at line 64 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbpCCm3
protectedinherited

neugen's Rijk: vbp, CC, multiplicity = 3

Definition at line 65 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbpNCm2
protectedinherited

neugen's Rijk: vbp, NC, multiplicity = 2

Definition at line 66 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvbpNCm3
protectedinherited

neugen's Rijk: vbp, NC, multiplicity = 3

Definition at line 67 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvnCCm2
protectedinherited

neugen's Rijk: vn, CC, multiplicity = 2

Definition at line 60 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvnCCm3
protectedinherited

neugen's Rijk: vn, CC, multiplicity = 3

Definition at line 61 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvnNCm2
protectedinherited

neugen's Rijk: vn, NC, multiplicity = 2

Definition at line 62 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvnNCm3
protectedinherited

neugen's Rijk: vn, NC, multiplicity = 3

Definition at line 63 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvpCCm2
protectedinherited

neugen's Rijk: vp, CC, multiplicity = 2

Definition at line 56 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvpCCm3
protectedinherited

neugen's Rijk: vp, CC, multiplicity = 3

Definition at line 57 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvpNCm2
protectedinherited

neugen's Rijk: vp, NC, multiplicity = 2

Definition at line 58 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::HadronizationModelBase::fRvpNCm3
protectedinherited

neugen's Rijk: vp, NC, multiplicity = 3

Definition at line 59 of file HadronizationModelBase.h.

Referenced by genie::HadronizationModelBase::ApplyRijk(), LoadConfig(), and genie::KNOHadronization::LoadConfig().

double genie::PythiaHadronization::fSSBarSuppression
private

ssbar suppression

Definition at line 64 of file PythiaHadronization.h.

Referenced by LoadConfig().

AlgStatus_t genie::Algorithm::fStatus
protectedinherited

algorithm execution status

Definition at line 166 of file Algorithm.h.

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

double genie::HadronizationModelBase::fWcut
protectedinherited

configuration data common to all hadronizers

neugen's Rijk applied for W<Wcut (see DIS/RES join scheme)

Definition at line 55 of file HadronizationModelBase.h.

Referenced by LoadConfig(), genie::KNOHadronization::LoadConfig(), MultiplicityProb(), and genie::KNOHadronization::MultiplicityProb().


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