ATLAS Offline Software
Loading...
Searching...
No Matches
SourceLinkHash.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include <cassert>
11namespace ActsTrk::detail {
12
13std::size_t sourceLinkHash(const Acts::SourceLink &slink) {
14 using namespace ActsTrk::detail;
16 using enum SourceLinkType;
17 case xAODUnCalibMeas:
19 case TrkMeasurement: {
20 const auto* rio = dynamic_cast<const Trk::RIO_OnTrack*>(TrkMeasurementCalibrator::unpack(slink));
21 assert(rio != nullptr);
22 return rio->identify().get_compact();
23 } case TrkPrepRawData: {
25 } default:
26 break;
27 }
28 return 0ul;
29}
30
31bool sourceLinkEquality(const Acts::SourceLink &a, const Acts::SourceLink &b) {
32 return sourceLinkHash(a) == sourceLinkHash(b);
33}
34
35}
static Double_t a
static SourceLinkType getType(const Acts::SourceLink &sl)
Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.
static const Trk::MeasurementBase * unpack(const Acts::SourceLink &sl)
Unpacks the Acts::SourceLink to a Trk measurement.
static const Trk::PrepRawData * unpack(const Acts::SourceLink &sl)
Unpack the prepraw data measurement 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.
value_type get_compact() const
Get the compact id.
Identifier identify() const
return the identifier
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
Hash functions to pack the source link into unordered_maps / unordered_sets.
bool sourceLinkEquality(const Acts::SourceLink &a, const Acts::SourceLink &b)
Returns whether two source links are equal.
std::size_t sourceLinkHash(const Acts::SourceLink &sl)
Calculates the source link hash which is evaluated to be the identifier of the underlying sourcelink.
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
@ xAODUnCalibMeas
UnCalibrated Trk::PrepRawData objects.
@ TrkPrepRawData
Calibrated Trk::MeasurementBase objects.