ATLAS Offline Software
UncalibratedMeasurement_v1.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef XAODMEASUREMENTBASE_VERSION_UNCALIBRATEDMEASUREMENT_V1_ICC
5 #define XAODMEASUREMENTBASE_VERSION_UNCALIBRATEDMEASUREMENT_V1_ICC
6 
7 namespace xAOD {
8 /// Returns the local position of the measurement
9 template <int N>
10 ConstVectorMap<N> UncalibratedMeasurement_v1::localPosition() const {
11  static const PosAccessor<N> acc{std::string("localPositionDim") + std::to_string(N)};
12  const auto& values = acc(*this);
13  assert(values.data() != nullptr);
14  return ConstVectorMap<N>{values.data()};
15 }
16 template <int N>
17 VectorMap<N> UncalibratedMeasurement_v1::localPosition() {
18  static const PosAccessor<N> acc{std::string("localPositionDim") + std::to_string(N)};
19  auto& values = acc(*this);
20  assert(values.data() != nullptr);
21  return VectorMap<N>{values.data()};
22 }
23 template <int N>
24 ConstMatrixMap<N> UncalibratedMeasurement_v1::localCovariance() const {
25  static const CovAccessor<N> acc{std::string("localCovarianceDim") + std::to_string(N)};
26  const auto& values = acc(*this);
27  assert(values.data() != nullptr);
28  return ConstMatrixMap<N>{values.data()};
29 }
30 template <int N>
31 MatrixMap<N> UncalibratedMeasurement_v1::localCovariance() {
32  static const CovAccessor<N> acc{std::string("localCovarianceDim") + std::to_string(N)};
33  auto& values = acc(*this);
34  assert(values.data() != nullptr);
35  return MatrixMap<N>{values.data()};
36 }
37 
38 template <int N>
39 void UncalibratedMeasurement_v1::setMeasurement(const DetectorIDHashType idHash,
40  MeasVector<N> locPos,
41  MeasMatrix<N> locCov) {
42  setIdentifierHash(idHash);
43  localPosition<N>() = std::move(locPos);
44  localCovariance<N>() = std::move(locCov);
45 }
46 } // namespace xAOD
47 #endif