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
17#include "Acts/EventData/TrackStateType.hpp"
18
19namespace ActsTrk::detail {
25
30 template <typename traj_t>
32 {
33 public:
35 : m_baseOptions(std::move(base_options))
36 {
37 assert(m_baseOptions.m_pixelID);
38 assert(m_baseOptions.m_lorentzAngleTool);
39 }
40
41 protected:
42 using Pos = xAOD::MeasVector<2>; // the coordinates of a pixel cluster
43 using Cov = xAOD::MeasMatrix<2>; // the corresponding covariance
44
47 const InDetDD::SiDetectorElement& getDetectorElement(const Acts::Surface &surface) const;
48
50 const PixelID &pixelID() const { return *m_baseOptions.m_pixelID; }
51
53 double getLorentzShift(const IdentifierHash& elementHash, const EventContext& ctx) const {
54 return m_baseOptions.m_lorentzAngleTool->getLorentzShift(elementHash, ctx);
55 }
56
68 std::pair<typename PixelClusterCalibratorCommon<traj_t>::Pos,
70 calibrate([[maybe_unused]] const EventContext &ctx,
71 [[maybe_unused]] const Acts::GeometryContext& gctx,
72 [[maybe_unused]] const Acts::CalibrationContext& cctx,
73 const xAOD::PixelCluster& cluster,
74 [[maybe_unused]] const InDetDD::SiDetectorElement& detElement,
75 [[maybe_unused]] const std::pair<float, float>& tan_incident_angles,
76 [[maybe_unused]] const Acts::Vector2& predicted_local_position) const {
77 return std::make_pair(cluster.template localPosition<2>(),
78 cluster.template localCovariance<2>());
79 }
80
82 std::pair<float, float>
83 tanAnglesOfIncidence(const EventContext& ctx,
84 const Acts::GeometryContext& gctx,
85 const Acts::Surface &surface,
86 const InDetDD::SiDetectorElement& element,
87 const Acts::Vector3& direction) const;
88
89 protected:
90 PixelClusterCalibratorOptionsBase m_baseOptions; // the common options of a pixel calibrator
91 };
92
93 template <typename derived_t, typename traj_t>
95 {
96 public:
98 using BASE::BASE;
102 using Pos = BASE::Pos;
103 using Cov = BASE::Cov;
104
105 const derived_t &derived() const
106 requires(std::is_base_of_v<std::remove_cvref_t<decltype( *this )>, derived_t >)
107 {
108 return *static_cast<const derived_t *>(this);
109 }
110
111 void calibrate(const Acts::GeometryContext&,
112 const Acts::CalibrationContext&,
113 const xAOD::PixelCluster&,
114 TrackStateProxy&) const;
115
116 std::tuple<Pos, Cov, unsigned int> calibrate(const Acts::GeometryContext&,
117 const Acts::CalibrationContext&,
118 const Acts::Surface&,
119 const xAOD::PixelCluster&,
120 const Acts::BoundTrackParameters&) const;
121
123 virtual void connectOnTrackCalibrator(OnTrackCalibrator& calibrator) const override;
124
126 virtual void connectCalibrator(Calibrator& calibrator) const override;
127 };
128
136 template <typename traj_t>
138 : public extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>> {
139 public:
140 using base_class = typename extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>>::base_class;
141 using base_class::base_class;
142
144 virtual StatusCode initialize() override;
145
147 virtual std::unique_ptr<PixelOnBoundStateCalibratorBase > create(const EventContext &ctx) const override {
148 return this->createOnTrackCalibrator(ctx);
149 }
150
152 virtual bool calibrateAfterMeasurementSelection() const override;
153
154 protected:
156 PixelClusterCalibratorOptionsBase createBaseOptions(const EventContext &/*ctx*/) const {
158 .m_lorentzAngleTool=&(*m_lorentzAngleTool),
159 .m_pixelID=m_pixelID,
160 };
161 }
162
163 // @TODO should use the Lorentz angle conditions data directly
164 ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "PixelLorentzAngleTool", "",
165 "Tool to retreive Lorentz angle"
166 };
167
168 Gaudi::Property<bool> m_postCalibration{this, "CalibrateAfterMeasurementSelection", true};
169
170 const PixelID *m_pixelID{}; // The helper object to interpret identifiers
171 };
172
173} // namespace ActsTrk::detail
174
176
177#endif
This is an Identifier helper class for the Pixel subdetector.
Acts::Delegate< std::tuple< Pos, Cov, unsigned int >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const cluster_t &, const Acts::BoundTrackParameters &)> Calibrator
typename Acts::MultiTrajectory< traj_t >::TrackStateProxy TrackStateProxy
Acts::Delegate< void(const Acts::GeometryContext &, const Acts::CalibrationContext &, const cluster_t &, TrackStateProxy &)> OnTrackCalibrator
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.
void calibrate(const Acts::GeometryContext &, const Acts::CalibrationContext &, const xAOD::PixelCluster &, TrackStateProxy &) const
virtual void connectCalibrator(Calibrator &calibrator) const override
connect the calibrator (derived class) to the given OnBoundState calaibrator delegate
std::tuple< Pos, Cov, unsigned int > calibrate(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const xAOD::PixelCluster &, const Acts::BoundTrackParameters &) 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 Acts::Vector2 &predicted_local_position) 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
Hash functions to pack the source link into unordered_maps / unordered_sets.
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