EIC Software
 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;
20  bool KFPARTICLE_TRUTH_MATCH = false;
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 
61 {
63 
65 
66  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::UpsilonName + "_Reco");
67  kfparticle->Verbosity(verbosity);
69 
74 
76  kfparticle->setMinimumTrackIPchi2(0); // Upsilon decays are prompt, tracks are more likely to point to vertex
78 
81 
83  kfparticle->setMaximumMass(KFPARTICLE::UpsilonMassRange.second);
85  kfparticle->constrainToPrimaryVertex(false);
86 
88  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::UpsilonName + "_reconstruction.root");
89 
90  se->registerSubsystem(kfparticle);
91 
93 
94  return;
95 }
96 
97 
99 {
101 
103 
104  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::D0Name + "_Reco");
105  kfparticle->Verbosity(verbosity);
107 
112 
116 
119 
120  kfparticle->setMinimumMass(KFPARTICLE::D0MassRange.first);
121  kfparticle->setMaximumMass(KFPARTICLE::D0MassRange.second);
123  kfparticle->constrainToPrimaryVertex(false);
124 
126  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::D0Name + "_reconstruction.root");
127 
128  se->registerSubsystem(kfparticle);
129 
130  KFPARTICLE::runD0Reco = true;
131 
132  return;
133 }
134 
135 
137 {
139 
141 
142  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::LambdacName + "_Reco");
143  kfparticle->Verbosity(verbosity);
145 
150 
154 
157 
158  kfparticle->setMinimumMass(KFPARTICLE::LambdacMassRange.first);
159  kfparticle->setMaximumMass(KFPARTICLE::LambdacMassRange.second);
161  kfparticle->constrainToPrimaryVertex(false);
162 
164  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::LambdacName + "_reconstruction.root");
165 
166  se->registerSubsystem(kfparticle);
167 
169 
170  return;
171 }
172 
174 {
176 
178 
180  {
181  DecayFinder *UpsilonFinder = new DecayFinder("DecayFinder_" + KFPARTICLE::UpsilonName);
182  UpsilonFinder->Verbosity(verbosity);
185  UpsilonFinder->saveDST(true);
186  UpsilonFinder->allowPi0(true);
187  UpsilonFinder->allowPhotons(true);
188  se->registerSubsystem(UpsilonFinder);
189 
194  se->registerSubsystem(UpsilonQA);
195  }
196 
198  {
199  DecayFinder *D0Finder = new DecayFinder("DecayFinder_" + KFPARTICLE::D0Name);
200  D0Finder->Verbosity(verbosity);
203  D0Finder->saveDST(true);
204  D0Finder->allowPi0(true);
205  D0Finder->allowPhotons(true);
206  se->registerSubsystem(D0Finder);
207 
211  KFPARTICLE::D0MassRange.second);
212  se->registerSubsystem(D0QA);
213  }
214 
216  {
217  DecayFinder *LambdacFinder = new DecayFinder("DecayFinder_" + KFPARTICLE::LambdacName);
218  LambdacFinder->Verbosity(verbosity);
221  LambdacFinder->saveDST(true);
222  LambdacFinder->allowPi0(true);
223  LambdacFinder->allowPhotons(true);
224  se->registerSubsystem(LambdacFinder);
225 
230  se->registerSubsystem(LambdacQA);
231  }
232 
233  return;
234 }
235 
236 #endif