Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
QAG4SimulationTruthDecay.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file QAG4SimulationTruthDecay.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
3
#ifndef GEANTTESTER_H
4
#define GEANTTESTER_H
5
6
#include <
fun4all/SubsysReco.h
>
7
8
#include <
decayfinder/DecayFinderContainer_v1.h
>
// for DecayFinderContainer_v1
9
10
#include <
g4main/PHG4Particle.h
>
11
#include <
g4main/PHG4TruthInfoContainer.h
>
12
#include <
g4main/PHG4VtxPoint.h
>
13
14
#include <TBranch.h>
15
#include <TFile.h>
16
#include <TTree.h>
17
18
#include <string>
19
20
class
PHCompositeNode
;
21
class
PHG4TruthInfoContainer
;
22
class
PHG4Particle
;
23
class
PHG4VtxPoint
;
24
25
class
QAG4SimulationTruthDecay
:
public
SubsysReco
26
{
27
public
:
28
QAG4SimulationTruthDecay
(
const
std::string
&
name
=
"QAG4SimulationTruthDecay"
);
29
30
virtual
~QAG4SimulationTruthDecay
();
31
37
int
Init
(
PHCompositeNode
*topNode)
override
;
38
42
int
process_event
(
PHCompositeNode
*topNode)
override
;
43
44
std::string
get_histo_prefix
();
45
47
int
End
(
PHCompositeNode
*topNode)
override
;
48
49
void
setMotherPDG
(
int
PDGID) {
m_decay_pdg_id
= PDGID; }
50
51
void
setMotherPDGRange
(
int
min
,
int
max)
52
{
53
m_mother_PDG_ID_min
=
min
;
54
m_mother_PDG_ID_max
= max;
55
};
56
void
setDaughterPDGRange
(
int
min
,
int
max)
57
{
58
m_daughter_PDG_ID_min
=
min
;
59
m_daughter_PDG_ID_max
= max;
60
};
61
62
void
setMinPT
(
float
value
) {
m_pt_min
=
value
; }
63
64
void
setEtaRange
(
float
min
,
float
max)
65
{
66
m_eta_min
=
min
;
67
m_eta_max
= max;
68
}
69
70
void
setNBinsMass
(
int
nBins) {
m_mass_nBins
= nBins; }
71
void
setMassRange
(
float
min
,
float
max)
72
{
73
m_mass_min
=
min
;
74
m_mass_max
= max;
75
}
76
77
void
setNBinsDecayLength
(
int
nBins) {
m_decayLength_nBins
= nBins; }
78
void
setDecayLengthRange
(
float
min
,
float
max)
79
{
80
m_decayLength_min
=
min
;
81
m_decayLength_max
= max;
82
}
83
84
void
setNBinsDecayTime
(
int
nBins) {
m_decayTime_nBins
= nBins; }
85
void
setDecayTimeRange
(
float
min
,
float
max)
86
{
87
m_decayTime_min
=
min
;
88
m_decayTime_max
= max;
89
}
90
91
void
setDFNodeName
(
const
std::string
&
name
) {
m_df_module_name
=
name
; }
92
void
setOutputName
(
const
std::string
&
name
) {
m_outfile_name
=
name
; }
93
void
writeTuple
(
bool
write
) {
m_write_nTuple
=
write
; }
94
95
private
:
96
typedef
std::vector<std::pair<std::pair<int, int>,
int
>>
Decay
;
97
98
unsigned
int
m_nTracks
;
99
float
m_pt_min
;
100
float
m_eta_min
;
101
float
m_eta_max
;
102
int
m_decay_pdg_id
;
103
104
PHG4TruthInfoContainer
*
m_truth_info
;
105
PHG4Particle
*
m_g4particle
;
106
std::string
m_df_module_name
;
107
std::string
m_outfile_name
;
108
TFile *
m_outfile
;
109
TTree *
m_tree
;
110
bool
m_write_nTuple
;
111
bool
m_write_QAHists
;
112
DecayFinderContainer_v1
*
m_decayMap
=
nullptr
;
113
114
void
initializeBranches
();
115
void
getMotherPDG
(
PHCompositeNode
*topNode);
116
std::vector<int>
getDecayFinderMothers
(
PHCompositeNode
*topNode);
117
bool
isInRange
(
float
min
,
float
value
,
float
max);
118
void
resetValues
();
119
120
int
m_mother_PDG_ID_min
= -421;
121
int
m_mother_PDG_ID_max
= 421;
122
int
m_daughter_PDG_ID_min
= -321;
123
int
m_daughter_PDG_ID_max
= 321;
124
125
int
m_mass_nBins
= 100;
126
float
m_mass_min
= 0;
127
float
m_mass_max
= 2;
128
129
int
m_decayLength_nBins
= 100;
130
float
m_decayLength_min
= 0;
131
float
m_decayLength_max
= 1;
132
133
int
m_decayTime_nBins
= 100;
134
float
m_decayTime_min
= 0;
135
float
m_decayTime_max
= 0.1;
136
137
static
const
int
max_tracks
= 20;
138
unsigned
int
m_event_number
= 0;
139
float
m_mother_mass
= -99;
140
float
m_daughter_sum_mass
= 0;
141
float
m_mother_decayLength
= -99;
142
float
m_mother_decayTime
= -99;
143
int
m_mother_pdg_id
= -99;
144
float
m_mother_px
= 0;
145
float
m_mother_py
= 0;
146
float
m_mother_pz
= 0;
147
float
m_mother_pE
= 0;
148
float
m_mother_pT
= 0;
149
float
m_mother_eta
= 0;
150
int
m_mother_barcode
= -99;
151
int
m_track_pdg_id
[
max_tracks
] = {0};
152
float
m_track_px
[
max_tracks
] = {0};
153
float
m_track_py
[
max_tracks
] = {0};
154
float
m_track_pz
[
max_tracks
] = {0};
155
float
m_track_pE
[
max_tracks
] = {0};
156
float
m_track_pT
[
max_tracks
] = {0};
157
float
m_track_eta
[
max_tracks
] = {0};
158
float
m_track_mass
[
max_tracks
] = {0};
159
int
m_track_mother_barcode
[
max_tracks
] = {0};
160
float
m_delta_px
= 0;
161
float
m_delta_py
= 0;
162
float
m_delta_pz
= 0;
163
float
m_delta_pE
= 0;
164
bool
m_accept_px_1percent
=
false
;
165
bool
m_accept_py_1percent
=
false
;
166
bool
m_accept_pz_1percent
=
false
;
167
bool
m_accept_pE_1percent
=
false
;
168
bool
m_accept_px_5percent
=
false
;
169
bool
m_accept_py_5percent
=
false
;
170
bool
m_accept_pz_5percent
=
false
;
171
bool
m_accept_pE_5percent
=
false
;
172
bool
m_accept_px_15percent
=
false
;
173
bool
m_accept_py_15percent
=
false
;
174
bool
m_accept_pz_15percent
=
false
;
175
bool
m_accept_pE_15percent
=
false
;
176
bool
m_accept_eta
=
true
;
177
bool
m_accept_pT
=
true
;
178
};
179
180
#endif // GEANTTESTER_H
coresoftware
blob
master
offline
QA
modules
QAG4SimulationTruthDecay.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:11
using
1.8.2 with
sPHENIX GitHub integration