ATLAS Offline Software
MuPatHitTool.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 MUPATHITTOOL_H
6 #define MUPATHITTOOL_H
7 
9 #include "GaudiKernel/ServiceHandle.h"
10 #include "GaudiKernel/ToolHandle.h"
20 
21 
22 namespace Muon {
23 
24  class MuonEDMPrinterTool;
25  class MuonSegment;
26 
27  class MuPatHitTool : public AthAlgTool {
28  public:
30  MuPatHitTool(const std::string&, const std::string&, const IInterface*);
31 
34 
36  StatusCode initialize() override;
37 
39  static const InterfaceID& interfaceID() {
40  static const InterfaceID IID_MuPatHitTool("Muon::MuPatHitTool", 1, 0);
41  return IID_MuPatHitTool;
42  }
43 
49  bool create(const EventContext& ctx, const MuonSegment& seg, MuPatHitList& hitList) const;
50 
56  bool create(const Trk::Track& track, MuPatHitList& hitList) const;
57 
64  bool create(const EventContext& ctx, const Trk::TrackParameters& pars, const std::vector<const Trk::MeasurementBase*>& measVec,
65  MuPatHitList& hitList) const;
66 
73  static MuPatHitList merge(const MuPatHitList& hitList1, const MuPatHitList& hitList2) ;
74 
81  static bool extract(const MuPatHitList& hitList, std::vector<const Trk::MeasurementBase*>& measVec, bool usePreciseHits = true,
82  bool getReducedTrack = false) ;
83 
85  static bool isSorted(const MuPatHitList& hitList) ;
86 
88  std::string print(const MuPatHitList& hitList, bool printPos = true, bool printDir = true, bool printMom = true) const;
89 
91  static bool remove(const Identifier& id, MuPatHitList& hitList) ;
92 
94  bool remove(const Trk::MeasurementBase& meas, MuPatHitList& hitList) const;
95 
97  bool update(const Trk::Track& track, MuPatHitList& hitList) const;
98 
99  private:
101  MuPatHit::Type getHitType(const Identifier& id) const;
102 
105 
107  std::unique_ptr<const Trk::MeasurementBase> createBroadMeasurement(const Trk::MeasurementBase& preciseMeas,
108  const MuPatHit::Info& hitInfo) const;
109 
112  double& residualPull) const;
113  ToolHandle<Trk::IPropagator> m_propagator{
114  this,
115  "AtlasRungeKuttaPropagator",
116  "Trk::RungeKuttaPropagator/AtlasRungeKuttaPropagator",
117  };
118  ToolHandle<IMdtDriftCircleOnTrackCreator> m_mdtRotCreator{
119  this,
120  "MdtRotCreator",
121  "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
122  }; //<! tool to calibrate MDT hits
123  ToolHandle<IMuonClusterOnTrackCreator> m_cscRotCreator{
124  this,
125  "CscRotCreator",
126  "Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator",
127  }; //<! tool to calibrate CSC hits
128 
129  ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator{
130  this,
131  "ResidualPullCalculator",
132  "Trk::ResidualPullCalculator/ResidualPullCalculator",
133  }; //<! tool to calculate residuals and pulls
134  PublicToolHandle<MuonEDMPrinterTool> m_printer{
135  this,
136  "Printer",
137  "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
138  }; //<! tool to print EDM objects
139 
141  this,
142  "MuonIdHelperSvc",
143  "Muon::MuonIdHelperSvc/MuonIdHelperSvc",
144  };
146  this,
147  "edmHelper",
148  "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
149  "Handle to the service providing the IMuonEDMHelperSvc interface",
150  }; //<! multipurpose helper tool
151 
153 
154  Gaudi::Property<bool> m_isCosmic{this, "isCosmic", false,
155  "Toggle whether the job runs on cosmic data. That influences the hit sorting on track"};
156  };
157 
158 } // namespace Muon
159 
160 #endif
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Muon::MuPatHitTool::createBroadMeasurement
std::unique_ptr< const Trk::MeasurementBase > createBroadMeasurement(const Trk::MeasurementBase &preciseMeas, const MuPatHit::Info &hitInfo) const
calculate broad measurement for a give precise measurement
Definition: MuPatHitTool.cxx:251
Muon::MuPatHitTool::merge
static MuPatHitList merge(const MuPatHitList &hitList1, const MuPatHitList &hitList2)
merge two MuPatHitLists into a new one
Definition: MuPatHitTool.cxx:148
Muon::MuPatHitTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuPatHitTool.h:140
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Muon::MuPatHitTool::update
bool update(const Trk::Track &track, MuPatHitList &hitList) const
update hit list for a give track
Definition: MuPatHitTool.cxx:285
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
Muon::MuPatHitTool::m_cscRotCreator
ToolHandle< IMuonClusterOnTrackCreator > m_cscRotCreator
Definition: MuPatHitTool.h:123
IMuonCompetingClustersOnTrackCreator.h
Muon::MuPatHitTool::m_magFieldProperties
Trk::MagneticFieldProperties m_magFieldProperties
magnetic field properties
Definition: MuPatHitTool.h:152
IPropagator.h
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuPatHitTool::m_mdtRotCreator
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
Definition: MuPatHitTool.h:118
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Muon::MuPatHitTool::m_propagator
ToolHandle< Trk::IPropagator > m_propagator
Definition: MuPatHitTool.h:113
Muon::MuPatHitTool::getHitType
MuPatHit::Type getHitType(const Identifier &id) const
get hit type
Definition: MuPatHitTool.cxx:215
Muon::MuPatHitTool::print
std::string print(const MuPatHitList &hitList, bool printPos=true, bool printDir=true, bool printMom=true) const
print the list of hits, with optional parts of the printout (position,direction,momentum)
Definition: MuPatHitTool.cxx:314
Muon::MuPatHitTool::m_isCosmic
Gaudi::Property< bool > m_isCosmic
Definition: MuPatHitTool.h:154
MagneticFieldProperties.h
Muon::MuPatHitTool::calculateResiduals
void calculateResiduals(const Trk::TrackStateOnSurface *tsos, Trk::ResidualPull::ResidualType type, double &residual, double &residualPull) const
calculate the residuals
Definition: MuPatHitTool.cxx:397
Muon::MuPatHitTool::m_pullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
Definition: MuPatHitTool.h:129
Muon::MuPatHit::Info
Definition: MuPatHit.h:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IMuonClusterOnTrackCreator.h
AthAlgTool.h
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuPatHitTool::initialize
StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
Definition: MuPatHitTool.cxx:32
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::NoField
@ NoField
Field is set to 0., 0., 0.,.
Definition: MagneticFieldMode.h:18
Muon::MuPatHitTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuPatHitTool.h:134
IMuonEDMHelperSvc.h
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Muon::MuPatHit::Type
Type
Definition: MuPatHit.h:32
IMdtDriftCircleOnTrackCreator.h
Muon::MuPatHitTool::interfaceID
static const InterfaceID & interfaceID()
access to tool interface
Definition: MuPatHitTool.h:39
Muon::MuPatHitList
std::vector< MuPatHitPtr > MuPatHitList
Definition: MuPatHit.h:26
Muon::MuPatHitTool::isSorted
static bool isSorted(const MuPatHitList &hitList)
check whether the list is correctly sorted
Definition: MuPatHitTool.cxx:381
IResidualPullCalculator.h
Muon::MuPatHitTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuPatHitTool.h:145
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MuPatHitTool::getHitInfo
MuPatHit::Info getHitInfo(const Trk::MeasurementBase &meas) const
get hit info
Definition: MuPatHitTool.cxx:233
Muon::MuPatHitTool::remove
static bool remove(const Identifier &id, MuPatHitList &hitList)
remove hit with a give Identifier
Definition: MuPatHitTool.cxx:185
Muon::MuPatHitTool::create
bool create(const EventContext &ctx, const MuonSegment &seg, MuPatHitList &hitList) const
create a MCTBList from a MuonSegment
Definition: MuPatHitTool.cxx:44
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
AthAlgTool
Definition: AthAlgTool.h:26
MuPatHit.h
Muon::MuPatHitTool::MuPatHitTool
MuPatHitTool(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
Definition: MuPatHitTool.cxx:26
Trk::ResidualPull::ResidualType
ResidualType
Definition: ResidualPull.h:53
IMuonIdHelperSvc.h
Muon::MuPatHitTool::~MuPatHitTool
~MuPatHitTool()
destructor
Muon::MuPatHitTool::extract
static bool extract(const MuPatHitList &hitList, std::vector< const Trk::MeasurementBase * > &measVec, bool usePreciseHits=true, bool getReducedTrack=false)
merge two MuPatHitLists into a new one.
Definition: MuPatHitTool.cxx:171
Muon::MuPatHitTool
Definition: MuPatHitTool.h:27
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14