GENIEGenerator
Loading...
Searching...
No Matches
Physics
Decay
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
13
#include "
Framework/GHEP/GHepRecord.h
"
14
#include "
Framework/Messenger/Messenger.h
"
15
#include "
Framework/Registry/Registry.h
"
16
#include "
Physics/Decay/UnstableParticleDecayer.h
"
17
18
using
std::ostringstream;
19
20
using namespace
genie
;
21
//___________________________________________________________________________
22
UnstableParticleDecayer::UnstableParticleDecayer
() :
23
EventRecordVisitorI
(
"genie::UnstableParticleDecayer"
)
24
{
25
26
}
27
//___________________________________________________________________________
28
UnstableParticleDecayer::UnstableParticleDecayer
(
string
config) :
29
EventRecordVisitorI
(
"genie::UnstableParticleDecayer"
, config)
30
{
31
32
}
33
//___________________________________________________________________________
34
UnstableParticleDecayer::~UnstableParticleDecayer
()
35
{
36
fDecayers
.clear();
37
}
38
//___________________________________________________________________________
39
void
UnstableParticleDecayer::ProcessEventRecord
(
GHepRecord
* event)
const
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
//___________________________________________________________________________
49
void
UnstableParticleDecayer::Configure
(
const
Registry
& config)
50
{
51
Algorithm::Configure
(config);
52
this->
LoadConfig
();
53
54
fAllowReconfig
=
false
;
55
}
56
//___________________________________________________________________________
57
void
UnstableParticleDecayer::Configure
(
string
config)
58
{
59
Algorithm::Configure
(config);
60
this->
LoadConfig
();
61
62
fAllowReconfig
=
false
;
63
}
64
//___________________________________________________________________________
65
void
UnstableParticleDecayer::LoadConfig
(
void
)
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
//___________________________________________________________________________
GHepRecord.h
Messenger.h
Registry.h
UnstableParticleDecayer.h
genie::Algorithm::fAllowReconfig
bool fAllowReconfig
Definition
Algorithm.h:162
genie::Algorithm::GetParam
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
genie::Algorithm::Configure
virtual void Configure(const Registry &config)
Definition
Algorithm.cxx:62
genie::Algorithm::SubAlg
const Algorithm * SubAlg(const RgKey ®istry_key) const
Definition
Algorithm.cxx:345
genie::EventRecordVisitorI::ProcessEventRecord
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
genie::EventRecordVisitorI::EventRecordVisitorI
EventRecordVisitorI()
Definition
EventRecordVisitorI.cxx:16
genie::GHepRecord
GENIE's GHEP MC event record.
Definition
GHepRecord.h:45
genie::Registry
A registry. Provides the container for algorithm configuration parameters.
Definition
Registry.h:65
genie::UnstableParticleDecayer::ProcessEventRecord
void ProcessEventRecord(GHepRecord *event) const
Definition
UnstableParticleDecayer.cxx:39
genie::UnstableParticleDecayer::Configure
void Configure(const Registry &config)
Definition
UnstableParticleDecayer.cxx:49
genie::UnstableParticleDecayer::~UnstableParticleDecayer
~UnstableParticleDecayer()
Definition
UnstableParticleDecayer.cxx:34
genie::UnstableParticleDecayer::UnstableParticleDecayer
UnstableParticleDecayer()
Definition
UnstableParticleDecayer.cxx:22
genie::UnstableParticleDecayer::LoadConfig
void LoadConfig(void)
Definition
UnstableParticleDecayer.cxx:65
genie::UnstableParticleDecayer::fDecayers
vector< const EventRecordVisitorI * > fDecayers
list of all specified decayers
Definition
UnstableParticleDecayer.h:51
genie
THE MAIN GENIE PROJECT NAMESPACE
Definition
AlgCmp.h:25
Generated on
for GENIEGenerator by
1.14.0