ATLAS Offline Software
Loading...
Searching...
No Matches
RefittingCalibrator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "Acts/Definitions/Algebra.hpp"
8#include "Acts/EventData/MeasurementHelpers.hpp"
9#include "Acts/EventData/SourceLink.hpp"
10#include "Acts/Utilities/CalibrationContext.hpp"
11
12namespace ActsTrk::detail {
13
17
18void RefittingCalibrator::calibrate(const Acts::GeometryContext& gctx,
19 const Acts::CalibrationContext& cctx,
20 const Acts::SourceLink& sourceLink,
21 MutableTrackStateProxy trackState) const {
22
23 switch (MeasurementCalibratorBase::getType(sourceLink)) {
24 using enum SourceLinkType;
25 case TrkMeasurement:
26 m_measCalibrator.calibrate(gctx, cctx, sourceLink, trackState);
27 break;
28 case TrkPrepRawData:
29 m_prdCalibrator.calibrate(gctx, cctx, sourceLink, trackState);
30 break;
31 case xAODUnCalibMeas:
32 m_xAODCalibrator.calibrate(gctx, cctx, sourceLink, trackState);
33 break;
34 default:
35 THROW_EXCEPTION("Unsupported source link type "<<MeasurementCalibratorBase::getType(sourceLink));
36 }
37}
38
39
40//##########################################################################
41// RefittingSurfaceAccesor
42//##########################################################################
44 const ITrackingGeometryTool* trackGeoTool):
45 m_xAODAcc{trackGeoTool}, m_prdAcc{trkConvTool}, m_rotAcc{trkConvTool} {}
46
47const Acts::Surface* RefittingSurfaceAccesor::operator()(const Acts::SourceLink& sourceLink) const {
48 switch (MeasurementCalibratorBase::getType(sourceLink)) {
49 using enum SourceLinkType;
50 case TrkMeasurement: return m_rotAcc(sourceLink);
51 case TrkPrepRawData: return m_prdAcc(sourceLink);
52 case xAODUnCalibMeas: return m_xAODAcc(sourceLink);
53 default:
54 THROW_EXCEPTION("Unsupported source link type "<<MeasurementCalibratorBase::getType(sourceLink));
55 }
56 return nullptr;
57 }
58
59
60} // namespace ActsTrk::detail
Interface for the conversion tool to translate the surface and track parameter objects between the Ac...
Geometry helper tool extending the Tracking geometry service by the data dependency to fetch the geom...
static SourceLinkType getType(const Acts::SourceLink &sl)
Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.
RefittingCalibrator(const ActsTrk::IGeometryRealmConvTool *convTool, const Trk::IRIO_OnTrackCreator *rotCreator)
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sourceLink, MutableTrackStateProxy trackState) const
ActsTrk::MutableTrackStateBackend::TrackStateProxy MutableTrackStateProxy
TrkMeasurementCalibrator m_measCalibrator
xAODUncalibMeasCalibrator m_xAODCalibrator
RefittingSurfaceAccesor(const IGeometryRealmConvTool *trkConvTool, const ActsTrk::ITrackingGeometryTool *trackGeoTool)
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Operator called by the Acts API to fetch the surface.
Interface class for transforming Trk::PrepRawData to Trk::RIO_OnTrack using a local track hypothesis.
Hash functions to pack the source link into unordered_maps / unordered_sets.
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
@ xAODUnCalibMeas
UnCalibrated Trk::PrepRawData objects.
@ TrkPrepRawData
Calibrated Trk::MeasurementBase objects.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10