 |
ATLAS Offline Software
|
|
StatusCode | convertInDetToXaodCluster (const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster) |
|
StatusCode | convertInDetToXaodCluster (const InDet::SCT_Cluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::StripCluster &xaodCluster) |
|
StatusCode | convertXaodToInDetCluster (const xAOD::PixelCluster &xaodCluster, const InDetDD::SiDetectorElement &element, const PixelID &pixelID, InDet::PixelCluster *&indetCluster) |
|
StatusCode | convertXaodToInDetCluster (const xAOD::StripCluster &xaodCluster, const InDetDD::SiDetectorElement &element, const SCT_ID &stripID, InDet::SCT_Cluster *&indetCluster, double shift=0.) |
|
StatusCode | convertInDetToXaodCluster (const HGTD_Cluster &indetCluster, const InDetDD::HGTD_DetectorElement &element, xAOD::HGTDCluster &xaodCluster) |
|
StatusCode | convertXaodToInDetCluster (const xAOD::HGTDCluster &xaodCluster, const InDetDD::HGTD_DetectorElement &element, ::HGTD_Cluster *&indetCluster) |
|
std::pair< xAOD::MeasVector< 1 >, xAOD::MeasMatrix< 1 > > | convertSCT_LocalPosCov (const InDet::SCT_Cluster &cluster) |
|
std::pair< float, float > | computeOmegas (const xAOD::PixelCluster &cluster, const PixelID &pixelID) |
|
StatusCode | convertTrkToXaodPixelSpacePoint (const InDet::PixelSpacePoint &trkSpacePoint, xAOD::SpacePoint &xaodSpacePoint) |
|
StatusCode | convertTrkToXaodStripSpacePoint (const InDet::SCT_SpacePoint &trkSpacePoint, const Amg::Vector3D &vertex, xAOD::SpacePoint &xaodSpacePoint) |
|
◆ computeOmegas()
Definition at line 9 of file InnerDetector/InDetMeasurementUtilities/src/Helpers.cxx.
12 const std::vector<Identifier>& rod_list_cluster =
cluster.rdoList();
13 const std::vector<float>& charge_list_cluster =
cluster.chargeList();
15 if (rod_list_cluster.size() != charge_list_cluster.size()) {
29 for (std::size_t
i(0);
i<rod_list_cluster.size(); ++
i) {
30 const Identifier& this_rdo = rod_list_cluster.at(
i);
31 const float this_charge = charge_list_cluster.at(
i);
36 qRowMax = this_charge;
37 }
else if (
row == rowmax) {
38 qRowMax += this_charge;
43 qRowMin = this_charge;
44 }
else if (
row == rowmin) {
45 qRowMin += this_charge;
51 qColMax = this_charge;
52 }
else if (
col == colmax) {
53 qColMax += this_charge;
58 qColMin = this_charge;
59 }
else if (
col == colmin) {
60 qColMin += this_charge;
66 if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
67 if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
69 return std::make_pair(omegax, omegay);
◆ convertInDetToXaodCluster() [1/3]
Definition at line 21 of file ClusterConversionUtilities.cxx.
30 const float time = indetCluster.
time();
33 const auto& RDOs = indetCluster.
rdoList();
34 const auto& ToTs = indetCluster.
totList();
38 localPosition(0, 0) = localPos.x();
39 localPosition(1, 0) = localPos.y();
40 localPosition(2, 0) =
time;
43 localCovariance(0, 0) = localCov(0, 0);
44 localCovariance(1, 1) = localCov(1, 1);
45 localCovariance(2, 2) = timeResolution * timeResolution;
47 xaodCluster.
setMeasurement<3>(idHash, localPosition, localCovariance);
52 return StatusCode::SUCCESS;
◆ convertInDetToXaodCluster() [2/3]
Definition at line 55 of file ClusterConversionUtilities.cxx.
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);
72 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
74 const auto& RDOs = indetCluster.
rdoList();
75 const auto& ToTs = indetCluster.
totList();
76 const auto& charges = indetCluster.
chargeList();
82 xaodCluster.
setMeasurement<2>(idHash, localPosition, localCovariance);
96 return StatusCode::SUCCESS;
◆ convertInDetToXaodCluster() [3/3]
Definition at line 122 of file ClusterConversionUtilities.cxx.
131 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
133 const auto& RDOs = indetCluster.
rdoList();
136 xaodCluster.
setMeasurement<1>(idHash, localPosition, localCovariance);
142 return StatusCode::SUCCESS;
◆ convertSCT_LocalPosCov()
Definition at line 99 of file ClusterConversionUtilities.cxx.
101 auto localPos =
cluster.localPosition();
103 float localPosition = 0.f, localCovariance = 0.f;
104 if (element.isBarrel()) {
105 localPosition = localPos.x();
106 localCovariance = element.phiPitch() * element.phiPitch() * one_over_twelve;
110 if ( design ==
nullptr ) {
114 localPosition = localInPolar.
xPhi();
115 localCovariance = design->phiPitchPhi() * design->phiPitchPhi() * one_over_twelve;
◆ convertTrkToXaodPixelSpacePoint()
Definition at line 12 of file SpacePointConversionUtilities.cxx.
22 float r_3 =
static_cast<float>( Tp(0,2) );
23 float r_4 =
static_cast<float>( Tp(1,2) );
24 float r_5 =
static_cast<float>( Tp(2,2) );
27 float f22 =
static_cast<float>(
v(1,1) );
28 float wid =
static_cast<float>(
c->width().z() );
29 float cov = wid*wid*.08333;
31 float covr = 6 *
cov * (r_5*r_5);
32 float covz = 6 *
cov * (r_3*r_3 + r_4*r_4);
35 globPos.cast<
float>(),
40 return StatusCode::SUCCESS;
◆ convertTrkToXaodStripSpacePoint()
Definition at line 43 of file SpacePointConversionUtilities.cxx.
47 std::pair<unsigned int, unsigned int> idHashes = trkSpacePoint.
elementIdList();
58 std::pair<Amg::Vector3D, Amg::Vector3D>
e0 =
60 std::pair<Amg::Vector3D, Amg::Vector3D>
e1 =
63 auto stripCenter_1 = 0.5 * (
e0.first +
e0.second);
64 auto stripDir_1 =
e0.first -
e0.second;
65 auto trajDir_1 = 2. * ( stripCenter_1 -
vertex);
67 auto stripCenter_2 = 0.5 * (
e1.first +
e1.second);
68 auto stripDir_2 =
e1.first -
e1.second;
70 float topHalfStripLength = 0.5 * stripDir_1.norm();
71 Eigen::Matrix<double, 3, 1> topStripDirection = - stripDir_1 / (2. * topHalfStripLength);
72 Eigen::Matrix<double, 3, 1> topStripCenter = 0.5 * trajDir_1;
73 float bottomHalfStripLength = 0.5 * stripDir_2.norm();
74 Eigen::Matrix<double, 3, 1> bottomStripDirection = - stripDir_2 / (2. * bottomHalfStripLength);
75 Eigen::Matrix<double, 3, 1> stripCenterDistance = stripCenter_1 - stripCenter_2;
78 float f22 =
static_cast<float>(
v(1,1) );
80 float covr =
d0->isBarrel() ? .1 : 8.*f22;
81 float covz =
d0->isBarrel() ? 8.*f22 : .1;
83 xaodSpacePoint.
setSpacePoint({idHashes.first, idHashes.second},
84 globPos.cast<
float>(),
89 bottomHalfStripLength,
90 topStripDirection.cast<
float>(),
91 bottomStripDirection.cast<
float>(),
92 stripCenterDistance.cast<
float>(),
93 topStripCenter.cast<
float>());
95 return StatusCode::SUCCESS;
◆ convertXaodToInDetCluster() [1/3]
Definition at line 356 of file ClusterConversionUtilities.cxx.
362 float time = locPos(2,0);
368 errorMatrix.setIdentity();
369 errorMatrix.fillSymmetric(0, 0, xaodCluster.
localCovariance<3>()(0, 0));
370 errorMatrix.fillSymmetric(1, 1, xaodCluster.
localCovariance<3>()(1, 1));
371 float time_resolution = std::sqrt(xaodCluster.
localCovariance<3>()(2, 2));
373 double etaWidth = 1.3;
381 std::vector<Identifier>(xaodCluster.
rdoList()),
384 std::move(errorMatrix),
387 std::vector<int>(xaodCluster.
totList()));
389 return StatusCode::SUCCESS;
◆ convertXaodToInDetCluster() [2/3]
Definition at line 145 of file ClusterConversionUtilities.cxx.
151 if (design ==
nullptr) {
152 return StatusCode::FAILURE;
162 Amg::Vector3D globalPosition(globalPos(0, 0), globalPos(1, 0), globalPos(2, 0));
165 errorMatrix.setIdentity();
166 errorMatrix.fillSymmetric(0, 0, xaodCluster.
localCovariance<2>()(0, 0));
167 errorMatrix.fillSymmetric(1, 1, xaodCluster.
localCovariance<2>()(1, 1));
179 const std::vector<Identifier>& rod_list_cluster = xaodCluster.
rdoList();
180 const std::vector<float>& charge_list_cluster = xaodCluster.
chargeList();
181 if (rod_list_cluster.size() != charge_list_cluster.size()) {
182 return StatusCode::FAILURE;
185 for (std::size_t
i(0);
i<rod_list_cluster.size(); ++
i) {
186 const Identifier& this_rdo = rod_list_cluster.at(
i);
187 const float this_charge = charge_list_cluster.at(
i);
192 qRowMax = this_charge;
193 }
else if (
row == rowmax) {
194 qRowMax += this_charge;
199 qRowMin = this_charge;
200 }
else if (
row == rowmin) {
201 qRowMin += this_charge;
207 qColMax = this_charge;
208 }
else if (
col == colmax) {
209 qColMax += this_charge;
214 qColMin = this_charge;
215 }
else if (
col == colmin) {
216 qColMin += this_charge;
225 if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
226 if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
228 double etaWidth = design->widthFromColumnRange(colmin, colmax);
229 double phiWidth = design->widthFromRowRange(rowmin, rowmax);
236 std::vector<Identifier>(xaodCluster.
rdoList()),
238 std::vector<int>(xaodCluster.
totList()),
242 std::move(errorMatrix),
249 return StatusCode::SUCCESS;
◆ convertXaodToInDetCluster() [3/3]
Definition at line 252 of file ClusterConversionUtilities.cxx.
266 if (design ==
nullptr) {
267 return StatusCode::FAILURE;
270 const auto designShape = design->
shape();
273 const auto& rdoList = xaodCluster.
rdoList();
278 double pos_x = localPos(0, 0);
281 const Identifier firstStripId = rdoList.front();
283 int stripRow = stripID.
row(firstStripId);
286 pos_x = clusterPosition.
xPhi() + shift;
287 pos_y = clusterPosition.xEta();
297 const auto&
row = stripID.
row(rdoList.front());
307 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
308 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
313 const double col_x =
width.colRow().x();
314 const double col_y =
width.colRow().y();
316 double scale_factor = 1.;
319 else if ( col_x == 2 )
323 errorMatrix.setIdentity();
324 errorMatrix.fillSymmetric(0, 0, scale_factor * scale_factor *
width.phiR() *
width.phiR() * one_over_twelve);
325 errorMatrix.fillSymmetric(1, 1,
width.z() *
width.z() / col_y / col_y * one_over_twelve);
336 double sn2 = sn * sn;
337 double cs2 = 1. - sn2;
339 double v0 = errorMatrix(0,0) *
w *
w;
340 double v1 = errorMatrix(1,1);
341 errorMatrix.fillSymmetric( 0, 0, cs2 *
v0 + sn2 * v1 );
342 errorMatrix.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (
v0 - v1) );
343 errorMatrix.fillSymmetric( 1, 1, sn2 *
v0 + cs2 * v1 );
348 std::vector<Identifier>(rdoList),
351 std::move(errorMatrix));
353 return StatusCode::SUCCESS;
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
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)
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.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x), respectively.
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
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
Trk::Surface & surface()
Element Surface.
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.
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.
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
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.
int row(const Identifier &id) const
Eigen::Affine3d Transform3D
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
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, const std::vector< const xAOD::UncalibratedMeasurement * > &measurementIndexes)
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
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 std::pair< IdentifierHash, IdentifierHash > & elementIdList() const
return the pair of Ids of the element by reference
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.
Eigen::Matrix< float, N, N > MeasMatrix
double e0(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in pre-sampler
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.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
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.