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
G4_KFParticle.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_KFParticle.C
1
#ifndef MACRO_G4KFPARTICLE_C
2
#define MACRO_G4KFPARTICLE_C
3
4
#include <
GlobalVariables.C
>
5
6
#define HomogeneousField
7
#include <kfparticle_sphenix/KFParticle_sPHENIX.h>
8
#include <
decayfinder/DecayFinder.h
>
9
#include <qa_modules/QAG4SimulationKFParticle.h>
10
11
#include <
fun4all/Fun4AllServer.h
>
12
13
R__LOAD_LIBRARY(libkfparticle_sphenix.so)
14
R__LOAD_LIBRARY(libqa_kfparticle.so)
15
R__LOAD_LIBRARY(libdecayfinder.so)
16
17
namespace Enable
18
{
19
bool
KFPARTICLE
=
false
;
20
bool
KFPARTICLE_SAVE_NTUPLE
=
false
;
21
bool
KFPARTICLE_APPEND_TO_DST
=
true
;
22
bool
KFPARTICLE_TRUTH_MATCH
=
false
;
23
bool
KFPARTICLE_DETECTOR_INFO
=
false
;
24
int
KFPARTICLE_VERBOSITY
= 0;
25
std::string
KFPARTICLE_TRACKMAP
=
"SvtxTrackMap"
;
26
std::string
KFPARTICLE_VERTEXMAP
=
"SvtxVertexMap"
;
27
}
// namespace Enable
28
29
namespace
KFPARTICLE
30
{
31
bool
QA
=
false
;
32
33
bool
runUpsilonReco
=
false
;
34
std::string
UpsilonName
=
"Upsilon"
;
35
std::string
UpsilonDecayDescriptor
=
UpsilonName
+
" -> e^+ e^-"
;
36
std::pair<float, float>
UpsilonMassRange
(8, 11);
37
bool
UpsilonTrigger
=
false
;
38
39
bool
runD0Reco
=
false
;
40
std::string
D0Name
=
"D0"
;
41
std::string
D0DecayDescriptor
=
"["
+
D0Name
+
" -> K^- pi^+]cc"
;
42
std::pair<float, float>
D0MassRange
(1.75, 1.95);
43
bool
D0Trigger
=
false
;
44
45
bool
runLambdacReco
=
false
;
46
std::string
LambdacName
=
"Lambdac"
;
47
std::string
LambdacDecayDescriptor
=
"["
+
LambdacName
+
" -> proton^+ K^- pi^+]cc"
;
48
std::pair<float, float>
LambdacMassRange
(2.15, 2.45);
49
bool
LambdacTrigger
=
false
;
50
}
//namesppace KFPARTICLE
51
52
namespace
KFParticleBaseCut
53
{
54
float
minTrackPT
= 0.5;
// GeV
55
float
maxTrackchi2nDoF
= 2;
56
float
minTrackIPchi2
= 15;
// IP = DCA of track with vertex
57
float
maxVertexchi2nDoF
= 2;
58
float
maxTrackTrackDCA
= 0.05;
// cm
59
float
minMotherPT
= 0;
// GeV
60
}
// namespace KFParticleBaseCut
61
62
void
KFParticle_Upsilon_Reco
()
63
{
64
int
verbosity
= std::max(
Enable::VERBOSITY
,
Enable::KFPARTICLE_VERBOSITY
);
65
66
Fun4AllServer
*se =
Fun4AllServer::instance
();
67
68
KFParticle_sPHENIX
*kfparticle =
new
KFParticle_sPHENIX
(
"KFParticle_"
+
KFPARTICLE::UpsilonName
+
"_Reco"
);
69
kfparticle->
Verbosity
(verbosity);
70
kfparticle->
setDecayDescriptor
(
KFPARTICLE::UpsilonDecayDescriptor
);
71
72
kfparticle->
saveDST
(
Enable::KFPARTICLE_APPEND_TO_DST
);
73
kfparticle->
saveOutput
(
Enable::KFPARTICLE_SAVE_NTUPLE
);
74
kfparticle->
doTruthMatching
(
Enable::KFPARTICLE_TRUTH_MATCH
);
75
kfparticle->
getDetectorInfo
(
Enable::KFPARTICLE_DETECTOR_INFO
);
76
77
kfparticle->
setMinimumTrackPT
(
KFParticleBaseCut::minTrackPT
);
78
kfparticle->
setMinimumTrackIPchi2
(0);
// Upsilon decays are prompt, tracks are more likely to point to vertex
79
kfparticle->
setMaximumTrackchi2nDOF
(
KFParticleBaseCut::maxTrackchi2nDoF
);
80
81
kfparticle->
setMaximumVertexchi2nDOF
(
KFParticleBaseCut::maxVertexchi2nDoF
);
82
kfparticle->
setMaximumDaughterDCA
(
KFParticleBaseCut::maxTrackTrackDCA
);
83
84
kfparticle->
setMinimumMass
(
KFPARTICLE::UpsilonMassRange
.first);
85
kfparticle->
setMaximumMass
(
KFPARTICLE::UpsilonMassRange
.second);
86
kfparticle->
setMotherPT
(
KFParticleBaseCut::minMotherPT
);
87
kfparticle->
constrainToPrimaryVertex
(
false
);
88
89
kfparticle->
setContainerName
(
KFPARTICLE::UpsilonName
);
90
kfparticle->
setOutputName
(
"KFParticleOutput_"
+
KFPARTICLE::UpsilonName
+
"_reconstruction.root"
);
91
92
se->
registerSubsystem
(kfparticle);
93
94
KFPARTICLE::runUpsilonReco
=
true
;
95
96
return
;
97
}
98
99
100
void
KFParticle_D0_Reco
()
101
{
102
int
verbosity
= std::max(
Enable::VERBOSITY
,
Enable::KFPARTICLE_VERBOSITY
);
103
104
Fun4AllServer
*se =
Fun4AllServer::instance
();
105
106
KFParticle_sPHENIX
*kfparticle =
new
KFParticle_sPHENIX
(
"KFParticle_"
+
KFPARTICLE::D0Name
+
"_Reco"
);
107
kfparticle->
Verbosity
(verbosity);
108
kfparticle->
setDecayDescriptor
(
KFPARTICLE::D0DecayDescriptor
);
109
110
kfparticle->
saveDST
(
Enable::KFPARTICLE_APPEND_TO_DST
);
111
kfparticle->
saveOutput
(
Enable::KFPARTICLE_SAVE_NTUPLE
);
112
kfparticle->
doTruthMatching
(
Enable::KFPARTICLE_TRUTH_MATCH
);
113
kfparticle->
getDetectorInfo
(
Enable::KFPARTICLE_DETECTOR_INFO
);
114
115
kfparticle->
setMinimumTrackPT
(
KFParticleBaseCut::minTrackPT
);
116
kfparticle->
setMinimumTrackIPchi2
(
KFParticleBaseCut::minTrackIPchi2
);
117
kfparticle->
setMaximumTrackchi2nDOF
(
KFParticleBaseCut::maxTrackchi2nDoF
);
118
119
kfparticle->
setMaximumVertexchi2nDOF
(
KFParticleBaseCut::maxVertexchi2nDoF
);
120
kfparticle->
setMaximumDaughterDCA
(
KFParticleBaseCut::maxTrackTrackDCA
);
121
122
kfparticle->
setMinimumMass
(
KFPARTICLE::D0MassRange
.first);
123
kfparticle->
setMaximumMass
(
KFPARTICLE::D0MassRange
.second);
124
kfparticle->
setMotherPT
(
KFParticleBaseCut::minMotherPT
);
125
kfparticle->
constrainToPrimaryVertex
(
false
);
126
127
kfparticle->
setContainerName
(
KFPARTICLE::D0Name
);
128
kfparticle->
setOutputName
(
"KFParticleOutput_"
+
KFPARTICLE::D0Name
+
"_reconstruction.root"
);
129
130
se->
registerSubsystem
(kfparticle);
131
132
KFPARTICLE::runD0Reco
=
true
;
133
134
return
;
135
}
136
137
138
void
KFParticle_Lambdac_Reco
()
139
{
140
int
verbosity
= std::max(
Enable::VERBOSITY
,
Enable::KFPARTICLE_VERBOSITY
);
141
142
Fun4AllServer
*se =
Fun4AllServer::instance
();
143
144
KFParticle_sPHENIX
*kfparticle =
new
KFParticle_sPHENIX
(
"KFParticle_"
+
KFPARTICLE::LambdacName
+
"_Reco"
);
145
kfparticle->
Verbosity
(verbosity);
146
kfparticle->
setDecayDescriptor
(
KFPARTICLE::LambdacDecayDescriptor
);
147
148
kfparticle->
saveDST
(
Enable::KFPARTICLE_APPEND_TO_DST
);
149
kfparticle->
saveOutput
(
Enable::KFPARTICLE_SAVE_NTUPLE
);
150
kfparticle->
doTruthMatching
(
Enable::KFPARTICLE_TRUTH_MATCH
);
151
kfparticle->
getDetectorInfo
(
Enable::KFPARTICLE_DETECTOR_INFO
);
152
153
kfparticle->
setMinimumTrackPT
(
KFParticleBaseCut::minTrackPT
);
154
kfparticle->
setMinimumTrackIPchi2
(
KFParticleBaseCut::minTrackIPchi2
);
155
kfparticle->
setMaximumTrackchi2nDOF
(
KFParticleBaseCut::maxTrackchi2nDoF
);
156
157
kfparticle->
setMaximumVertexchi2nDOF
(
KFParticleBaseCut::maxVertexchi2nDoF
);
158
kfparticle->
setMaximumDaughterDCA
(
KFParticleBaseCut::maxTrackTrackDCA
);
159
160
kfparticle->
setMinimumMass
(
KFPARTICLE::LambdacMassRange
.first);
161
kfparticle->
setMaximumMass
(
KFPARTICLE::LambdacMassRange
.second);
162
kfparticle->
setMotherPT
(
KFParticleBaseCut::minMotherPT
);
163
kfparticle->
constrainToPrimaryVertex
(
false
);
164
165
kfparticle->
setContainerName
(
KFPARTICLE::LambdacName
);
166
kfparticle->
setOutputName
(
"KFParticleOutput_"
+
KFPARTICLE::LambdacName
+
"_reconstruction.root"
);
167
168
se->
registerSubsystem
(kfparticle);
169
170
KFPARTICLE::runLambdacReco
=
true
;
171
172
return
;
173
}
174
175
void
KFParticle_QA
()
176
{
177
int
verbosity
= std::max(
Enable::VERBOSITY
,
Enable::KFPARTICLE_VERBOSITY
);
178
179
Fun4AllServer
*se =
Fun4AllServer::instance
();
180
181
if
(
KFPARTICLE::runUpsilonReco
)
182
{
183
DecayFinder
*UpsilonFinder =
new
DecayFinder
(
"DecayFinder_"
+
KFPARTICLE::UpsilonName
);
184
UpsilonFinder->
Verbosity
(verbosity);
185
UpsilonFinder->
setDecayDescriptor
(
KFPARTICLE::UpsilonDecayDescriptor
);
186
UpsilonFinder->
triggerOnDecay
(
KFPARTICLE::UpsilonTrigger
);
187
UpsilonFinder->
saveDST
(
true
);
188
UpsilonFinder->
allowPi0
(
true
);
189
UpsilonFinder->
allowPhotons
(
true
);
190
se->
registerSubsystem
(UpsilonFinder);
191
192
QAG4SimulationKFParticle
*UpsilonQA =
new
QAG4SimulationKFParticle
(
"QA_"
+
KFPARTICLE::UpsilonName
,
193
KFPARTICLE::UpsilonName
,
194
KFPARTICLE::UpsilonMassRange
.first,
195
KFPARTICLE::UpsilonMassRange
.second);
196
se->
registerSubsystem
(UpsilonQA);
197
}
198
199
if
(
KFPARTICLE::runD0Reco
)
200
{
201
DecayFinder
*D0Finder =
new
DecayFinder
(
"DecayFinder_"
+
KFPARTICLE::D0Name
);
202
D0Finder->
Verbosity
(verbosity);
203
D0Finder->
setDecayDescriptor
(
KFPARTICLE::D0DecayDescriptor
);
204
D0Finder->
triggerOnDecay
(
KFPARTICLE::D0Trigger
);
205
D0Finder->
saveDST
(
true
);
206
D0Finder->
allowPi0
(
true
);
207
D0Finder->
allowPhotons
(
true
);
208
se->
registerSubsystem
(D0Finder);
209
210
QAG4SimulationKFParticle
*D0QA =
new
QAG4SimulationKFParticle
(
"QA_"
+
KFPARTICLE::D0Name
,
211
KFPARTICLE::D0Name
,
212
KFPARTICLE::D0MassRange
.first,
213
KFPARTICLE::D0MassRange
.second);
214
se->
registerSubsystem
(D0QA);
215
}
216
217
if
(
KFPARTICLE::runLambdacReco
)
218
{
219
DecayFinder
*LambdacFinder =
new
DecayFinder
(
"DecayFinder_"
+
KFPARTICLE::LambdacName
);
220
LambdacFinder->
Verbosity
(verbosity);
221
LambdacFinder->
setDecayDescriptor
(
KFPARTICLE::LambdacDecayDescriptor
);
222
LambdacFinder->
triggerOnDecay
(
KFPARTICLE::LambdacTrigger
);
223
LambdacFinder->
saveDST
(
true
);
224
LambdacFinder->
allowPi0
(
true
);
225
LambdacFinder->
allowPhotons
(
true
);
226
se->
registerSubsystem
(LambdacFinder);
227
228
QAG4SimulationKFParticle
*LambdacQA =
new
QAG4SimulationKFParticle
(
"QA_"
+
KFPARTICLE::LambdacName
,
229
KFPARTICLE::LambdacName
,
230
KFPARTICLE::LambdacMassRange
.first,
231
KFPARTICLE::LambdacMassRange
.second);
232
se->
registerSubsystem
(LambdacQA);
233
}
234
235
return
;
236
}
237
238
#endif
macros
blob
master
common
G4_KFParticle.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:27
using
1.8.2 with
sPHENIX GitHub integration