ATLAS Offline Software
MuPatHit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUPATHIT_H
6 #define MUPATHIT_H
7 
8 #include <list>
9 #include <mutex>
10 
12 #include "Identifier/Identifier.h"
17 
18 
19 namespace Muon {
20 
24  class MuPatHit;
25  using MuPatHitPtr = std::shared_ptr<MuPatHit>;
26  using MuPatHitList = std::vector<MuPatHitPtr>;
27  using MuPatHitCit = MuPatHitList::const_iterator;
29 
30  class MuPatHit : public Trk::ObjectCounter<MuPatHit> {
31  public:
32  enum Type { UnknownType = -1, MDT = 0, RPC = 1, TGC = 2, CSC = 3, MM = 4, sTGC = 5, PREC = 6, Pseudo = 7, Scatterer = 8 };
34  enum HitSelection { UnknownSelection = -1, Precise = 0, Broad = 1 };
35 
36  struct Info {
37  Info() = default;
39  Identifier id{};
40 
48  MuonStationIndex::StIndex stIdx{MuonStationIndex::StIndex::StUnknown};
50  MuonStationIndex::ChIndex chIdx{MuonStationIndex::ChIndex::ChUnknown};
52  bool isSmall{false};
54  bool isEndcap{false};
56  bool measuresPhi{true};
58  };
59 
71  MuPatHit(std::shared_ptr<const Trk::TrackParameters> pars,
72  std::shared_ptr<const Trk::MeasurementBase> presMeas,
73  std::shared_ptr<const Trk::MeasurementBase> broadMeas,
74  const Info& info);
75 
77  MuPatHit(const MuPatHit& hit);
78 
80  MuPatHit& operator=(const MuPatHit&);
81 
83  virtual ~MuPatHit() = default;
84 
86  const Trk::TrackParameters& parameters() const;
87 
89  const Trk::MeasurementBase& measurement() const;
90 
92  const Info& info() const;
93 
95  Info& info();
96 
98  std::unique_ptr<MuPatHit> clone() const { return std::make_unique<MuPatHit>(*this); }
99 
102 
104  const Trk::MeasurementBase& broadMeasurement() const;
105 
106  void setResidual(double residual, double pull);
107 
109  double residual() const;
111  double pull() const;
112 
114  static unsigned int maxNumberOfInstantiations();
115 
117  static unsigned int numberOfInstantiations();
118 
120  static unsigned int numberOfCopies();
121 
122  private:
124  void copy(const MuPatHit& hit);
125 
126  // private member data
127  std::shared_ptr<const Trk::TrackParameters> m_pars{};
128  std::shared_ptr<const Trk::MeasurementBase> m_precisionMeas{};
129  std::shared_ptr<const Trk::MeasurementBase> m_broadMeas;
131  double m_residual{0.};
132  double m_pull{0.};
133  }; // class MuPatHit
134 
135 } // namespace Muon
136 
137 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Muon::MuPatHit::MuPatHit
MuPatHit(std::shared_ptr< const Trk::TrackParameters > pars, std::shared_ptr< const Trk::MeasurementBase > presMeas, std::shared_ptr< const Trk::MeasurementBase > broadMeas, const Info &info)
construction taking all members as argument, ownership is taken only of the broadMeas.
Definition: MuPatHit.cxx:17
Muon::MuPatHit::m_precisionMeas
std::shared_ptr< const Trk::MeasurementBase > m_precisionMeas
Definition: MuPatHit.h:128
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Muon::MuPatHit::Scatterer
@ Scatterer
Definition: MuPatHit.h:32
TrackParameters.h
MeasurementBase.h
Muon::MuPatHit
Definition: MuPatHit.h:30
Muon::MuPatHit::m_pull
double m_pull
Definition: MuPatHit.h:132
Muon::MuPatHit::info
const Info & info() const
returns a reference to the hit info
Definition: MuPatHit.cxx:51
Muon::MuPatHit::clone
std::unique_ptr< MuPatHit > clone() const
clones the MuPatHit
Definition: MuPatHit.h:98
Muon::MuPatHit::~MuPatHit
virtual ~MuPatHit()=default
destructor
Muon::MuPatHit::measurement
const Trk::MeasurementBase & measurement() const
returns a reference to the selected measurement
Definition: MuPatHit.cxx:45
Muon::MuPatHit::HitSelection
HitSelection
Definition: MuPatHit.h:34
Muon::MuPatHit::m_residual
double m_residual
Definition: MuPatHit.h:131
Muon::MuPatHit::Pseudo
@ Pseudo
Definition: MuPatHit.h:32
TrkObjectCounter.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MuPatHit::Info::Info
Info()=default
atomic_fetch_minmax.h
Atomic min/max functions.
Muon::MuPatHit::Broad
@ Broad
Definition: MuPatHit.h:34
Muon::MuPatHit::copy
void copy(const MuPatHit &hit)
copy hit
Definition: MuPatHit.cxx:35
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition: TrkObjectCounter.h:18
Muon::MuPatHit::CSC
@ CSC
Definition: MuPatHit.h:32
Muon::MuPatHit::operator=
MuPatHit & operator=(const MuPatHit &)
assignment operator
Definition: MuPatHit.cxx:29
Muon::MuPatHit::PREC
@ PREC
Definition: MuPatHit.h:32
Muon::MuPatHit::maxNumberOfInstantiations
static unsigned int maxNumberOfInstantiations()
maximum number of objects of this type in memory
Muon::MuPatHit::Info
Definition: MuPatHit.h:36
Muon::MuPatHit::RPC
@ RPC
Definition: MuPatHit.h:32
TGC
Definition: TgcBase.h:6
Muon::MuPatHit::broadMeasurement
const Trk::MeasurementBase & broadMeasurement() const
returns broad measurement
Definition: MuPatHit.cxx:50
Muon::MuPatHitCit
MuPatHitList::const_iterator MuPatHitCit
Definition: MuPatHit.h:27
Muon::MuPatHit::OnTrack
@ OnTrack
Definition: MuPatHit.h:33
Muon::MuPatHit::m_pars
std::shared_ptr< const Trk::TrackParameters > m_pars
Definition: MuPatHit.h:127
Muon::MuPatHit::Info::status
Status status
Flag whether the hit is on Tack or not.
Definition: MuPatHit.h:46
Muon::MuPatHit::m_broadMeas
std::shared_ptr< const Trk::MeasurementBase > m_broadMeas
Definition: MuPatHit.h:129
Muon::MuPatHit::UnknownType
@ UnknownType
Definition: MuPatHit.h:32
Muon::MuPatHit::NotOnTrack
@ NotOnTrack
Definition: MuPatHit.h:33
Muon::MuPatHit::residual
double residual() const
returns the residual of the measurement
Definition: MuPatHit.cxx:53
Muon::MuPatHit::MDT
@ MDT
Definition: MuPatHit.h:32
Trk::ParametersBase
Definition: ParametersBase.h:55
xAODType
Definition: ObjectType.h:13
Muon::MuPatHit::MM
@ MM
Definition: MuPatHit.h:32
Muon::MuPatHitPtr
std::shared_ptr< MuPatHit > MuPatHitPtr
Definition: MuPatHit.h:25
MuonStationIndexHelpers.h
Muon::MuPatHit::numberOfInstantiations
static unsigned int numberOfInstantiations()
current number of objects of this type in memory
Muon::MuPatHitIt
MuPatHitList::iterator MuPatHitIt
Definition: MuPatHit.h:28
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Muon::MuPatHit::m_info
Info m_info
Definition: MuPatHit.h:130
Muon::MuPatHitList
std::vector< MuPatHitPtr > MuPatHitList
Definition: MuPatHit.h:26
Muon::MuPatHit::Info::isSmall
bool isSmall
Small or large sector?
Definition: MuPatHit.h:52
Muon::MuPatHit::Info::type
Type type
Measurement type as defined above.
Definition: MuPatHit.h:42
Muon::MuPatHit::Outlier
@ Outlier
Definition: MuPatHit.h:33
Muon::MuPatHit::UnknownSelection
@ UnknownSelection
Definition: MuPatHit.h:34
Muon::MuPatHit::pull
double pull() const
returns the pull of the measurement
Definition: MuPatHit.cxx:54
Muon::MuPatHit::preciseMeasurement
const Trk::MeasurementBase & preciseMeasurement() const
returns precise measurement
Definition: MuPatHit.cxx:49
Muon::MuPatHit::Info::selection
HitSelection selection
Definition: MuPatHit.h:44
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuPatHit::parameters
const Trk::TrackParameters & parameters() const
returns a reference to the TrackParameters
Definition: MuPatHit.cxx:43
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Muon::MuPatHit::Info::chIdx
MuonStationIndex::ChIndex chIdx
Chamber index of the Identifier.
Definition: MuPatHit.h:50
Muon::MuPatHit::Precise
@ Precise
Definition: MuPatHit.h:34
Muon::MuPatHit::Info::stIdx
MuonStationIndex::StIndex stIdx
Station index of the Identifier BI.
Definition: MuPatHit.h:48
Muon::MuPatHit::Info::isEndcap
bool isEndcap
Hit in the endcap?
Definition: MuPatHit.h:54
Muon::MuPatHit::sTGC
@ sTGC
Definition: MuPatHit.h:32
Muon::MuPatHit::setResidual
void setResidual(double residual, double pull)
Definition: MuPatHit.cxx:55
Muon::MuPatHit::Info::measuresPhi
bool measuresPhi
Does the hit constrain phi?
Definition: MuPatHit.h:56
Muon::MuPatHit::numberOfCopies
static unsigned int numberOfCopies()
number of times the copy constructor was called since last reset
Muon::MuPatHit::Status
Status
Definition: MuPatHit.h:33
Identifier
Definition: IdentifierFieldParser.cxx:14
Muon::MuPatHit::UnknownStatus
@ UnknownStatus
Definition: MuPatHit.h:33