Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FillClusMatchTree.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FillClusMatchTree.h
1 #ifndef FILLCLUSMATCHTREE__H
2 #define FILLCLUSMATCHTREE__H
3 
46 #include "TrkrClusLoc.h"
47 #include "TrackClusEvaluator.h"
48 
49 #include <fun4all/SubsysReco.h>
50 #include <vector>
51 #include <string>
52 
54 class PHCompositeNode;
58 class PHCompositeNode;
62 class SvtxTrack;
63 class SvtxTrackMap;
64 class TrackSeedContainer;
65 class TrkrCluster;
66 /* class TrkrClusterContainer; */
67 class TrkrTruthTrack;
69 class TTree;
70 class TH2D;
71 class ClusHitsVerbose;
73 
75 {
76  public:
78  TrkrClusterIsMatcher* _ismatcher
79  , const std::string& tfile_name="trackclusmatch.root"
80  , bool _fill_clusters = true
81  , bool _fill_clusverbose = true
82  , bool _fill_svtxnomatch = false
83  );
84 
85  virtual ~FillClusMatchTree();
86 
87  int Init(PHCompositeNode *) override;
88  int InitRun(PHCompositeNode *topNode) override;
89  int process_event(PHCompositeNode * /*topNode*/) override;
90  int End(PHCompositeNode *topNode) override;
91 
92  void clear_clusvecs(const std::string& tag="");
93 
95 
97  private:
98 
99  int createNodes(PHCompositeNode *topNode);
101 
102  // contianer used to fill the other track matches
109  /* TrkrClusterContainer *m_TruthClusterContainer {nullptr}; */
110  /* TrkrClusterContainer *m_RecoClusterContainer {nullptr}; */
111  /* PHG4TpcCylinderGeomContainer *m_PHG4TpcCylinderGeomContainer {nullptr}; */
112 
113 
114  TTree* m_ttree;
116  public:
118  bool m_fill_clusverbose; // unmatched Svtx tracks
119  bool m_fill_SvUnmatched; // unmatched Svtx tracks
120  private:
121 
122  // Tree Branch members:
123  int nevent {-1};
124  int nphg4 {0};
125  int nsvtx {0};
126  int ntrackmatches {0};
127  int nphg4_part {0};
128  float centrality {0.};
129 
130  // Tracks and clustes
131  //
132  // lables:
133  // tracks:
134  // g4 : phg4track matched
135  // sv : svtx_track matched
136  // gU : phg4track not-matched
137  // sU : svtx_track not-matched
138  // clusters:
139  // M : matched
140  // U : unmatched
145 
146  // Track tree
151 
152  float b_trkpt;
153  float b_trkphi;
154  float b_trketa;
155 
156  int b_nclus {};
157  int b_nclustpc {};
158  int b_nclusmvtx {};
159  int b_nclusintt {};
160 
161  float b_matchrat {};
162  float b_matchrat_intt {};
163  float b_matchrat_mvtx {};
164  float b_matchrat_tpc {};
165 
166  std::vector<bool> b_clusmatch {};
167  std::vector<float> b_clus_x {};
168  std::vector<float> b_clus_y {};
169  std::vector<float> b_clus_z {};
170  std::vector<float> b_clus_r {};
171  std::vector<int> b_clus_layer {};
172  /* std::vector<int> b_clus_nphibins {}; */
173  /* std::vector<int> b_clus_ntbins {}; */
174 
175  std::vector<float> b_clus_lphi {}; // l for local surface
176  std::vector<float> b_clus_lphisize {}; // phi scaled by dphi
177  std::vector<float> b_clus_lz {};
178  std::vector<float> b_clus_lzsize {};
179 
180  // Maps of hits within clusters
181  /* using BinData = std::pair<int,float>; // index + energy for a given bin (MVTX, INTT, or TPC) */
182  using VecVecInt = std::vector<std::vector<int>>;
183  /* using VecVecFloat = std::vector<std::vector<float>>; */
188 
193 
194  void fill_cluster_branches(TrkrClusLoc&, bool isPHG4=true);
195  /* void pushback_verb_bins(TrkrDefs::cluskey, bool isPHG4=true); */
196 
197 };
198 
199 #endif // FILLTRUTHRECOMATCHTREE_H