ATLAS Offline Software
SpacePointCalibrator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONSPACEPOINTCALIBRATOR_SPACEPOINTCALIBRATOR_H
5 #define MUONSPACEPOINTCALIBRATOR_SPACEPOINTCALIBRATOR_H
6 
8 
9 
15 
19 
20 #include "GaudiKernel/PhysicalConstants.h"
23 
26 
27 
28 namespace MuonR4{
29  /*** @brief Implementation of the space point calibrator interface */
30  class SpacePointCalibrator : public extends<AthAlgTool, ISpacePointCalibrator>,
32  public:
34  using base_class::base_class;
35 
36  StatusCode initialize() override final;
37 
38  CalibSpacePointPtr calibrate(const EventContext& ctx,
39  const SpacePoint* spacePoint,
40  const Amg::Vector3D& seedPosInChamb,
41  const Amg::Vector3D& seedDirInChamb,
42  const double timeDelay) const override final;
43 
44  CalibSpacePointPtr calibrate(const EventContext& ctx,
45  const CalibratedSpacePoint& spacePoint,
46  const Amg::Vector3D& seedPosInChamb,
47  const Amg::Vector3D& seedDirInChamb,
48  const double timeDelay) const override final;
49 
50 
51  CalibSpacePointVec calibrate(const EventContext& ctx,
52  const std::vector<const SpacePoint*>& spacePoints,
53  const Amg::Vector3D& seedPosInChamb,
54  const Amg::Vector3D& seedDirInChamb,
55  const double timeDelay) const override final;
56 
57  CalibSpacePointVec calibrate(const Acts::CalibrationContext& ctx,
58  const Amg::Vector3D& seedPosInChamb,
59  const Amg::Vector3D& seedDirInChamb,
60  const double timeDelay,
61  const CalibSpacePointVec& spacePoints) const override final;
62 
63  void updateSigns(const Amg::Vector3D& trackPos,
64  const Amg::Vector3D& trackDir,
65  CalibSpacePointVec& hitsToCalib) const override final;
66 
67  double driftVelocity(const Acts::CalibrationContext& ctx,
68  const CalibratedSpacePoint& spacePoint) const override final;
69 
70  double driftAcceleration(const Acts::CalibrationContext& ctx,
71  const CalibratedSpacePoint& spacePoint) const override final;
72 
73  void calibrateSourceLink(const Acts::GeometryContext& geoctx,
74  const Acts::CalibrationContext& cctx,
75  const Acts::SourceLink& link,
76  ActsTrk::MutableTrackContainer::TrackStateProxy state) const override final;
77 
78  void stampSignsOnMeasurements(const xAOD::MuonSegment& segment) const override final;
79  private:
87  void calibrateCombinedPrd(const EventContext& ctx,
88  const ActsTrk::GeometryContext& gctx,
89  const xAOD::CombinedMuonStrip* combinedPrd,
90  ActsTrk::MutableTrackContainer::TrackStateProxy state) const;
100  std::pair<double, double> calibrateMM(const EventContext& ctx,
101  const ActsTrk::GeometryContext& gctx,
102  const xAOD::MMCluster& cluster,
103  const Amg::Vector3D& globalPos,
104  const Amg::Vector3D& globalDir) const;
116  std::pair<double, double> calibratesTGC(const EventContext& ctx,
117  const ActsTrk::GeometryContext& gctx,
118  const xAOD::sTgcStripCluster& cluster,
119  std::optional<double> posAlongTheStrip,
120  const Amg::Vector3D& globalPos,
121  const Amg::Vector3D& globalDir) const;
122 
124  SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
125 
126  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
127 
128  ToolHandle<IMdtCalibrationTool> m_mdtCalibrationTool{this, "MdtCalibrationTool", ""};
129 
130  ToolHandle<Muon::INSWCalibTool> m_nswCalibTool{this, "NSWCalibTool", ""};
131 
132  ToolHandle<Muon::IMMClusterBuilderTool> m_clusterBuilderToolMM{this, "MMClusterBuilder", ""};
133 
135 
139  Gaudi::Property<double> m_muonPropSpeed{this, "PropagationSpeed", 1./ Gaudi::Units::c_light };
140 
142  Gaudi::Property<double> m_rpcSignalVelocity {this, "rpcSignalVelocity", 0.5 * Gaudi::Units::c_light,
143  "Propagation speed of the signal inside the rpc strip"};
144  /*** Resolution of the rpc time measurement */
145  Gaudi::Property<double> m_rpcTimeResolution{this, "rpcTimeResolution", 0.6 * Gaudi::Units::nanosecond,
146  "Estimated time resolution of the strip readout"};
147 
149  Gaudi::Property<bool> m_useRpcTime{this, "useRpcTime", false};
151  Gaudi::Property<bool> m_useTgcTime{this, "useTgcTime", false,
152  "Load the Tgc BC-ID on the track states for the fit"};
153  Gaudi::Property<bool> m_usesTgcTime{this, "usesTgcTime", false,
154  "Load the sTgc time on the track states for the fit"};
155  Gaudi::Property<bool> m_MdtSignFromSegment{this, "useSegmentSigns", true,
156  "Mdt drift signs are copied from the segment line instead from the track state"};
157  };
158 
159 }
160 #endif
MuonR4::SpacePointCalibrator::driftVelocity
double driftVelocity(const Acts::CalibrationContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
Definition: SpacePointCalibrator.cxx:307
MuonR4::SpacePointCalibrator::stampSignsOnMeasurements
void stampSignsOnMeasurements(const xAOD::MuonSegment &segment) const override final
Definition: SpacePointCalibrator.cxx:611
xAOD::sTgcStripCluster_v1
Definition: sTgcStripCluster_v1.h:13
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
IMdtCalibrationTool.h
MuonR4::SpacePointCalibrator::m_MdtSignFromSegment
Gaudi::Property< bool > m_MdtSignFromSegment
Definition: SpacePointCalibrator.h:155
INSWCalibTool.h
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::SpacePointCalibrator::m_geoCtxKey
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
access to the ACTS geometry context
Definition: SpacePointCalibrator.h:124
SpacePoint.h
ISpacePointCalibrator.h
CombinedMuonStripFwd.h
python.SystemOfUnits.nanosecond
float nanosecond
Definition: SystemOfUnits.py:134
SG::ReadHandleKey< ActsTrk::GeometryContext >
sTgcStripClusterFwd.h
MuonR4::SpacePointCalibrator::m_muonPropSpeed
Gaudi::Property< double > m_muonPropSpeed
Assumed propagation velocity of the muon through the detector.
Definition: SpacePointCalibrator.h:139
MuonR4::CalibSpacePointVec
ISpacePointCalibrator::CalibSpacePointVec CalibSpacePointVec
Definition: SpacePointCalibrator.cxx:40
MuonR4::SpacePointCalibrator::m_rpcSignalVelocity
Gaudi::Property< double > m_rpcSignalVelocity
How fast does an electron signal travel along an rpc strip
Definition: SpacePointCalibrator.h:142
MuonR4::SpacePointCalibrator::calibratesTGC
std::pair< double, double > calibratesTGC(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::sTgcStripCluster &cluster, std::optional< double > posAlongTheStrip, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of an sTGC (small-strip Thin Gap Chamber) cluster.
Definition: SpacePointCalibrator.cxx:355
MuonR4::SpacePointCalibrator::m_useRpcTime
Gaudi::Property< bool > m_useRpcTime
Load the Rpc time on the track states for the track fit.
Definition: SpacePointCalibrator.h:149
MuonR4::SpacePointCalibrator::m_useTgcTime
Gaudi::Property< bool > m_useTgcTime
Load the Tgc bunch crossing ID on the track states.
Definition: SpacePointCalibrator.h:151
MuonR4::SpacePointCalibrator::calibrateMM
std::pair< double, double > calibrateMM(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::MMCluster &cluster, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of a MicroMegas (MM) cluster.
Definition: SpacePointCalibrator.cxx:327
CalibratedSpacePoint.h
GeometryContext.h
MuonR4::SpacePointCalibrator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: SpacePointCalibrator.h:126
MuonR4::SpacePointCalibrator::m_nswCalibTool
ToolHandle< Muon::INSWCalibTool > m_nswCalibTool
Definition: SpacePointCalibrator.h:130
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
MuonDetectorManager.h
MuonR4::SpacePointCalibrator::calibrateSourceLink
void calibrateSourceLink(const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, ActsTrk::MutableTrackContainer::TrackStateProxy state) const override final
Definition: SpacePointCalibrator.cxx:419
MeasurementCalibratorBase.h
MuonR4::SpacePointCalibrator::updateSigns
void updateSigns(const Amg::Vector3D &trackPos, const Amg::Vector3D &trackDir, CalibSpacePointVec &hitsToCalib) const override final
Definition: SpacePointCalibrator.cxx:54
MuonR4::SpacePointCalibrator::m_clusterBuilderToolMM
ToolHandle< Muon::IMMClusterBuilderTool > m_clusterBuilderToolMM
Definition: SpacePointCalibrator.h:132
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
ActsTrk::detail::MeasurementCalibratorBase
Base class providing the boiler code to fill the Acts multi trajectory track states.
Definition: MeasurementCalibratorBase.h:24
F600IntegrationConfig.spacePoints
spacePoints
Definition: F600IntegrationConfig.py:122
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:24
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
MuonR4::SpacePointCalibrator::m_usesTgcTime
Gaudi::Property< bool > m_usesTgcTime
Definition: SpacePointCalibrator.h:153
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4::SpacePointCalibrator::driftAcceleration
double driftAcceleration(const Acts::CalibrationContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
Definition: SpacePointCalibrator.cxx:317
MuonR4::SpacePointCalibrator::m_mdtCalibrationTool
ToolHandle< IMdtCalibrationTool > m_mdtCalibrationTool
Definition: SpacePointCalibrator.h:128
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::SpacePointCalibrator
Definition: SpacePointCalibrator.h:31
MuonR4::SpacePointCalibrator::calibrate
CalibSpacePointPtr calibrate(const EventContext &ctx, const SpacePoint *spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
Definition: SpacePointCalibrator.cxx:96
MuonR4::CalibSpacePointPtr
ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
Definition: SpacePointCalibrator.cxx:41
xAOD::CombinedMuonStrip_v1
The Acts fitters running on the Uncalibrated measurements are uncapable of producing two track states...
Definition: CombinedMuonStrip_v1.h:19
MuonR4::SpacePointCalibrator::m_rpcTimeResolution
Gaudi::Property< double > m_rpcTimeResolution
Definition: SpacePointCalibrator.h:145
MuonR4::CalibratedSpacePoint
The calibrated Space point is created during the calibration process.
Definition: CalibratedSpacePoint.h:14
MuonR4::SpacePointCalibrator::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: SpacePointCalibrator.h:134
IMMClusterBuilderTool.h
MuonR4::SpacePointCalibrator::calibrateCombinedPrd
void calibrateCombinedPrd(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::CombinedMuonStrip *combinedPrd, ActsTrk::MutableTrackContainer::TrackStateProxy state) const
Calibrates the track states from a combined muon strip.
Definition: SpacePointCalibrator.cxx:372
IMuonIdHelperSvc.h
MuonR4::SpacePointCalibrator::initialize
StatusCode initialize() override final
Definition: SpacePointCalibrator.cxx:45
ServiceHandle< Muon::IMuonIdHelperSvc >