ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsCalibration
ActsCalibrators
src
xAODUncalibMeasSurfAcc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
ActsCalibrators/xAODUncalibMeasSurfAcc.h
"
5
#include "
ActsCalibrators/xAODUncalibMeasCalibrator.h
"
6
#include "
ActsGeometry/DetectorElementToActsGeometryIdMap.h
"
7
#include "
ActsGeometry/SurfaceOfMeasurementUtil.h
"
8
#include "
xAODAuxiliaryMeasurement/AuxiliaryMeasurement.h
"
9
#include "
xAODMuonPrepData/UtilFunctions.h
"
10
11
namespace
ActsTrk::detail
{
12
xAODUncalibMeasSurfAcc::xAODUncalibMeasSurfAcc
(
const
ActsTrk::ITrackingGeometrySvc
* trackGeoSvc):
13
m_actsTrackingGeometry
{trackGeoSvc->trackingGeometry().
get
()},
14
m_detectorElementToGeometryIdMap
{trackGeoSvc->surfaceIdMap()}{}
15
16
const
Acts::Surface*
xAODUncalibMeasSurfAcc::operator()
(
const
Acts::SourceLink& sourceLink)
const
{
17
return
get
(
xAODUncalibMeasCalibrator::unpack
(sourceLink));
18
}
19
const
Acts::Surface*
xAODUncalibMeasSurfAcc::get
(
const
xAOD::UncalibratedMeasurement
* meas)
const
{
20
switch
(meas->
type
()) {
21
using
enum
xAOD::UncalibMeasType
;
23
case
PixelClusterType:
24
case
StripClusterType:
25
case
HGTDClusterType:{
26
assert(
m_detectorElementToGeometryIdMap
);
27
assert(
m_actsTrackingGeometry
);
28
const
auto
geoKey =
makeDetectorElementKey
(meas->
type
(), meas->
identifierHash
());
29
const
auto
geoid_iter =
m_detectorElementToGeometryIdMap
->find(geoKey);
30
if
(geoid_iter ==
m_detectorElementToGeometryIdMap
->end()) {
31
return
nullptr
;
32
}
34
if
(
const
Acts::Surface* surface =
DetectorElementToActsGeometryIdMap::getSurface
(*geoid_iter)) {
35
return
surface;
36
}
37
return
m_actsTrackingGeometry
->findSurface(
DetectorElementToActsGeometryIdMap::getValue
(*geoid_iter));
38
}
40
case
MdtDriftCircleType:
41
case
RpcStripType:
42
case
TgcStripType:
43
case
sTgcStripType:
44
case
MMClusterType:{
45
return
&
xAOD::muonSurface
(meas);
46
break
;
47
}
case
Other
: {
48
const
auto
* pMeas =
static_cast<
const
xAOD::AuxiliaryMeasurement
*
>
(meas);
49
return
pMeas->surface().get();
50
}
51
52
default
:
53
break
;
54
55
}
56
#ifndef NDEBUG
57
throw
std::domain_error(
"xAODUncalibMeasSurfAcc() - Cannot decode surface type"
);
58
#endif
59
return
nullptr
;
60
}
61
}
AuxiliaryMeasurement.h
DetectorElementToActsGeometryIdMap.h
OfflineHitType::Other
@ Other
Definition
FPGATrackSimTypes.h:31
UtilFunctions.h
SurfaceOfMeasurementUtil.h
ActsTrk::ITrackingGeometrySvc
Interface class for the ATLAS service providing the ActsTrackingGeometry.
Definition
Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/ITrackingGeometrySvc.h:31
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:9
ActsTrk::detail::xAODUncalibMeasSurfAcc::get
const Acts::Surface * get(const xAOD::UncalibratedMeasurement *meas) const
Operator.
Definition
xAODUncalibMeasSurfAcc.cxx:19
ActsTrk::detail::xAODUncalibMeasSurfAcc::m_detectorElementToGeometryIdMap
const DetectorElementToActsGeometryIdMap * m_detectorElementToGeometryIdMap
Definition
xAODUncalibMeasSurfAcc.h:37
ActsTrk::detail::xAODUncalibMeasSurfAcc::m_actsTrackingGeometry
const Acts::TrackingGeometry * m_actsTrackingGeometry
Definition
xAODUncalibMeasSurfAcc.h:36
ActsTrk::detail::xAODUncalibMeasSurfAcc::operator()
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Operator called by the Acts API to fetch the surface.
Definition
xAODUncalibMeasSurfAcc.cxx:16
ActsTrk::detail::xAODUncalibMeasSurfAcc::xAODUncalibMeasSurfAcc
xAODUncalibMeasSurfAcc()=default
Empty default constructor -> conversion will crash for ID measurements.
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
ActsTrk::detail
Hash functions to pack the source link into unordered_maps / unordered_sets.
Definition
MeasurementCalibratorBase.h:31
ActsTrk::makeDetectorElementKey
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
Definition
DetectorElementToActsGeometryIdMap.h:20
xAOD::AuxiliaryMeasurement
AuxiliaryMeasurement_v1 AuxiliaryMeasurement
Definition
AuxiliaryMeasurement.h:10
xAOD::UncalibratedMeasurement
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
Definition
UncalibratedMeasurementFwd.h:13
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition
MeasurementDefs.h:24
xAOD::muonSurface
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
Definition
MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:43
ActsTrk::DetectorElementToActsGeometryIdMap::getValue
static const Acts::GeometryIdentifier & getValue(const value_type &element)
Definition
DetectorElementToActsGeometryIdMap.h:41
ActsTrk::DetectorElementToActsGeometryIdMap::getSurface
static const Acts::Surface * getSurface(const value_type &element)
Surface of the detector element, or nullptr if none was stored.
Definition
DetectorElementToActsGeometryIdMap.h:45
xAODUncalibMeasCalibrator.h
xAODUncalibMeasSurfAcc.h
Generated on
for ATLAS Offline Software by
1.17.0