ATLAS Offline Software
MuPatCandidateBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUPATCANDIDATEBASE_H
6 #define MUPATCANDIDATEBASE_H
7 
8 #include <set>
9 
10 #include "Identifier/Identifier.h"
15 
16 namespace Muon {
17 
47  friend class MuPatCandidateTool;
48 
49  public:
50  using MeasVec = std::vector<const Trk::MeasurementBase*>;
51 
52  public:
54  MuPatCandidateBase() = default;
55 
57  MuPatCandidateBase(const MeasVec& etaHits, const MeasVec& phiHits, const MeasVec& fakePhiHits, const MeasVec& allHits);
58 
60  virtual ~MuPatCandidateBase() = default;
61 
63  const MeasVec& etaHits() const;
64 
66  const MeasVec& phiHits() const;
67 
69  const MeasVec& fakePhiHits() const;
70 
72  const MeasVec& hits() const;
73 
75  bool hasSmallChamber() const;
76 
78  bool hasLargeChamber() const;
79 
81  bool hasSLOverlap() const;
82 
84  virtual const Trk::TrackParameters& entryPars() const = 0;
85 
87  bool hasEndcap() const;
88 
90  void hasEndcap(bool hasEC);
91 
93  bool hasMomentum() const;
94 
96  const std::set<MuonStationIndex::StIndex>& stations() const;
97 
99  const std::set<MuonStationIndex::ChIndex>& chambers() const;
100 
102  bool containsChamber(MuonStationIndex::ChIndex chIndex) const;
103 
105  bool containsStation(MuonStationIndex::StIndex chIndex) const;
106 
108  const MuPatHitList& hitList() const { return m_hitList; }
109 
111  const std::set<Identifier>& chamberIds() const;
112 
114  bool shareChambers(const MuPatCandidateBase& entry) const;
115 
117  void addToTrash(std::unique_ptr<const Trk::MeasurementBase> meas);
118  void addToTrash(const std::vector<std::shared_ptr<const Trk::MeasurementBase>>& measurements);
119  const std::vector<std::shared_ptr<const Trk::MeasurementBase>>& garbage() const;
120  protected:
121  // all non-const functions protected, only accessible by derived classes and MCTBEntryHandler and MuPatHitHandler
122 
124  void hasSLOverlap(bool hasSL);
125 
127  void hasSmallChamber(bool hasSmall);
128 
130  void hasLargeChamber(bool hasLarge);
131 
133  void setEtaHits(const MeasVec& hits);
134 
136  void setPhiHits(const MeasVec& hits);
137 
139  void setFakePhiHits(const MeasVec& hits);
140 
142  void setAllHits(const MeasVec& hits);
143 
146 
148  std::set<Identifier>& chamberIds();
149 
151  void clearChambers();
152 
155 
157  void setChambers(const std::set<MuonStationIndex::ChIndex>& chambers);
158 
159  private:
160  MeasVec m_etaHits; //<! vector containing all eta measurements
161  MeasVec m_phiHits; //<! vector containing all phi measurements
162  MeasVec m_fakePhiHits; //<! vector containing all fake phi measurements
163  MeasVec m_allHits; //<! vector containing all measurements (except fake phi measurements)
164 
166 
167  std::set<Identifier> m_chamberIds; //<! set to store chamber Ids of hits associated with candidate
168 
169  protected:
170  std::set<MuonStationIndex::ChIndex> m_chambers; //<! set to store chamber indices of segments associated with candidate
171  std::set<MuonStationIndex::StIndex> m_stations; //<! set to store station indices of segments associated with candidate
172  bool m_hasMomentum{false};
173 
174  public:
176  unsigned int nmdtHitsMl1{0};
177  unsigned int nmdtHitsMl2{0};
178  unsigned int ncscHitsEta{0};
179  unsigned int ncscHitsPhi{0};
180  unsigned int nrpcHitsEta{0};
181  unsigned int nrpcHitsPhi{0};
182  unsigned int ntgcHitsEta{0};
183  unsigned int ntgcHitsPhi{0};
184 
185  private:
186  bool m_hasEndcap{false};
187  bool m_hasSmallChamber{false};
188  bool m_hasLargeChamber{false};
189  bool m_hasSLOverlap{false};
190 
191  std::vector<std::shared_ptr<const Trk::MeasurementBase>> m_garbage{};
192  };
193 
194 } // namespace Muon
195 
196 #endif
Muon::MuPatCandidateBase::ncscHitsPhi
unsigned int ncscHitsPhi
Definition: MuPatCandidateBase.h:179
Muon::MuPatCandidateBase::addToTrash
void addToTrash(std::unique_ptr< const Trk::MeasurementBase > meas)
adds the measurement to the garbage container.
Definition: MuPatCandidateBase.cxx:91
Muon::MuPatCandidateBase::m_phiHits
MeasVec m_phiHits
Definition: MuPatCandidateBase.h:161
Muon::MuPatCandidateBase::phiHits
const MeasVec & phiHits() const
return all phi hits on the entry
Definition: MuPatCandidateBase.cxx:57
Muon::MuPatCandidateBase::hasMomentum
bool hasMomentum() const
returns whether entry has a momentum measurement
Definition: MuPatCandidateBase.cxx:89
TrackParameters.h
MeasurementBase.h
Muon::MuPatCandidateBase
track candidate entry object.
Definition: MuPatCandidateBase.h:46
Muon::MuPatCandidateBase::nmdtHitsMl1
unsigned int nmdtHitsMl1
public hit counters
Definition: MuPatCandidateBase.h:176
Muon::MuPatCandidateBase::m_hasMomentum
bool m_hasMomentum
Definition: MuPatCandidateBase.h:172
Muon::MuPatCandidateBase::m_fakePhiHits
MeasVec m_fakePhiHits
Definition: MuPatCandidateBase.h:162
Muon::MuPatCandidateBase::chambers
const std::set< MuonStationIndex::ChIndex > & chambers() const
returns set with contained chamberIndices
Definition: MuPatCandidateBase.cxx:31
Muon::MuPatCandidateBase::hasLargeChamber
bool hasLargeChamber() const
returns whether entry contains a small chamber
Definition: MuPatCandidateBase.cxx:45
Muon::MuPatCandidateBase::shareChambers
bool shareChambers(const MuPatCandidateBase &entry) const
checks whether the two entries contain the same chamber
Definition: MuPatCandidateBase.cxx:20
Muon::MuPatCandidateBase::ncscHitsEta
unsigned int ncscHitsEta
Definition: MuPatCandidateBase.h:178
Muon::MuPatCandidateBase::nrpcHitsEta
unsigned int nrpcHitsEta
Definition: MuPatCandidateBase.h:180
Muon::MuPatCandidateBase::m_hasEndcap
bool m_hasEndcap
Definition: MuPatCandidateBase.h:186
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuPatCandidateBase::setAllHits
void setAllHits(const MeasVec &hits)
set all hits on the entry
Definition: MuPatCandidateBase.cxx:69
Muon::MuPatCandidateBase::m_garbage
std::vector< std::shared_ptr< const Trk::MeasurementBase > > m_garbage
Definition: MuPatCandidateBase.h:191
Muon::MuPatCandidateBase::~MuPatCandidateBase
virtual ~MuPatCandidateBase()=default
destructor.
Muon::MuPatCandidateBase::m_hasSmallChamber
bool m_hasSmallChamber
Definition: MuPatCandidateBase.h:187
Muon::MuPatCandidateBase::setPhiHits
void setPhiHits(const MeasVec &hits)
set phi hits on the entry
Definition: MuPatCandidateBase.cxx:65
Muon::MuPatCandidateBase::fakePhiHits
const MeasVec & fakePhiHits() const
return all fake phi hits on the entry
Definition: MuPatCandidateBase.cxx:59
Muon::MuPatCandidateBase::MuPatCandidateBase
MuPatCandidateBase()=default
constructor.
Muon::MuPatCandidateBase::chamberIds
const std::set< Identifier > & chamberIds() const
returns set with contained chamber ids
Definition: MuPatCandidateBase.cxx:33
Muon::MuPatCandidateBase::etaHits
const MeasVec & etaHits() const
return all eta hits on the entry
Muon::MuPatCandidateBase::nrpcHitsPhi
unsigned int nrpcHitsPhi
Definition: MuPatCandidateBase.h:181
Muon::MeasVec
NSWSeed::MeasVec MeasVec
Stereo seeds can be formed using hits from 4 independent layers by solving the following system of eq...
Definition: MuonNSWSegmentFinderTool.cxx:102
Muon::MuPatCandidateBase::hitList
MuPatHitList & hitList()
returns a reference to the hit list
Definition: MuPatCandidateBase.h:145
Muon::MuPatCandidateBase::m_stations
std::set< MuonStationIndex::StIndex > m_stations
Definition: MuPatCandidateBase.h:171
Muon::MuPatCandidateBase::setChambers
void setChambers(const std::set< MuonStationIndex::ChIndex > &chambers)
Set the list of chambers and update list of stations.
Definition: MuPatCandidateBase.cxx:14
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuPatCandidateTool
class to manipulate MuPatCandidateBase objects
Definition: MuPatCandidateTool.h:49
Muon::MuPatCandidateBase::clearChambers
void clearChambers()
clear the list of contained chambers.
Definition: MuPatCandidateBase.cxx:83
Muon::MuPatCandidateBase::entryPars
virtual const Trk::TrackParameters & entryPars() const =0
return track parameters representing the entry
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
Muon::MuPatCandidateBase::nmdtHitsMl2
unsigned int nmdtHitsMl2
Definition: MuPatCandidateBase.h:177
Muon::MuPatCandidateBase::hasEndcap
bool hasEndcap() const
returns whether the entry contains endcap hits
Definition: MuPatCandidateBase.cxx:71
Muon::MuPatCandidateBase::containsStation
bool containsStation(MuonStationIndex::StIndex chIndex) const
returns whether the StationIndex is already contained in candidate
Definition: MuPatCandidateBase.cxx:79
Muon::MuPatHitList
std::vector< MuPatHitPtr > MuPatHitList
Definition: MuPatHit.h:26
Muon::MuPatCandidateBase::m_etaHits
MeasVec m_etaHits
Definition: MuPatCandidateBase.h:160
Muon::MuPatCandidateBase::MeasVec
std::vector< const Trk::MeasurementBase * > MeasVec
Definition: MuPatCandidateBase.h:50
Muon::MuPatCandidateBase::m_hasSLOverlap
bool m_hasSLOverlap
Definition: MuPatCandidateBase.h:189
Muon::MuPatCandidateBase::hasSLOverlap
bool hasSLOverlap() const
returns whether there is at least one small/large overlap in the same station layer
Definition: MuPatCandidateBase.cxx:47
Muon::MuPatCandidateBase::setEtaHits
void setEtaHits(const MeasVec &hits)
set eta hits on the entry
Definition: MuPatCandidateBase.cxx:63
Muon::MuPatCandidateBase::hasSmallChamber
bool hasSmallChamber() const
returns whether entry contains a small chamber
Definition: MuPatCandidateBase.cxx:43
Muon::MuPatCandidateBase::m_hasLargeChamber
bool m_hasLargeChamber
Definition: MuPatCandidateBase.h:188
Muon::MuPatCandidateBase::containsChamber
bool containsChamber(MuonStationIndex::ChIndex chIndex) const
returns whether the ChamberIndex is already contained in candidate
Definition: MuPatCandidateBase.cxx:75
Muon::MuPatCandidateBase::hitList
const MuPatHitList & hitList() const
returns a reference to the hit list
Definition: MuPatCandidateBase.h:108
Muon::MuPatCandidateBase::m_chamberIds
std::set< Identifier > m_chamberIds
Definition: MuPatCandidateBase.h:167
Muon::MuPatCandidateBase::m_chambers
std::set< MuonStationIndex::ChIndex > m_chambers
Definition: MuPatCandidateBase.h:170
Muon::MuPatCandidateBase::ntgcHitsEta
unsigned int ntgcHitsEta
Definition: MuPatCandidateBase.h:182
Muon::MuPatCandidateBase::ntgcHitsPhi
unsigned int ntgcHitsPhi
Definition: MuPatCandidateBase.h:183
Muon::MuPatCandidateBase::addChamber
void addChamber(MuonStationIndex::ChIndex chIndex)
add the chamber to the list of contained chambers.
Definition: MuPatCandidateBase.cxx:38
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Muon::MuPatCandidateBase::setFakePhiHits
void setFakePhiHits(const MeasVec &hits)
set fake phi hits on the entry
Definition: MuPatCandidateBase.cxx:67
MuonStationIndex.h
Muon::MuPatCandidateBase::m_hitList
MuPatHitList m_hitList
Definition: MuPatCandidateBase.h:165
MuPatHit.h
Muon::MuPatCandidateBase::hits
const MeasVec & hits() const
return all hits on the entry.
Definition: MuPatCandidateBase.cxx:61
Muon::MuPatCandidateBase::m_allHits
MeasVec m_allHits
Definition: MuPatCandidateBase.h:163
Muon::MuPatCandidateBase::stations
const std::set< MuonStationIndex::StIndex > & stations() const
returns set with contained stationIndices
Definition: MuPatCandidateBase.cxx:29
Muon::MuPatCandidateBase::garbage
const std::vector< std::shared_ptr< const Trk::MeasurementBase > > & garbage() const
Definition: MuPatCandidateBase.cxx:98