Analysis Software
Documentation for sPHENIX simulation 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>
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;
22  bool KFPARTICLE_TRUTH_MATCH = false;
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";
36  std::pair<float, float> UpsilonMassRange(8, 11);
37  bool UpsilonTrigger = false;
38 
39  bool runD0Reco = false;
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 
63 {
65 
67 
68  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::UpsilonName + "_Reco");
69  kfparticle->Verbosity(verbosity);
71 
76 
78  kfparticle->setMinimumTrackIPchi2(0); // Upsilon decays are prompt, tracks are more likely to point to vertex
80 
83 
85  kfparticle->setMaximumMass(KFPARTICLE::UpsilonMassRange.second);
87  kfparticle->constrainToPrimaryVertex(false);
88 
90  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::UpsilonName + "_reconstruction.root");
91 
92  se->registerSubsystem(kfparticle);
93 
95 
96  return;
97 }
98 
99 
101 {
103 
105 
106  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::D0Name + "_Reco");
107  kfparticle->Verbosity(verbosity);
109 
114 
118 
121 
122  kfparticle->setMinimumMass(KFPARTICLE::D0MassRange.first);
123  kfparticle->setMaximumMass(KFPARTICLE::D0MassRange.second);
125  kfparticle->constrainToPrimaryVertex(false);
126 
128  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::D0Name + "_reconstruction.root");
129 
130  se->registerSubsystem(kfparticle);
131 
132  KFPARTICLE::runD0Reco = true;
133 
134  return;
135 }
136 
137 
139 {
141 
143 
144  KFParticle_sPHENIX *kfparticle = new KFParticle_sPHENIX("KFParticle_" + KFPARTICLE::LambdacName + "_Reco");
145  kfparticle->Verbosity(verbosity);
147 
152 
156 
159 
160  kfparticle->setMinimumMass(KFPARTICLE::LambdacMassRange.first);
161  kfparticle->setMaximumMass(KFPARTICLE::LambdacMassRange.second);
163  kfparticle->constrainToPrimaryVertex(false);
164 
166  kfparticle->setOutputName("KFParticleOutput_" + KFPARTICLE::LambdacName + "_reconstruction.root");
167 
168  se->registerSubsystem(kfparticle);
169 
171 
172  return;
173 }
174 
176 {
178 
180 
182  {
183  DecayFinder *UpsilonFinder = new DecayFinder("DecayFinder_" + KFPARTICLE::UpsilonName);
184  UpsilonFinder->Verbosity(verbosity);
187  UpsilonFinder->saveDST(true);
188  UpsilonFinder->allowPi0(true);
189  UpsilonFinder->allowPhotons(true);
190  se->registerSubsystem(UpsilonFinder);
191 
196  se->registerSubsystem(UpsilonQA);
197  }
198 
200  {
201  DecayFinder *D0Finder = new DecayFinder("DecayFinder_" + KFPARTICLE::D0Name);
202  D0Finder->Verbosity(verbosity);
205  D0Finder->saveDST(true);
206  D0Finder->allowPi0(true);
207  D0Finder->allowPhotons(true);
208  se->registerSubsystem(D0Finder);
209 
213  KFPARTICLE::D0MassRange.second);
214  se->registerSubsystem(D0QA);
215  }
216 
218  {
219  DecayFinder *LambdacFinder = new DecayFinder("DecayFinder_" + KFPARTICLE::LambdacName);
220  LambdacFinder->Verbosity(verbosity);
223  LambdacFinder->saveDST(true);
224  LambdacFinder->allowPi0(true);
225  LambdacFinder->allowPhotons(true);
226  se->registerSubsystem(LambdacFinder);
227 
232  se->registerSubsystem(LambdacQA);
233  }
234 
235  return;
236 }
237 
238 #endif