GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UnstableParticleDecayer.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <c.andreopoulos \at cern.ch>
7  University of Liverpool
8 */
9 //____________________________________________________________________________
10 
11 #include <sstream>
12 
17 
18 using std::ostringstream;
19 
20 using namespace genie;
21 //___________________________________________________________________________
23 EventRecordVisitorI("genie::UnstableParticleDecayer")
24 {
25 
26 }
27 //___________________________________________________________________________
29 EventRecordVisitorI("genie::UnstableParticleDecayer", config)
30 {
31 
32 }
33 //___________________________________________________________________________
35 {
36  fDecayers.clear();
37 }
38 //___________________________________________________________________________
40 {
41  vector<const EventRecordVisitorI *>::const_iterator it = fDecayers.begin();
42  for( ; it != fDecayers.end(); ++it)
43  {
44  const EventRecordVisitorI * decayer = *it;
45  decayer->ProcessEventRecord(event);
46  }
47 }
48 //___________________________________________________________________________
50 {
51  Algorithm::Configure(config);
52  this->LoadConfig();
53 
54  fAllowReconfig = false;
55 }
56 //___________________________________________________________________________
58 {
59  Algorithm::Configure(config);
60  this->LoadConfig();
61 
62  fAllowReconfig = false;
63 }
64 //___________________________________________________________________________
66 {
67  fDecayers.clear();
68 
69  // Load particle decayers
70  // Order is important if both decayers can handle a specific particle
71  // as only the first would get the chance to decay it
72  int ndec = 0 ;
73  this->GetParam("NDecayers", ndec);
74  assert(ndec>0);
75 
76  for(int idec = 0; idec < ndec; idec++) {
77  ostringstream alg_key;
78  alg_key << "Decayer-" << idec;
79  const EventRecordVisitorI * decayer =
80  dynamic_cast<const EventRecordVisitorI *>
81  (this->SubAlg(alg_key.str()));
82  fDecayers.push_back(decayer);
83  }
84 }
85 //___________________________________________________________________________
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
void Configure(const Registry &config)
vector< const EventRecordVisitorI * > fDecayers
list of all specified decayers
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
void ProcessEventRecord(GHepRecord *event) const
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345