Skip to content

Commit a6b813f

Browse files
committed
ITS3: remove unnecessary recalculation of trackingframe
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 3d7fcdb commit a6b813f

File tree

4 files changed

+8
-36
lines changed

4 files changed

+8
-36
lines changed

Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,6 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
333333
/// Sym name of the chip in the given layer/halfbarrel/stave/substave/module
334334
static const char* composeSymNameChip(int lr, int hba, int sta, int ssta, int mod, int chip, bool isITS3 = false);
335335

336-
// create matrix for transformation from tracking frame to local one for ITS3
337-
const Mat3D getT2LMatrixITS3(int isn, float alpha);
338-
339336
TString getMatrixPath(int index) const;
340337

341338
/// Get the transformation matrix of the SENSOR (not necessary the same as the chip)

Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -899,19 +899,6 @@ TGeoHMatrix& GeometryTGeo::createT2LMatrix(int isn)
899899
return t2l;
900900
}
901901

902-
//__________________________________________________________________________
903-
const o2::math_utils::Transform3D GeometryTGeo::getT2LMatrixITS3(int isn, float alpha)
904-
{
905-
// create for sensor isn the TGeo matrix for Tracking to Local frame transformations with correction for effective thickness
906-
static TGeoHMatrix t2l;
907-
t2l.Clear();
908-
t2l.RotateZ(alpha * RadToDeg()); // rotate in direction of normal to the tangent to the cylinder
909-
const TGeoHMatrix& matL2G = getMatrixL2G(isn);
910-
const auto& matL2Gi = matL2G.Inverse();
911-
t2l.MultiplyLeft(&matL2Gi);
912-
return Mat3D(t2l);
913-
}
914-
915902
//__________________________________________________________________________
916903
int GeometryTGeo::extractVolumeCopy(const char* name, const char* prefix) const
917904
{

Detectors/Upgrades/ITS3/macros/align/CheckResidualsITS3.C

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,11 @@ std::optional<Cluster> propagateTo(Track& trk, const o2::itsmft::CompClusterExt&
6666
++cTotal;
6767
auto chipID = clus.getSensorID();
6868
float sigmaY2{0}, sigmaZ2{0}, sigmaYZ{0};
69+
auto isITS3 = o2::its3::constants::detID::isDetITS3(chipID);
6970
const float alpha = o2::its::GeometryTGeo::Instance()->getSensorRefAlpha(clus.getSensorID()); // alpha for the tracking frame
7071
const auto locC = o2::its3::ioutils::extractClusterData(clus, pattIt, mDict, sigmaY2, sigmaZ2); // get cluster in sensor local frame with errors
71-
Point3D trkC;
72-
auto isITS3 = o2::its3::constants::detID::isDetITS3(chipID);
73-
if (isITS3) {
74-
trkC = o2::its::GeometryTGeo::Instance()->getT2LMatrixITS3(chipID, alpha) ^ (locC); // cluster position in the tracking frame
75-
} else {
76-
trkC = o2::its::GeometryTGeo::Instance()->getMatrixT2L(chipID) ^ (locC); // cluster position in the tracking frame
77-
}
78-
const auto gloC = o2::its::GeometryTGeo::Instance()->getMatrixL2G(chipID)(locC); // global cluster position
72+
Point3D trkC = o2::its::GeometryTGeo::Instance()->getMatrixT2L(chipID) ^ (locC); // cluster position in the tracking frame
73+
const auto gloC = o2::its::GeometryTGeo::Instance()->getMatrixL2G(chipID)(locC); // global cluster position
7974
const auto bz = o2::base::Propagator::Instance()->getNominalBz();
8075

8176
// rotate the parameters to the tracking frame then propagate to the clusters'x

Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ void convertCompactClusters(gsl::span<const itsmft::CompClusterExt> clusters,
4848
float sigmaY2, sigmaZ2, sigmaYZ = 0;
4949
auto locXYZ = extractClusterData(c, pattIt, dict, sigmaY2, sigmaZ2);
5050
const auto detID = c.getSensorID();
51-
auto& cl3d = output.emplace_back(detID,
52-
(its3::constants::detID::isDetITS3(detID) ? geom->getT2LMatrixITS3(detID, geom->getSensorRefAlpha(detID)) : geom->getMatrixT2L(detID)) ^ locXYZ); // local --> tracking
51+
auto& cl3d = output.emplace_back(detID, geom->getMatrixT2L(detID) ^ locXYZ); // local --> tracking
5352
if (applyMisalignment) {
5453
auto lrID = geom->getLayer(detID);
5554
sigmaY2 += conf.sysErrY2[lrID];
@@ -79,7 +78,6 @@ int loadROFrameDataITS3(its::TimeFrame<7>* tf,
7978
for (int clusterId{rof.getFirstEntry()}; clusterId < rof.getFirstEntry() + rof.getNEntries(); ++clusterId) {
8079
auto& c = clusters[clusterId];
8180
auto sensorID = c.getSensorID();
82-
auto isITS3 = its3::constants::detID::isDetITS3(sensorID);
8381
auto layer = geom->getLayer(sensorID);
8482

8583
float sigmaY2{0}, sigmaZ2{0}, sigmaYZ{0};
@@ -90,16 +88,11 @@ int loadROFrameDataITS3(its::TimeFrame<7>* tf,
9088
// Transformation to the local --> global
9189
auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ;
9290

93-
// for cylindrical layers we have a different alpha for each cluster, for regular silicon detectors instead a single alpha for the whole sensor
91+
// Inverse transformation to the local --> tracking
92+
o2::math_utils::Point3D<float> trkXYZ = geom->getMatrixT2L(sensorID) ^ locXYZ;
93+
94+
// Tracking alpha angle
9495
float alpha = geom->getSensorRefAlpha(sensorID);
95-
o2::math_utils::Point3D<float> trkXYZ;
96-
if (isITS3) {
97-
// Inverse transformation to the local --> tracking
98-
trkXYZ = geom->getT2LMatrixITS3(sensorID, alpha) ^ locXYZ;
99-
} else {
100-
// Inverse transformation to the local --> tracking
101-
trkXYZ = geom->getMatrixT2L(sensorID) ^ locXYZ;
102-
}
10396

10497
tf->addTrackingFrameInfoToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), trkXYZ.x(), alpha,
10598
std::array<float, 2>{trkXYZ.y(), trkXYZ.z()},

0 commit comments

Comments
 (0)