ATLAS Offline Software
Loading...
Searching...
No Matches
SpacePoint_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// EDM include(s):
7// Local include(s):
9
10// replace by handwritten version to avoid vector copy
11// AUXSTORE_OBJECT_SETTER_AND_GETTER( xAOD::SpacePoint_v1, std::vector< xAOD::DetectorIDHashType >,
12// elementIdList, setElementIdList )
13
14const std::vector< xAOD::DetectorIDHashType > & xAOD::SpacePoint_v1::elementIdList() const {
15 static const Accessor< std::vector< xAOD::DetectorIDHashType > > acc( "elementIdList" );
16 return acc( *this );
17}
18void xAOD::SpacePoint_v1::setElementIdList(std::vector< xAOD::DetectorIDHashType > && value ) {
19 static const Accessor< std::vector< xAOD::DetectorIDHashType > > acc( "elementIdList" );
20 acc( *this ) = std::move(value);
21}
22
24
29
34
36 radius, setRadius )
37
38float xAOD::SpacePoint_v1::x() const
39{
40 return globalPosAcc(*this)[0];
41}
42
43float xAOD::SpacePoint_v1::y() const
44{
45 return globalPosAcc(*this)[1];
46}
47
48float xAOD::SpacePoint_v1::z() const
49{
50 return globalPosAcc(*this)[2];
51}
52
53AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( xAOD::SpacePoint_v1, float,
54 varianceR, setVarianceR )
55
56AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( xAOD::SpacePoint_v1, float,
57 varianceZ, setVarianceZ )
58
59// replace by handwritten version to avoid vector copy
60// AUXSTORE_OBJECT_SETTER_AND_GETTER( xAOD::SpacePoint_v1, std::vector< const xAOD::UncalibratedMeasurement* >,
61// measurements, setMeasurements )
62
63const std::vector< const xAOD::UncalibratedMeasurement* > & xAOD::SpacePoint_v1::measurements() const {
64 static const Accessor< std::vector< const xAOD::UncalibratedMeasurement* > > acc( "measurements" );
65 return acc( *this );
66}
67void xAOD::SpacePoint_v1::setMeasurements(std::vector< const xAOD::UncalibratedMeasurement* > && value ) {
68 static const Accessor< std::vector< const xAOD::UncalibratedMeasurement* > > acc( "measurements" );
69 acc( *this ) = std::move(value);
70}
71
72AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( xAOD::SpacePoint_v1, float,
73 topHalfStripLength, setTopHalfStripLength )
74
75AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( xAOD::SpacePoint_v1, float,
76 bottomHalfStripLength, setBottomHalfStripLength )
77
78static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > topStripDirectionAcc( "topStripDirection" );
82
84 const auto& values = topStripDirectionAcc(*this);
85 return ConstVectorMap{values.data()};
86}
87
92
97
102
104 auto& values = topStripDirectionAcc(*this);
105 return VectorMap{values.data()};
106}
107
112
117
122
124 const Eigen::Matrix<float,3,1>& globPos,
125 float cov_r, float cov_z,
126 std::vector< const xAOD::UncalibratedMeasurement* >&& measurements)
127{
128 this->setElementIdList({idHash});
129 this->globalPosition() = globPos;
130 this->setRadius( std::sqrt( globPos(0,0) * globPos(0,0) + globPos(1,0) * globPos(1,0) ) );
131 this->setVarianceR(cov_r);
132 this->setVarianceZ(cov_z);
133 this->setMeasurements(std::move(measurements));
134}
135
136void xAOD::SpacePoint_v1::setSpacePoint(std::vector<DetectorIDHashType>&& idHashes,
137 const Eigen::Matrix<float,3,1>& globPos,
138 float cov_r, float cov_z,
139 std::vector< const xAOD::UncalibratedMeasurement* >&& measurements,
140 float topHalfStripLength,
142 const Eigen::Matrix<float,3,1>& topStripDirection,
143 const Eigen::Matrix<float,3,1>& bottomStripDirection,
144 const Eigen::Matrix<float,3,1>& stripCenterDistance,
145 const Eigen::Matrix<float,3,1>& topStripCenter)
146{
147 this->setElementIdList(std::move(idHashes));
148 this->globalPosition() = globPos;
149 this->setRadius( std::sqrt( globPos(0,0) * globPos(0,0) + globPos(1,0) * globPos(1,0) ) );
150 this->setVarianceR(cov_r);
151 this->setVarianceZ(cov_z);
152 this->setMeasurements(std::move(measurements));
153
156
157 this->topStripDirection() = topStripDirection;
158 this->bottomStripDirection() = bottomStripDirection;
159 this->stripCenterDistance() = stripCenterDistance;
160 this->topStripCenter() = topStripCenter;
161}
162
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
static const SG::AuxElement::Accessor< std::array< float, 3 > > globalPosAcc("globalPosition")
static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > topStripCenterAcc("topStripCenter")
static const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > stripCenterDistanceAcc("stripCenterDistance")
static AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(xAOD::SpacePoint_v1, float, topHalfStripLength, setTopHalfStripLength) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(xAOD const SG::AuxElement::Accessor< xAOD::ArrayFloat3 > bottomStripDirectionAcc("bottomStripDirection")
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
void setTopHalfStripLength(float)
ConstVectorMap stripCenterDistance() const
void setMeasurements(std::vector< const xAOD::UncalibratedMeasurement * > &&value)
Sets the index of the measurements.
float bottomHalfStripLength() const
const std::vector< DetectorIDHashType > & elementIdList() const
Returns the IdentifierHash of the spacepoint (corresponds to the detector element IdentifierHash)
float z() const
void setVarianceZ(float)
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, std::vector< const xAOD::UncalibratedMeasurement * > &&measurementIndexes)
ConstVectorMap bottomStripDirection() const
ConstVectorMap topStripCenter() const
const std::vector< const xAOD::UncalibratedMeasurement * > & measurements() const
Returns the index of the measurements.
void setBottomHalfStripLength(float)
Eigen::Map< Eigen::Matrix< float, 3, 1 > > VectorMap
Eigen::Map< const Eigen::Matrix< float, 3, 1 > > ConstVectorMap
void setRadius(float)
Set the radius.
float y() const
void setElementIdList(std::vector< DetectorIDHashType > &&idHash)
Sets the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
void setVarianceR(float)
Sets the variances.
ConstVectorMap globalPosition() const
Returns the global position of the pixel cluster.
float topHalfStripLength() const
Return details.
float x() const
ConstVectorMap topStripDirection() const
static AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(EmTauRoI_v1, uint32_t, roiWord, setRoIWord) uint32_t EmTauRoI_v1 const SG::AuxElement::Accessor< std::vector< float > > values("thrValues")
This is a convenience function for accessing the threshold pattern part of the RoI.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
unsigned int DetectorIDHashType
@ detector ID element hash