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