Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:01

0001 #ifndef TRKRCLUSTERISMATCHER__H
0002 #define TRKRCLUSTERISMATCHER__H
0003 // Principle use:
0004 //   Does comparison of two clusters
0005 //   For now, does comparison by relative separation in T and RxPhi space
0006 //   Option to compare by a relative number of bins|pixels, or by relative
0007 //   overall size of the clusters (using the largest clustersize).
0008 //
0009 
0010 #include <array>
0011 #include <string>
0012 
0013 #include <trackbase/TrkrDefs.h>
0014 
0015 class ActsGeometry;
0016 class TrkrCluster;
0017 class PHCompositeNode;
0018 class TrkrClusterContainer;
0019 class TrackClusEvaluator;
0020 
0021 class TrkrClusterIsMatcher
0022 {
0023  public:
0024   TrkrClusterIsMatcher(){};
0025 
0026   bool operator()(TrkrDefs::cluskey key_T, TrkrDefs::cluskey key_R);
0027 
0028   int init(PHCompositeNode* topNode,
0029            const std::string& name_truth_clusters = "TRKR_TRUTHCLUSTERCONTAINER",
0030            const std::string& name_reco_clusters = "TRKR_CLUSTER");
0031 
0032   void set_tol_phi_MVTX(float _val);
0033   void set_tol_phi_INTT(float _val);
0034   void set_tol_phi_TPC(float _val);
0035 
0036   void set_tol_z_MVTX(float _val);
0037   void set_tol_t_TPC(float _val);
0038 
0039   // options for if tolerance is multipled by width of one pixel|bin, or by total number of pixel|bin's
0040   // in the larger of two clusters compared
0041   bool single_pixel_phi_MVTX{false};  // default to pitch*max(N_pixels_M,N_pixels_T)*tol_MVTX
0042   bool single_pixel_phi_INTT{false};  // ... same as for MVTX
0043   bool single_bin_phi_TPC{true};      // default to pitch*tol_TPC
0044 
0045   bool single_pixel_z_MVTX{false};  // default to pitch*max(N_pixels_M,N_pixels_T)*tol_MVTX
0046   bool single_pixel_z_INTT{false};  // ... same as for MVTX
0047   bool single_bin_t_TPC{true};      // default to pitch*tol_TPC
0048 
0049   // For efficiency and convenience, hang on to minimal information about most recent comparison:
0050   // --------------------------------------------------------------------------------------------
0051   TrkrCluster* clus_T{nullptr};  // _T for truth cluster
0052   TrkrCluster* clus_R{nullptr};  // _R for reco  cluster
0053   int layer{0};
0054   int det_0123{0};
0055   bool is_match{false};  // also the return value of operator()
0056   float dphi{0.};
0057 
0058   // multipliers for pixels and bins to cm and times
0059   std::array<float, 56> pitch_phi{0.};  // the phistep squared
0060   float pitch_z_MVTX{0.};               // pixel width for MVTX
0061   float step_t_TPC{0.};                 // time bin width for PTC
0062 
0063   std::array<float, 56> tol_pitch_phi{0.};  // pitched times tol_phi_{MVTX,INTT,TPC}
0064   float tol_pitch_z_MVTX{0.};               // tol * pixel width for MVTX
0065   float tol_step_t_TPC{0.};                 // tol * time bin width for PTC
0066 
0067   // containers to get the clusters from
0068   TrkrClusterContainer* m_TruthClusters{nullptr};
0069   TrkrClusterContainer* m_RecoClusters{nullptr};
0070   ActsGeometry* m_ActsGeometry{nullptr};
0071 
0072   /* public: */
0073   /* TrkrClusterContainer* get_TruthClusters() { return m_TruthClusters; }; */
0074   /* TrkrClusterContainer* get_RecoClusters () { return m_RecoClusters; }; */
0075   /* ActsGeometry* get_ActsGeometry () { return m_ActsGeometry; }; */
0076   /* private: */
0077 
0078   // tolerances for comparison in MVTX, INTT, TPC, and TPOT
0079   float tol_phi_MVTX{0.5};
0080   float tol_phi_INTT{0.5};
0081   float tol_phi_TPC{1.0};
0082 
0083   float tol_z_MVTX{0.5};
0084   float tol_t_TPC{1.0};
0085 };
0086 
0087 #endif