Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:12

0001 #ifndef JetInidicesMatcher__h
0002 #define JetInidicesMatcher__h
0003 
0004 #include <vector>
0005 #include <array>
0006 using std::vector;
0007 using std::array;
0008 using std::pair;
0009 
0010 class JetIndicesMatcher {
0011     // a simple class that matches jets based on their pt,
0012     // This is done by matching the first jets (feed in presumable
0013     // by pt) with phi-eta distance less than R
0014     const double R2; // distance in phi-eta squared
0015     vector<float> eta_truth{};
0016     vector<float> phi_truth{};
0017     vector<float> pt_truth{};
0018     vector<int>   index_truth{};
0019 
0020     vector<float> eta_reco{};
0021     vector<float> phi_reco{};
0022     vector<float> pt_reco{};
0023     vector<int>   index_reco{};
0024 
0025     float min_pT_truth ;
0026     float min_pT_reco  ;
0027 
0028 public:
0029     vector<unsigned int> indices_fake{};
0030     vector<unsigned int> indices_miss{};
0031     vector<pair < unsigned int, unsigned int> > indices_matched{};
0032 
0033     vector<unsigned int> &f{indices_fake};
0034     vector<unsigned int> &m{indices_miss};
0035     vector<pair<unsigned int,unsigned int>> &match{indices_matched};
0036 
0037     void reset();
0038 
0039     /* void add_truth(float eta, float phi, float pt); */
0040     /* void add_reco(float eta, float phi, float pt); */
0041 
0042     void add_truth(vector<float> &eta, vector<float> &phi, vector<float> &pt);
0043 
0044     void add_reco(vector<float> &eta, vector<float> &phi, vector<float> &pt);
0045 
0046     array<unsigned int, 3> do_matching(); // returns n-matched, n-miss, n-fake
0047     JetIndicesMatcher(float R, float min_pT_truth=-1000., float min_pT_reco=-1000.);
0048 };
0049 #endif