ATLAS Offline Software
Loading...
Searching...
No Matches
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
22namespace Muon {
23
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
80
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
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
PublicToolHandle< MuonEDMPrinterTool > m_printer
MuPatHit::Type getHitType(const Identifier &id) const
get hit type
void calculateResiduals(const Trk::TrackStateOnSurface *tsos, Trk::ResidualPull::ResidualType type, double &residual, double &residualPull) const
calculate the residuals
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
static bool remove(const Identifier &id, MuPatHitList &hitList)
remove hit with a give Identifier
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
ToolHandle< IMuonClusterOnTrackCreator > m_cscRotCreator
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Trk::MagneticFieldProperties m_magFieldProperties
magnetic field properties
ToolHandle< Trk::IPropagator > m_propagator
StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
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.
MuPatHit::Info getHitInfo(const Trk::MeasurementBase &meas) const
get hit info
bool update(const Trk::Track &track, MuPatHitList &hitList) const
update hit list for a give track
~MuPatHitTool()
destructor
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
std::unique_ptr< const Trk::MeasurementBase > createBroadMeasurement(const Trk::MeasurementBase &preciseMeas, const MuPatHit::Info &hitInfo) const
calculate broad measurement for a give precise measurement
MuPatHitTool(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
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)
static bool isSorted(const MuPatHitList &hitList)
check whether the list is correctly sorted
bool create(const EventContext &ctx, const MuonSegment &seg, MuPatHitList &hitList) const
create a MCTBList from a MuonSegment
static const InterfaceID & interfaceID()
access to tool interface
Gaudi::Property< bool > m_isCosmic
Helper tool to print EDM objects to string in a fix format.
This is the common class for 3D segments used in the muon spectrometer.
magnetic field properties to steer the behavior of the extrapolation
This class is the pure abstract base class for all fittable tracking measurements.
represents the track state (measurement, material, fit parameters and quality) at a surface.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::vector< MuPatHitPtr > MuPatHitList
Definition MuPatHit.h:26
@ NoField
Field is set to 0., 0., 0.,.
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition merge.py:1