4#ifndef MEASUREMENTCALIBRATOR2_H
5#define MEASUREMENTCALIBRATOR2_H
7#include "Acts/EventData/Types.hpp"
16#include "Acts/EventData/MultiTrajectory.hpp"
17#include "Acts/EventData/BoundTrackParameters.hpp"
18#include "Acts/Geometry/GeometryIdentifier.hpp"
19#include "Acts/Surfaces/Surface.hpp"
20#include "Acts/Surfaces/SurfaceBounds.hpp"
21#include "Acts/Definitions/TrackParametrization.hpp"
22#include "Acts/Utilities/AlgebraHelpers.hpp"
31#include "boost/container/static_vector.hpp"
43 unsigned char shift = (volume_id%2) ? 4 : 0;
44 unsigned char idx = volume_id/2;
49 unsigned char shift = (volume_id%2) ? 4 : 0;
50 unsigned char idx = volume_id/2;
55 std::vector<unsigned int> pixel_vol {16, 15, 9, 20, 19, 18, 10, 14, 13, 8};
56 for (
unsigned int vol_id : pixel_vol) {
59 std::vector<unsigned int> strip_vol {23, 22, 24};
60 for (
unsigned int vol_id : strip_vol) {
63 std::vector<unsigned int> hgtd_vol {2, 25};
64 for (
unsigned int vol_id : hgtd_vol) {
69 template <std::
size_t DIM>
70 Acts::SubspaceIndices<DIM>
parameterMap([[maybe_unused]]
const Acts::GeometryContext&,
71 [[maybe_unused]]
const Acts::CalibrationContext&,
72 const Acts::Surface &surface)
const {
74 if constexpr(DIM==3) {
78 else if constexpr(DIM==2) {
82 else if constexpr(DIM==1) {
84 auto boundType = surface.bounds().type();
85 const std::size_t projector_idx = boundType == Acts::SurfaceBounds::eAnnulus;
89 throw std::runtime_error(
"Unsupported dimension");
99 Acts::eBoundLoc0, Acts::eBoundLoc1
102 Acts::eBoundLoc0, Acts::eBoundLoc1, Acts::eBoundTime
112 std::pair<PixelPos, PixelCov>(
const Acts::GeometryContext&,
113 const Acts::CalibrationContext&,
114 const Acts::Surface&,
116 const Acts::BoundTrackParameters &)>;
121 std::pair<StripPos, StripCov>(
const Acts::GeometryContext&,
122 const Acts::CalibrationContext&,
123 const Acts::Surface&,
125 const Acts::BoundTrackParameters &)>;
129 std::pair<hgtdPos, hgtdCov>(
const Acts::GeometryContext&,
130 const Acts::CalibrationContext&,
131 const Acts::Surface&,
133 const Acts::BoundTrackParameters &)>;
141 boost::container::static_vector<std::unique_ptr<ClusterCalibratorBase >, 3>
m_calibrators;
143 template <
typename T_CalibratorTool,
typename T_Delegate>
145 const T_CalibratorTool *calibrator_tool,
146 T_Delegate &pre_calibrator,
147 T_Delegate &post_calibrator) {
148 bool calibrate_after_measurement_selection=
true;
149 if (calibrator_tool) {
150 calibrate_after_measurement_selection = calibrator_tool->calibrateAfterMeasurementSelection();
151 auto calibrator = calibrator_tool->create(ctx);
152 calibrator->connectCalibrator( calibrate_after_measurement_selection ?
153 post_calibrator : pre_calibrator );
156 if (calibrate_after_measurement_selection) {
157 using CalibratorBase_t =
typename decltype( calibrator_tool->create(ctx) )::element_type;
159 typename CalibratorBase_t::ClusterType>>(
this);
182 template <std::
size_t Dim,
typename Cluster>
185 [[maybe_unused]]
const Acts::CalibrationContext& cctx,
186 [[maybe_unused]]
const Acts::Surface& surface,
187 const Cluster &cluster,
188 const Acts::BoundTrackParameters &)
const
190 auto ret = std::make_pair<xAOD::MeasVector<Dim>,
xAOD::MeasMatrix<Dim>>(cluster.template localPosition<Dim>(),
191 cluster.template localCovariance<Dim>());
192 if constexpr(std::is_same_v<xAOD::HGTDCluster, std::remove_cvref_t<Cluster> >) {
194 assert(ret.second(2,1)==0. && ret.second(2,0)==0.);
Wrapper to avoid constant divisions when using units.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr auto timeCovToActs(T athenaTCov)
Converts a time covariance element from Athena to Acts units.
constexpr auto timeToActs(T athenaT)
Converts a time unit from Athena to Acts units.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
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.
UncalibMeasType
Define the type of the uncalibrated measurement.
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.
const StripCalibrator & stripPostCalibrator() const
xAOD::MeasVector< 3 > hgtdPos
Acts::Delegate< std::pair< StripPos, StripCov >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const xAOD::StripCluster &, const Acts::BoundTrackParameters &)> StripCalibrator
xAOD::MeasMatrix< 1 > StripCov
std::pair< xAOD::MeasVector< Dim >, xAOD::MeasMatrix< Dim > > passthrough(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::Surface &surface, const Cluster &cluster, const Acts::BoundTrackParameters &) const
HGTDCalibrator hgtd_preCalibrator
void connect(const EventContext &ctx, const T_CalibratorTool *calibrator_tool, T_Delegate &pre_calibrator, T_Delegate &post_calibrator)
const PixelCalibrator & pixelPreCalibrator() const
const StripCalibrator & stripPreCalibrator() const
Acts::Delegate< std::pair< hgtdPos, hgtdCov >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const xAOD::HGTDCluster &, const Acts::BoundTrackParameters &)> HGTDCalibrator
const PixelCalibrator & pixelPostCalibrator() const
Acts::Delegate< std::pair< PixelPos, PixelCov >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &, const xAOD::PixelCluster &, const Acts::BoundTrackParameters &)> PixelCalibrator
const HGTDCalibrator & hgtdPreCalibrator() const
PixelCalibrator pixel_preCalibrator
xAOD::MeasMatrix< 3 > hgtdCov
StripCalibrator strip_preCalibrator
MeasurementCalibrator(const EventContext &ctx, const IPixelOnBoundStateCalibratorTool *pixelCalibratorTool, const IStripOnBoundStateCalibratorTool *stripCalibratorTool, const IHGTDOnBoundStateCalibratorTool *hgtdCalibratorTool)
xAOD::MeasMatrix< 2 > PixelCov
xAOD::MeasVector< 2 > PixelPos
xAOD::MeasVector< 1 > StripPos
StripCalibrator strip_postCalibrator
const HGTDCalibrator & hgtdPostCalibrator() const
boost::container::static_vector< std::unique_ptr< ClusterCalibratorBase >, 3 > m_calibrators
PixelCalibrator pixel_postCalibrator
HGTDCalibrator hgtd_postCalibrator
void setMeasurementTypeForVolumeId(unsigned int volume_id, xAOD::UncalibMeasType type)
static constexpr Acts::SubspaceIndices< 2 > s_pixelSubspaceIndices
static constexpr std::array< Acts::SubspaceIndices< 1 >, 2 > s_stripSubspaceIndices
Acts::SubspaceIndices< DIM > parameterMap(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &surface) const
std::array< unsigned char, 128 > m_volumeIdToMeasurementType
static constexpr Acts::SubspaceIndices< 3 > s_hgtdSubspaceIndices
xAOD::UncalibMeasType measurementTypeFromVolumeId(unsigned int volume_id) const
MeasurementParameterMap()