File indexing completed on 2025-08-06 08:19:07
0001 #ifndef FILLCLUSMATCHTREE__H
0002 #define FILLCLUSMATCHTREE__H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #include "TrackClusEvaluator.h"
0047 #include "TrkrClusLoc.h"
0048
0049 #include <fun4all/SubsysReco.h>
0050
0051 #include <string>
0052 #include <vector>
0053
0054 class EmbRecoMatchContainer;
0055 class PHCompositeNode;
0056 class PHG4ParticleSvtxMap;
0057 class SvtxPHG4ParticleMap;
0058 class EmbRecoMatchContainer;
0059 class PHCompositeNode;
0060 class PHG4TpcCylinderGeom;
0061 class PHG4TpcCylinderGeomContainer;
0062 class PHG4TruthInfoContainer;
0063 class SvtxTrack;
0064 class SvtxTrackMap;
0065 class TrackSeedContainer;
0066 class TrkrCluster;
0067 class TrkrTruthTrack;
0068 class TrkrTruthTrackContainer;
0069 class TTree;
0070 class TH2D;
0071 class ClusHitsVerbose;
0072 class TrkrClusterIsMatcher;
0073
0074 class FillClusMatchTree : public SubsysReco
0075 {
0076 public:
0077 FillClusMatchTree(
0078 TrkrClusterIsMatcher *_ismatcher, const std::string &tfile_name = "trackclusmatch.root", bool _fill_clusters = true, bool _fill_clusverbose = true, bool _fill_svtxnomatch = false);
0079
0080 virtual ~FillClusMatchTree() = default;
0081
0082 int Init(PHCompositeNode *) override;
0083 int InitRun(PHCompositeNode *topNode) override;
0084 int process_event(PHCompositeNode * ) override;
0085 int End(PHCompositeNode *topNode) override;
0086
0087 void clear_clusvecs(const std::string &tag = "");
0088
0089 void print_mvtx_diagnostics();
0090
0091 TrkrClusterIsMatcher *m_ismatcher;
0092
0093 private:
0094 int createNodes(PHCompositeNode *topNode);
0095 TrackClusEvaluator m_TCEval;
0096
0097
0098 EmbRecoMatchContainer *m_EmbRecoMatchContainer{nullptr};
0099 PHG4TruthInfoContainer *m_PHG4TruthInfoContainer{nullptr};
0100 SvtxTrackMap *m_SvtxTrackMap{nullptr};
0101 TrkrTruthTrackContainer *m_TrkrTruthTrackContainer{nullptr};
0102 ClusHitsVerbose *m_PHG4ClusHitVerb{nullptr};
0103 ClusHitsVerbose *m_SvtxClusHitVerb{nullptr};
0104
0105
0106
0107
0108 TTree *m_ttree;
0109 std::string m_outfile_name;
0110
0111 public:
0112 bool m_fill_clusters;
0113 bool m_fill_clusverbose;
0114 bool m_fill_SvUnmatched;
0115 private:
0116
0117 int nevent{-1};
0118 int nphg4{0};
0119 int nsvtx{0};
0120 int ntrackmatches{0};
0121 int nphg4_part{0};
0122 float centrality{0.};
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 TH2D *h2_G4_nPixelsPhi;
0136 TH2D *h2_G4_nPixelsZ;
0137 TH2D *h2_Sv_nPixelsPhi;
0138 TH2D *h2_Sv_nPixelsZ;
0139
0140
0141 int b_trackid{};
0142 bool b_is_g4track{};
0143 bool b_is_Svtrack{};
0144 bool b_is_matched{};
0145
0146 float b_trkpt{};
0147 float b_trkphi{};
0148 float b_trketa{};
0149
0150 int b_nclus{};
0151 int b_nclustpc{};
0152 int b_nclusmvtx{};
0153 int b_nclusintt{};
0154
0155 float b_matchrat{};
0156 float b_matchrat_intt{};
0157 float b_matchrat_mvtx{};
0158 float b_matchrat_tpc{};
0159
0160 std::vector<bool> b_clusmatch{};
0161 std::vector<float> b_clus_x{};
0162 std::vector<float> b_clus_y{};
0163 std::vector<float> b_clus_z{};
0164 std::vector<float> b_clus_r{};
0165 std::vector<int> b_clus_layer{};
0166
0167
0168
0169 std::vector<float> b_clus_lphi{};
0170 std::vector<float> b_clus_lphisize{};
0171 std::vector<float> b_clus_lz{};
0172 std::vector<float> b_clus_lzsize{};
0173
0174
0175
0176 using VecVecInt = std::vector<std::vector<int>>;
0177
0178 VecVecInt b_phibins;
0179 VecVecInt b_phibins_cut;
0180 VecVecInt b_zbins;
0181 VecVecInt b_zbins_cut;
0182
0183 VecVecInt b_phibinsE;
0184 VecVecInt b_phibinsE_cut;
0185 VecVecInt b_zbinsE;
0186 VecVecInt b_zbinsE_cut;
0187
0188 void fill_cluster_branches(TrkrClusLoc &, bool isPHG4 = true);
0189
0190 };
0191
0192 #endif