ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusterCalibrationToolBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRACKRECONSTRUCTION_PIXELCLUSTERCALIBRATIONTOOLBASE_H
6#define ACTSTRACKRECONSTRUCTION_PIXELCLUSTERCALIBRATIONTOOLBASE_H
7
14
16
17namespace ActsTrk::detail {
23
28 template <typename traj_t>
30 {
31 public:
33 : m_baseOptions(std::move(base_options))
34 {
35 assert(m_baseOptions.m_pixelID);
36 assert(m_baseOptions.m_lorentzAngleTool);
37 }
38
39 protected:
40 using Pos = xAOD::MeasVector<2>; // the coordinates of a pixel cluster
41 using Cov = xAOD::MeasMatrix<2>; // the corresponding covariance
42
45 const InDetDD::SiDetectorElement& getDetectorElement(const Acts::Surface &surface) const;
46
48 const PixelID &pixelID() const { return *m_baseOptions.m_pixelID; }
49
51 double getLorentzShift(const IdentifierHash& elementHash, const EventContext& ctx) const {
52 return m_baseOptions.m_lorentzAngleTool->getLorentzShift(elementHash, ctx);
53 }
54
64 std::pair<typename PixelClusterCalibratorCommon<traj_t>::Pos,
66 calibrate([[maybe_unused]] const EventContext &ctx,
67 [[maybe_unused]] const Acts::GeometryContext& gctx,
68 [[maybe_unused]] const Acts::CalibrationContext& cctx,
69 const xAOD::PixelCluster& cluster,
70 [[maybe_unused]] const InDetDD::SiDetectorElement& detElement,
71 [[maybe_unused]] const std::pair<float, float>& tan_incident_angles) const {
72 return std::make_pair(cluster.template localPosition<2>(),
73 cluster.template localCovariance<2>());
74 }
75
77 std::pair<float, float>
78 tanAnglesOfIncidence(const EventContext& ctx,
79 const Acts::GeometryContext& gctx,
80 const Acts::Surface &surface,
81 const InDetDD::SiDetectorElement& element,
82 const Acts::Vector3& direction) const;
83
84 protected:
85 PixelClusterCalibratorOptionsBase m_baseOptions; // the common options of a pixel calibrator
86 };
87
88 template <typename derived_t, typename traj_t>
90 {
91 public:
93 using BASE::BASE;
97 using Pos = BASE::Pos;
98 using Cov = BASE::Cov;
99
100 const derived_t &derived() const
101 requires(std::is_base_of_v<std::remove_cvref_t<decltype( *this )>, derived_t >)
102 {
103 return *static_cast<const derived_t *>(this);
104 }
105
106 std::pair<Pos, Cov> calibrate(const Acts::GeometryContext&,
107 const Acts::CalibrationContext&,
108 const xAOD::PixelCluster&,
109 const TrackStateProxy&) const;
110
111 std::pair<Pos, Cov> calibrate(const Acts::GeometryContext&,
112 const Acts::CalibrationContext&,
113 const Acts::Surface&,
114 const xAOD::PixelCluster&,
115 const Acts::BoundTrackParameters&) const;
116
118 virtual void connectOnTrackCalibrator(OnTrackCalibrator& calibrator) const override;
119
121 virtual void connectCalibrator(Calibrator& calibrator) const override;
122
123 };
124
132 template <typename traj_t>
134 : public extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>> {
135 public:
136 using base_class = typename extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>>::base_class;
137 using base_class::base_class;
138
140 virtual StatusCode initialize() override;
141
143 virtual std::unique_ptr<PixelOnBoundStateCalibratorBase > create(const EventContext &ctx) const override {
144 return this->createOnTrackCalibrator(ctx);
145 }
146
148 virtual bool calibrateAfterMeasurementSelection() const override;
149
150 protected:
152 PixelClusterCalibratorOptionsBase createBaseOptions(const EventContext &/*ctx*/) const {
154 .m_lorentzAngleTool=&(*m_lorentzAngleTool),
155 .m_pixelID=m_pixelID,
156 };
157 }
158
159 // @TODO should use the Lorentz angle conditions data directly
160 ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "PixelLorentzAngleTool", "",
161 "Tool to retreive Lorentz angle"
162 };
163
164 Gaudi::Property<bool> m_postCalibration{this, "CalibrateAfterMeasurementSelection", true};
165
166 const PixelID *m_pixelID{}; // The helper object to interpret identifiers
167 };
168
169} // namespace ActsTrk::detail
170
172
173#endif
This is an Identifier helper class for the Pixel subdetector.
Acts::Delegate< std::pair< Pos, Cov >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const cluster_t &, const Acts::BoundTrackParameters &)> Calibrator
Acts::Delegate< std::pair< Pos, Cov >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const cluster_t &, const TrackStateProxy &)> OnTrackCalibrator
typename Acts::MultiTrajectory< traj_t >::TrackStateProxy TrackStateProxy
OnBoundStateCalibratorBase< xAOD::PixelCluster, DIM > BASE
base class of a Pixel cluster calibration tool In addition to some common functionality provied by Pi...
typename extends< AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool< traj_t > >::base_class base_class
virtual bool calibrateAfterMeasurementSelection() const override
test whether the calibration should be applied after measurement selection (faster)
virtual StatusCode initialize() override
initializes this base class (must be called by the derived class)
virtual std::unique_ptr< PixelOnBoundStateCalibratorBase > create(const EventContext &ctx) const override
convenience class to create an OnBoundState calibrator from an OnTrack calibrator.
PixelClusterCalibratorOptionsBase createBaseOptions(const EventContext &) const
create options needed by the calibrator base class.
std::pair< Pos, Cov > calibrate(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const xAOD::PixelCluster &, const Acts::BoundTrackParameters &) const
virtual void connectCalibrator(Calibrator &calibrator) const override
connect the calibrator (derived class) to the given OnBoundState calaibrator delegate
std::pair< Pos, Cov > calibrate(const Acts::GeometryContext &, const Acts::CalibrationContext &, const xAOD::PixelCluster &, const TrackStateProxy &) const
virtual void connectOnTrackCalibrator(OnTrackCalibrator &calibrator) const override
connect the calibrator (derived class) to the given OnTrack calaibrator delegate
PixelClusterCalibratorCommon(PixelClusterCalibratorOptionsBase &&base_options)
double getLorentzShift(const IdentifierHash &elementHash, const EventContext &ctx) const
@breif get the lorentz shift for the given module.
const InDetDD::SiDetectorElement & getDetectorElement(const Acts::Surface &surface) const
convenience method to get the detector element for a module
const PixelID & pixelID() const
get the Pixel ID helper.
std::pair< typename PixelClusterCalibratorCommon< traj_t >::Pos, typename PixelClusterCalibratorCommon< traj_t >::Cov > calibrate(const EventContext &ctx, const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const xAOD::PixelCluster &cluster, const InDetDD::SiDetectorElement &detElement, const std::pair< float, float > &tan_incident_angles) const
single calibrate method serving OnTrack and OnBoundState cluster calibration
std::pair< float, float > tanAnglesOfIncidence(const EventContext &ctx, const Acts::GeometryContext &gctx, const Acts::Surface &surface, const InDetDD::SiDetectorElement &element, const Acts::Vector3 &direction) const
compute tan of Lorentz angle corrected incidence angles in local-x and local-y direction.
Interface class for tool providing Lorentz angle (and the corresponding shift of the measurement) for...
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
Athena definition of the Eigen plugin.
OnTrackCalibratorBase< xAOD::PixelCluster, 2, traj_t > PixelOnTrackCalibratorBase
STL namespace.
Eigen::Matrix< float, N, N > MeasMatrix
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
the base options the options of the options of every PixelClusterCalibrator must be based on