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

Baryon resonance decayer module. More...

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

Inheritance diagram for genie::BaryonResonanceDecayer:
genie::Decayer genie::EventRecordVisitorI genie::Algorithm

Public Member Functions

 BaryonResonanceDecayer ()
 
 BaryonResonanceDecayer (string config)
 
virtual ~BaryonResonanceDecayer ()
 
void ProcessEventRecord (GHepRecord *event) const
 
virtual void LoadConfig (void)
 

Protected Member Functions

void Configure (const Registry &config)
 
void Configure (string config)
 
virtual bool ToBeDecayed (int pdgc, GHepStatus_t ist) const
 
virtual bool IsUnstable (int pdgc) const
 
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...
 
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

bool fGenerateWeighted
 generate weighted or unweighted decays? More...
 
bool fRunBefHadroTransp
 is invoked before or after FSI? More...
 
PDGCodeList fParticlesToDecay
 list of particles to be decayed More...
 
PDGCodeList fParticlesNotToDecay
 list of particles for which decay is inhibited More...
 
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Private Member Functions

void Initialize (void) const
 
bool IsHandled (int pdgc) const
 
void InhibitDecay (int pdgc, TDecayChannel *ch=0) const
 
void UnInhibitDecay (int pdgc, TDecayChannel *ch=0) const
 
double Weight (void) const
 
bool Decay (int dec_part_id, GHepRecord *event) const
 
TDecayChannel * SelectDecayChannel (int dec_part_id, GHepRecord *event, bool &to_be_deleted) const
 
bool DecayExclusive (int dec_part_id, GHepRecord *event, TDecayChannel *ch) const
 
TObjArray * EvolveDeltaBR (int dec_part_pdgc, TObjArray *decay_list, double W) const
 
double EvolveDeltaDecayWidth (int dec_part_pdgc, TDecayChannel *ch, double W) const
 
bool AcceptPionDecay (TLorentzVector lab_pion, int dec_part_id, const GHepRecord *event) const
 
double FinalStateMass (TDecayChannel *ch) const
 
bool IsPiNDecayChannel (TDecayChannel *ch) const
 

Static Private Member Functions

static bool IsDelta (int dec_part_pdgc)
 
static bool HasEvolvedBRs (int dec_part_pdgc)
 

Private Attributes

TGenPhaseSpace fPhaseSpaceGenerator
 
double fWeight
 
bool fDeltaThetaOnly
 
std::vector< double > fR33
 
std::vector< double > fR31
 
std::vector< double > fR3m1
 
std::vector< double > fQ2Thresholds
 
std::vector< double > fW_max
 
double fFFScaling
 

Detailed Description

Baryon resonance decayer module.

A simple resonance decay simulation built using resonance branching fraction data and an N-body phase space generator. Since the resonance can be produced off-the-mass-shell, decay channels with total-mass > W are suppressed.

Is a concerete implementation of the EventRecordVisitorI interface.

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

November 27, 2004

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

Definition at line 36 of file BaryonResonanceDecayer.h.

Constructor & Destructor Documentation

BaryonResonanceDecayer::BaryonResonanceDecayer ( )

Definition at line 39 of file BaryonResonanceDecayer.cxx.

References Initialize().

39  :
40 Decayer("genie::BaryonResonanceDecayer")
41 {
42  this->Initialize();
43 }
BaryonResonanceDecayer::BaryonResonanceDecayer ( string  config)

Definition at line 45 of file BaryonResonanceDecayer.cxx.

References Initialize().

45  :
46 Decayer("genie::BaryonResonanceDecayer", config)
47 {
48  this->Initialize();
49 }
Definition: config.py:1
BaryonResonanceDecayer::~BaryonResonanceDecayer ( )
virtual

Definition at line 51 of file BaryonResonanceDecayer.cxx.

52 {
53 
54 }

Member Function Documentation

bool BaryonResonanceDecayer::AcceptPionDecay ( TLorentzVector  lab_pion,
int  dec_part_id,
const GHepRecord event 
) const
private

Definition at line 588 of file BaryonResonanceDecayer.cxx.

References fDeltaThetaOnly, fQ2Thresholds, fR31, fR33, fR3m1, genie::Kinematics::FSLeptonP4(), fW_max, genie::RandomGen::Instance(), genie::Interaction::KinePtr(), genie::constants::kSqrt3, genie::GHepParticle::P4(), genie::utils::kinematics::Q2(), std::sqrt(), and Unit().

Referenced by DecayExclusive().

590  {
591 
592  // This evaluate the function W(theta, phi) as a function of the emitted pion and of the status of
593  // the Delta to be decayed and the whole event
594 
595  // in its simplest form W(theta) is
596  // W(Theta) = 1 − P[ 3/2 ] x L_2(cos Theta) + P[ 1/2 ] x L_2(cos Theta)
597  // where
598  // L_2 is the second Legendre polynomial L_2(x) = (3x^2 -1)/2
599  // and P[3/2] and P[1/2] have to some up to 1.
600  // But the code has been extended to include a phi dependence
601 
602  // Get the delta 4-momentum
603  GHepParticle * decay_particle = event->Particle( dec_part_id );
604  TLorentzVector delta_p4 = *(decay_particle->P4() );
605 
606  // find incoming lepton
607  TLorentzVector in_lep_p4( * (event -> Probe()-> GetP4()) ) ;
608 
609  // find outgoing lepton
610  Interaction * interaction = event->Summary();
611  TLorentzVector out_lep_p4 = interaction->KinePtr()->FSLeptonP4() ;
612 
613  TLorentzVector q = in_lep_p4 - out_lep_p4 ;
614 
615  pion.Boost(-delta_p4.BoostVector() ); // this gives us the pion in the Delta reference frame
616  q.Boost(-delta_p4.BoostVector() ); // this gives us the transferred momentm in the Delta reference frame
617 
618  TVector3 pion_dir = pion.Vect().Unit() ;
619  TVector3 z_axis = q.Vect().Unit() ;
620 
621  double c_t = pion_dir*z_axis; // cos theta
622 
623  unsigned int q2_index = 0 ;
624 
625  // find out Q2 region for values
626  // note that Q2 is a lorentz invariant so it does not matter it is evaluated in the lab frame
627  // like in this case or in the Delta reference frame
628  double Q2 = - q.Mag2() ;
629  while( q2_index < fQ2Thresholds.size() ) {
630  if ( Q2 < fQ2Thresholds[q2_index] ) ++q2_index ;
631  else break ;
632  }
633 
634  double w_function = 1. - (fR33[q2_index] - 0.5)*(3.*c_t*c_t - 1.) ;
635 
636  if ( ! fDeltaThetaOnly ) {
637 
638  // evaluate sin theta as it appears in the formula
639  double s_t = sqrt(1. - c_t*c_t) ; //sin theta
640 
641  in_lep_p4.Boost(-delta_p4.BoostVector() ) ;
642  out_lep_p4.Boost( -delta_p4.BoostVector() ) ;
643 
644  // evaluate reference frame -> define x axis
645  TVector3 y_axis = in_lep_p4.Vect().Cross( out_lep_p4.Vect() ).Unit() ;
646  TVector3 x_axis = y_axis.Cross(z_axis);
647 
648  double c_phi = pion_dir*x_axis;
649 
650  double phi_dependency = kSqrt3 *( 2.*fR31[q2_index]*s_t*c_t*c_phi + fR3m1[q2_index]*s_t*(2.*c_phi*c_phi-1.) ) ;
651  w_function -= phi_dependency ;
652  }
653 
654  double aidrnd = fW_max[q2_index] * RandomGen::Instance()-> RndDec().Rndm();
655 
656  return ( aidrnd <= w_function ) ;
657 
658 }
static const double kSqrt3
Definition: Constants.h:117
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
T sqrt(T number)
Definition: d0nt_math.hpp:156
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & FSLeptonP4(void) const
Definition: Kinematics.h:66
TVector3 Unit() const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
int Algorithm::AddLowRegistry ( Registry rp,
bool  owns = true 
)
protectedinherited

add registry with lowest priority, also update ownership

Definition at line 601 of file Algorithm.cxx.

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

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

Add registries with top priority, also udated Ownerships.

Definition at line 653 of file Algorithm.cxx.

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

add registry with top priority, also update ownership

Definition at line 585 of file Algorithm.cxx.

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

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

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

Definition at line 394 of file Algorithm.cxx.

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

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

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

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

Definition at line 408 of file Algorithm.cxx.

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

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

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

Definition at line 119 of file Decayer.cxx.

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

120 {
121  Algorithm::Configure(config);
122  this->LoadConfig();
123 
124  fAllowReconfig = false;
125 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
virtual void LoadConfig(void)
Definition: Decayer.cxx:135
void Decayer::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 from genie::Algorithm.

Definition at line 127 of file Decayer.cxx.

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

128 {
130  this->LoadConfig();
131 
132  fAllowReconfig = false;
133 }
Definition: config.py:1
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
virtual void LoadConfig(void)
Definition: Decayer.cxx:135
bool BaryonResonanceDecayer::Decay ( int  dec_part_id,
GHepRecord event 
) const
private

Definition at line 104 of file BaryonResonanceDecayer.cxx.

References DecayExclusive(), fWeight, genie::kIStDecayedState, LOG, pERROR, SelectDecayChannel(), genie::GHepParticle::SetStatus(), and ana::weight.

Referenced by ProcessEventRecord().

106 {
107  // Reset previous decay weight
108  fWeight = 1.;
109 
110  // Get particle to be decayed
111  GHepParticle * decay_particle = event->Particle(decay_particle_id);
112  if( ! decay_particle) {
113  LOG("ResonanceDecay", pERROR)
114  << "Particle to be decayed not in the event record. Particle ud: " << decay_particle_id ;
115  return false;
116  }
117 
118  bool to_be_deleted ;
119 
120  // Select a decay channel
121  TDecayChannel * selected_decay_channel =
122  this->SelectDecayChannel(decay_particle_id, event, to_be_deleted ) ;
123 
124  if(!selected_decay_channel) {
125  LOG("ResonanceDecay", pERROR)
126  << "No decay channel for particle " << decay_particle_id ;
127  LOG("ResonanceDecay", pERROR)
128  << *event ;
129 
130  return false;
131  }
132 
133  // Decay the exclusive state and copy daughters in the event record
134  bool decayed = this->DecayExclusive(decay_particle_id, event, selected_decay_channel);
135 
136  if ( to_be_deleted )
137  delete selected_decay_channel ;
138 
139  if ( ! decayed ) return false ;
140 
141  // Update the event weight for each weighted particle decay
142  double weight = event->Weight() * fWeight;
143  event->SetWeight(weight);
144 
145  // Mark input particle as a 'decayed state' & add its daughter links
146  decay_particle->SetStatus(kIStDecayedState);
147 
148  return true;
149 }
#define pERROR
Definition: Messenger.h:60
const Var weight
bool DecayExclusive(int dec_part_id, GHepRecord *event, TDecayChannel *ch) const
TDecayChannel * SelectDecayChannel(int dec_part_id, GHepRecord *event, bool &to_be_deleted) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:127
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
bool BaryonResonanceDecayer::DecayExclusive ( int  dec_part_id,
GHepRecord event,
TDecayChannel *  ch 
) const
private

Definition at line 264 of file BaryonResonanceDecayer.cxx.

References AcceptPionDecay(), ana::assert(), genie::Decayer::fGenerateWeighted, genie::PDGLibrary::Find(), fPhaseSpaceGenerator, genie::Decayer::fRunBefHadroTransp, fWeight, MECModelEnuComparisons::i, genie::PDGLibrary::Instance(), genie::RandomGen::Instance(), genie::pdg::IsHadron(), IsPiNDecayChannel(), genie::pdg::IsPion(), genie::kIStHadronInTheNucleus, genie::kIStStableFinalState, genie::controls::kMaxUnweightDecayIterations, genie::kPdgP33m1232_Delta0, genie::kPdgP33m1232_DeltaP, genie::kPdgP33m1232_DeltaPP, LOG, nd, genie::GHepParticle::P4(), pDEBUG, genie::GHepParticle::Pdg(), pINFO, pWARN, generate_hists::rnd, genie::RandomGen::RndDec(), SLOG, w, and genie::GHepParticle::X4().

Referenced by Decay().

266 {
267  // Find the particle to be decayed in the event record
268  GHepParticle * decay_particle = event->Particle(decay_particle_id);
269  if(!decay_particle) return false ;
270 
271  // Get the decayed particle 4-momentum, 4-position and PDG code
272  TLorentzVector decay_particle_p4 = *(decay_particle->P4());
273  TLorentzVector decay_particle_x4 = *(decay_particle->X4());
274  int decay_particle_pdg_code = decay_particle->Pdg();
275 
276  // Get the final state mass spectrum and the particle codes
277  // for the selected decay channel
278  unsigned int nd = ch->NDaughters();
279 
280  int pdgc[nd];
281  double mass[nd];
282 
283  for(unsigned int iparticle = 0; iparticle < nd; iparticle++) {
284 
285  int daughter_code = ch->DaughterPdgCode(iparticle);
286  TParticlePDG * daughter = PDGLibrary::Instance()->Find(daughter_code);
287  assert(daughter);
288 
289  pdgc[iparticle] = daughter_code;
290  mass[iparticle] = daughter->Mass();
291 
292  SLOG("ResonanceDecay", pINFO)
293  << "+ daughter[" << iparticle << "]: "
294  << daughter->GetName() << " (pdg-code = "
295  << pdgc[iparticle] << ", mass = " << mass[iparticle] << ")";
296  }
297 
298  // Check whether the expected channel is Delta->pion+nucleon
299  bool is_delta = (decay_particle_pdg_code == kPdgP33m1232_DeltaPP ||
300  decay_particle_pdg_code == kPdgP33m1232_DeltaP ||
301  decay_particle_pdg_code == kPdgP33m1232_Delta0);
302 
303  bool is_delta_N_Pi_decay = is_delta && this->IsPiNDecayChannel(ch);
304 
305  // Decay the resonance using an N-body phase space generator
306  // The particle will be decayed in its rest frame and then the daughters
307  // will be boosted back to the original frame.
308 
309  bool is_permitted = fPhaseSpaceGenerator.SetDecay(decay_particle_p4, nd, mass);
310  if ( ! is_permitted ) return false ;
311 
312  // Find the maximum phase space decay weight
313  // double wmax = fPhaseSpaceGenerator.GetWtMax();
314  double wmax = -1;
315  for(int i=0; i<50; i++) {
316  double w = fPhaseSpaceGenerator.Generate();
317  wmax = TMath::Max(wmax,w);
318  }
319  assert(wmax>0);
320  LOG("ResonanceDecay", pINFO)
321  << "Max phase space gen. weight for current decay: " << wmax;
322 
324  {
325  // Generating weighted decays
326  // Do a single draw of momentum 4-vectors and then stop,
327  // taking into account the weight for this particular draw
328  double w = fPhaseSpaceGenerator.Generate();
329  fWeight *= TMath::Max(w/wmax, 1.);
330  }
331  else
332  {
333  // Generating un-weighted decays
335  wmax *= 2;
336  bool accept_decay=false;
337  unsigned int itry=0;
338 
339  while(!accept_decay)
340  {
341  itry++;
343 
344  double w = fPhaseSpaceGenerator.Generate();
345  double gw = wmax * rnd->RndDec().Rndm();
346 
347  if(w>wmax) {
348  LOG("ResonanceDecay", pWARN)
349  << "Current decay weight = " << w << " > wmax = " << wmax;
350  }
351  LOG("ResonanceDecay", pINFO)
352  << "Current decay weight = " << w << " / R = " << gw;
353 
354  accept_decay = (gw<=w);
355 
356  // Extra logic that applies only for Delta -> N + pi
357  if( accept_decay && is_delta_N_Pi_decay ) {
358 
359  // We don't want the decay Delta -> Pi + N to be isotropic in the Delta referemce frame
360  // as generated by the simple phase space generator.
361  // In order to sample pion distribution according to W(Theta, phi) in the Delta resonance decay,
362  // we make use of the following.
363  // Note that Theta and Phi are defined in a reference frame which depends on the whole event
364  // For each event generated from a Delta -> N + Pi event with Pi emitted at
365  // at angles Theta and Phi (in the Delta rest frame), attach a random number to it.
366  // then we calculate W(Theta, Phi).
367  // Each possible final state is used to evaluate (Theta, Phi),
368  // then a random number is thrown, if the the random number is higher than W(Theta, Phi) drop this event and go
369  // back to re-generate an event and repeat the procedure.
370  // Otherwise keep this event to the record.
371  // For efficiency reasons the maxium of the function is Q2 dependent
372 
373  // Locate the pion in the decay products
374  // at this point we already know that the pion is unique so the first pion we find is our pion
375  unsigned int pi_id = 0 ;
376 
377  for(unsigned int iparticle = 0; iparticle < nd; iparticle++) {
378 
379  if ( genie::pdg::IsPion( ch->DaughterPdgCode(iparticle) ) ) {
380  pi_id = iparticle ;
381  break ;
382  }
383  }//iparticle
384 
385  TLorentzVector * lab_pion = fPhaseSpaceGenerator.GetDecay(pi_id);
386 
387  accept_decay = AcceptPionDecay( *lab_pion, decay_particle_id, event) ;
388 
389  } //if it is a Delta -> N + Pi
390 
391  }//accept_decay
392 
393  }//fGenerateWeighted
394 
395  // A decay was generated - Copy to the event record
396 
397  // Check whether the interaction is off a nuclear target or free nucleon
398  // Depending on whether this module is run before or after the hadron
399  // transport module it would affect the daughters status code
400  GHepParticle * target_nucleus = event->TargetNucleus();
401  bool in_nucleus = (target_nucleus!=0);
402 
403  // Loop over daughter list and add corresponding GHepParticles
404  for(unsigned int id = 0; id < nd; id++) {
405 
406  int daughter_pdg_code = pdgc[id];
407 
408  TLorentzVector * daughter_p4 = fPhaseSpaceGenerator.GetDecay(id);
409  LOG("ResonanceDecay", pDEBUG)
410  << "Adding daughter particle with PDG code = " << pdgc[id]
411  << " and mass = " << mass[id] << " GeV";
412 
413  bool is_hadron = pdg::IsHadron(daughter_pdg_code);
414  bool hadron_in_nuc = (in_nucleus && is_hadron && fRunBefHadroTransp);
415 
416  GHepStatus_t daughter_status_code = (hadron_in_nuc) ?
418 
419  event->AddParticle(
420  daughter_pdg_code, daughter_status_code, decay_particle_id,-1,-1,-1,
421  *daughter_p4, decay_particle_x4);
422  }
423 
424  return true ;
425 }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
const int kPdgP33m1232_DeltaPP
Definition: PDGCodes.h:91
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:289
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
enum genie::EGHepStatus GHepStatus_t
static const unsigned int kMaxUnweightDecayIterations
Definition: Controls.h:61
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
const int kPdgP33m1232_DeltaP
Definition: PDGCodes.h:90
int Pdg(void) const
Definition: GHepParticle.h:64
bool IsHadron(int pdgc)
Definition: PDGUtils.cxx:355
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool IsPiNDecayChannel(TDecayChannel *ch) const
bool fRunBefHadroTransp
is invoked before or after FSI?
Definition: Decayer.h:57
#define pINFO
Definition: Messenger.h:63
bool fGenerateWeighted
generate weighted or unweighted decays?
Definition: Decayer.h:56
#define pWARN
Definition: Messenger.h:61
const int kPdgP33m1232_Delta0
Definition: PDGCodes.h:89
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
bool AcceptPionDecay(TLorentzVector lab_pion, int dec_part_id, const GHepRecord *event) const
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
Float_t w
Definition: plot.C:20
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:57
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
#define pDEBUG
Definition: Messenger.h:64
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
TObjArray * BaryonResonanceDecayer::EvolveDeltaBR ( int  dec_part_pdgc,
TObjArray *  decay_list,
double  W 
) const
private

Definition at line 427 of file BaryonResonanceDecayer.cxx.

References d, EvolveDeltaDecayWidth(), GetEntries(), MECModelEnuComparisons::i, nd, APDHVSetting::temp, and PandAna.Demos.pi0_spectra::tot.

Referenced by SelectDecayChannel().

427  {
428 
429  unsigned int nch = decay_list -> GetEntries();
430 
431  std::vector<double> widths( nch, 0. ) ;
432  double tot = 0. ;
433 
434  TDecayChannel * temp = nullptr ;
435 
436  for ( unsigned int i = 0 ; i < nch ; ++i ) {
437 
438  temp = (TDecayChannel*) decay_list -> At(i) ;
439  tot += widths[i] = EvolveDeltaDecayWidth(dec_part_pdgc, temp, W ) ;
440 
441  }
442 
443  if ( tot <= 0. ) return nullptr ;
444 
445  TObjArray * new_list = new TObjArray() ;
446 
447  TDecayChannel * update = nullptr ;
448 
449  for ( unsigned int i = 0 ; i < nch ; ++i ) {
450 
451  if ( widths[i] <= 0. ) continue ;
452 
453  temp = (TDecayChannel*) decay_list -> At(i) ;
454 
455  unsigned int nd = temp -> NDaughters() ;
456  std::vector<Int_t> ds( nd, 0 ) ;
457  for ( unsigned int d = 0 ; d < nd; ++d ) {
458  ds[d] = temp -> DaughterPdgCode(d) ;
459  }
460 
461  update = new TDecayChannel(
462  temp -> Number(),
463  temp -> MatrixElementCode(),
464  widths[i] / tot,
465  nd,
466  & ds[0]
467  ) ;
468 
469  new_list -> Add( update ) ;
470  }
471 
472  new_list -> SetOwner(kFALSE);
473 
474  return new_list ;
475 }
double EvolveDeltaDecayWidth(int dec_part_pdgc, TDecayChannel *ch, double W) const
cout<< t1-> GetEntries()
Definition: plottest35.C:29
Float_t d
Definition: plot.C:236
A very simple service to remember what detector we&#39;re working in.
#define W(x)
double BaryonResonanceDecayer::EvolveDeltaDecayWidth ( int  dec_part_pdgc,
TDecayChannel *  ch,
double  W 
) const
private

Definition at line 478 of file BaryonResonanceDecayer.cxx.

References fFFScaling, FinalStateMass(), genie::utils::res::FromPdgCode(), MECModelEnuComparisons::i, genie::pdg::IsNucleon(), genie::pdg::IsPion(), genie::pdg::IsProton(), genie::constants::kNucleonMass, genie::kPdgPiP, genie::constants::kPi0Mass, genie::constants::kPionMass, genie::constants::kProtonMass, m, genie::utils::res::Mass(), nd, scaling(), ana::Sqrt(), W, and genie::utils::res::Width().

Referenced by EvolveDeltaBR().

478  {
479 
480  /*
481  * The decay widths of the Delta in Pions or in N gammas are not constant.
482  * They depend on the actual mass of the decaying delta (W) they need to be evolved accordingly.
483  * This method tweaks the Delta branching ratios as a function of the W and
484  * returns the proper one depending on the specific decay channel.
485  */
486 
487  // identify the decay channel
488  // The delta decays only in 3 ways
489  // Delta -> Charged Pi + N
490  // Delta -> Pi0 + N
491  // Delta -> Gamma + N
492 
493  // They have evolution as a function of W that are different if the final state has pions or not
494  // so having tagged the pion is enough for the purpose of this method.
495 
496  bool has_pion = false ;
497  int pion_id = -1 ;
498  int nucleon_id = -1 ;
499  unsigned int nd = ch -> NDaughters() ;
500  for(unsigned int i = 0 ; i < nd; ++i ) {
501  if ( genie::pdg::IsPion( ch -> DaughterPdgCode(i) ) ) {
502  has_pion = true ;
503  pion_id = i ;
504  }
505 
506  if ( genie::pdg::IsNucleon( ch -> DaughterPdgCode(i) ) ) {
507  nucleon_id = i ;
508  }
509  }
510 
511 
512  // The first and most trivial evolution of the Width as a function of W
513  // is that if W is lower then the final state mass the width collapses to 0.
514 
515  if ( W < this -> FinalStateMass( ch ) ) {
516 
517  return 0. ;
518 
519  }
520 
521  // At this point, W is high enough to assume the decay of the delta in this channel
522  //
523  // The amplitude dependencies on W scales with the momentum of the pion or the photon respectivelly
524  // following these relationships
525  //
526  // (p_pi(W))^3
527  // Ampl_pi(W) = Ampl_pi(def)x---------------
528  // (p_pi(def))^3
529  //
530  //
531  // (p_ga(W))^3 (F_ga(W))^2
532  // Ampl_ga(W) = Ampl_ga(def)x--------------- x ---------------
533  // (p_ga(def))^3 (F_ga(def))^2
534  //
535  // where the "def" stand for the nominal value of the Delta mass.
536  // - pi_* are the momentum of the gamma and of the pion coming from the decay
537  // - F_ga is the form factor
538  //
539  // So the new amplitudes are evaluated and the proper value is returned
540 
541  // Getting the delta resonance from GENIE database
542  Resonance_t res = genie::utils::res::FromPdgCode( dec_part_pdgc ) ;
543 
544  double m = genie::utils::res::Mass( res ) ;
545  double m_2 = TMath::Power(m, 2);
546 
547  double mN = genie::pdg::IsProton( ch -> DaughterPdgCode( nucleon_id ) ) ? genie::constants::kProtonMass : genie::constants::kNucleonMass ;
548  double mN_2 = TMath::Power( mN, 2);
549 
550  double W_2 = TMath::Power(W, 2);
551 
552  double scaling = 0. ;
553 
554  if ( has_pion ) {
555 
556  double mPion = TMath::Abs( ch -> DaughterPdgCode( pion_id ) ) == kPdgPiP ? genie::constants::kPionMass : genie::constants::kPi0Mass ;
557  double m_aux1= TMath::Power( mN + mPion, 2) ;
558  double m_aux2= TMath::Power( mN - mPion, 2) ;
559 
560  // momentum of the pion in the Delta reference frame
561  double pPi_W = TMath::Sqrt((W_2-m_aux1)*(W_2-m_aux2))/(2*W); // at W
562  double pPi_m = TMath::Sqrt((m_2-m_aux1)*(m_2-m_aux2))/(2*m); // at the default Delta mass
563 
564  scaling = TMath::Power( pPi_W / pPi_m , 3 ) ;
565 
566  }
567  else {
568 
569  // momentum of the photon in the Delta Reference frame = Energy of the photon
570  double Egamma_W = (W_2-mN_2)/(2*W); // at W
571  double Egamma_m = (m_2-mN_2)/(2*m); // at the default Delta mass
572 
573  // form factor of the photon production
574  double fgamma_W = 1./(TMath::Power(1+Egamma_W*Egamma_W/fFFScaling, 2));
575  double fgamma_m = 1./(TMath::Power(1+Egamma_m*Egamma_m/fFFScaling, 2));
576 
577  scaling = TMath::Power( Egamma_W / Egamma_m, 3 ) * TMath::Power( fgamma_W / fgamma_m , 2 ) ;
578  }
579 
580  // get the width of the delta and obtain the width of the decay in the channel we are evolving
581  // evaluated at the nominal mass of the delta
582  double defChWidth = ch -> BranchingRatio() * genie::utils::res::Width( res ) ;
583 
584  return defChWidth * scaling ;
585 
586 }
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:289
static const double kNucleonMass
Definition: Constants.h:78
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:309
static const double kPi0Mass
Definition: Constants.h:75
double Mass(Resonance_t res)
resonance mass (GeV)
double Width(Resonance_t res)
resonance width (GeV)
enum genie::EResonance Resonance_t
void scaling(TH1D *hIn, const double shape_scale)
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:299
const int kPdgPiP
Definition: PDGCodes.h:135
double FinalStateMass(TDecayChannel *ch) const
Resonance_t FromPdgCode(int pdgc)
PDG code -> resonance id.
static const double kPionMass
Definition: Constants.h:74
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
#define W(x)
static const double kProtonMass
Definition: Constants.h:76
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
double BaryonResonanceDecayer::FinalStateMass ( TDecayChannel *  ch) const
private

Definition at line 665 of file BaryonResonanceDecayer.cxx.

References ana::assert(), genie::PDGLibrary::Find(), genie::PDGLibrary::Instance(), LOG, fetch_tb_beamline_files::md, nd, and pNOTICE.

Referenced by EvolveDeltaDecayWidth(), and SelectDecayChannel().

666 {
667 // Computes the total mass of the final state system
668 
669  double mass = 0;
670  unsigned int nd = ch->NDaughters();
671 
672  for(unsigned int iparticle = 0; iparticle < nd; iparticle++) {
673 
674  int daughter_code = ch->DaughterPdgCode(iparticle);
675  TParticlePDG * daughter = PDGLibrary::Instance()->Find(daughter_code);
676  assert(daughter);
677 
678  double md = daughter->Mass();
679 
680  // hack to switch off channels giving rare occurences of |1114| that has
681  // no decay channels in the pdg table (08/2007)
682  if(TMath::Abs(daughter_code) == 1114) {
683  LOG("ResonanceDecay", pNOTICE)
684  << "Disabling decay channel containing resonance 1114";;
685  md = 999999999;
686  }
687  mass += md;
688  }
689  return mass;
690 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
#define pNOTICE
Definition: Messenger.h:62
void Algorithm::FindConfig ( void  )
virtualinherited

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

Definition at line 135 of file Algorithm.cxx.

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

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

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

Definition at line 254 of file Algorithm.cxx.

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

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

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

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

Definition at line 287 of file Algorithm.cxx.

References GetConfig().

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

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

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

Referenced by genie::CollinsSpillerFragm::BuildFunction(), genie::PetersonFragm::BuildFunction(), genie::DISXSec::LoadConfig(), genie::INukeDeltaPropg::LoadConfig(), genie::COHXSec::LoadConfig(), genie::HadronTransporter::LoadConfig(), genie::DFRKinematicsGenerator::LoadConfig(), genie::RSHelicityAmplModelNCn::LoadConfig(), genie::RSHelicityAmplModelNCp::LoadConfig(), 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::DFRXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::KNOPythiaHadronization::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::MECXSec::LoadConfig(), genie::AivazisCharmPXSecLO::LoadConfig(), genie::BergerSehgalFMCOHPiPXSec2015::LoadConfig(), genie::ZExpAxialFormFactorModel::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::BBA03ELFormFactorsModel::LoadConfig(), genie::BBA05ELFormFactorsModel::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::ReinSehgalRESXSec::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::PrimaryLeptonGenerator::LoadConfig(), genie::SpectralFunc1d::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::OutgoingDarkGenerator::LoadConfig(), genie::LHAPDF6::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::ReinSehgalRESXSecFast::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::ReinSehgalSPPXSec::LoadConfig(), genie::EventGenerator::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(), 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::RESInteractionListGenerator::LoadConfigData(), genie::SKInteractionListGenerator::LoadConfigData(), genie::COHInteractionListGenerator::LoadConfigData(), genie::DMELInteractionListGenerator::LoadConfigData(), genie::RSPPInteractionListGenerator::LoadConfigData(), genie::DISInteractionListGenerator::LoadConfigData(), and genie::DMDISInteractionListGenerator::LoadConfigData().

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

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

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

Get algorithm status.

Definition at line 101 of file Algorithm.h.

References genie::Algorithm::fStatus.

101 { return fStatus; }
AlgStatus_t fStatus
algorithm execution status
Definition: Algorithm.h:166
bool BaryonResonanceDecayer::HasEvolvedBRs ( int  dec_part_pdgc)
staticprivate

Definition at line 765 of file BaryonResonanceDecayer.cxx.

References abs(), genie::kPdgP33m1232_Delta0, and genie::kPdgP33m1232_DeltaP.

Referenced by SelectDecayChannel().

765  {
766 
767  dec_part_pdgc = abs( dec_part_pdgc ) ;
768 
769  // the evolution of the Delta BR as a function of W is meaningful only when there are
770  // more than one decay channels.
771  // Delta++ and Delta- have only one decay channel bacause of baryon number and charge conservation
772 
773  return ( dec_part_pdgc == kPdgP33m1232_Delta0 ||
774  dec_part_pdgc == kPdgP33m1232_DeltaP ) ;
775 }
void abs(TH1 *hist)
const int kPdgP33m1232_DeltaP
Definition: PDGCodes.h:90
const int kPdgP33m1232_Delta0
Definition: PDGCodes.h:89
virtual const AlgId& genie::Algorithm::Id ( void  ) const
inlinevirtualinherited

Get algorithm ID.

Definition at line 98 of file Algorithm.h.

References genie::Algorithm::fID.

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

98 { return fID; }
AlgId fID
algorithm name and configuration set
Definition: Algorithm.h:156
void BaryonResonanceDecayer::InhibitDecay ( int  pdgc,
TDecayChannel *  ch = 0 
) const
privatevirtual

Implements genie::Decayer.

Definition at line 735 of file BaryonResonanceDecayer.cxx.

References IsHandled().

736 {
737  if(! this->IsHandled(pdgc)) return;
738  if(!dc) return;
739 
740  //
741  // Not implemented
742  //
743 }
void BaryonResonanceDecayer::Initialize ( void  ) const
private

Definition at line 719 of file BaryonResonanceDecayer.cxx.

Referenced by BaryonResonanceDecayer().

720 {
721 
722 }
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
bool BaryonResonanceDecayer::IsDelta ( int  dec_part_pdgc)
staticprivate

Definition at line 755 of file BaryonResonanceDecayer.cxx.

References abs(), genie::kPdgP33m1232_Delta0, genie::kPdgP33m1232_DeltaM, genie::kPdgP33m1232_DeltaP, and genie::kPdgP33m1232_DeltaPP.

755  {
756 
757  dec_part_pdgc = abs( dec_part_pdgc ) ;
758 
759  return ( dec_part_pdgc == kPdgP33m1232_DeltaM ||
760  dec_part_pdgc == kPdgP33m1232_Delta0 ||
761  dec_part_pdgc == kPdgP33m1232_DeltaP ||
762  dec_part_pdgc == kPdgP33m1232_DeltaPP ) ;
763 }
const int kPdgP33m1232_DeltaPP
Definition: PDGCodes.h:91
void abs(TH1 *hist)
const int kPdgP33m1232_DeltaP
Definition: PDGCodes.h:90
const int kPdgP33m1232_DeltaM
Definition: PDGCodes.h:88
const int kPdgP33m1232_Delta0
Definition: PDGCodes.h:89
bool BaryonResonanceDecayer::IsHandled ( int  pdgc) const
privatevirtual

Implements genie::Decayer.

Definition at line 724 of file BaryonResonanceDecayer.cxx.

References genie::utils::res::IsBaryonResonance(), LOG, and pDEBUG.

Referenced by InhibitDecay(), ProcessEventRecord(), and UnInhibitDecay().

725 {
726  bool is_handled = utils::res::IsBaryonResonance(pdg_code);
727 
728  LOG("ResonanceDecay", pDEBUG)
729  << "Can decay particle with PDG code = " << pdg_code
730  << "? " << ((is_handled)? "Yes" : "No");
731 
732  return pdg_code;
733 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?
#define pDEBUG
Definition: Messenger.h:64
bool BaryonResonanceDecayer::IsPiNDecayChannel ( TDecayChannel *  ch) const
private

Definition at line 692 of file BaryonResonanceDecayer.cxx.

References genie::pdg::IsNucleon(), genie::pdg::IsPion(), and nd.

Referenced by DecayExclusive().

693 {
694  if(!ch) return false;
695 
696  unsigned int nd = ch->NDaughters();
697  if(nd != 2) return false;
698 
699  int npi = 0;
700  int nnucl = 0;
701 
702  for(unsigned int iparticle = 0; iparticle < nd; iparticle++) {
703 
704  int daughter_code = ch->DaughterPdgCode(iparticle);
705 
706  if( genie::pdg::IsPion( daughter_code ) )
707  npi++;
708 
709  if ( genie::pdg::IsNucleon(daughter_code ) )
710  nnucl++;
711 
712  }//iparticle
713 
714  if(npi == 1 && nnucl == 1) return true;
715 
716  return false;
717 }
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:289
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:309
bool Decayer::IsUnstable ( int  pdgc) const
protectedvirtualinherited

Definition at line 87 of file Decayer.cxx.

References genie::PDGCodeList::ExistsInPDGCodeList(), genie::Decayer::fParticlesToDecay, genie::Decayer::fRunBefHadroTransp, and genie::utils::res::IsBaryonResonance().

Referenced by genie::Decayer::ToBeDecayed().

88 {
89  // ROOT's TParticlepdg::Lifetime() does not work properly
90  // do something else instead (temporarily)
91  //
92  // TParticlePDG * ppdg = PDGLibrary::Instance()->Find(pdg_code);
93  //if( ppdg->Lifetime() < fMaxLifetime ) { /* ... */ };
94  //
95 
96  // <temp/>
97  if( fRunBefHadroTransp ) {
98  //
99  // Run *before* the hadron transport MC
100  // At this point we decay only baryon resonances
101  //
102  bool decay = utils::res::IsBaryonResonance(pdg_code);
103  return decay;
104  }
105  else {
106  //
107  // Run *after* the hadron transport MC
108  // At this point we decay only particles in the fParticlesToDecay
109  // PDGCodeList (filled in from config inputs)
110  //
112  return decay;
113  }
114  // </temp>
115 
116  return false;
117 }
bool ExistsInPDGCodeList(int pdg_code) const
bool fRunBefHadroTransp
is invoked before or after FSI?
Definition: Decayer.h:57
PDGCodeList fParticlesToDecay
list of particles to be decayed
Definition: Decayer.h:58
Definition: decay.py:1
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?
void BaryonResonanceDecayer::LoadConfig ( void  )
virtual

Reimplemented from genie::Decayer.

Definition at line 777 of file BaryonResonanceDecayer.cxx.

References genie::utils::str::Convert(), exit(), fDeltaThetaOnly, fFFScaling, fQ2Thresholds, fR31, fR33, fR3m1, fW_max, genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), MECModelEnuComparisons::i, genie::constants::k1_Sqrt3, genie::Decayer::LoadConfig(), LOG, pFATAL, genie::utils::str::Split(), and string.

777  {
778 
780 
781  this -> GetParam( "FFScaling", fFFScaling ) ;
782 
783  this -> GetParamDef( "Delta-ThetaOnly", fDeltaThetaOnly, true ) ;
784 
785  bool invalid_configuration = false ;
786 
787  std::string raw ;
788  std::vector<std::string> bits ;
789 
790  // load R33 parameters
791  this -> GetParamDef( "Delta-R33", raw, string(" 0.5 ") ) ;
792  bits = utils::str::Split( raw, ";" ) ;
793 
794  if ( ! utils::str::Convert(bits, fR33) ) {
795  LOG("BaryonResonanceDecayer", pFATAL) << "Failed to decode Delta-R33 string: " ;
796  LOG("BaryonResonanceDecayer", pFATAL) << "String " << raw ;
797  invalid_configuration = true ;
798  }
799 
800  // load Q2 thresholds if necessary
801  if ( fR33.size() > 1 ) {
802  this -> GetParam("Delta-Q2", raw ) ;
803  bits = utils::str::Split( raw, ";" ) ;
804 
805  if ( ! utils::str::Convert(bits, fQ2Thresholds ) ) {
806  LOG("BaryonResonanceDecayer", pFATAL) << "Failed to decode Delta-Q2 string: " ;
807  LOG("BaryonResonanceDecayer", pFATAL) << "String: " << raw ;
808  invalid_configuration = true ;
809  }
810  }
811  else {
812  fQ2Thresholds.clear() ;
813  }
814 
815  // check if the number of Q2 matches the number of R33
816  if ( fQ2Thresholds.size() != fR33.size() -1 ) {
817  invalid_configuration = true ;
818  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-Q2 and Delta-R33 have wrong sizes" ;
819  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-Q2 -> " << fQ2Thresholds.size() ;
820  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-R33 -> " << fR33.size() ;
821  }
822 
823  if ( fDeltaThetaOnly ) {
824 
825  // check the parameters validity
826  for ( unsigned int i = 0 ; i < fR33.size(); ++i ) {
827  if ( (fR33[i] < -0.5) || (fR33[i] > 1.) ) {
828  invalid_configuration = true ;
829  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-R33[" << i << "] out of valid range [-0.5 ; 1 ]" ;
830  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-R33[" << i << "] = " << fR33[i] ;
831  break ;
832  }
833  }
834 
835  // set appropriate maxima
836  fW_max.resize( fR33.size(), 0. ) ;
837  for ( unsigned int i = 0 ; i < fR33.size(); ++i ) {
838  fW_max[i] = fR33[i] < 0.5 ? 2. * ( 1. - fR33[i] ) : fR33[i] + 0.5 ;
839  }
840 
841  } // Delta Theta Only
842 
843  else {
844 
845  // load R31 and R3m1 parameters
846  this -> GetParam( "Delta-R31", raw ) ;
847  bits = utils::str::Split( raw, ";" ) ;
848 
849  if ( ! utils::str::Convert(bits, fR31) ) {
850  LOG("BaryonResonanceDecayer", pFATAL) << "Failed to decode Delta-R31 string: " ;
851  LOG("BaryonResonanceDecayer", pFATAL) << "String " << raw ;
852  invalid_configuration = true ;
853  }
854 
855  this -> GetParam( "Delta-R3m1", raw ) ;
856  bits = utils::str::Split( raw, ";" ) ;
857 
858  if ( ! utils::str::Convert(bits, fR3m1) ) {
859  LOG("BaryonResonanceDecayer", pFATAL) << "Failed to decode Delta-R3m1 string: " ;
860  LOG("BaryonResonanceDecayer", pFATAL) << "String " << raw ;
861  invalid_configuration = true ;
862  }
863 
864  // check if they match the numbers of R33
865  if ( (fR31.size() != fR33.size()) || (fR3m1.size() != fR33.size()) ) {
866  LOG("BaryonResonanceDecayer", pFATAL) << "Delta-R31 or Delta-R3m1 sizes don't match Delta-R33" ;
867  LOG("BaryonResonanceDecayer", pFATAL) << "R31: " << fR31.size()
868  << ", R3m1: " << fR31.size()
869  << " while R33: " << fR33.size() ;
870  invalid_configuration = true ;
871  }
872 
873  // check if they are physical
874 
875  // Set the appropriate maxima
876  fW_max.resize( fR33.size(), 0. ) ;
877  for ( unsigned int i = 0 ; i < fR33.size(); ++i ) {
878  fW_max[i] = 1.+(fR33[i]-0.5) + 2.*k1_Sqrt3*fR31[i] + k1_Sqrt3*fR3m1[i];
879  }
880  }
881 
882  if ( invalid_configuration ) {
883 
884  LOG("BaryonResonanceDecayer", pFATAL)
885  << "Invalid configuration: Exiting" ;
886 
887  // From the FreeBSD Library Functions Manual
888  //
889  // EX_CONFIG (78) Something was found in an unconfigured or miscon-
890  // figured state.
891 
892  exit( 78 ) ;
893 
894  }
895 
896 }
#define pFATAL
Definition: Messenger.h:57
static const double k1_Sqrt3
Definition: Constants.h:137
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool Convert(const vector< std::string > &input, std::vector< T > &v)
virtual void LoadConfig(void)
Definition: Decayer.cxx:135
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
exit(0)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
enum BeamMode string
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
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 BaryonResonanceDecayer::ProcessEventRecord ( GHepRecord event) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 56 of file BaryonResonanceDecayer.cxx.

References Decay(), genie::Decayer::fRunBefHadroTransp, IsHandled(), genie::kHadroSysGenErr, LOG, genie::GHepParticle::Name(), pDEBUG, genie::GHepParticle::Pdg(), pINFO, pNOTICE, pWARN, genie::exceptions::EVGThreadException::SetReason(), genie::GHepParticle::Status(), genie::exceptions::EVGThreadException::SwitchOnFastForward(), and genie::Decayer::ToBeDecayed().

57 {
58  LOG("ResonanceDecay", pINFO)
59  << "Running resonance decayer "
60  << ((fRunBefHadroTransp) ? "*before*" : "*after*") << " FSI";
61 
62  // Loop over particles, find unstable ones and decay them
63  TObjArrayIter piter(event);
64  GHepParticle * p = 0;
65  int ipos = -1;
66 
67  while( (p = (GHepParticle *) piter.Next()) ) {
68 
69  ipos++;
70  LOG("ResonanceDecay", pDEBUG) << "Checking: " << p->Name();
71 
72  int pdg_code = p->Pdg();
73  GHepStatus_t status_code = p->Status();
74 
75  // std::cout << "Decaing particle " << ipos << " with PDG " << pdg_code << std::endl ;
76 
77  if(!this->IsHandled (pdg_code)) continue;
78  if(!this->ToBeDecayed(pdg_code, status_code)) continue;
79 
80  LOG("ResonanceDecay", pNOTICE)
81  << "Decaying unstable particle: " << p->Name();
82 
83  bool decayed = this->Decay(ipos, event);
84  if ( ! decayed ) {
85  LOG("ResonanceDecay", pWARN) << "Resonance not decayed!" ;
86  LOG("ResonanceDecay", pWARN) << "Quitting the current event generation thread" ;
87 
88  event -> EventFlags() -> SetBitNumber(kHadroSysGenErr, true);
89 
91  exception.SetReason("Resonance not decayed");
92  exception.SwitchOnFastForward();
93  throw exception;
94 
95  return ;
96  }
97 
98  } // loop over particles
99 
100  LOG("ResonanceDecay", pNOTICE)
101  << "Done finding & decaying baryon resonances";
102 }
virtual bool ToBeDecayed(int pdgc, GHepStatus_t ist) const
Definition: Decayer.cxx:51
bool Decay(int dec_part_id, GHepRecord *event) const
enum genie::EGHepStatus GHepStatus_t
const char * p
Definition: xmltok.h:285
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
GHepStatus_t Status(void) const
Definition: GHepParticle.h:65
int Pdg(void) const
Definition: GHepParticle.h:64
string Name(void) const
Name that corresponds to the PDG code.
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool fRunBefHadroTransp
is invoked before or after FSI?
Definition: Decayer.h:57
#define pINFO
Definition: Messenger.h:63
#define pWARN
Definition: Messenger.h:61
#define pNOTICE
Definition: Messenger.h:62
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
#define pDEBUG
Definition: Messenger.h:64
TDecayChannel * BaryonResonanceDecayer::SelectDecayChannel ( int  dec_part_id,
GHepRecord event,
bool &  to_be_deleted 
) const
private

Definition at line 151 of file BaryonResonanceDecayer.cxx.

References EvolveDeltaBR(), FinalStateMass(), genie::PDGLibrary::Find(), GetEntries(), HasEvolvedBRs(), MECModelEnuComparisons::i, genie::PDGLibrary::Instance(), genie::RandomGen::Instance(), LOG, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), pDEBUG, genie::GHepParticle::Pdg(), pERROR, pINFO, pWARN, generate_hists::rnd, genie::RandomGen::RndDec(), SLOG, W, and submit_syst::x.

Referenced by Decay().

154 {
155  // Get particle to be decayed
156  GHepParticle * decay_particle = event->Particle(decay_particle_id);
157  if(!decay_particle) return 0;
158 
159  // Get the particle 4-momentum and PDG code
160  TLorentzVector decay_particle_p4 = *(decay_particle->P4());
161  int decay_particle_pdg_code = decay_particle->Pdg();
162 
163  // Find the particle in the PDG library & quit if it does not exist
164  TParticlePDG * mother =
165  PDGLibrary::Instance()->Find(decay_particle_pdg_code);
166  if(!mother) {
167  LOG("ResonanceDecay", pERROR)
168  << "\n *** The particle with PDG code = " << decay_particle_pdg_code
169  << " was not found in PDGLibrary";
170  return 0;
171  }
172  LOG("ResonanceDecay", pINFO)
173  << "Decaying a " << mother->GetName()
174  << " with P4 = " << utils::print::P4AsString(&decay_particle_p4);
175 
176  // Get the resonance mass W (generally different from the mass associated
177  // with the input PDG code, since the it is produced off the mass shell)
178  double W = decay_particle_p4.M();
179  LOG("ResonanceDecay", pINFO) << "Available mass W = " << W;
180 
181  // Get all decay channels
182  TObjArray * original_decay_list = mother->DecayList();
183 
184  unsigned int nch = original_decay_list -> GetEntries();
185  LOG("ResonanceDecay", pINFO)
186  << mother->GetName() << " has: " << nch << " decay channels";
187 
188  // Loop over the decay channels (dc) and write down the branching
189  // ratios to be used for selecting a decay channel.
190  // Since a baryon resonance can be created at W < Mres, explicitly
191  // check and inhibit decay channels for which W > final-state-mass
192 
193  bool has_evolved_brs = BaryonResonanceDecayer::HasEvolvedBRs( decay_particle_pdg_code ) ;
194 
195  TObjArray * actual_decay_list = nullptr ;
196 
197  if ( has_evolved_brs ) {
198  actual_decay_list = EvolveDeltaBR( decay_particle_pdg_code, original_decay_list, W ) ;
199  if ( ! actual_decay_list ) return nullptr ;
200  nch = actual_decay_list -> GetEntries() ;
201  to_be_deleted = true ;
202  }
203  else {
204  actual_decay_list = original_decay_list ;
205  to_be_deleted = false ;
206  }
207 
208  double BR[nch], tot_BR = 0;
209 
210  for(unsigned int ich = 0; ich < nch; ich++) {
211 
212  TDecayChannel * ch = (TDecayChannel *) actual_decay_list -> At(ich);
213 
214  double fsmass = this->FinalStateMass(ch) ;
215  if ( fsmass < W ) {
216 
217  SLOG("ResonanceDecay", pDEBUG)
218  << "Using channel: " << ich
219  << " with final state mass = " << fsmass << " GeV";
220 
221  tot_BR += ch->BranchingRatio();
222 
223  } else {
224  SLOG("ResonanceDecay", pINFO)
225  << "Suppresing channel: " << ich
226  << " with final state mass = " << fsmass << " GeV";
227  } // final state mass
228 
229  BR[ich] = tot_BR;
230  }//channel loop
231 
232  if( tot_BR <= 0. ) {
233  SLOG("ResonanceDecay", pWARN)
234  << "None of the " << nch << " decay channels is available @ W = " << W;
235  return 0;
236  }
237 
238  // Select a resonance based on the branching ratios
239  unsigned int ich = 0, sel_ich; // id of selected decay channel
241  double x = tot_BR * rnd->RndDec().Rndm();
242  do {
243  sel_ich = ich;
244  } while (x > BR[ich++]);
245 
246  TDecayChannel * sel_ch = (TDecayChannel *) actual_decay_list -> At(sel_ich);
247 
248  LOG("ResonanceDecay", pINFO)
249  << "Selected " << sel_ch->NDaughters() << "-particle decay channel ("
250  << sel_ich << ") has BR = " << sel_ch->BranchingRatio();
251 
252  if ( has_evolved_brs ) {
253 
254  for ( unsigned int i = 0; i < nch; ++i) {
255  if ( sel_ich != i ) delete actual_decay_list -> At(i);
256  }
257 
258  delete actual_decay_list ;
259  }
260 
261  return sel_ch;
262 }
#define pERROR
Definition: Messenger.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
static bool HasEvolvedBRs(int dec_part_pdgc)
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:34
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
cout<< t1-> GetEntries()
Definition: plottest35.C:29
int Pdg(void) const
Definition: GHepParticle.h:64
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TObjArray * EvolveDeltaBR(int dec_part_pdgc, TObjArray *decay_list, double W) const
double FinalStateMass(TDecayChannel *ch) const
#define pINFO
Definition: Messenger.h:63
#define pWARN
Definition: Messenger.h:61
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
#define W(x)
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:57
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
#define pDEBUG
Definition: Messenger.h:64
void Algorithm::SetId ( const AlgId id)
virtualinherited

Set algorithm ID.

Definition at line 313 of file Algorithm.cxx.

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

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

Definition at line 318 of file Algorithm.cxx.

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

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

Definition at line 353 of file Algorithm.cxx.

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

Referenced by genie::Algorithm::AllowReconfig(), genie::utils::gsl::FullQELdXSec::FullQELdXSec(), genie::NewQELXSec::Integrate(), genie::HadronTransporter::LoadConfig(), genie::NucleonDecayPrimaryVtxGenerator::LoadConfig(), genie::IBDXSecMap::LoadConfig(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::COHElasticPXSec::LoadConfig(), genie::DISHadronicSystemGenerator::LoadConfig(), genie::SlowRsclCharmDISPXSecLO::LoadConfig(), genie::AhrensNCELPXSec::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::UnstableParticleDecayer::LoadConfig(), genie::ReinDFRPXSec::LoadConfig(), genie::PythiaHadronization::LoadConfig(), genie::BYPDF::LoadConfig(), genie::QPMDISPXSec::LoadConfig(), genie::AlvarezRusoCOHPiPXSec::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::StrumiaVissaniIBDPXSec::LoadConfig(), genie::MECGenerator::LoadConfig(), genie::NNBarOscPrimaryVtxGenerator::LoadConfig(), genie::FermiMover::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::IMDAnnihilationPXSec::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::KNOPythiaHadronization::LoadConfig(), genie::AivazisCharmPXSecLO::LoadConfig(), genie::RESHadronicSystemGenerator::LoadConfig(), genie::P33PaschosLalakulichPXSec::LoadConfig(), genie::BergerSehgalFMCOHPiPXSec2015::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::BergerSehgalCOHPiPXSec2015::LoadConfig(), genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::NuElectronPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::ReinSehgalCOHPiPXSec::LoadConfig(), genie::NievesSimoVacasMECPXSec2016::LoadConfig(), genie::KovalenkoQELCharmPXSec::LoadConfig(), genie::CharmHadronization::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::EventGenerator::LoadConfig(), genie::SmithMonizQELCCXSec::LoadConfig(), genie::BardinIMDRadCorPXSec::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::MartiniEricsonChanfrayMarteauMECPXSec2016::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), genie::QELEventGeneratorSM::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
bool Decayer::ToBeDecayed ( int  pdgc,
GHepStatus_t  ist 
) const
protectedvirtualinherited

Definition at line 51 of file Decayer.cxx.

References genie::Decayer::fRunBefHadroTransp, genie::Decayer::IsUnstable(), genie::kIStHadronInTheNucleus, genie::kIStPreDecayResonantState, genie::kIStStableFinalState, LOG, and pDEBUG.

Referenced by genie::PythiaDecayer::ProcessEventRecord(), and ProcessEventRecord().

52 {
53  // Check whether it is "unstable" (definition can vary)
54 
55  bool is_unstable = this->IsUnstable(pdg_code);
56 
57  LOG("Decay", pDEBUG)
58  << "Particle is unstable? "
59  << ((is_unstable) ? "Yes" : "No");
60 
61  if(!is_unstable) return false;
62 
63  // Check whether the given unstable particle
64  // has the appropriate status code to be decayed
65 
66  bool to_be_decayed = false;
67 
68  if(fRunBefHadroTransp) {
69  to_be_decayed =
70  (status_code == kIStHadronInTheNucleus ||
71  status_code == kIStPreDecayResonantState ||
72  status_code == kIStStableFinalState);
73  }
74  else {
75  to_be_decayed =
76  (status_code == kIStStableFinalState);
77  }
78 
79  LOG("Decay", pDEBUG)
80  << "Particle to be decayed "
81  << "[" << ((fRunBefHadroTransp) ? "Before" : "After") << " FSI]? "
82  << ((to_be_decayed) ? "Yes" : "No");
83 
84  return to_be_decayed;
85 }
virtual bool IsUnstable(int pdgc) const
Definition: Decayer.cxx:87
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool fRunBefHadroTransp
is invoked before or after FSI?
Definition: Decayer.h:57
#define pDEBUG
Definition: Messenger.h:64
void BaryonResonanceDecayer::UnInhibitDecay ( int  pdgc,
TDecayChannel *  ch = 0 
) const
privatevirtual

Implements genie::Decayer.

Definition at line 745 of file BaryonResonanceDecayer.cxx.

References IsHandled().

746 {
747  if(! this->IsHandled(pdgc)) return;
748  if(!dc) return;
749 
750  //
751  // Not implemented
752  //
753 }
double BaryonResonanceDecayer::Weight ( void  ) const
private

Definition at line 660 of file BaryonResonanceDecayer.cxx.

References fWeight.

661 {
662  return fWeight;
663 }

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.

bool genie::BaryonResonanceDecayer::fDeltaThetaOnly
private

Definition at line 74 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

double genie::BaryonResonanceDecayer::fFFScaling
private

Definition at line 81 of file BaryonResonanceDecayer.h.

Referenced by EvolveDeltaDecayWidth(), and LoadConfig().

bool genie::Decayer::fGenerateWeighted
protectedinherited

generate weighted or unweighted decays?

Definition at line 56 of file Decayer.h.

Referenced by DecayExclusive(), and genie::Decayer::LoadConfig().

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.

PDGCodeList genie::Decayer::fParticlesNotToDecay
protectedinherited

list of particles for which decay is inhibited

Definition at line 59 of file Decayer.h.

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

PDGCodeList genie::Decayer::fParticlesToDecay
protectedinherited

list of particles to be decayed

Definition at line 58 of file Decayer.h.

Referenced by genie::Decayer::IsUnstable(), and genie::Decayer::LoadConfig().

TGenPhaseSpace genie::BaryonResonanceDecayer::fPhaseSpaceGenerator
mutableprivate

Definition at line 71 of file BaryonResonanceDecayer.h.

Referenced by DecayExclusive().

std::vector<double> genie::BaryonResonanceDecayer::fQ2Thresholds
private

Definition at line 77 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

std::vector<double> genie::BaryonResonanceDecayer::fR31
private

Definition at line 76 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

std::vector<double> genie::BaryonResonanceDecayer::fR33
private

Definition at line 76 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

std::vector<double> genie::BaryonResonanceDecayer::fR3m1
private

Definition at line 76 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

bool genie::Decayer::fRunBefHadroTransp
protectedinherited
AlgStatus_t genie::Algorithm::fStatus
protectedinherited

algorithm execution status

Definition at line 166 of file Algorithm.h.

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

std::vector<double> genie::BaryonResonanceDecayer::fW_max
private

Definition at line 79 of file BaryonResonanceDecayer.h.

Referenced by AcceptPionDecay(), and LoadConfig().

double genie::BaryonResonanceDecayer::fWeight
mutableprivate

Definition at line 72 of file BaryonResonanceDecayer.h.

Referenced by Decay(), DecayExclusive(), and Weight().


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