ATLAS Offline Software
ATLASSourceLink.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSGEOMETRY_ATLASOURCELINK_H
6 #define ACTSGEOMETRY_ATLASOURCELINK_H
7 
12 
13 #include "Acts/EventData/MultiTrajectory.hpp"
14 #include "Acts/Utilities/CalibrationContext.hpp"
15 #include "Acts/Geometry/GeometryIdentifier.hpp"
16 #include "Acts/Surfaces/Surface.hpp"
17 #include "Acts/Definitions/TrackParametrization.hpp"
18 #include "Acts/Geometry/TrackingGeometry.hpp"
19 
20 #include <cassert>
21 
22 namespace ActsTrk {
25 
27  assert(source_link);
28  return *source_link;
29  }
31  std::size_t index,
32  [[maybe_unused]] const EventContext& ctx) {
33  assert(container && index < container->size());
34  return container->at(index);
35  }
37  const xAOD::UncalibratedMeasurement *measurement,
38  [[maybe_unused]] const EventContext& ctx) {
39  assert( container == measurement->container());
40  assert( container && measurement->index() < container->size() );
41  return measurement;
42  }
44  std::size_t index) {
45  assert(container && index < container->size());
46  return container->at(index);
47  }
48  // *dynamic_cast<const xAOD::UncalibratedMeasurementContainer*>(umeas->container()), umeas->index()
50  assert(measurement && measurement->container() && measurement->index() < measurement->container()->size_v());
51  return measurement;
52  }
53  inline float localXFromSourceLink(const ATLASUncalibSourceLink &source_link) {
54  const xAOD::UncalibratedMeasurement &uncalib_meas = getUncalibratedMeasurement(source_link);
55  return uncalib_meas.type() == xAOD::UncalibMeasType::PixelClusterType
56  ? uncalib_meas.localPosition<2>()[Trk::locX]
57  : uncalib_meas.localPosition<1>()[Trk::locX];
58  }
59 
60  inline float localYFromSourceLink(const ATLASUncalibSourceLink &source_link) {
61  const xAOD::UncalibratedMeasurement &uncalib_meas = getUncalibratedMeasurement(source_link);
62  assert(uncalib_meas.type() == xAOD::UncalibMeasType::PixelClusterType );
63  return uncalib_meas.localPosition<2>()[Trk::locY];
64  }
65 
66 }
67 
68 #endif
UncalibratedMeasurement.h
MeasurementBase.h
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
index
Definition: index.py:1
ActsTrk::localXFromSourceLink
float localXFromSourceLink(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:53
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ActsTrk::makeATLASUncalibSourceLink
ATLASUncalibSourceLink makeATLASUncalibSourceLink(const xAOD::UncalibratedMeasurementContainer *container, std::size_t index, [[maybe_unused]] const EventContext &ctx)
Definition: ATLASSourceLink.h:30
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
UncalibratedMeasurementContainer.h
ActsTrk::localYFromSourceLink
float localYFromSourceLink(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:60
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::UncalibratedMeasurement_v1::localPosition
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
Trk::MeasurementBase
Definition: MeasurementBase.h:58
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:26
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
SG::AuxVectorData::size_v
virtual size_t size_v() const =0
Return the size of the container.
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType