GENIEGenerator
Loading...
Searching...
No Matches
UnstableParticleDecayer.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, 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
18using std::ostringstream;
19
20using namespace genie;
21//___________________________________________________________________________
23EventRecordVisitorI("genie::UnstableParticleDecayer")
24{
25
26}
27//___________________________________________________________________________
29EventRecordVisitorI("genie::UnstableParticleDecayer", config)
30{
31
32}
33//___________________________________________________________________________
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{
52 this->LoadConfig();
53
54 fAllowReconfig = false;
55}
56//___________________________________________________________________________
58{
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//___________________________________________________________________________
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
const Algorithm * SubAlg(const RgKey &registry_key) const
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
void ProcessEventRecord(GHepRecord *event) const
void Configure(const Registry &config)
vector< const EventRecordVisitorI * > fDecayers
list of all specified decayers
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25