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
66 std::pair<typename PixelClusterCalibratorCommon<traj_t>::Pos,
68 calibrate([[maybe_unused]] const EventContext &ctx,
69 [[maybe_unused]] const Acts::GeometryContext& gctx,
70 [[maybe_unused]] const Acts::CalibrationContext& cctx,
71 const xAOD::PixelCluster& cluster,
72 [[maybe_unused]] const InDetDD::SiDetectorElement& detElement,
73 [[maybe_unused]] const std::pair<float, float>& tan_incident_angles) const {
74 return std::make_pair(cluster.template localPosition<2>(),
75 cluster.template localCovariance<2>());
76 }
77
79 std::pair<float, float>
80 tanAnglesOfIncidence(const EventContext& ctx,
81 const Acts::GeometryContext& gctx,
82 const Acts::Surface &surface,
83 const InDetDD::SiDetectorElement& element,
84 const Acts::Vector3& direction) const;
85
86 protected:
87 PixelClusterCalibratorOptionsBase m_baseOptions; // the common options of a pixel calibrator
88 };
89
90 template <typename derived_t, typename traj_t>
92 {
93 public:
95 using BASE::BASE;
99 using Pos = BASE::Pos;
100 using Cov = BASE::Cov;
101
102 const derived_t &derived() const
103 requires(std::is_base_of_v<std::remove_cvref_t<decltype( *this )>, derived_t >)
104 {
105 return *static_cast<const derived_t *>(this);
106 }
107
108 void calibrate(const Acts::GeometryContext&,
109 const Acts::CalibrationContext&,
110 const xAOD::PixelCluster&,
111 TrackStateProxy&) const;
112
113 std::tuple<Pos, Cov, unsigned int> calibrate(const Acts::GeometryContext&,
114 const Acts::CalibrationContext&,
115 const Acts::Surface&,
116 const xAOD::PixelCluster&,
117 const Acts::BoundTrackParameters&) const;
118
120 virtual void connectOnTrackCalibrator(OnTrackCalibrator& calibrator) const override;
121
123 virtual void connectCalibrator(Calibrator& calibrator) const override;
124 };
125
133 template <typename traj_t>
135 : public extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>> {
136 public:
137 using base_class = typename extends<AthAlgTool, ActsTrk::IPixelOnTrackCalibratorTool<traj_t>>::base_class;
138 using base_class::base_class;
139
141 virtual StatusCode initialize() override;
142
144 virtual std::unique_ptr<PixelOnBoundStateCalibratorBase > create(const EventContext &ctx) const override {
145 return this->createOnTrackCalibrator(ctx);
146 }
147
149 virtual bool calibrateAfterMeasurementSelection() const override;
150
151 protected:
153 PixelClusterCalibratorOptionsBase createBaseOptions(const EventContext &/*ctx*/) const {
155 .m_lorentzAngleTool=&(*m_lorentzAngleTool),
156 .m_pixelID=m_pixelID,
157 };
158 }
159
160 // @TODO should use the Lorentz angle conditions data directly
161 ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "PixelLorentzAngleTool", "",
162 "Tool to retreive Lorentz angle"
163 };
164
165 Gaudi::Property<bool> m_postCalibration{this, "CalibrateAfterMeasurementSelection", true};
166
167 const PixelID *m_pixelID{}; // The helper object to interpret identifiers
168 };
169
170} // namespace ActsTrk::detail
171
173
174#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
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