EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticle_truthAndDetTools.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticle_truthAndDetTools.h
1 #ifndef KFPARTICLESPHENIX_KFPARTICLETRUTHANDDETTOOLS_H
2 #define KFPARTICLESPHENIX_KFPARTICLETRUTHANDDETTOOLS_H
3 
4 #include "KFParticle_Tools.h"
5 
6 #include <intt/InttDefs.h>
7 #include <mvtx/MvtxDefs.h>
8 #include <tpc/TpcDefs.h>
9 
10 #include <g4eval/SvtxClusterEval.h>
11 #include <g4eval/SvtxEvalStack.h>
12 #include <g4eval/SvtxHitEval.h>
13 #include <g4eval/SvtxTrackEval.h>
14 #include <g4eval/SvtxTruthEval.h>
15 #include <g4eval/SvtxVertexEval.h>
16 
17 #include <g4main/PHG4Particle.h>
19 #include <g4main/PHG4VtxPoint.h>
20 
23 #include <phool/getClass.h>
24 
27 
28 #include <trackbase/TrkrCluster.h>
30 #include <trackbase/TrkrDefs.h>
31 
32 #include <TTree.h>
33 #include <KFParticle.h>
34 
35 #include <HepMC/GenEvent.h>
36 #include <HepMC/GenParticle.h>
37 #include <HepMC/IteratorRange.h>
38 #include <HepMC/SimpleVector.h>
39 
40 #include <algorithm>
41 #include <iterator>
42 #include <string>
43 #include <vector>
44 
45 class PHCompositeNode;
46 class PHG4Particle;
47 class PHG4VtxPoint;
48 class SvtxClusterEval;
49 class SvtxEvalStack;
50 class SvtxHitEval;
51 class SvtxTrack;
52 class SvtxTrackEval;
53 class SvtxTrackMap;
54 class SvtxTruthEval;
55 class SvtxVertexMap;
56 class SvtxVertex;
57 class SvtxVertexEval;
59 class TTree;
60 class KFParticle;
61 
63 {
64  public:
65  KFParticle_truthAndDetTools(); //Constructor
66 
67  virtual ~KFParticle_truthAndDetTools(); //Destructor
68 
69  SvtxTrack *getTrack(unsigned int track_id, SvtxTrackMap *trackmap);
70  SvtxVertex *getVertex(unsigned int vertex_id, SvtxVertexMap *vertexmap);
71  PHG4Particle *getTruthTrack(SvtxTrack *thisTrack, PHCompositeNode *topNode);
72 
73  void initializeTruthBranches(TTree *m_tree, int daughter_id, std::string daughter_number, bool m_constrain_to_vertex_truthMatch);
74  void fillTruthBranch(PHCompositeNode *topNode, TTree *m_tree, KFParticle daughter, int daughter_id, KFParticle vertex, bool m_constrain_to_vertex_truthMatch);
75  void fillHepMCBranch(HepMC::GenParticle *particle, int daughter_id);
76  int getHepMCInfo(PHCompositeNode *topNode, TTree *m_tree, KFParticle daughter, int daughter_id);
77 
78  void initializeCaloBranches(TTree *m_tree, int daughter_id, std::string daughter_number);
79  void fillCaloBranch(PHCompositeNode *topNode, TTree *m_tree, KFParticle daughter, int daughter_id);
80 
81  void initializeDetectorBranches(TTree *m_tree, int daughter_id, std::string daughter_number);
82  void initializeSubDetectorBranches(TTree *m_tree, std::string detectorName, int daughter_id, std::string daughter_number);
83  void fillDetectorBranch(PHCompositeNode *topNode, TTree *m_tree, KFParticle daughter, int daughter_id);
84 
85  void allPVInfo(PHCompositeNode *topNode, TTree *m_tree,
86  KFParticle motherParticle,
87  std::vector<KFParticle> daughters,
88  std::vector<KFParticle> intermediates);
89 
90  void clearVectors();
91 
92  protected:
93  std::string m_trk_map_node_name_nTuple = "SvtxTrackMap";
94  std::string m_vtx_map_node_name_nTuple = "SvtxVertexMap";
95 
98  SvtxHitEval *hiteval = nullptr;
102 
104  SvtxTrack *track = nullptr;
105 
108 
110  SvtxVertex *vertex = nullptr;
111 
113 
116 
117  static const int max_tracks = 20;
118 
133 
141 
157 
158  std::vector<float> detector_local_x[max_tracks]; // 7 subdetector including outer and inner hcal plus 4th tracker
159  std::vector<float> detector_local_y[max_tracks];
160  std::vector<float> detector_local_z[max_tracks];
161  std::vector<int> detector_layer[max_tracks];
162  std::vector<int> mvtx_staveID[max_tracks];
163  std::vector<int> mvtx_chipID[max_tracks];
164  std::vector<int> intt_ladderZID[max_tracks];
165  std::vector<int> intt_ladderPhiID[max_tracks];
166  std::vector<int> tpc_sectorID[max_tracks];
167  std::vector<int> tpc_side[max_tracks];
168 
169  std::vector<float> allPV_x;
170  std::vector<float> allPV_y;
171  std::vector<float> allPV_z;
172  std::vector<float> allPV_mother_IP;
173  std::vector<float> allPV_mother_IPchi2;
174  std::vector<float> allPV_daughter_IP[max_tracks];
175  std::vector<float> allPV_daughter_IPchi2[max_tracks];
176  std::vector<float> allPV_intermediates_IP[max_tracks];
178 
181 };
182 
183 #endif //KFPARTICLESPHENIX_KFPARTICLETRUTHANDDETTOOLS_H