ATLAS Offline Software
SpacePoint_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // EDM include(s):
7 // Local include(s):
9 
10 AUXSTORE_OBJECT_SETTER_AND_GETTER( xAOD::SpacePoint_v1, std::vector< xAOD::DetectorIDHashType >,
11  elementIdList, setElementIdList )
12 
13 static const SG::AuxElement::Accessor< std::array< float, 3 > > globalPosAcc("globalPosition");
14 
16  const auto& values = globalPosAcc(*this);
17  return ConstVectorMap{values.data()};
18 }
19 
21  auto& values = globalPosAcc(*this);
22  return VectorMap{values.data()};
23 }
24 
26  radius, setRadius )
27 
28 float xAOD::SpacePoint_v1::x() const
29 {
30  return globalPosAcc(*this)[0];
31 }
32 
33 float xAOD::SpacePoint_v1::y() const
34 {
35  return globalPosAcc(*this)[1];
36 }
37 
38 float xAOD::SpacePoint_v1::z() const
39 {
40  return globalPosAcc(*this)[2];
41 }
42 
44  varianceR, setVarianceR )
45 
47  varianceZ, setVarianceZ )
48 
49 AUXSTORE_OBJECT_SETTER_AND_GETTER( xAOD::SpacePoint_v1, std::vector< const xAOD::UncalibratedMeasurement* >,
50  measurements, setMeasurements )
51 
53  topHalfStripLength, setTopHalfStripLength )
54 
56  bottomHalfStripLength, setBottomHalfStripLength )
57 
58 static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > topStripDirectionAcc( "topStripDirection" );
59 static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > bottomStripDirectionAcc( "bottomStripDirection" );
60 static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > stripCenterDistanceAcc( "stripCenterDistance" );
61 static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > topStripCenterAcc( "topStripCenter" );
62 
64  const auto& values = topStripDirectionAcc(*this);
65  return ConstVectorMap{values.data()};
66 }
67 
69  const auto& values = bottomStripDirectionAcc(*this);
70  return ConstVectorMap{values.data()};
71 }
72 
74  const auto& values = stripCenterDistanceAcc(*this);
75  return ConstVectorMap{values.data()};
76 }
77 
79  const auto& values = topStripCenterAcc(*this);
80  return ConstVectorMap{values.data()};
81 }
82 
84  auto& values = topStripDirectionAcc(*this);
85  return VectorMap{values.data()};
86 }
87 
89  auto& values = bottomStripDirectionAcc(*this);
90  return VectorMap{values.data()};
91 }
92 
94  auto& values = stripCenterDistanceAcc(*this);
95  return VectorMap{values.data()};
96 }
97 
99  auto& values = topStripCenterAcc(*this);
100  return VectorMap{values.data()};
101 }
102 
104  const Eigen::Matrix<float,3,1>& globPos,
105  float cov_r, float cov_z,
106  const std::vector< const xAOD::UncalibratedMeasurement* >& measurements)
107 {
108  this->setElementIdList({idHash});
109  this->globalPosition() = globPos;
110  this->setRadius( std::sqrt( globPos(0,0) * globPos(0,0) + globPos(1,0) * globPos(1,0) ) );
111  this->setVarianceR(cov_r);
112  this->setVarianceZ(cov_z);
113  this->setMeasurements(measurements);
114 }
115 
116 void xAOD::SpacePoint_v1::setSpacePoint(const std::vector<DetectorIDHashType>& idHashes,
117  const Eigen::Matrix<float,3,1>& globPos,
118  float cov_r, float cov_z,
119  const std::vector< const xAOD::UncalibratedMeasurement* >& measurements,
120  float topHalfStripLength,
121  float bottomHalfStripLength,
122  const Eigen::Matrix<float,3,1>& topStripDirection,
123  const Eigen::Matrix<float,3,1>& bottomStripDirection,
124  const Eigen::Matrix<float,3,1>& stripCenterDistance,
125  const Eigen::Matrix<float,3,1>& topStripCenter)
126 {
127  this->setElementIdList(idHashes);
128  this->globalPosition() = globPos;
129  this->setRadius( std::sqrt( globPos(0,0) * globPos(0,0) + globPos(1,0) * globPos(1,0) ) );
130  this->setVarianceR(cov_r);
131  this->setVarianceZ(cov_z);
132  this->setMeasurements(measurements);
133 
134  this->setTopHalfStripLength(topHalfStripLength);
135  this->setBottomHalfStripLength(bottomHalfStripLength);
136 
137  this->topStripDirection() = topStripDirection;
138  this->bottomStripDirection() = bottomStripDirection;
139  this->stripCenterDistance() = stripCenterDistance;
140  this->topStripCenter() = topStripCenter;
141 }
142 
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::SpacePoint_v1::stripCenterDistance
ConstVectorMap stripCenterDistance() const
Definition: SpacePoint_v1.cxx:73
xAOD::SpacePoint_v1::topStripDirection
ConstVectorMap topStripDirection() const
Definition: SpacePoint_v1.cxx:63
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
AuxStoreAccessorMacros.h
SpacePoint_v1.h
xAOD::SpacePoint_v1::ConstVectorMap
Eigen::Map< const Eigen::Matrix< float, 3, 1 > > ConstVectorMap
Definition: SpacePoint_v1.h:31
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
xAOD::SpacePoint_v1::z
float z() const
xAOD::SpacePoint_v1::globalPosition
ConstVectorMap globalPosition() const
Returns the global position of the pixel cluster.
xAOD::SpacePoint_v1::bottomStripDirection
ConstVectorMap bottomStripDirection() const
Definition: SpacePoint_v1.cxx:68
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
xAOD::SpacePoint_v1::VectorMap
Eigen::Map< Eigen::Matrix< float, 3, 1 > > VectorMap
Definition: SpacePoint_v1.h:32
xAOD::SpacePoint_v1::setSpacePoint
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, const std::vector< const xAOD::UncalibratedMeasurement * > &measurementIndexes)
Definition: SpacePoint_v1.cxx:103
xAOD::DetectorIDHashType
unsigned int DetectorIDHashType
@ detector ID element hash
Definition: MeasurementDefs.h:42
xAOD::SpacePoint_v1::y
float y() const
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
xAOD::SpacePoint_v1::x
float x() const
AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(xAOD::PixelCluster_v1, std::vector< int >, totList, setToTlist) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(xAOD
Definition: PixelCluster_v1.cxx:67
xAOD::SpacePoint_v1::topStripCenter
ConstVectorMap topStripCenter() const
Definition: SpacePoint_v1.cxx:78
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27