ATLAS Offline Software
Loading...
Searching...
No Matches
xAODUncalibMeasCalibrator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
6#include "GeoModelKernel/throwExcept.h"
7
8namespace ActsTrk::detail{
10 return Acts::SourceLink{meas};
11 }
13 SourceLink_t meas = sl.template get<SourceLink_t>();
14 assert(meas != nullptr);
15 return meas;
16 }
24
25 void xAODUncalibMeasCalibrator::invalidCalibrator(const Acts::GeometryContext& /*gctx*/,
26 const Acts::CalibrationContext& /*cctx*/,
27 const Acts::SourceLink& sl,
28 MutableTrackStateBackend::TrackStateProxy /*trackState*/) const {
29 THROW_EXCEPTION("Calibrator is not configured for measurement type "<<static_cast<int>(unpack(sl)->type()));
30 }
31
32 void xAODUncalibMeasCalibrator::auxillaryCalibrator(const Acts::GeometryContext& /*gctx*/,
33 const Acts::CalibrationContext& /*cctx*/,
34 const Acts::SourceLink& sl,
35 MutableTrackStateBackend::TrackStateProxy trackState) const {
36 const xAOD::UncalibratedMeasurement* meas = unpack(sl);
37 assert(meas->type() == xAOD::UncalibMeasType::Other);
38
39 const auto* pMeas = dynamic_cast<const xAOD::AuxiliaryMeasurement*>(meas);
40 switch(pMeas->numDimensions()) {
41 case 1:
42 setState<1, MutableTrackStateBackend>(pMeas->calibProjector(), pMeas->localPosition<1>(),
43 pMeas->localCovariance<1>(), sl, trackState);
44 break;
45 case 2:
46 setState<2, MutableTrackStateBackend>(pMeas->calibProjector(), pMeas->localPosition<2>(),
47 pMeas->localCovariance<2>(), sl, trackState);
48 break;
49 case 3:
50 setState<3, MutableTrackStateBackend>(pMeas->calibProjector(), pMeas->localPosition<3>(),
51 pMeas->localCovariance<3>(), sl, trackState);
52 break;
53 default:
54 break;
55 }
56
57 }
58 void xAODUncalibMeasCalibrator::calibrate(const Acts::GeometryContext &gctx,
59 const Acts::CalibrationContext & cctx,
60 const Acts::SourceLink& sl,
61 const MutableTrackStateBackend::TrackStateProxy trackState) const {
62 const xAOD::UncalibratedMeasurement* meas = unpack(sl);
63 assert(meas->type() != xAOD::UncalibMeasType::nTypes);
64
65 const CalibDelegate& delegate = m_calibrators[static_cast<int>(meas->type())];
66 delegate(gctx, cctx, sl, trackState);
67 }
68
69}
void setState(const ProjectorType projector, const pos_t &locpos, const cov_t &cov, Acts::SourceLink link, TrackState_t< trajectory_t > &trackState) const
Copy the local position & covariance into the Acts track state proxy.
std::array< CalibDelegate, s_nMeasTypes > m_calibrators
Dispatch table of the calibrators per measurement type.
Acts::Experimental::Gx2FitterExtensions< MutableTrackStateBackend >::Calibrator CalibDelegate
Abrivation for the calibrator delegate.
void auxillaryCalibrator(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, MutableTrackStateBackend::TrackStateProxy trackState) const
Delegate method for the Auxiliary measurements.
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, const MutableTrackStateBackend::TrackStateProxy trackState) const
: Interface method for the Acts fitter to calibrate the trajectory track states from the source link ...
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
void connect(const xAOD::UncalibMeasType type, const Type *instance)
Register a calibrator implementation instance for a given measurement type.
const xAOD::UncalibratedMeasurement * SourceLink_t
Underlying source link type of the uncalibrated measurement.
void invalidCalibrator(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, MutableTrackStateBackend::TrackStateProxy trackState) const
Delegate method that's assigned during the construction phase of this class.
static Acts::SourceLink pack(const xAOD::UncalibratedMeasurement *meas)
Helper method to pack an uncalibrated measurement to an Acts source link.
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
Athena definition of the Eigen plugin.
AuxiliaryMeasurement_v1 AuxiliaryMeasurement
UncalibMeasType
Define the type of the uncalibrated measurement.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10