MuonTrackSummary.h 6.22 KB
Newer Older
1
/*
2
  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
4
5
6
7
8
9
10
*/

#ifndef TRK_MUONTRACKSUMMARY_H
#define TRK_MUONTRACKSUMMARY_H

#include "Identifier/Identifier.h"

class MsgStream;
11
12
13
class MuonTrackSummaryCnv_p1;
class MuonTrackSummaryCnv_p2;
class TrackSummaryCnv_p2;
14
15

namespace Muon {
16
class MuonTrackSummaryHelperTool;
17
18
19
}

namespace Trk {
20
21
22
23
24
25
26
27
28
29
30
31
32

/**
    Detailed track summary for the muon system
    Give access to hit counts per chamber.
*/
class MuonTrackSummary
{
public:
  friend class Muon::MuonTrackSummaryHelperTool;

  /** structure to hold information per chamber in the muon system */
  struct ChamberHitSummary
  {
33
34
    friend class Muon::MuonTrackSummaryHelperTool;

35
36
37
38
    /** structure to hold the information for the eta/phi projection of RPC, TGC and CSC
    chambers and per multilayer for MDT chambers */
    struct Projection
    {
39
      Projection() {}
40
41
42
43
44
45
46
47
      int nhits{ 0 };      //<! number of hits on track in the projection
      int nholes{ 0 };     //<! number of holes in the projection
      int noutliers{ 0 };  //<! number of outliers in the projection
      int ndeltas{ 0 };    //<! number of delta electrons in the projection (only filled for MDT chambers)
      int ncloseHits{ 0 }; //<! number of hits within a road around the track in the projection
      int ngoodHits{ 0 };  //<! number of hits that matter for the track
      int noutBounds{ 0 }; //<! number of out-of-bounds hits
    };
48

49
50
51
52
53
54
55
    /** constructor taking the Identifier of the chamber and a boolean whether we are dealing with a MDT chamber or not
    (the boolean is passed as the ChamberHitSummary cannot unpack the identifier and it needs to know whether it is
    dealing with a MDT chamber) */
    ChamberHitSummary(Identifier chID, bool isMdtTube)
      : m_chId(chID)
      , m_isMdt(isMdtTube)
    {}
56

57
58
    /** returns the chamber identifier */
    const Identifier& chamberId() const { return m_chId; }
59

60
61
    /** returns whether this is a MDT chamber */
    bool isMdt() const { return m_isMdt; }
62

63
64
    /** returns the total number of hits on track in the chamber */
    int nhits() const { return m_first.nhits + m_second.nhits; }
65

66
67
    /** returns the total number of holes in the chamber */
    int nholes() const { return m_first.nholes + m_second.nholes; }
68

69
70
    /** returns the total number of outliers in the chamber */
    int noutliers() const { return m_first.noutliers + m_second.noutliers; }
71

72
73
    /** returns the total number of delta electrons in the chamber */
    int ndeltas() const { return m_first.ndeltas + m_second.ndeltas; }
74

75
76
    /** returns the total number of close hits in the chamber */
    int ncloseHits() const { return m_first.ncloseHits + m_second.ncloseHits; }
77

78
79
    /** returns the number of non-deweighted hits in the chamber */
    int ngoodHits() const { return m_first.ngoodHits + m_second.ngoodHits; }
80

81
82
    // returns the number of out of bounds hits
    int noutBoundsHits() const { return m_first.noutBounds + m_second.noutBounds; }
83

84
85
    /** returns the total number of eta hits on track  in the chamber */
    int netaHits() const { return isMdt() ? nhits() : m_first.nhits; }
86

87
88
    /** returns the total number of phi hits on track  in the chamber */
    int nphiHits() const { return isMdt() ? 0 : m_second.nhits; }
89

90
91
    /** returns the total number of MDT hits on track  in the first multi layer */
    int nMdtHitsMl1() const { return isMdt() ? m_first.nhits : 0; }
92

93
94
    /** returns the total number of MDT hits on track  in the second multi layer */
    int nMdtHitsMl2() const { return isMdt() ? m_second.nhits : 0; }
95

96
97
    /** access to the data of the first MDT multi layer, users have to check whether this is a MDT chamber first!! */
    const Projection& mdtMl1() const { return m_first; }
98

99
100
    /** access to the data of the second MDT multi layer, users have to check whether this is a MDT chamber first!! */
    const Projection& mdtMl2() const { return m_second; }
101

102
103
    /** access to the data of the eta projection, users have to check whether this is NOT a MDT chamber first!! */
    const Projection& etaProjection() const { return m_first; }
104

105
106
107
108
109
110
111
    /** access to the data of the phi projection, users have to check whether this is NOT a MDT chamber first!! */
    const Projection& phiProjection() const { return m_second; }

  private:
    friend class ::MuonTrackSummaryCnv_p1;
    friend class ::MuonTrackSummaryCnv_p2;
    friend class ::TrackSummaryCnv_p2;
112

113
114
    Identifier m_chId{ 0 }; //<! chamber identifier
    bool m_isMdt{ false };  //<! is this a MDT chamber
115

116
117
118
    Projection m_first;  //<! eta projections for cluster chambers, first multi layer for mdt chambers
    Projection m_second; //<! phi projections for cluster chambers, first multi layer for mdt chambers
  };
119

120
121
  /** default constructor */
  MuonTrackSummary();
122

123
124
  /** destructor */
  ~MuonTrackSummary();
125

126
127
  /** number of eta hits on the track */
  unsigned int netaHits() const;
128

129
130
  /** number of phi hits on the track */
  unsigned int nphiHits() const;
131

132
133
  /** number of eta trigger hits on the track */
  unsigned int noutliers() const;
134

135
136
  /** number of holes on the track */
  unsigned int nholes() const;
137

138
139
  /** number of holes on the track */
  unsigned int ncloseHits() const;
140

141
142
  /** number of scattering centres on the track */
  unsigned int nscatterers() const { return m_nscatterers; }
143

144
145
  /** number of pseudo measurements on the track */
  unsigned int npseudoMeasurements() const { return m_npseudoMeasurements; }
146

147
148
  /** access to the vector of chamber hit summaries on the track */
  const std::vector<ChamberHitSummary>& chamberHitSummary() const { return m_chamberHitSummary; }
149

150
151
152
153
private:
  friend class ::MuonTrackSummaryCnv_p1;
  friend class ::MuonTrackSummaryCnv_p2;
  friend class ::TrackSummaryCnv_p2;
154

155
156
157
158
  unsigned int m_nscatterers;                         //<! number of scattering centres on the track
  unsigned int m_npseudoMeasurements;                 //<! number of pseudomeasurements on the track
  std::vector<ChamberHitSummary> m_chamberHitSummary; //<! vector with chamber hit summaries
};
159
160

/**output. This dumps the values of each of the possible summary enums*/
161
162
MsgStream&
operator<<(MsgStream& out, const MuonTrackSummary& trackSum);
163
164

/**output. This dumps the values of each of the possible summary enums*/
165
166
std::ostream&
operator<<(std::ostream& out, const MuonTrackSummary& trackSum);
167
168
169

}
#endif