 |
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GeoModelKernel/throwExcept.h"
17 constexpr
static double one_over_twelve = 1. / 12.;
29 localPosition(0, 0) = localPos.x();
30 localPosition(1, 0) = localPos.y();
31 localPosition(2, 0) =
time;
34 localCovariance(0, 0) = localCov(0, 0);
35 localCovariance(1, 1) = localCov(1, 1);
36 localCovariance(2, 2) = timeResolution * timeResolution;
38 return {localPosition, localCovariance};
49 const auto& RDOs = indetCluster.
rdoList();
50 const auto& ToTs = indetCluster.
totList();
52 xaodCluster.
setMeasurement<3>(idHash, localPosition, localCovariance);
57 return StatusCode::SUCCESS;
64 Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
66 Eigen::Matrix<float,2,2> localCovariance;
67 localCovariance.setZero();
68 localCovariance(0, 0) = localCov(0, 0);
69 localCovariance(1, 1) = localCov(1, 1);
71 return {localPosition, localCovariance};
83 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
85 const auto& RDOs = indetCluster.
rdoList();
86 const auto& ToTs = indetCluster.
totList();
87 const auto& charges = indetCluster.
chargeList();
93 xaodCluster.
setMeasurement<2>(idHash, localPosition, localCovariance);
107 return StatusCode::SUCCESS;
114 float localPosition = 0.f, localCovariance = 0.f;
115 if (element.isBarrel()) {
116 localPosition = localPos.x();
117 localCovariance = element.phiPitch() * element.phiPitch() * one_over_twelve;
121 if ( design ==
nullptr ) {
125 localPosition = localInPolar.
xPhi();
126 localCovariance = design->phiPitchPhi() * design->phiPitchPhi() * one_over_twelve;
142 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
144 const auto& RDOs = indetCluster.
rdoList();
147 xaodCluster.
setMeasurement<1>(idHash, localPosition, localCovariance);
153 return StatusCode::SUCCESS;
162 if (design ==
nullptr) {
163 return StatusCode::FAILURE;
173 Amg::Vector3D globalPosition(globalPos(0, 0), globalPos(1, 0), globalPos(2, 0));
176 errorMatrix.setIdentity();
177 errorMatrix.fillSymmetric(0, 0, xaodCluster.
localCovariance<2>()(0, 0));
178 errorMatrix.fillSymmetric(1, 1, xaodCluster.
localCovariance<2>()(1, 1));
190 const std::vector<Identifier>& rod_list_cluster = xaodCluster.
rdoList();
191 const std::vector<float>& charge_list_cluster = xaodCluster.
chargeList();
192 if (rod_list_cluster.size() != charge_list_cluster.size()) {
193 return StatusCode::FAILURE;
196 for (std::size_t
i(0);
i<rod_list_cluster.size(); ++
i) {
197 const Identifier& this_rdo = rod_list_cluster.at(
i);
198 const float this_charge = charge_list_cluster.at(
i);
203 qRowMax = this_charge;
204 }
else if (
row == rowmax) {
205 qRowMax += this_charge;
210 qRowMin = this_charge;
211 }
else if (
row == rowmin) {
212 qRowMin += this_charge;
215 const int col = pixelID.
eta_index(this_rdo);
218 qColMax = this_charge;
219 }
else if (col == colmax) {
220 qColMax += this_charge;
225 qColMin = this_charge;
226 }
else if (col == colmin) {
227 qColMin += this_charge;
236 if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
237 if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
247 std::vector<Identifier>(xaodCluster.
rdoList()),
249 std::vector<int>(xaodCluster.
totList()),
253 std::move(errorMatrix),
260 return StatusCode::SUCCESS;
277 if (design ==
nullptr) {
278 return StatusCode::FAILURE;
281 const auto designShape = design->
shape();
284 const auto& rdoList = xaodCluster.
rdoList();
289 double pos_x = localPos(0, 0);
292 const Identifier firstStripId = rdoList.front();
294 int stripRow = stripID.
row(firstStripId);
297 pos_x = clusterPosition.
xPhi() + shift;
298 pos_y = clusterPosition.xEta();
308 const auto&
row = stripID.
row(rdoList.front());
318 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
319 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
324 const double col_x =
width.colRow().x();
325 const double col_y =
width.colRow().y();
327 double scale_factor = 1.;
330 else if ( col_x == 2 )
334 errorMatrix.setIdentity();
335 errorMatrix.fillSymmetric(0, 0, scale_factor * scale_factor *
width.phiR() *
width.phiR() * one_over_twelve);
336 errorMatrix.fillSymmetric(1, 1,
width.z() *
width.z() / col_y / col_y * one_over_twelve);
347 double sn2 = sn * sn;
348 double cs2 = 1. - sn2;
350 double v0 = errorMatrix(0,0) *
w *
w;
351 double v1 = errorMatrix(1,1);
352 errorMatrix.fillSymmetric( 0, 0, cs2 *
v0 + sn2 * v1 );
353 errorMatrix.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (
v0 - v1) );
354 errorMatrix.fillSymmetric( 1, 1, sn2 *
v0 + cs2 * v1 );
359 std::vector<Identifier>(rdoList),
362 std::move(errorMatrix));
364 return StatusCode::SUCCESS;
373 float time = locPos(2,0);
379 errorMatrix.setIdentity();
380 errorMatrix.fillSymmetric(0, 0, xaodCluster.
localCovariance<3>()(0, 0));
381 errorMatrix.fillSymmetric(1, 1, xaodCluster.
localCovariance<3>()(1, 1));
382 float time_resolution = std::sqrt(xaodCluster.
localCovariance<3>()(2, 2));
384 double etaWidth = 1.3;
392 std::vector<Identifier>(xaodCluster.
rdoList()),
395 std::move(errorMatrix),
398 std::vector<int>(xaodCluster.
totList()));
400 return StatusCode::SUCCESS;
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
const std::vector< float > & chargeList() const
Returns the list of charges of the channels building the cluster.
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
StatusCode convertInDetToXaodCluster(const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster)
void setTotalCharge(float totalCharge)
Sets the total charge.
int phi_index(const Identifier &id) const
void setChannelsInPhi(int channelsInPhi)
Sets the dimensions of the cluster in numbers of channels in phi (x)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x), respectively.
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
Eigen::Matrix< double, 2, 1 > Vector2D
virtual DetectorShape shape() const
Shape of element.
bool isSplit() const
access mehtods for splitting
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
int computeTotalToT(const SG::AuxElement &cluster)
double splitProbability1() const
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
value_type get_compact() const
Get the compact id.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setChargelist(const std::vector< float > &charges)
Sets the list of charges of the channels building the cluster.
StatusCode convertXaodToInDetCluster(const xAOD::PixelCluster &xaodCluster, const InDetDD::SiDetectorElement &element, const PixelID &pixelID, InDet::PixelCluster *&indetCluster)
void setIsSplit(bool isSplit)
Sets if the cluster is split or not.
bool isSplit(int matchInfo)
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) direction.
std::pair< xAOD::MeasVector< 3 >, xAOD::MeasMatrix< 3 > > convertHGTD_LocalPosCov(const HGTD_Cluster &cluster)
const std::vector< int > & totList() const
void setTotalToT(int totalToT)
Sets the total ToT.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
float splitProbability2() const
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
void setSplitProbabilities(float prob1, float prob2)
Sets the splitting probabilities for the cluster.
double xPhi() const
position along phi direction:
double phiPitch() const
Pitch (inline methods)
double splitProbability2() const
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
::StatusCode StatusCode
StatusCode definition for legacy code.
int row(const Identifier &id) const
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
int eta_index(const Identifier &id) const
const std::vector< int > & totList() const
Returns the list of Time Over Threshold of the channels building the cluster.
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
virtual float timeResolution() const
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
void setLVL1A(int lvl1a)
Sets the LVL1 accept.
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
float computeTotalCharge(const SG::AuxElement &cluster)
Identifier identify() const
return the identifier
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
const Amg::Vector2D & localPosition() const
return the local position reference
const std::vector< int > & totList() const
Returns the list of ToT of the channels building the cluster.
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int cluserSize) const =0
const Amg::Vector3D & globalPosition() const
return global position reference
const InDet::SiWidth & width() const
return width class reference
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
def time(flags, cells_name, *args, **kw)
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
std::pair< xAOD::MeasVector< 1 >, xAOD::MeasMatrix< 1 > > convertSCT_LocalPosCov(const InDet::SCT_Cluster &cluster)
int strip(const Identifier &id) const
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
virtual const std::vector< int > & totList() const
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the strip cluster.
std::pair< xAOD::MeasVector< 2 >, xAOD::MeasMatrix< 2 > > convertPix_LocalPosCov(const InDet::PixelCluster &cluster)
Eigen::Matrix< float, N, N > MeasMatrix
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
int channelsInEta() const
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
virtual float time() const
Vertex centroid(const Polygon &p)
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions,...
float splitProbability1() const
Returns the splitting probabilities for the cluster.
int lvl1a() const
Return the LVL1 accept.
const std::vector< float > & chargeList() const
bool isSplit() const
Returns if the cluster is split or not.