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

Generates the f/s hadronic system in v COH pi production interactions. Is a concrete implementation of the EventRecordVisitorI interface. More...

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

Inheritance diagram for genie::COHHadronicSystemGenerator:
genie::HadronicSystemGenerator genie::EventRecordVisitorI genie::Algorithm

Public Member Functions

 COHHadronicSystemGenerator ()
 
 COHHadronicSystemGenerator (string config)
 
 ~COHHadronicSystemGenerator ()
 
void ProcessEventRecord (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_ReinSehgal (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_BergerSehgal (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_BergerSehgalFM (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_AlvarezRuso (GHepRecord *event_rec) const
 
void AddTargetNucleusRemnant (GHepRecord *event_rec) const
 
void AddFinalHadronicSyst (GHepRecord *event_rec) const
 
void PreHadronTransportDecays (GHepRecord *event_rec) const
 
TLorentzVector Hadronic4pLAB (GHepRecord *event_rec) const
 
TLorentzVector MomentumTransferLAB (GHepRecord *event_rec) const
 
TVector3 HCM2LAB (GHepRecord *event_rec) const
 
int HadronShowerCharge (GHepRecord *event_rec) const
 
int ResonanceCharge (GHepRecord *event_rec) const
 
virtual void Configure (const Registry &config)
 
virtual 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)
 
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

const EventRecordVisitorIfPreINukeDecayer
 
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

int getPionPDGCodeFromXclTag (const XclsTag &xcls_tag) const
 

Detailed Description

Generates the f/s hadronic system in v COH pi production interactions. Is a concrete implementation of the EventRecordVisitorI interface.

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

October 03, 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 29 of file COHHadronicSystemGenerator.h.

Constructor & Destructor Documentation

COHHadronicSystemGenerator::COHHadronicSystemGenerator ( )

Definition at line 51 of file COHHadronicSystemGenerator.cxx.

51  :
52  HadronicSystemGenerator("genie::COHHadronicSystemGenerator")
53 {
54 
55 }
COHHadronicSystemGenerator::COHHadronicSystemGenerator ( string  config)

Definition at line 57 of file COHHadronicSystemGenerator.cxx.

57  :
58  HadronicSystemGenerator("genie::COHHadronicSystemGenerator", config)
59 {
60 
61 }
Definition: config.py:1
COHHadronicSystemGenerator::~COHHadronicSystemGenerator ( )

Definition at line 63 of file COHHadronicSystemGenerator.cxx.

64 {
65 
66 }

Member Function Documentation

void HadronicSystemGenerator::AddFinalHadronicSyst ( GHepRecord event_rec) const
inherited

Definition at line 60 of file HadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::HadronicSystemGenerator::Hadronic4pLAB(), genie::GHepRecord::HitNucleonPosition(), genie::Interaction::KinePtr(), genie::kIStDISPreFragmHadronicState, genie::kPdgHadronicSyst, LOG, make_associated_cosmic_defs::p4, genie::utils::print::P4AsString(), pNOTICE, genie::Kinematics::SetHadSystP4(), and genie::GHepRecord::Summary().

Referenced by genie::DISHadronicSystemGenerator::ProcessEventRecord().

61 {
62 // Adds a GHEP entry for the sum of the f/s hadronic system.
63 // Intended for DIS hadronic system generators.
64 
65  TLorentzVector p4 = this->Hadronic4pLAB(evrec);
66  LOG("HadronicVtx", pNOTICE) << "\n HadrSyst [LAB]: " << P4AsString(&p4);
67 
68  TLorentzVector v4(0,0,0,0);
69  int mom = evrec->HitNucleonPosition();
70 
71  evrec->AddParticle(
72  kPdgHadronicSyst, kIStDISPreFragmHadronicState, mom,-1,-1,-1, p4, v4);
73 
74  // update the interaction summary
75  evrec->Summary()->KinePtr()->SetHadSystP4(p4);
76 }
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:34
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pNOTICE
Definition: Messenger.h:62
const int kPdgHadronicSyst
Definition: PDGCodes.h:187
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
void HadronicSystemGenerator::AddTargetNucleusRemnant ( GHepRecord event_rec) const
inherited

Definition at line 78 of file HadronicSystemGenerator.cxx.

References genie::units::A, genie::GHepParticle::A(), genie::GHepRecord::AddParticle(), ana::assert(), E, genie::PDGLibrary::Find(), genie::GHepRecord::HitNucleon(), genie::PDGLibrary::Instance(), genie::pdg::IonPdgCode(), genie::pdg::IsProton(), genie::kIStStableFinalState, LOG, genie::GHepParticle::P4(), pDEBUG, genie::GHepParticle::Pdg(), pFATAL, pINFO, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), ana::Sqrt(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), Z, and genie::GHepParticle::Z().

80 {
81 // add the remnant nuclear target at the GHEP record
82 
83  LOG("HadronicVtx", pDEBUG) << "Adding final state nucleus";
84 
85  //-- skip for non nuclear targets
86  GHepParticle * nucleus = evrec->TargetNucleus();
87  if (!nucleus) {
88  LOG("HadronicVtx", pDEBUG)
89  << "Initial state not a nucleus - no remnant nucleus to add";
90  return;
91  }
92 
93  //-- compute A,Z for final state nucleus & get its PDG code and its mass
94  GHepParticle * nucleon = evrec->HitNucleon();
95  assert(nucleon);
96  int npdgc = nucleon->Pdg();
97  bool is_p = pdg::IsProton(npdgc);
98  int A = nucleus->A();
99  int Z = nucleus->Z();
100  if (is_p) Z--;
101  A--;
102  TParticlePDG * particle = 0;
103  int ipdgc = pdg::IonPdgCode(A, Z);
104  particle = PDGLibrary::Instance()->Find(ipdgc);
105  if(!particle) {
106  LOG("HadronicVtx", pFATAL)
107  << "No particle with [A = " << A << ", Z = " << Z
108  << ", pdgc = " << ipdgc << "] in PDGLibrary!";
109  assert(particle);
110  }
111  double Mf = particle->Mass(); // remnant nucleus rest mass
112  double Mf2 = TMath::Power(Mf,2);
113 
114  //-- Has opposite momentum from the struck nucleon
115  double px = -1.* nucleon->Px();
116  double py = -1.* nucleon->Py();
117  double pz = -1.* nucleon->Pz();
118  double E = TMath::Sqrt(Mf2 + nucleon->P4()->Vect().Mag2());
119 
120  //-- Add the nucleus to the event record
121  LOG("HadronicVtx", pINFO)
122  << "Adding nucleus [A = " << A << ", Z = " << Z
123  << ", pdgc = " << ipdgc << "]";
124 
125  int mom = evrec->TargetNucleusPosition();
126  evrec->AddParticle(
127  ipdgc,kIStStableFinalState, mom,-1,-1,-1, px,py,pz,E, 0,0,0,0);
128 }
int Z(void) const
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
#define pFATAL
Definition: Messenger.h:57
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
Float_t Z
Definition: plot.C:38
int Pdg(void) const
Definition: GHepParticle.h:64
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:299
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
Float_t E
Definition: plot.C:20
#define pINFO
Definition: Messenger.h:63
static const double A
Definition: Units.h:82
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:69
assert(nhit_max >=nhit_nbins)
int A(void) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
#define pDEBUG
Definition: Messenger.h:64
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
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 COHHadronicSystemGenerator::CalculateHadronicSystem_AlvarezRuso ( GHepRecord event_rec) const

Definition at line 338 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), exit(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::Kinematics::HadSystP4(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), kinematics(), genie::kIStStableFinalState, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, LOG, genie::GHepParticle::Pdg(), pFATAL, genie::GHepRecord::Probe(), genie::Interaction::ProcInfo(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::GHepRecord::Summary(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

339 {
340  Interaction * interaction = evrec->Summary();
341  const Kinematics & kinematics = interaction -> Kine();
342  GHepParticle * nu = evrec->Probe();
343  GHepParticle * Ni = evrec->TargetNucleus();
344  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
345 
346  // Pion
347  const TLorentzVector ppi = kinematics.HadSystP4();
348  const TVector3 ppi3 = ppi.Vect();
349  const double Epi = ppi.E();
350  int pion_pdgc=0;
351  if ( interaction->ProcInfo().IsWeakCC() ) {
352  if( nu->Pdg() > 0 ){ // neutrino
353  pion_pdgc = kPdgPiP;
354  }
355  else{ // anti-neutrino
356  pion_pdgc = kPdgPiM;
357  }
358  }
359  else if ( interaction->ProcInfo().IsWeakNC() ) {
360  pion_pdgc = kPdgPi0;
361  }
362  else{
363  LOG("COHHadronicSystemGeneratorAR", pFATAL)
364  << "Could not determine pion involved in interaction";
365  exit(1);
366  }
367 
368  //
369  // Nucleus
370  int nucl_pdgc = Ni->Pdg(); // pdg of final nucleus same as the initial nucleus
371  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
372  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
373  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
374  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
375  //
376  // Both
377  const TLorentzVector & vtx = *(nu->X4());
378  int mom = evrec->TargetNucleusPosition();
379 
380  //
381  // Fill the records
382  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
383  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
384 
385  evrec->AddParticle(pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
386  ppi3.Px(), ppi3.Py(),ppi3.Pz(),Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
387 }
bool IsWeakCC(void) const
double E(void) const
Get energy.
Definition: GHepParticle.h:92
#define pFATAL
Definition: Messenger.h:57
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
const TLorentzVector & HadSystP4(void) const
Definition: Kinematics.h:67
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
int Pdg(void) const
Definition: GHepParticle.h:64
Summary information for an interaction.
Definition: Interaction.h:56
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 kPdgPiP
Definition: PDGCodes.h:135
const int kPdgPi0
Definition: PDGCodes.h:137
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
exit(0)
const int kPdgPiM
Definition: PDGCodes.h:136
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
void kinematics()
Definition: kinematics.C:10
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
void COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgal ( GHepRecord event_rec) const

Definition at line 104 of file COHHadronicSystemGenerator.cxx.

References CalculateHadronicSystem_ReinSehgal().

Referenced by ProcessEventRecord().

105 {
106  // Treatment of the hadronic side is identical to Rein-Sehgal if we assume an infinite
107  // mass for the nucleus.
109 }
void CalculateHadronicSystem_ReinSehgal(GHepRecord *event_rec) const
void COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgalFM ( GHepRecord event_rec) const

Definition at line 111 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), ana::assert(), E, genie::GHepParticle::E(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), getPionPDGCodeFromXclTag(), genie::PDGLibrary::Instance(), genie::RandomGen::Instance(), genie::Interaction::Kine(), genie::kIStStableFinalState, kPi, genie::Target::Mass(), genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pERROR, pINFO, genie::GHepRecord::Probe(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::Kinematics::Q2(), genie::utils::kinematics::Q2(), generate_hists::rnd, genie::RandomGen::RndHadro(), SLOG, std::sqrt(), ana::Sqrt(), genie::GHepRecord::Summary(), genie::Kinematics::t(), confusionMatrixTree::t, genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), genie::InitialState::Tgt(), genie::GHepParticle::X4(), genie::Kinematics::y(), and submit_syst::y.

Referenced by ProcessEventRecord().

112 {
113  //
114  // This method generates the final state hadronic system (pion + nucleus) in
115  // COH interactions
116  //
118 
119  Interaction * interaction = evrec->Summary();
120  const XclsTag & xcls_tag = interaction->ExclTag();
121  const InitialState & init_state = interaction -> InitState();
122 
123  //-- Access neutrino, initial nucleus and final state prim. lepton entries
124  GHepParticle * nu = evrec->Probe();
125  GHepParticle * Ni = evrec->TargetNucleus();
126  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
127  assert(nu);
128  assert(Ni);
129  assert(fsl);
130 
131  const TLorentzVector & vtx = *(nu->X4());
132  const TLorentzVector & p4nu = *(nu ->P4());
133  const TLorentzVector & p4fsl = *(fsl->P4());
134 
135  //-- Determine the pdg code of the final state pion & nucleus
136  int nucl_pdgc = Ni->Pdg(); // same as the initial nucleus
137  int pion_pdgc = getPionPDGCodeFromXclTag(xcls_tag);
138 
139  //-- basic kinematic inputs
140  double E = nu->E();
141  double Q2 = interaction->Kine().Q2(true);
142  double y = interaction->Kine().y(true);
143  double t = interaction->Kine().t(true);
144  double MA = init_state.Tgt().Mass();
145  // double MA2 = TMath::Power(MA, 2.); // Unused
146  double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass();
147  double mpi2 = TMath::Power(mpi,2);
148 
149  SLOG("COHHadronicVtx", pINFO)
150  << "Ev = "<< E << ", Q^2 = " << Q2
151  << ", y = " << y << ", t = " << t;
152 
153  double Epi = y * E - t / (2 * MA);
154  double ppi2 = Epi * Epi - mpi2;
155  double ppi = ppi2 > 0.0 ? TMath::Sqrt(ppi2) : 0.0;
156 
157  double costheta = (t - Q2 - mpi2) / (2 * ( (y *E - Epi) * Epi -
158  ppi * sqrt(TMath::Power(y * E - Epi, 2.) + t) ) );
159 
160  if ((costheta > 1.0) || (costheta < -1.0)) {
161  SLOG("COHHadronicVtx", pERROR)
162  << "Unphysical pion angle!";
163  }
164 
165  double sintheta = TMath::Sqrt(1 - costheta * costheta);
166 
167  //-- first work in the c.m.s. frame
168  // double S = 2 * MA * nuh - Q2 + MA2;
169  // double S_2 = S >= 0 ? TMath::Sqrt(S) : 0.0; // TODO - Error here?
170  // double Pcm = MA * TMath::Sqrt( (nuh*nuh + Q2)/S );
171  // double Epi = (S + mpi2 - MA2)/(2 * S_2);
172  // double EAprime = (S - mpi2 + MA2)/(2 * S_2);
173  // double EA = (S + MA2 + Q2)/(2 * S_2);
174  // double PAprime2 = TMath::Power(EAprime,2.0) - MA2;
175  // double PAprime = TMath::Sqrt(PAprime2);
176  // double tA = TMath::Power((EAprime - EA),2.0) - TMath::Power(PAprime,2.0) -
177  // TMath::Power(Pcm, 2.0);
178  // double tB = 2 * Pcm * PAprime;
179  // double cosT = (t - tA)/tB;
180  // double sinT = TMath::Sqrt(1 - cosT*cosT);
181  // double PAz = PAprime * cosT;
182  // double PAperp = PAprime * sinT;
183  // double PPiz = -PAz;
184 
185  // Randomize transverse components
186  double phi = 2 * kPi * rnd->RndHadro().Rndm();
187  double ppix = ppi * sintheta * TMath::Cos(phi);
188  double ppiy = ppi * sintheta * TMath::Sin(phi);
189  double ppiz = ppi * costheta;
190 
191  // boost back to the lab frame
192  // double beta = TMath::Sqrt( nuh*nuh + Q2 )/(nuh + MA);
193  // double gamma = (nuh + MA)/TMath::Sqrt(S);
194  // double betagamma = beta * gamma;
195 
196  // double epi = gamma*Epi + betagamma*PPiz;
197  // double ppiz = betagamma*Epi + gamma*PPiz;
198 
199  // double ea = gamma*EAprime + betagamma*PAz;
200  // double paz = betagamma*EAprime + gamma*PAz;
201 
202  // Now rotate so our axes are aligned with the lab instead of q
203  TLorentzVector q = p4nu - p4fsl;
204  TVector3 ppi3(ppix, ppiy, ppiz);
205  ppi3.RotateUz(q.Vect().Unit());
206 
207  // Nucleus...
208  // TVector3 pa(PAx,PAy,paz);
209  // pa.RotateUz(q.Vect().Unit());
210 
211  // now figure out the f/s nucleus 4-p
212 
213  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
214  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
215  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
216  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
217 
218  //-- Save the particles at the GHEP record
219 
220  int mom = evrec->TargetNucleusPosition();
221 
222  // Nucleus - need to balance overall 4-momentum
223  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
224  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
225 
226  // evrec->AddParticle(
227  // nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
228  // pa.Px(), pa.Py(), pa.Pz(), ea, 0, 0, 0, 0);
229 
230  evrec->AddParticle(
231  pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
232  ppi3.Px(), ppi3.Py(), ppi3.Pz(), Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
233 }
const double kPi
#define pERROR
Definition: Messenger.h:60
double E(void) const
Get energy.
Definition: GHepParticle.h:92
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
int getPionPDGCodeFromXclTag(const XclsTag &xcls_tag) const
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
T sqrt(T number)
Definition: d0nt_math.hpp:156
double Mass(void) const
Definition: Target.cxx:241
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:37
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
double y(bool selected=false) const
Definition: Kinematics.cxx:122
int Pdg(void) const
Definition: GHepParticle.h:64
Summary information for an interaction.
Definition: Interaction.h:56
Float_t E
Definition: plot.C:20
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:63
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition: RandomGen.h:54
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
double t(bool selected=false) const
Definition: Kinematics.cxx:180
double Q2(bool selected=false) const
Definition: Kinematics.cxx:135
const Target & Tgt(void) const
Definition: InitialState.h:67
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
Initial State information.
Definition: InitialState.h:49
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
void COHHadronicSystemGenerator::CalculateHadronicSystem_ReinSehgal ( GHepRecord event_rec) const

Definition at line 235 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), ana::assert(), E, genie::GHepParticle::E(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), getPionPDGCodeFromXclTag(), genie::PDGLibrary::Instance(), genie::RandomGen::Instance(), genie::Interaction::Kine(), genie::kIStStableFinalState, genie::constants::kNucleonMass, kPi, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), genie::GHepParticle::Pdg(), pINFO, genie::GHepRecord::Probe(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), generate_hists::rnd, genie::RandomGen::RndHadro(), SLOG, ana::Sqrt(), genie::GHepRecord::Summary(), genie::Kinematics::t(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), genie::utils::print::Vec3AsString(), genie::Kinematics::x(), genie::GHepParticle::X4(), and genie::Kinematics::y().

Referenced by CalculateHadronicSystem_BergerSehgal(), and ProcessEventRecord().

236 {
237  //
238  // This method generates the final state hadronic system (pion + nucleus) in
239  // COH interactions
240  //
242 
243  Interaction * interaction = evrec->Summary();
244  const XclsTag & xcls_tag = interaction->ExclTag();
245 
246  //-- Access neutrino, initial nucleus and final state prim. lepton entries
247  GHepParticle * nu = evrec->Probe();
248  GHepParticle * Ni = evrec->TargetNucleus();
249  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
250  assert(nu);
251  assert(Ni);
252  assert(fsl);
253 
254  const TLorentzVector & vtx = *(nu->X4());
255  const TLorentzVector & p4nu = *(nu ->P4());
256  const TLorentzVector & p4fsl = *(fsl->P4());
257 
258  //-- Determine the pdg code of the final state pion & nucleus
259  int nucl_pdgc = Ni->Pdg(); // same as the initial nucleus
260  int pion_pdgc = getPionPDGCodeFromXclTag(xcls_tag);
261 
262  //-- basic kinematic inputs
263  double E = nu->E();
264  double M = kNucleonMass;
265  double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass();
266  double mpi2 = TMath::Power(mpi,2);
267  double xo = interaction->Kine().x(true);
268  double yo = interaction->Kine().y(true);
269  double to = interaction->Kine().t(true);
270 
271  SLOG("COHHadronicVtx", pINFO)
272  << "Ev = "<< E << ", xo = " << xo
273  << ", yo = " << yo << ", to = " << to;
274 
275  //-- compute pion energy and |momentum|
276  double Epi = yo * E;
277  double Epi2 = TMath::Power(Epi,2);
278  double ppi2 = Epi2-mpi2;
279  double ppi = TMath::Sqrt(TMath::Max(0.,ppi2));
280 
281  SLOG("COHHadronicVtx", pINFO)
282  << "f/s pion E = " << Epi << ", |p| = " << ppi;
283  assert(Epi>mpi);
284 
285  //-- 4-momentum transfer q=p(neutrino) - p(f/s lepton)
286  // Note: m^2 = q^2 < 0
287  // Also, since the nucleus is heavy all energy loss is comminicated to
288  // the outgoing pion Rein & Sehgal, Nucl.Phys.B223.29-44(1983), p.35
289 
290  TLorentzVector q = p4nu - p4fsl;
291 
292  SLOG("COHHadronicVtx", pINFO)
293  << "\n 4-p transfer q @ LAB: " << utils::print::P4AsString(&q);
294 
295  //-- find angle theta between q and ppi (xi=costheta)
296  // note: t=|(ppi-q)^2|, Rein & Sehgal, Nucl.Phys.B223.29-44(1983), p.36
297 
298  double xi = 1. + M*xo/Epi - 0.5*mpi2/Epi2 - 0.5*to/Epi2;
299  xi /= TMath::Sqrt((1.+2.*M*xo/Epi)*(1.-mpi2/Epi2));
300 
301  double costheta = xi;
302  double sintheta = TMath::Sqrt(TMath::Max(0.,1.-xi*xi));
303 
304  SLOG("COHHadronicVtx", pINFO) << "cos(pion, q) = " << costheta;
305 
306  // compute transverse and longitudinal ppi components along q
307  double ppiL = ppi*costheta;
308  double ppiT = ppi*sintheta;
309 
310  double phi = 2*kPi* rnd->RndHadro().Rndm();
311 
312  TVector3 ppi3(0,ppiT,ppiL);
313 
314  ppi3.RotateZ(phi); // randomize transverse components
315  ppi3.RotateUz(q.Vect().Unit()); // align longit. component with q in LAB
316 
317  SLOG("COHHadronicVtx", pINFO)
318  << "Pion 3-p @ LAB: " << utils::print::Vec3AsString(&ppi3);
319 
320  // now figure out the f/s nucleus 4-p
321 
322  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
323  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
324  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
325  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
326 
327  //-- Save the particles at the GHEP record
328 
329  int mom = evrec->TargetNucleusPosition();
330 
331  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
332  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
333 
334  evrec->AddParticle(pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
335  ppi3.Px(), ppi3.Py(),ppi3.Pz(),Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
336 }
const double kPi
double E(void) const
Get energy.
Definition: GHepParticle.h:92
static const double kNucleonMass
Definition: Constants.h:78
int getPionPDGCodeFromXclTag(const XclsTag &xcls_tag) const
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:34
double x(bool selected=false) const
Definition: Kinematics.cxx:109
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:37
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
double y(bool selected=false) const
Definition: Kinematics.cxx:122
int Pdg(void) const
Definition: GHepParticle.h:64
Summary information for an interaction.
Definition: Interaction.h:56
Float_t E
Definition: plot.C:20
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:63
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition: RandomGen.h:54
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
double t(bool selected=false) const
Definition: Kinematics.cxx:180
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:87
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
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 Algorithm::Configure ( const Registry config)
virtualinherited

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 in genie::NewQELXSec, genie::KNOHadronization, genie::ReinSehgalSPPPXSec, genie::Intranuke, genie::Intranuke2018, genie::SmithMonizUtils, genie::LocalFGM, genie::NievesQELCCPXSec, genie::GRV98LO, genie::BSKLNBaseRESPXSec2014, genie::BBA07ELFormFactorsModel, genie::NuclearModelMap, genie::SmithMonizQELCCPXSec, genie::ReinSehgalRESPXSec, genie::ReinSehgalSPPXSec, genie::KovalenkoQELCharmPXSec, genie::MartiniEricsonChanfrayMarteauMECPXSec2016, genie::BardinIMDRadCorPXSec, genie::ReinSehgalRESXSecFast, genie::EventGenerator, genie::CharmHadronization, genie::LHAPDF6, genie::QELEventGeneratorSM, genie::ReinSehgalCOHPiPXSec, genie::NievesSimoVacasMECPXSec2016, genie::FGMBodekRitchie, genie::SpectralFunc1d, genie::PaisQELLambdaPXSec, genie::QPMDISStrucFuncBase, genie::EffectiveSF, genie::NuElectronPXSec, genie::LwlynSmithFF, genie::ReinSehgalRESXSec, genie::BergerSehgalCOHPiPXSec2015, genie::SmithMonizQELCCXSec, genie::QPMDMDISPXSec, genie::SpectralFunc, genie::LHAPDF5, genie::LwlynSmithQELCCPXSec, genie::BergerSehgalFMCOHPiPXSec2015, genie::BBA03ELFormFactorsModel, genie::BBA05ELFormFactorsModel, genie::AhrensDMELPXSec, genie::OutgoingDarkGenerator, genie::KLVOxygenIBDPXSec, genie::IMDAnnihilationPXSec, genie::NuElectronXSec, genie::P33PaschosLalakulichPXSec, genie::DMDISInteractionListGenerator, genie::AivazisCharmPXSecLO, genie::AlvarezRusoCOHPiPXSec, genie::QPMDISPXSec, genie::DFRXSec, genie::StrumiaVissaniIBDPXSec, genie::NNBarOscPrimaryVtxGenerator, genie::PauliBlocker, genie::RESHadronicSystemGenerator, genie::DMDISKinematicsGenerator, genie::PrimaryLeptonGenerator, genie::BYPDF, genie::MECGenerator, genie::RosenbluthPXSec, genie::DISInteractionListGenerator, genie::ReinDFRPXSec, genie::KNOPythiaHadronization, genie::PythiaHadronization, genie::MECXSec, genie::QELEventGenerator, genie::AhrensNCELPXSec, genie::TransverseEnhancementFFModel, genie::AlamSimoAtharVacasSKXSec, genie::SlowRsclCharmDISPXSecLO, genie::UnstableParticleDecayer, genie::DISKinematicsGenerator, genie::NucBindEnergyAggregator, genie::ZExpAxialFormFactorModel, genie::AlamSimoAtharVacasSKPXSec2014, genie::H3AMNuGammaPXSec, genie::COHElasticPXSec, genie::CollinsSpillerFragm, genie::PetersonFragm, genie::EmpiricalMECPXSec2015, genie::KuzminNaumov2016AxialFormFactorModel, genie::RSPPResonanceSelector, genie::DMELKinematicsGenerator, genie::DMELXSec, genie::COHKinematicsGenerator, genie::IBDKinematicsGenerator, genie::NucleonDecayPrimaryVtxGenerator, genie::DMELInteractionListGenerator, genie::DMDISXSec, genie::FermiMover, genie::RESKinematicsGenerator, genie::RSPPInteractionListGenerator, genie::PhysInteractionSelector, genie::COHElKinematicsGenerator, genie::COHInteractionListGenerator, genie::Decayer, genie::DISHadronicSystemGenerator, genie::IBDInteractionListGenerator, genie::IBDXSecMap, genie::QELKinematicsGenerator, genie::DipoleAxialFormFactorModel, genie::DipoleELFormFactorsModel, genie::QELXSec, genie::RESInteractionListGenerator, genie::RSHelicityAmplModelNCn, genie::RSHelicityAmplModelNCp, genie::SKInteractionListGenerator, genie::SKKinematicsGenerator, genie::VertexGenerator, genie::DFRInteractionListGenerator, genie::DFRKinematicsGenerator, genie::GLRESGenerator, genie::HadronTransporter, genie::MECInteractionListGenerator, genie::NuEInteractionListGenerator, genie::NuEKinematicsGenerator, genie::QELInteractionListGenerator, genie::COHXSec, genie::DISXSec, genie::INukeDeltaPropg, genie::RESXSec, genie::COHXSecAR, genie::IMDXSec, and genie::BYStrucFunc.

Definition at line 70 of file Algorithm.cxx.

References gen_flatrecord::config, Configure(), genie::Algorithm::Id(), genie::AlgId::Key(), LOG, genie::Registry::Name(), genie::Registry::NEntries(), pERROR, and pNOTICE.

Referenced by genie::COHXSecAR::Configure(), genie::IMDXSec::Configure(), genie::INukeDeltaPropg::Configure(), genie::DISXSec::Configure(), genie::COHXSec::Configure(), genie::RESXSec::Configure(), genie::GLRESGenerator::Configure(), genie::QELInteractionListGenerator::Configure(), genie::MECInteractionListGenerator::Configure(), genie::NuEInteractionListGenerator::Configure(), genie::DFRInteractionListGenerator::Configure(), genie::DFRKinematicsGenerator::Configure(), genie::NuEKinematicsGenerator::Configure(), genie::HadronTransporter::Configure(), genie::VertexGenerator::Configure(), genie::COHElKinematicsGenerator::Configure(), genie::DISHadronicSystemGenerator::Configure(), genie::Decayer::Configure(), genie::COHInteractionListGenerator::Configure(), genie::QELKinematicsGenerator::Configure(), genie::DipoleAxialFormFactorModel::Configure(), genie::DipoleELFormFactorsModel::Configure(), genie::PhysInteractionSelector::Configure(), genie::QELXSec::Configure(), genie::SKKinematicsGenerator::Configure(), genie::RESInteractionListGenerator::Configure(), genie::IBDInteractionListGenerator::Configure(), genie::IBDXSecMap::Configure(), genie::RSHelicityAmplModelNCn::Configure(), genie::RSHelicityAmplModelNCp::Configure(), genie::SKInteractionListGenerator::Configure(), genie::DMELInteractionListGenerator::Configure(), genie::FermiMover::Configure(), genie::DMDISXSec::Configure(), genie::RESKinematicsGenerator::Configure(), genie::RSPPInteractionListGenerator::Configure(), genie::NucleonDecayPrimaryVtxGenerator::Configure(), genie::DMELKinematicsGenerator::Configure(), genie::COHKinematicsGenerator::Configure(), genie::IBDKinematicsGenerator::Configure(), genie::DMELXSec::Configure(), genie::EmpiricalMECPXSec2015::Configure(), genie::RSPPResonanceSelector::Configure(), genie::CollinsSpillerFragm::Configure(), genie::COHElasticPXSec::Configure(), genie::KuzminNaumov2016AxialFormFactorModel::Configure(), genie::PetersonFragm::Configure(), genie::H3AMNuGammaPXSec::Configure(), genie::AlamSimoAtharVacasSKPXSec2014::Configure(), genie::UnstableParticleDecayer::Configure(), genie::DISKinematicsGenerator::Configure(), genie::SlowRsclCharmDISPXSecLO::Configure(), genie::ZExpAxialFormFactorModel::Configure(), genie::NucBindEnergyAggregator::Configure(), genie::MECXSec::Configure(), genie::DISInteractionListGenerator::Configure(), genie::AlamSimoAtharVacasSKXSec::Configure(), genie::QELEventGenerator::Configure(), genie::ReinDFRPXSec::Configure(), genie::AhrensNCELPXSec::Configure(), genie::KNOPythiaHadronization::Configure(), genie::PythiaHadronization::Configure(), genie::TransverseEnhancementFFModel::Configure(), genie::PrimaryLeptonGenerator::Configure(), genie::BYPDF::Configure(), genie::DMDISKinematicsGenerator::Configure(), genie::MECGenerator::Configure(), genie::RosenbluthPXSec::Configure(), genie::AivazisCharmPXSecLO::Configure(), genie::NNBarOscPrimaryVtxGenerator::Configure(), genie::DFRXSec::Configure(), genie::RESHadronicSystemGenerator::Configure(), genie::PauliBlocker::Configure(), genie::DMDISInteractionListGenerator::Configure(), genie::StrumiaVissaniIBDPXSec::Configure(), genie::QPMDISPXSec::Configure(), genie::AlvarezRusoCOHPiPXSec::Configure(), genie::IMDAnnihilationPXSec::Configure(), genie::NuElectronXSec::Configure(), genie::OutgoingDarkGenerator::Configure(), genie::P33PaschosLalakulichPXSec::Configure(), genie::KLVOxygenIBDPXSec::Configure(), genie::AhrensDMELPXSec::Configure(), genie::BBA05ELFormFactorsModel::Configure(), genie::BBA03ELFormFactorsModel::Configure(), genie::BergerSehgalFMCOHPiPXSec2015::Configure(), genie::SpectralFunc::Configure(), genie::LHAPDF5::Configure(), genie::LwlynSmithQELCCPXSec::Configure(), genie::QPMDMDISPXSec::Configure(), genie::BergerSehgalCOHPiPXSec2015::Configure(), genie::SmithMonizQELCCXSec::Configure(), genie::ReinSehgalRESXSec::Configure(), genie::QPMDISStrucFuncBase::Configure(), genie::LwlynSmithFF::Configure(), genie::NuElectronPXSec::Configure(), genie::EffectiveSF::Configure(), genie::FGMBodekRitchie::Configure(), genie::PaisQELLambdaPXSec::Configure(), genie::NievesSimoVacasMECPXSec2016::Configure(), genie::SpectralFunc1d::Configure(), genie::ReinSehgalCOHPiPXSec::Configure(), genie::CharmHadronization::Configure(), genie::LHAPDF6::Configure(), genie::EventGenerator::Configure(), genie::QELEventGeneratorSM::Configure(), genie::BardinIMDRadCorPXSec::Configure(), genie::KovalenkoQELCharmPXSec::Configure(), genie::MartiniEricsonChanfrayMarteauMECPXSec2016::Configure(), genie::ReinSehgalRESXSecFast::Configure(), genie::SmithMonizQELCCPXSec::Configure(), genie::ReinSehgalRESPXSec::Configure(), genie::NuclearModelMap::Configure(), genie::ReinSehgalSPPXSec::Configure(), genie::BBA07ELFormFactorsModel::Configure(), genie::GRV98LO::Configure(), genie::BSKLNBaseRESPXSec2014::Configure(), genie::HAIntranuke::Configure(), genie::NievesQELCCPXSec::Configure(), genie::LocalFGM::Configure(), genie::SmithMonizUtils::Configure(), genie::Intranuke::Configure(), genie::Intranuke2018::Configure(), genie::ReinSehgalSPPPXSec::Configure(), genie::KNOHadronization::Configure(), genie::NewQELXSec::Configure(), genie::AlgFactory::ForceReconfiguration(), genie::AlgFactory::InstantiateAlgorithm(), testReconfigInOwnedModules(), and testXsec().

71 {
72 // Configure the Algorithm using the input configuration Registry
73 
74  LOG("Algorithm", pNOTICE) << "Input configuration: " << config;
75 
76  if ( config.NEntries() <= 0 ) {
77 
78  LOG("Algorithm", pNOTICE) "Registry " << config.Name() << " is empty. Not added to " << fID.Name();
79  return;
80  }
81 
82  Registry* rp = ExtractLocalConfig( config ) ;
83  if ( rp ) {
84 
85  MergeTopRegistry( *rp ) ;
86  LOG("Algorithm", pNOTICE) << fID.Name() << " merged with external configuration: " << *rp;
87 
88  // The memory handled by this pointer has been copied and needs to be cleared
89  delete rp ;
90  }
91 
92  if(!fOwnsSubstruc) return; // doesn't own substructure
93  if(fOwnedSubAlgMp->size()==0) return; // no sub-algorithms
94 
95  LOG("Algorithm", pNOTICE) << "Configuring algorithms stored at local pool";
96 
97  // loop over local pool algorithms
98 
99  for( AlgMapIter alg_iter = fOwnedSubAlgMp->begin();
100  alg_iter != fOwnedSubAlgMp->end(); ++alg_iter) {
101 
102  string alg_key = alg_iter->first;
103  Algorithm * alg = alg_iter->second;
104 
105  if(!alg) {
106  LOG("Algorithm", pERROR)
107  << "Key: " << alg_key << " points to a null algorithm at local pool";
108  continue;
109  }
110 
111  LOG("Algorithm", pNOTICE) << "Configuring sub-alg: " << alg->Id().Key();
112 
113  rp = ExtractLowerConfig( config, alg_key ) ;
114  if ( rp ) {
115 
116  alg -> Configure( *rp ) ;
117 
118  delete rp ;
119 
120  }
121 
122  }
123 
124 }
#define pERROR
Definition: Messenger.h:60
Registry * ExtractLowerConfig(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...
Definition: Algorithm.cxx:549
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
int MergeTopRegistry(const Registry &r)
Definition: Algorithm.cxx:618
Algorithm abstract base class.
Definition: Algorithm.h:54
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
string Name(void) const
get the registry name
Definition: Registry.cxx:612
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
string Name(void) const
Definition: AlgId.h:45
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
Registry * ExtractLocalConfig(const Registry &in) const
Definition: Algorithm.cxx:518
#define pNOTICE
Definition: Messenger.h:62
map< string, Algorithm * >::iterator AlgMapIter
Definition: Algorithm.h:50
string Key(void) const
Definition: AlgId.h:47
int NEntries(void) const
get number of items
Definition: Registry.cxx:597
void Algorithm::Configure ( string  config)
virtualinherited

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 in genie::KNOHadronization, genie::ReinSehgalSPPPXSec, genie::Intranuke, genie::Intranuke2018, genie::SmithMonizUtils, genie::LocalFGM, genie::NievesQELCCPXSec, genie::HAIntranuke, genie::GRV98LO, genie::BSKLNBaseRESPXSec2014, genie::BBA07ELFormFactorsModel, genie::NuclearModelMap, genie::SmithMonizQELCCPXSec, genie::ReinSehgalRESPXSec, genie::ReinSehgalSPPXSec, genie::KovalenkoQELCharmPXSec, genie::MartiniEricsonChanfrayMarteauMECPXSec2016, genie::BardinIMDRadCorPXSec, genie::ReinSehgalRESXSecFast, genie::EventGenerator, genie::CharmHadronization, genie::LHAPDF6, genie::QELEventGeneratorSM, genie::ReinSehgalCOHPiPXSec, genie::NievesSimoVacasMECPXSec2016, genie::FGMBodekRitchie, genie::SpectralFunc1d, genie::PaisQELLambdaPXSec, genie::QPMDISStrucFuncBase, genie::EffectiveSF, genie::NuElectronPXSec, genie::LwlynSmithFF, genie::ReinSehgalRESXSec, genie::BergerSehgalCOHPiPXSec2015, genie::SmithMonizQELCCXSec, genie::QPMDMDISPXSec, genie::SpectralFunc, genie::LHAPDF5, genie::LwlynSmithQELCCPXSec, genie::BergerSehgalFMCOHPiPXSec2015, genie::BBA03ELFormFactorsModel, genie::BBA05ELFormFactorsModel, genie::AhrensDMELPXSec, genie::OutgoingDarkGenerator, genie::KLVOxygenIBDPXSec, genie::IMDAnnihilationPXSec, genie::NuElectronXSec, genie::P33PaschosLalakulichPXSec, genie::DMDISInteractionListGenerator, genie::AivazisCharmPXSecLO, genie::AlvarezRusoCOHPiPXSec, genie::QPMDISPXSec, genie::StrumiaVissaniIBDPXSec, genie::NNBarOscPrimaryVtxGenerator, genie::PauliBlocker, genie::RESHadronicSystemGenerator, genie::DMDISKinematicsGenerator, genie::PrimaryLeptonGenerator, genie::BYPDF, genie::MECGenerator, genie::RosenbluthPXSec, genie::DISInteractionListGenerator, genie::ReinDFRPXSec, genie::KNOPythiaHadronization, genie::PythiaHadronization, genie::MECXSec, genie::QELEventGenerator, genie::AhrensNCELPXSec, genie::TransverseEnhancementFFModel, genie::AlamSimoAtharVacasSKXSec, genie::SlowRsclCharmDISPXSecLO, genie::UnstableParticleDecayer, genie::DISKinematicsGenerator, genie::NucBindEnergyAggregator, genie::ZExpAxialFormFactorModel, genie::AlamSimoAtharVacasSKPXSec2014, genie::H3AMNuGammaPXSec, genie::COHElasticPXSec, genie::CollinsSpillerFragm, genie::PetersonFragm, genie::EmpiricalMECPXSec2015, genie::KuzminNaumov2016AxialFormFactorModel, genie::RSPPResonanceSelector, genie::DMELKinematicsGenerator, genie::DMELXSec, genie::COHKinematicsGenerator, genie::IBDKinematicsGenerator, genie::NucleonDecayPrimaryVtxGenerator, genie::DMELInteractionListGenerator, genie::DMDISXSec, genie::FermiMover, genie::RESKinematicsGenerator, genie::RSPPInteractionListGenerator, genie::PhysInteractionSelector, genie::COHElKinematicsGenerator, genie::COHInteractionListGenerator, genie::Decayer, genie::DISHadronicSystemGenerator, genie::IBDInteractionListGenerator, genie::IBDXSecMap, genie::QELKinematicsGenerator, genie::DipoleAxialFormFactorModel, genie::DipoleELFormFactorsModel, genie::QELXSec, genie::RESInteractionListGenerator, genie::RSHelicityAmplModelNCn, genie::RSHelicityAmplModelNCp, genie::SKInteractionListGenerator, genie::SKKinematicsGenerator, genie::VertexGenerator, genie::DFRInteractionListGenerator, genie::DFRKinematicsGenerator, genie::GLRESGenerator, genie::HadronTransporter, genie::MECInteractionListGenerator, genie::NuEInteractionListGenerator, genie::NuEKinematicsGenerator, genie::QELInteractionListGenerator, genie::COHXSec, genie::DISXSec, genie::INukeDeltaPropg, genie::RESXSec, genie::COHXSecAR, genie::IMDXSec, and genie::BYStrucFunc.

Definition at line 126 of file Algorithm.cxx.

127 {
128 // Configure the Algorithm looking up at the ConfigPool singleton for a
129 // configuration Registry corresponding to the input named parameter set.
130 
132  this->FindConfig();
133 }
Definition: config.py:1
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
virtual void FindConfig(void)
Definition: Algorithm.cxx:135
void SetConfig(string config)
Definition: AlgId.cxx:65
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_flatrecord::config, exit(), genie::AlgConfigPool::FindRegistry(), genie::Registry::GetItemMap(), genie::Registry::GetString(), MECModelEnuComparisons::i, genie::AlgConfigPool::Instance(), it, genie::Registry::ItemIsLocal(), parse_dependency_file_t::list, LOG, pDEBUG, pFATAL, time_estimates::pool, pWARN, moon_position_table_new3::second, genie::utils::str::Split(), string, and APDHVSetting::temp.

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

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

Definition at line 254 of file Algorithm.cxx.

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

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

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

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

Definition at line 287 of file Algorithm.cxx.

References GetConfig().

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

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

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

Referenced by genie::CollinsSpillerFragm::BuildFunction(), genie::PetersonFragm::BuildFunction(), genie::COHXSec::LoadConfig(), genie::DISXSec::LoadConfig(), genie::INukeDeltaPropg::LoadConfig(), genie::HadronTransporter::LoadConfig(), genie::DFRKinematicsGenerator::LoadConfig(), genie::RSHelicityAmplModelNCn::LoadConfig(), genie::RSHelicityAmplModelNCp::LoadConfig(), genie::BaryonResonanceDecayer::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::DMDISXSec::LoadConfig(), genie::DipoleAxialFormFactorModel::LoadConfig(), genie::DipoleELFormFactorsModel::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::VertexGenerator::LoadConfig(), genie::H3AMNuGammaPXSec::LoadConfig(), genie::RSPPResonanceSelector::LoadConfig(), genie::IBDXSecMap::LoadConfig(), genie::Decayer::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::COHElasticPXSec::LoadConfig(), genie::KuzminNaumov2016AxialFormFactorModel::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::DFRXSec::LoadConfig(), genie::RosenbluthPXSec::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::BBA05ELFormFactorsModel::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::BBA03ELFormFactorsModel::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::PrimaryLeptonGenerator::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::SpectralFunc1d::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::OutgoingDarkGenerator::LoadConfig(), genie::LHAPDF6::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), genie::QPMDISStrucFuncBase::LoadConfig(), genie::BBA07ELFormFactorsModel::LoadConfig(), genie::HAIntranuke::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), genie::HNIntranuke2018::LoadConfig(), genie::LocalFGM::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::RESXSec::LoadConfig(), genie::DISXSec::LoadConfig(), genie::DFRKinematicsGenerator::LoadConfig(), genie::COHXSecAR::LoadConfig(), genie::DMDISXSec::LoadConfig(), genie::BaryonResonanceDecayer::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::COHElKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::QELXSec::LoadConfig(), genie::RESKinematicsGenerator::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::AhrensDMELPXSec::LoadConfig(), genie::NuElectronXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::MECXSec::LoadConfig(), genie::FermiMover::LoadConfig(), genie::AlamSimoAtharVacasSKXSec::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::QELInteractionListGenerator::LoadConfigData(), genie::MECInteractionListGenerator::LoadConfigData(), genie::DFRInteractionListGenerator::LoadConfigData(), genie::COHInteractionListGenerator::LoadConfigData(), genie::RESInteractionListGenerator::LoadConfigData(), genie::SKInteractionListGenerator::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...

int COHHadronicSystemGenerator::getPionPDGCodeFromXclTag ( const XclsTag xcls_tag) const
private

Definition at line 90 of file COHHadronicSystemGenerator.cxx.

References exit(), genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, LOG, genie::XclsTag::NPi0(), genie::XclsTag::NPiMinus(), genie::XclsTag::NPiPlus(), and pFATAL.

Referenced by CalculateHadronicSystem_BergerSehgalFM(), and CalculateHadronicSystem_ReinSehgal().

91 {
92  int pion_pdgc = 0;
93  if (xcls_tag.NPi0() == 1) pion_pdgc = kPdgPi0;
94  else if (xcls_tag.NPiPlus() == 1) pion_pdgc = kPdgPiP;
95  else if (xcls_tag.NPiMinus() == 1) pion_pdgc = kPdgPiM;
96  else {
97  LOG("COHHadronicVtx", pFATAL)
98  << "No final state pion information in XclsTag!";
99  exit(1);
100  }
101  return pion_pdgc;
102 }
#define pFATAL
Definition: Messenger.h:57
int NPiMinus(void) const
Definition: XclsTag.h:58
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
int NPiPlus(void) const
Definition: XclsTag.h:57
const int kPdgPiP
Definition: PDGCodes.h:135
const int kPdgPi0
Definition: PDGCodes.h:137
int NPi0(void) const
Definition: XclsTag.h:56
exit(0)
const int kPdgPiM
Definition: PDGCodes.h:136
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
TLorentzVector HadronicSystemGenerator::Hadronic4pLAB ( GHepRecord event_rec) const
inherited

Definition at line 138 of file HadronicSystemGenerator.cxx.

References ana::assert(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::GHepRecord::HitNucleon(), submit_hadd::l, LOG, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), pINFO, and genie::GHepRecord::Probe().

Referenced by genie::HadronicSystemGenerator::AddFinalHadronicSyst(), genie::DISHadronicSystemGenerator::AddFragmentationProducts(), genie::QELHadronicSystemGenerator::AddRecoilBaryon(), genie::IBDHadronicSystemGenerator::AddRecoilBaryon(), genie::RSPPResonanceSelector::AddResonance(), genie::RESHadronicSystemGenerator::AddResonance(), genie::HadronicSystemGenerator::HCM2LAB(), and genie::COHElHadronicSystemGenerator::ProcessEventRecord().

140 {
141 // Returns the final state hadronic system 4-p in LAB
142 
143  GHepParticle * nu = evrec->Probe(); // incoming v
144  GHepParticle * N = evrec->HitNucleon(); // struck nucleon
145  GHepParticle * l = evrec->FinalStatePrimaryLepton(); // f/s primary lepton
146 
147  assert(nu);
148  assert(N);
149  assert(l);
150 
151  LOG("HadronicVtx", pINFO)
152  << "\n v [LAB]: " << P4AsString( nu->P4() )
153  << "\n N [LAB]: " << P4AsString( N->P4() )
154  << "\n l [LAB]: " << P4AsString( l->P4() );
155 
156  //-- Compute the Final State Hadronic System 4p (PX = Pv + PN - Pl)
157 
158  const TLorentzVector & p4nu = *(nu->P4());
159  const TLorentzVector & p4N = *(N ->P4());
160  const TLorentzVector & p4l = *(l ->P4());
161 
162  TLorentzVector pX4 = p4nu + p4N - p4l;
163 
164  LOG("HadronicVtx", pINFO) << "\n HadrSyst [LAB]: " << P4AsString(&pX4);
165 
166  return pX4;
167 }
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:34
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
assert(nhit_max >=nhit_nbins)
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
int HadronicSystemGenerator::HadronShowerCharge ( GHepRecord event_rec) const
inherited

Definition at line 204 of file HadronicSystemGenerator.cxx.

References ana::assert(), genie::PDGLibrary::Find(), genie::Interaction::FSPrimLepton(), genie::Target::HitNucPdg(), genie::Interaction::InitState(), genie::PDGLibrary::Instance(), makeTrainCVSamples::int, genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::InitialState::Probe(), genie::GHepRecord::Summary(), and genie::InitialState::Tgt().

Referenced by genie::HadronicSystemGenerator::ResonanceCharge().

205 {
206 // Returns the hadron shower charge in units of +e
207 // eg in v n -> l- X the hadron shower charge is +1
208 
209  int hadronShowerCharge = 0;
210 
211  Interaction * interaction = evrec->Summary();
212  const InitialState & init_state = interaction->InitState();
213 
214  int hit_nucleon = init_state.Tgt().HitNucPdg();
215 
216  assert( pdg::IsProton(hit_nucleon) || pdg::IsNeutron(hit_nucleon) );
217 
218  double qfsl = interaction->FSPrimLepton()->Charge() / 3.;
219  double qp = interaction->InitState().Probe()->Charge() / 3.;
220  double qnuc = PDGLibrary::Instance()->Find(hit_nucleon)->Charge() / 3.;
221 
222  // probe + nucleon - primary final state lepton
223  hadronShowerCharge = (int) (qp + qnuc - qfsl);
224 
225  return hadronShowerCharge;
226 }
int HitNucPdg(void) const
Definition: Target.cxx:321
TParticlePDG * Probe(void) const
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:304
Summary information for an interaction.
Definition: Interaction.h:56
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:299
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
const InitialState & InitState(void) const
Definition: Interaction.h:69
const Target & Tgt(void) const
Definition: InitialState.h:67
Initial State information.
Definition: InitialState.h:49
TVector3 HadronicSystemGenerator::HCM2LAB ( GHepRecord event_rec) const
inherited

Definition at line 188 of file HadronicSystemGenerator.cxx.

References beta, genie::HadronicSystemGenerator::Hadronic4pLAB(), LOG, pINFO, and genie::utils::print::Vec3AsString().

189 {
190 // Velocity for the Hadronic CM -> LAB active Lorentz transform
191 
192  TLorentzVector pH = this->Hadronic4pLAB(evrec);
193 
194  //-- Compute the velocity of the LAB frame in the Final State Hadronic
195  // CM Frame (PxH/EH, PyH/EH, PzH/EH)
196 
197  TVector3 beta = pH.BoostVector();
198 
199  LOG("HadronicVtx", pINFO) << "beta (HCM->LAB): " << Vec3AsString(&beta);
200 
201  return beta;
202 }
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
Double_t beta
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:87
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(), 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 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
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
TLorentzVector HadronicSystemGenerator::MomentumTransferLAB ( GHepRecord event_rec) const
inherited

Definition at line 169 of file HadronicSystemGenerator.cxx.

References ana::assert(), genie::GHepRecord::FinalStatePrimaryLepton(), submit_hadd::l, LOG, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), pNOTICE, and genie::GHepRecord::Probe().

171 {
172  GHepParticle * nu = evrec->Probe(); // incoming v
173  GHepParticle * l = evrec->FinalStatePrimaryLepton(); // f/s primary lepton
174 
175  assert(nu);
176  assert(l);
177 
178  const TLorentzVector & p4nu = *(nu->P4());
179  const TLorentzVector & p4l = *(l ->P4());
180 
181  TLorentzVector pq4 = p4nu - p4l; // q
182 
183  LOG("HadronicVtx", pNOTICE)
184  << "\n Momentum Transfer [LAB]: " << P4AsString(&pq4);
185  return pq4;
186 }
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:34
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
assert(nhit_max >=nhit_nbins)
#define pNOTICE
Definition: Messenger.h:62
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
void HadronicSystemGenerator::PreHadronTransportDecays ( GHepRecord event_rec) const
inherited

Definition at line 130 of file HadronicSystemGenerator.cxx.

References genie::HadronicSystemGenerator::fPreINukeDecayer, and genie::EventRecordVisitorI::ProcessEventRecord().

Referenced by genie::DISHadronicSystemGenerator::SimulateFormationZone().

132 {
133  if(fPreINukeDecayer) {
135  }
136 }
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
const EventRecordVisitorI * fPreINukeDecayer
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
void COHHadronicSystemGenerator::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 68 of file COHHadronicSystemGenerator.cxx.

References CalculateHadronicSystem_AlvarezRuso(), CalculateHadronicSystem_BergerSehgal(), CalculateHadronicSystem_BergerSehgalFM(), CalculateHadronicSystem_ReinSehgal(), genie::EventGeneratorI::CrossSectionAlg(), genie::Algorithm::Id(), genie::RunningThreadInfo::Instance(), LOG, genie::AlgId::Name(), pFATAL, and genie::RunningThreadInfo::RunningThread().

69 {
70  // Access cross section algorithm for running thread
72  const EventGeneratorI * evg = rtinfo->RunningThread();
73  const XSecAlgorithmI *fXSecModel = evg->CrossSectionAlg();
74  if (fXSecModel->Id().Name() == "genie::ReinSehgalCOHPiPXSec") {
76  } else if ((fXSecModel->Id().Name() == "genie::BergerSehgalCOHPiPXSec2015")) {
78  } else if ((fXSecModel->Id().Name() == "genie::BergerSehgalFMCOHPiPXSec2015")) {
80  } else if ((fXSecModel->Id().Name() == "genie::AlvarezRusoCOHPiPXSec")) {
82  }
83  else {
84  LOG("COHHadronicSystemGenerator",pFATAL) <<
85  "ProcessEventRecord >> Cannot calculate hadronic system for " <<
86  fXSecModel->Id().Name();
87  }
88 }
Cross Section Calculation Interface.
void CalculateHadronicSystem_AlvarezRuso(GHepRecord *event_rec) const
#define pFATAL
Definition: Messenger.h:57
Defines the EventGeneratorI interface.
void CalculateHadronicSystem_ReinSehgal(GHepRecord *event_rec) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
string Name(void) const
Definition: AlgId.h:45
void CalculateHadronicSystem_BergerSehgalFM(GHepRecord *event_rec) const
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
void CalculateHadronicSystem_BergerSehgal(GHepRecord *event_rec) const
static RunningThreadInfo * Instance(void)
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
const EventGeneratorI * RunningThread(void)
Keep info on the event generation thread currently on charge. This is used so that event generation m...
int HadronicSystemGenerator::ResonanceCharge ( GHepRecord event_rec) const
inherited
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::DISHadronicSystemGenerator::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::COHElasticPXSec::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::AlvarezRusoCOHPiPXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::NNBarOscPrimaryVtxGenerator::LoadConfig(), genie::FermiMover::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::IMDAnnihilationPXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::KNOPythiaHadronization::LoadConfig(), genie::AivazisCharmPXSecLO::LoadConfig(), genie::RESHadronicSystemGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::BergerSehgalFMCOHPiPXSec2015::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::KovalenkoQELCharmPXSec::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::SmithMonizQELCCXSec::LoadConfig(), genie::BardinIMDRadCorPXSec::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), genie::MartiniEricsonChanfrayMarteauMECPXSec2016::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::QPMDISStrucFuncBase::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::HAIntranuke::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), genie::HNIntranuke2018::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::ReinSehgalSPPPXSec::LoadConfig(), genie::KNOHadronization::LoadConfig(), and genie::EventGeneratorListAssembler::LoadGenerator().

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

Member Data Documentation

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.

AlgId genie::Algorithm::fID
protectedinherited

algorithm name and configuration set

Definition at line 156 of file Algorithm.h.

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

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.

const EventRecordVisitorI* genie::HadronicSystemGenerator::fPreINukeDecayer
protectedinherited
AlgStatus_t genie::Algorithm::fStatus
protectedinherited

algorithm execution status

Definition at line 166 of file Algorithm.h.

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


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