Analysis Software
Documentation for sPHENIX simulation 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 <string>
5 #include <vector>
6 
7 class PHCompositeNode;
8 class PHG4Particle;
9 class PHG4VtxPoint;
11 class PHHepMCGenEvent;
12 class PHHepMCGenEventMap;
13 class SvtxClusterEval;
14 class SvtxEvalStack;
15 class SvtxHitEval;
16 class SvtxTrack;
17 class SvtxTrackEval;
18 class SvtxTrackMap;
19 class SvtxTruthEval;
20 class SvtxVertexMap;
21 class SvtxVertex;
22 class SvtxVertexEval;
24 class TTree;
25 class KFParticle;
26 class GlobalVertex;
27 class GlobalVertexMap;
28 
29 namespace HepMC
30 {
31  class GenParticle;
32 }
33 
35 {
36  public:
37  KFParticle_truthAndDetTools(); // Constructor
38 
39  virtual ~KFParticle_truthAndDetTools(); // Destructor
40 
41  SvtxTrack *getTrack(unsigned int track_id, SvtxTrackMap *trackmap);
42  GlobalVertex *getVertex(unsigned int vertex_id, GlobalVertexMap *vertexmap);
43  PHG4Particle *getTruthTrack(SvtxTrack *thisTrack, PHCompositeNode *topNode);
44 
45  void initializeTruthBranches(TTree *m_tree, int daughter_id, const std::string &daughter_number, bool m_constrain_to_vertex_truthMatch);
46  void fillTruthBranch(PHCompositeNode *topNode, TTree *m_tree, const KFParticle &daughter, int daughter_id, const KFParticle &vertex, bool m_constrain_to_vertex_truthMatch);
47 
48  void fillGeant4Branch(PHG4Particle *particle, int daughter_id);
49  void fillHepMCBranch(HepMC::GenParticle *particle, int daughter_id);
50  int getHepMCInfo(PHCompositeNode *topNode, TTree *m_tree, const KFParticle &daughter, int daughter_id);
51 
52  void initializeCaloBranches(TTree *m_tree, int daughter_id, const std::string &daughter_number);
53  void fillCaloBranch(PHCompositeNode *topNode, TTree *m_tree, const KFParticle &daughter, int daughter_id);
54 
55  void initializeDetectorBranches(TTree *m_tree, int daughter_id, const std::string &daughter_number);
56  void initializeSubDetectorBranches(TTree *m_tree, const std::string &detectorName, int daughter_id, const std::string &daughter_number);
57  void fillDetectorBranch(PHCompositeNode *topNode, TTree *m_tree, const KFParticle &daughter, int daughter_id);
58 
59  void allPVInfo(PHCompositeNode *topNode, TTree *m_tree,
60  const KFParticle &motherParticle,
61  std::vector<KFParticle> daughters,
62  std::vector<KFParticle> intermediates);
63 
64  void clearVectors();
65 
66  protected:
69 
72  SvtxHitEval *hiteval = nullptr;
76 
78  SvtxTrack *track = nullptr;
79 
82 
84  SvtxVertex *vertex = nullptr;
85 
87 
90 
91  static const int max_tracks = 20;
92 
107 
115 
131 
132  std::vector<float> detector_local_x[max_tracks]; // 7 subdetector including outer and inner hcal plus 4th tracker
133  std::vector<float> detector_local_y[max_tracks];
134  std::vector<float> detector_local_z[max_tracks];
135  std::vector<int> detector_layer[max_tracks];
136  std::vector<int> mvtx_staveID[max_tracks];
137  std::vector<int> mvtx_chipID[max_tracks];
138  std::vector<int> intt_ladderZID[max_tracks];
139  std::vector<int> intt_ladderPhiID[max_tracks];
140  std::vector<int> tpc_sectorID[max_tracks];
141  std::vector<int> tpc_side[max_tracks];
142 
143  std::vector<float> allPV_x;
144  std::vector<float> allPV_y;
145  std::vector<float> allPV_z;
146  std::vector<float> allPV_mother_IP;
147  std::vector<float> allPV_mother_IPchi2;
148  std::vector<float> allPV_daughter_IP[max_tracks];
149  std::vector<float> allPV_daughter_IPchi2[max_tracks];
150  std::vector<float> allPV_intermediates_IP[max_tracks];
152 
156 };
157 
158 #endif // KFPARTICLESPHENIX_KFPARTICLETRUTHANDDETTOOLS_H