ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::detail::xAODUncalibMeasCalibrator Class Reference

Source link calibrator implementation for xAOD::Uncalibrated measurements. More...

#include <xAODUncalibMeasCalibrator.h>

Inheritance diagram for ActsTrk::detail::xAODUncalibMeasCalibrator:
Collaboration diagram for ActsTrk::detail::xAODUncalibMeasCalibrator:

Public Types

enum class  ProjectorType {
  e1DimNoTime = 0 , e1DimRotNoTime = 1 , e2DimNoTime = 2 , e1DimWithTime = 3 ,
  e1DimRotWithTime = 4 , e2DimWithTime = 5
}
 Enum encoding the possible projectors used in ATLAS. More...
using SourceLink_t
 Encode the source links supported by the Calibrator class as a variant of the measurement class type pointer used within Athena.

Public Member Functions

 xAODUncalibMeasCalibrator ()
 Empty default constructor.
template<auto Callable, typename Type>
void connect (const xAOD::UncalibMeasType type, const Type *instance)
 Register a calibrator implementation instance for a given measurement type.
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 The source link is unpacked to access the measurement type and then to forward the calibration to the registered calibrator.
template<std::size_t Dim, Acts::TrackStateProxyConcept proxy_t, typename pos_t, typename cov_t>
void setState (const ProjectorType projector, const pos_t &locpos, const cov_t &cov, Acts::SourceLink link, proxy_t &trackState) const
 Copy the local position & covariance into the Acts track state proxy.

Static Public Member Functions

static const xAOD::UncalibratedMeasurementunpack (const Acts::SourceLink &sl)
 Helper method to unpack an Acts source link to an uncalibrated measurement.
static SourceLinkType getType (const Acts::SourceLink &sl)
 Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.
static SourceLink_t unpackBase (const Acts::SourceLink &sl)
 Unpack the SourceLink_t from the passed Acts source link.
template<Acts::PointerConcept Ptr_t>
static Acts::SourceLink pack (const Ptr_t &measurement)
 Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a SourceLink_t.
template<Acts::PointerConcept Ptr_t>
static void pack (const std::vector< Ptr_t > &measList, std::vector< Acts::SourceLink > &targetSL)
 Converts a vector measurement pointers to Acts::SourceLinks.

Protected Member Functions

template<std::size_t Dim, Acts::TrackStateProxyConcept proxy_t>
void prepareCalibratedState (const ProjectorType projector, Acts::SourceLink link, proxy_t &trackState) const
 Queries the track proxy to allocate memory for the incoming calibration object.

Private Types

using CalibDelegate = Acts::Experimental::Gx2FitterExtensions<MutableTrackStateBackend>::Calibrator
 Abrivation for the calibrator delegate.

Private Member Functions

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.
void auxillaryCalibrator (const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, MutableTrackStateBackend::TrackStateProxy trackState) const
 Delegate method for the Auxiliary measurements.

Private Attributes

std::array< CalibDelegate, s_nMeasTypesm_calibrators {}
 Dispatch table of the calibrators per measurement type.

Static Private Attributes

static constexpr std::size_t s_nMeasTypes = Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)
static constexpr std::array< Acts::BoundSubspaceIndices, 6 > s_boundSpaceIndices
 Array to map the Projector types to the bound index configurations used by the ATLAS detector measurements.

Detailed Description

Source link calibrator implementation for xAOD::Uncalibrated measurements.

The class provides the methods to pack & unpack Acts::SourceLinks from Uncalibrated measurements and also the calibrate method which will be connected to the Acts::Fitter's calibrator delegator. However, this method is nothing else than a forward dispatch table, which is calling other instances of calibrators doing the actual work. For each measurement type to calibrate, the actual calibrator needs to be connected with this class instance

Definition at line 20 of file xAODUncalibMeasCalibrator.h.

Member Typedef Documentation

◆ CalibDelegate

Abrivation for the calibrator delegate.

The signature of all delegates should be shared accross all fitters implemented in Acts

Definition at line 77 of file xAODUncalibMeasCalibrator.h.

◆ SourceLink_t

Initial value:
std::variant<std::monostate,
This class is the pure abstract base class for all fittable tracking measurements.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.

Encode the source links supported by the Calibrator class as a variant of the measurement class type pointer used within Athena.

The std::monostate is used to encode nullptrs or not yet supported types

Definition at line 53 of file MeasurementCalibratorBase.h.

Member Enumeration Documentation

◆ ProjectorType

Enum encoding the possible projectors used in ATLAS.

Their integer representations correspond to the element index in the s_boundSpaceIndices member

Enumerator
e1DimNoTime 
e1DimRotNoTime 

Project out solely the locX (Applies to Itk strips, Rpc, Tgc, sTgc, Mm).

e2DimNoTime 

Project out solely the locY - Complementary projector if the strip plane is rotated (Applies to Itk endcap strips, Rpc, Tgc, sTgc).

e1DimWithTime 

Project out the two spatial coordinates - (Applies to ITk pixel, BI-Rpc, sTgc pad).

e1DimRotWithTime 

Project out the locX & time coordinate - (Applies to Rpc, Tgc, Mm, sTgc).

e2DimWithTime 

Project out the locY & time coordinate - (Applies to Rpc, Tgc, sTgc).

Definition at line 41 of file MeasurementCalibratorBase.h.

41 {
42 e1DimNoTime = 0,
43 e1DimRotNoTime = 1,
45 e2DimNoTime = 2,
46 e1DimWithTime = 3,
47 e1DimRotWithTime = 4,
48 e2DimWithTime = 5,
49 };

Constructor & Destructor Documentation

◆ xAODUncalibMeasCalibrator()

ActsTrk::detail::xAODUncalibMeasCalibrator::xAODUncalibMeasCalibrator ( )

Empty default constructor.

Definition at line 14 of file xAODUncalibMeasCalibrator.cxx.

14 {
15 for (std::size_t t =0 ; t < m_calibrators.size(); ++t) {
16 const auto mType = static_cast<xAOD::UncalibMeasType>(t);
18 }
20 }
std::array< CalibDelegate, s_nMeasTypes > m_calibrators
Dispatch table of the calibrators per measurement type.
void connect(const xAOD::UncalibMeasType type, const Type *instance)
Register a calibrator implementation instance for a given measurement type.
UncalibMeasType
Define the type of the uncalibrated measurement.

Member Function Documentation

◆ auxillaryCalibrator()

void ActsTrk::detail::xAODUncalibMeasCalibrator::auxillaryCalibrator ( const Acts::GeometryContext & gctx,
const Acts::CalibrationContext & cctx,
const Acts::SourceLink & sl,
MutableTrackStateBackend::TrackStateProxy trackState ) const
private

Delegate method for the Auxiliary measurements.

Parameters
gctxGeometry context passed to access the global alignment
cctxCalibration context which is a wrapped Gaudi::EventContext* to retrieve extra information from store gate
slReference to the source link having the calibrated measurement packed
trackStateProxy to the track state into which the calibrated measurement parameters are copied.

Definition at line 29 of file xAODUncalibMeasCalibrator.cxx.

32 {
33 const xAOD::UncalibratedMeasurement* meas = unpack(sl);
34 assert(meas->type() == xAOD::UncalibMeasType::Other);
35
36 const auto* pMeas = dynamic_cast<const xAOD::AuxiliaryMeasurement*>(meas);
37 switch(pMeas->numDimensions()) {
38 case 1:
39 setState<1>(pMeas->calibProjector(), pMeas->localPosition<1>(),
40 pMeas->localCovariance<1>(), sl, trackState);
41 break;
42 case 2:
43 setState<2>(pMeas->calibProjector(), pMeas->localPosition<2>(),
44 pMeas->localCovariance<2>(), sl, trackState);
45 break;
46 case 3:
47 setState<3>(pMeas->calibProjector(), pMeas->localPosition<3>(),
48 pMeas->localCovariance<3>(), sl, trackState);
49 break;
50 default:
51 break;
52 }
53
54 }
void setState(const ProjectorType projector, const pos_t &locpos, const cov_t &cov, Acts::SourceLink link, proxy_t &trackState) const
Copy the local position & covariance into the Acts track state proxy.
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
AuxiliaryMeasurement_v1 AuxiliaryMeasurement

◆ calibrate()

void ActsTrk::detail::xAODUncalibMeasCalibrator::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 The source link is unpacked to access the measurement type and then to forward the calibration to the registered calibrator.

If no calibrator has been connected, then the invalidCalib method is called which is throwing an exception.

Parameters
gctxGeometry context passed to access the global alignment
cctxCalibration context which is a wrapped Gaudi::EventContext* to retrieve extra information from store gate
slReference to the source link having the calibrated measurement packed
trackStateProxy to the track state into which the calibrated measurement parameters are copied.

Definition at line 55 of file xAODUncalibMeasCalibrator.cxx.

58 {
59 const xAOD::UncalibratedMeasurement* meas = unpack(sl);
60 assert(meas->type() != xAOD::UncalibMeasType::nTypes);
61
62 const CalibDelegate& delegate = m_calibrators[Acts::toUnderlying(meas->type())];
63 delegate(gctx, cctx, sl, trackState);
64 }
Acts::Experimental::Gx2FitterExtensions< MutableTrackStateBackend >::Calibrator CalibDelegate
Abrivation for the calibrator delegate.

◆ connect()

template<auto Callable, typename Type>
void ActsTrk::detail::xAODUncalibMeasCalibrator::connect ( const xAOD::UncalibMeasType type,
const Type * instance )
inline

Register a calibrator implementation instance for a given measurement type.

The function signature must satisfy the requirements of a Calibration delegate defined by the Acts::Fitters

Parameters
typeMeasurment type for which this instance of the calibrator shall be called
instancePointer to the calibrator instance.

Definition at line 32 of file xAODUncalibMeasCalibrator.h.

32 {
33 assert(instance);
34 m_calibrators[static_cast<int>(type)].connect<Callable>(instance);
35 }
std::map< std::string, double > instance

◆ getType()

SourceLinkType ActsTrk::detail::MeasurementCalibratorBase::getType ( const Acts::SourceLink & sl)
staticinherited

Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.

The SourceLink must have been created by a MeasurementCalibrator to ensure that the underlying variant is cached. If the variant is a monostate, nTypes is returned

Parameters
slReference to the source link to unpack.

◆ invalidCalibrator()

void ActsTrk::detail::xAODUncalibMeasCalibrator::invalidCalibrator ( const Acts::GeometryContext & gctx,
const Acts::CalibrationContext & cctx,
const Acts::SourceLink & sl,
MutableTrackStateBackend::TrackStateProxy trackState ) const
private

Delegate method that's assigned during the construction phase of this class.

If called, the method throws an exception reminding the user that he needs to connect a calibrator with the requested measruement type.

Parameters
gctxGeometry context passed to access the global alignment
cctxCalibration context which is a wrapped Gaudi::EventContext* to retrieve extra information from store gate
slReference to the source link having the calibrated measurement packed
trackStateProxy to the track state into which the calibrated measurement parameters are copied.

Definition at line 22 of file xAODUncalibMeasCalibrator.cxx.

25 {
26 THROW_EXCEPTION("Calibrator is not configured for measurement type "<<unpack(sl)->type());
27 }
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ pack() [1/2]

template<Acts::PointerConcept Ptr_t>
Acts::SourceLink ActsTrk::detail::MeasurementCalibratorBase::pack ( const Ptr_t & measurement)
staticinherited

Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a SourceLink_t.

Nullptrs are converted to a std::monostate.

Parameters
measurementPointer to the measurement to transform into a SourceLInk

◆ pack() [2/2]

template<Acts::PointerConcept Ptr_t>
void ActsTrk::detail::MeasurementCalibratorBase::pack ( const std::vector< Ptr_t > & measList,
std::vector< Acts::SourceLink > & targetSL )
staticinherited

Converts a vector measurement pointers to Acts::SourceLinks.

Parameters
measListThe list of measurement pointers for conversion
targetSLThe allocated SourceLink vectors to which the Acts::SourceLink objects are appended.

◆ prepareCalibratedState()

template<std::size_t Dim, Acts::TrackStateProxyConcept proxy_t>
void ActsTrk::detail::MeasurementCalibratorBase::prepareCalibratedState ( const ProjectorType projector,
Acts::SourceLink link,
proxy_t & trackState ) const
protectedinherited

Queries the track proxy to allocate memory for the incoming calibration object.

Defines the projector indices and allocates the source link to the state

Parameters
projectorProjector configuration of the measurement
linkSource link to associate with the state
trackStateRefrence to the track state proxy to write.

◆ setState()

template<std::size_t Dim, Acts::TrackStateProxyConcept proxy_t, typename pos_t, typename cov_t>
void ActsTrk::detail::MeasurementCalibratorBase::setState ( const ProjectorType projector,
const pos_t & locpos,
const cov_t & cov,
Acts::SourceLink link,
proxy_t & trackState ) const
inherited

Copy the local position & covariance into the Acts track state proxy.

Template Parameters
DimDimension of the measurement
trajectory_tData type of the track state proxy backend
pos_tData type of the [Dim x 1] position vector
cov_tData type of the [Dim x Dim] covariance matrix
Parameters
projectorProjector configuration of the measurement
locposCalibrated local postion
covCalibrated local covariance
linkSource link to associate with the state
trackStateRefrence to the track state proxy to write.

◆ unpack()

const xAOD::UncalibratedMeasurement * ActsTrk::detail::xAODUncalibMeasCalibrator::unpack ( const Acts::SourceLink & sl)
static

Helper method to unpack an Acts source link to an uncalibrated measurement.

Parameters
slReference to the source link pointing to the uncalibrated measurement

Definition at line 9 of file xAODUncalibMeasCalibrator.cxx.

9 {
10 const SourceLink_t& meas = sl.template get<SourceLink_t>();
11 return std::holds_alternative<const xAOD::UncalibratedMeasurement*>(meas) ?
12 std::get<const xAOD::UncalibratedMeasurement*>(meas) : nullptr;
13 }
std::variant< std::monostate, const xAOD::UncalibratedMeasurement *, const Trk::PrepRawData *, const Trk::MeasurementBase * > SourceLink_t
Encode the source links supported by the Calibrator class as a variant of the measurement class type ...
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132

◆ unpackBase()

SourceLink_t ActsTrk::detail::MeasurementCalibratorBase::unpackBase ( const Acts::SourceLink & sl)
staticinherited

Unpack the SourceLink_t from the passed Acts source link.

Parameters
slReference to the source link to unpack.

Member Data Documentation

◆ m_calibrators

std::array<CalibDelegate, s_nMeasTypes> ActsTrk::detail::xAODUncalibMeasCalibrator::m_calibrators {}
private

Dispatch table of the calibrators per measurement type.

In the construction phase of this class all delegates are connected with the invalidCalibrator method.

Definition at line 81 of file xAODUncalibMeasCalibrator.h.

81{};

◆ s_boundSpaceIndices

std::array<Acts::BoundSubspaceIndices, 6> ActsTrk::detail::MeasurementCalibratorBase::s_boundSpaceIndices
staticconstexprprivateinherited
Initial value:
{
Acts::BoundSubspaceIndices{Acts::eBoundLoc0},
Acts::BoundSubspaceIndices{Acts::eBoundLoc1},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundTime},
Acts::BoundSubspaceIndices{Acts::eBoundLoc1, Acts::eBoundTime},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1, Acts::eBoundTime}
}

Array to map the Projector types to the bound index configurations used by the ATLAS detector measurements.

Definition at line 115 of file MeasurementCalibratorBase.h.

115 {
116 Acts::BoundSubspaceIndices{Acts::eBoundLoc0}, // One dimenion without time
117 Acts::BoundSubspaceIndices{Acts::eBoundLoc1}, // Complementary one dimension without time
118 Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1},
119 Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundTime}, // One dimension with time
120 Acts::BoundSubspaceIndices{Acts::eBoundLoc1, Acts::eBoundTime}, // Complementary one dimension with time
121 Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1, Acts::eBoundTime}
122 };

◆ s_nMeasTypes

std::size_t ActsTrk::detail::xAODUncalibMeasCalibrator::s_nMeasTypes = Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)
staticconstexprprivate

Definition at line 78 of file xAODUncalibMeasCalibrator.h.


The documentation for this class was generated from the following files: