Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EmbRecoMatchv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EmbRecoMatchv1.h
1 #ifndef TRACKBASE_EMBRECOMATCHV1_H
2 #define TRACKBASE_EMBRECOMATCHV1_H
3 
4 #include "EmbRecoMatch.h"
5 
6 #include <trackbase/TrkrDefs.h>
7 #include <phool/PHObject.h>
8 #include <vector>
9 #include <array>
10 
11 /* class VtxPoint; */
13 {
14  public:
15  ~EmbRecoMatchv1() override = default;
16 
17  unsigned short idTruthTrack() const override { return m_idTruthTrack; };
18  unsigned short nClustersTruth() const override { return m_nClustersTruth; };
19  unsigned short nMatches() const override { return m_nMatches; };
20 
21 
22  private:
23  static constexpr int MATCH_idReco = 0;
24  static constexpr int MATCH_idTpcSeed = 1;
25  static constexpr int MATCH_idSvtxSeed = 2;
26  static constexpr int MATCH_nClustersReco = 3;
27  static constexpr int MATCH_nClustersMatched = 4;
28 
29  public:
30  unsigned short idRecoTrack (unsigned short i=0) const override { return m_matches[i][MATCH_idReco]; };
31  unsigned short idTpcTrackSeed (unsigned short i=0) const override { return m_matches[i][MATCH_idTpcSeed]; };
32  unsigned short idSvtxTrackSeed (unsigned short i=0) const override { return m_matches[i][MATCH_idSvtxSeed]; };
33 
34  unsigned short nClustersReco (unsigned short i=0) const override { return m_matches[i][MATCH_nClustersReco]; };
35  unsigned short nClustersMatched (unsigned short i=0) const override { return m_matches[i][MATCH_nClustersMatched]; };
36 
37  /* float meanClusterZDiff() const override { return m_meanClusterZDiff; }; */
38  /* float meanClusterPhiDiff() const override { return m_meanClusterPhiDiff; }; */
39 
41  unsigned short id_truth = USHRT_MAX
42  , unsigned short id_reco = USHRT_MAX
43  , unsigned short nclustruth = USHRT_MAX
44  , unsigned short nclusreco = USHRT_MAX
45  , unsigned short nclusmatched = USHRT_MAX
46  , unsigned short id_tpctrackseed = USHRT_MAX
47  , unsigned short id_svtxtrackseed = USHRT_MAX
48  )
49  : m_idTruthTrack { id_truth }
50  , m_nClustersTruth { nclustruth }
51  , m_nMatches { 1 }
52  , m_matches {{ id_reco, id_tpctrackseed, id_svtxtrackseed, nclusreco, nclusmatched }}
53  {};
54 
55  unsigned short add_match (
56  unsigned short id_reco = USHRT_MAX
57  , unsigned short nclusreco = USHRT_MAX
58  , unsigned short nclusmatched = USHRT_MAX
59  , unsigned short id_tpctrackseed = USHRT_MAX
60  , unsigned short id_svtxtrackseed = USHRT_MAX
61  );
62 
63  private:
64 
65  unsigned short m_idTruthTrack {USHRT_MAX};
66  unsigned short m_nClustersTruth {USHRT_MAX};
67  unsigned short m_nMatches {USHRT_MAX};
68 
69  std::vector<std::array<unsigned short, 5>> m_matches;
70  // each match has metrics defined by five unsigned ints: idReco, idTpcSee, idSvtxSeed, nClustersReco, nClusterMatched
71 
72  public:
73  // PHObject virtual overloads
74  void identify(std::ostream& os = std::cout) const override
75  {
76  os << "EmbRecoMatchv1 base class" << std::endl;
77  };
78 
79  protected:
80  ClassDefOverride(EmbRecoMatchv1, 1)
81 };
82 
83 #endif // G4TPC_TruthTrack_h