-
Notifications
You must be signed in to change notification settings - Fork 31
/
G4_KFParticle.C
166 lines (125 loc) · 5.69 KB
/
G4_KFParticle.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef MACRO_G4KFPARTICLE_C
#define MACRO_G4KFPARTICLE_C
#include <GlobalVariables.C>
#include <kfparticle_sphenix/KFParticle_sPHENIX.h>
#include <fun4all/Fun4AllServer.h>
R__LOAD_LIBRARY(libkfparticle_sphenix.so)
namespace Enable
{
bool KFPARTICLE = false;
bool KFPARTICLE_SAVE_NTUPLE = false;
bool KFPARTICLE_APPEND_TO_DST = true;
bool KFPARTICLE_TRUTH_MATCH = false;
bool KFPARTICLE_DETECTOR_INFO = false;
int KFPARTICLE_VERBOSITY = 0;
std::string KFPARTICLE_TRACKMAP = "SvtxTrackMap";
std::string KFPARTICLE_VERTEXMAP = "SvtxVertexMap";
} // namespace Enable
namespace KFParticleBaseCut
{
float minTrackPT = 0.5; // GeV
float maxTrackchi2nDoF = 2;
float minTrackIPchi2 = 15; // IP = DCA of track with vertex
float maxVertexchi2nDoF = 2;
float maxTrackTrackDCA = 0.05; // cm
float minMotherPT = 0; // GeV
} // namespace KFParticleBaseCut
void KFParticleInit() {} //I guess this line isnt needed
void KFParticle_Upsilon_Reco()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::KFPARTICLE_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();
std::string motherName = "Upsilon";
KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + motherName + "_Reco");
kfparticle->Verbosity(verbosity);
kfparticle->saveDST(Enable::KFPARTICLE_APPEND_TO_DST);
kfparticle->saveOutput(Enable::KFPARTICLE_SAVE_NTUPLE);
kfparticle->doTruthMatching(Enable::KFPARTICLE_TRUTH_MATCH);
kfparticle->getDetectorInfo(Enable::KFPARTICLE_DETECTOR_INFO);
kfparticle->setContainerName(motherName);
kfparticle->setOutputName("KFParticleOutput_" + motherName + "_reconstruction.root");
std::pair<std::string, int> daughterList[99];
kfparticle->setNumberOfTracks(2);
daughterList[0] = make_pair("electron", +1);
daughterList[1] = make_pair("electron", -1);
kfparticle->getChargeConjugate(false);
kfparticle->setDaughters(daughterList);
kfparticle->setMinimumTrackPT(KFParticleBaseCut::minTrackPT);
kfparticle->setMinimumTrackIPchi2(0); // Upsilon decays are prompt, tracks are more likely to point to vertex
kfparticle->setMaximumTrackchi2nDOF(KFParticleBaseCut::maxTrackchi2nDoF);
kfparticle->setMaximumVertexchi2nDOF(KFParticleBaseCut::maxVertexchi2nDoF);
kfparticle->setMaximumDaughterDCA(KFParticleBaseCut::maxTrackTrackDCA);
kfparticle->setMotherName(motherName);
kfparticle->setMinimumMass(7);
kfparticle->setMaximumMass(11);
kfparticle->setMotherPT(KFParticleBaseCut::minMotherPT);
kfparticle->constrainToPrimaryVertex(false);
se->registerSubsystem(kfparticle);
return;
}
void KFParticle_D0_Reco()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::KFPARTICLE_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();
std::string motherName = "D0";
KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + motherName + "_Reco");
kfparticle->Verbosity(verbosity);
kfparticle->saveDST(Enable::KFPARTICLE_APPEND_TO_DST);
kfparticle->saveOutput(Enable::KFPARTICLE_SAVE_NTUPLE);
kfparticle->doTruthMatching(Enable::KFPARTICLE_TRUTH_MATCH);
kfparticle->getDetectorInfo(Enable::KFPARTICLE_DETECTOR_INFO);
kfparticle->setContainerName(motherName);
kfparticle->setOutputName("KFParticleOutput_" + motherName + "_reconstruction.root");
std::pair<std::string, int> daughterList[99];
kfparticle->setNumberOfTracks(2);
daughterList[0] = make_pair("kaon", -1);
daughterList[1] = make_pair("pion", +1);
kfparticle->getChargeConjugate(true);
kfparticle->setDaughters(daughterList);
kfparticle->setMinimumTrackPT(KFParticleBaseCut::minTrackPT);
kfparticle->setMinimumTrackIPchi2(KFParticleBaseCut::minTrackIPchi2);
kfparticle->setMaximumTrackchi2nDOF(KFParticleBaseCut::maxTrackchi2nDoF);
kfparticle->setMaximumVertexchi2nDOF(KFParticleBaseCut::maxVertexchi2nDoF);
kfparticle->setMaximumDaughterDCA(KFParticleBaseCut::maxTrackTrackDCA);
kfparticle->setMotherName(motherName);
kfparticle->setMinimumMass(1.750);
kfparticle->setMaximumMass(1.950);
kfparticle->setMotherPT(KFParticleBaseCut::minMotherPT);
kfparticle->constrainToPrimaryVertex(false);
se->registerSubsystem(kfparticle);
return;
}
void KFParticle_Lambdac_Reco()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::KFPARTICLE_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();
std::string motherName = "Lambdac";
KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + motherName + "_Reco");
kfparticle->Verbosity(verbosity);
kfparticle->saveDST(Enable::KFPARTICLE_APPEND_TO_DST);
kfparticle->saveOutput(Enable::KFPARTICLE_SAVE_NTUPLE);
kfparticle->doTruthMatching(Enable::KFPARTICLE_TRUTH_MATCH);
kfparticle->getDetectorInfo(Enable::KFPARTICLE_DETECTOR_INFO);
kfparticle->setContainerName(motherName);
kfparticle->setOutputName("KFParticleOutput_" + motherName + "_reconstruction.root");
std::pair<std::string, int> daughterList[99];
kfparticle->setNumberOfTracks(3);
daughterList[0] = make_pair("proton", +1);
daughterList[1] = make_pair("kaon", -1);
daughterList[2] = make_pair("pion", +1);
kfparticle->getChargeConjugate(true);
kfparticle->setDaughters(daughterList);
kfparticle->setMinimumTrackPT(KFParticleBaseCut::minTrackPT);
kfparticle->setMinimumTrackIPchi2(KFParticleBaseCut::minTrackIPchi2);
kfparticle->setMaximumTrackchi2nDOF(KFParticleBaseCut::maxTrackchi2nDoF);
kfparticle->setMaximumVertexchi2nDOF(KFParticleBaseCut::maxVertexchi2nDoF);
kfparticle->setMaximumDaughterDCA(KFParticleBaseCut::maxTrackTrackDCA);
kfparticle->setMotherName(motherName);
kfparticle->setMinimumMass(2.150);
kfparticle->setMaximumMass(2.400);
kfparticle->setMotherPT(KFParticleBaseCut::minMotherPT);
kfparticle->constrainToPrimaryVertex(false);
se->registerSubsystem(kfparticle);
return;
}
#endif