ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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

using SourceLink_t = const xAOD::UncalibratedMeasurement *
 Underlying source link type of the uncalibrated measurement
More...
 
enum  ProjectorType {
  ProjectorType::e1DimNoTime = 0, ProjectorType::e1DimRotNoTime = 1, ProjectorType::e2DimNoTime = 2, ProjectorType::e1DimWithTime = 3,
  ProjectorType::e1DimRotWithTime = 4, ProjectorType::e2DimWithTime = 5
}
 Enum encoding the possible projectors used in ATLAS. More...
 
template<typename trajectory_t >
using TrackState_t = typename Acts::MultiTrajectory< trajectory_t >::TrackStateProxy
 Abbrivation of the track state proxy type. More...
 
template<typename trajectory_t >
using ConstTrackState_t = typename Acts::MultiTrajectory< trajectory_t >::ConstTrackStateProxy
 Abbrivation of the const track state proxy type. More...
 

Public Member Functions

 xAODUncalibMeasCalibrator ()
 Empty default constructor. More...
 
template<auto Callable, typename Type >
void connect (const xAOD::UncalibMeasType type, const Type *instance)
 Register a calibrator implementation instance for a given measurement type. More...
 
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. More...
 
template<std::size_t Dim, typename trajectory_t , typename pos_t , typename cov_t >
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. More...
 

Static Public Member Functions

static Acts::SourceLink pack (const xAOD::UncalibratedMeasurement *meas)
 Helper method to pack an uncalibrated measurement to an Acts source link. More...
 
static const xAOD::UncalibratedMeasurementunpack (const Acts::SourceLink &sl)
 Helper method to unpack an Acts source link to an uncalibrated measurement. More...
 

Private Types

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

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

Private Attributes

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

Static Private Attributes

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

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 19 of file xAODUncalibMeasCalibrator.h.

Member Typedef Documentation

◆ CalibDelegate

using ActsTrk::detail::xAODUncalibMeasCalibrator::CalibDelegate = Acts::Experimental::Gx2FitterExtensions<MutableTrackStateBackend>::Calibrator
private

Abrivation for the calibrator delegate.

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

Definition at line 81 of file xAODUncalibMeasCalibrator.h.

◆ ConstTrackState_t

template<typename trajectory_t >
using ActsTrk::detail::MeasurementCalibratorBase::ConstTrackState_t = typename Acts::MultiTrajectory<trajectory_t>::ConstTrackStateProxy
inherited

Abbrivation of the const track state proxy type.

Definition at line 44 of file MeasurementCalibratorBase.h.

◆ SourceLink_t

Underlying source link type of the uncalibrated measurement

Definition at line 24 of file xAODUncalibMeasCalibrator.h.

◆ TrackState_t

template<typename trajectory_t >
using ActsTrk::detail::MeasurementCalibratorBase::TrackState_t = typename Acts::MultiTrajectory<trajectory_t>::TrackStateProxy
inherited

Abbrivation of the track state proxy type.

Definition at line 41 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 29 of file MeasurementCalibratorBase.h.

29  {
30  e1DimNoTime = 0,
31  e1DimRotNoTime = 1,
32  e2DimNoTime = 2,
34  e1DimWithTime = 3,
35  e1DimRotWithTime = 4,
36  e2DimWithTime = 5,
37  };

Constructor & Destructor Documentation

◆ xAODUncalibMeasCalibrator()

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

Empty default constructor.

Definition at line 17 of file xAODUncalibMeasCalibrator.cxx.

17  {
18  for (std::size_t t =0 ; t < m_calibrators.size(); ++t) {
19  const auto mType = static_cast<xAOD::UncalibMeasType>(t);
20  connect<&xAODUncalibMeasCalibrator::invalidCalibrator>(mType, this);
21  }
22  connect<&xAODUncalibMeasCalibrator::auxillaryCalibrator>(xAOD::UncalibMeasType::Other, this);
23  }

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 32 of file xAODUncalibMeasCalibrator.cxx.

35  {
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  }

◆ 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 58 of file xAODUncalibMeasCalibrator.cxx.

61  {
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  }

◆ 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 36 of file xAODUncalibMeasCalibrator.h.

36  {
37  assert(instance);
38  m_calibrators[static_cast<int>(type)].connect<Callable>(instance);
39  }

◆ 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 25 of file xAODUncalibMeasCalibrator.cxx.

28  {
29  THROW_EXCEPTION("Calibrator is not configured for measurement type "<<static_cast<int>(unpack(sl)->type()));
30  }

◆ pack()

Acts::SourceLink ActsTrk::detail::xAODUncalibMeasCalibrator::pack ( const xAOD::UncalibratedMeasurement meas)
static

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

Parameters
measPointer to the measurement to unpack

Definition at line 9 of file xAODUncalibMeasCalibrator.cxx.

9  {
10  return Acts::SourceLink{meas};
11  }

◆ setState()

template<std::size_t Dim, typename trajectory_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,
TrackState_t< trajectory_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 12 of file xAODUncalibMeasCalibrator.cxx.

12  {
13  SourceLink_t meas = sl.template get<SourceLink_t>();
14  assert(meas != nullptr);
15  return meas;
16  }

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 85 of file xAODUncalibMeasCalibrator.h.

◆ s_boundSpaceIndices

constexpr static 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 66 of file MeasurementCalibratorBase.h.

◆ s_nMeasTypes

constexpr static int ActsTrk::detail::xAODUncalibMeasCalibrator::s_nMeasTypes = static_cast<int>(xAOD::UncalibMeasType::nTypes)
staticconstexprprivate

Definition at line 82 of file xAODUncalibMeasCalibrator.h.


The documentation for this class was generated from the following files:
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ActsTrk::detail::xAODUncalibMeasCalibrator::unpack
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
Definition: xAODUncalibMeasCalibrator.cxx:12
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
ActsTrk::detail::xAODUncalibMeasCalibrator::SourceLink_t
const xAOD::UncalibratedMeasurement * SourceLink_t
Underlying source link type of the uncalibrated measurement
Definition: xAODUncalibMeasCalibrator.h:24
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
xAOD::Other
@ Other
ActsTrk::detail::xAODUncalibMeasCalibrator::m_calibrators
std::array< CalibDelegate, s_nMeasTypes > m_calibrators
Dispatch table of the calibrators per measurement type.
Definition: xAODUncalibMeasCalibrator.h:85
xAOD::AuxiliaryMeasurement_v1
Implementation of an uncalibrated AuxiliaryMeasurement which may serve as an external constraint in t...
Definition: AuxiliaryMeasurement_v1.h:24
xAOD::UncalibMeasType::nTypes
@ nTypes
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
ActsTrk::detail::xAODUncalibMeasCalibrator::CalibDelegate
Acts::Experimental::Gx2FitterExtensions< MutableTrackStateBackend >::Calibrator CalibDelegate
Abrivation for the calibrator delegate.
Definition: xAODUncalibMeasCalibrator.h:81
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25