From 8a00d810c134fd7c819d16d02d5c39dff2b77aa4 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 19 Apr 2024 17:35:22 +0200 Subject: [PATCH] workstopgo Signed-off-by: Felix Schlepper --- .../src/TPCITSMatchingSpec.cxx | 2 +- .../ITS/base/include/ITSBase/GeometryTGeo.h | 3 -- .../ITSMFT/ITS/base/src/GeometryTGeo.cxx | 28 +++++++++---------- .../ITS3/reconstruction/src/IOUtils.cxx | 4 +-- .../ITS3/workflow/src/TrackerSpec.cxx | 2 +- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx index df04205a87c88..870579737eba6 100644 --- a/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx @@ -163,7 +163,7 @@ void TPCITSMatchingDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) return; } if (matcher == ConcreteDataMatcher("ITS", "GEOMTGEO", 0)) { - LOG(info) << "ITS GeomtetryTGeo loaded from ccdb"; + LOG(info) << "ITS GeometryTGeo loaded from ccdb"; o2::its::GeometryTGeo::adopt((o2::its::GeometryTGeo*)obj); return; } diff --git a/Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h b/Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h index fa9da99eb2d8b..6172a02286abd 100644 --- a/Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h +++ b/Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h @@ -333,9 +333,6 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo /// Sym name of the chip in the given layer/halfbarrel/stave/substave/module static const char* composeSymNameChip(int lr, int hba, int sta, int ssta, int mod, int chip, bool isITS3 = false); - // get tracking frame alpha for ITS3 clusters in global coordinates - static float getAlphaFromGlobalITS3(const o2::math_utils::Point3D& gloXYZ); - // create matrix for transformation from tracking frame to local one for ITS3 const Mat3D getT2LMatrixITS3(int isn, float alpha); diff --git a/Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx b/Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx index f22e29a5bc120..b52fd8f58320f 100644 --- a/Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx +++ b/Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx @@ -434,15 +434,6 @@ TGeoHMatrix* GeometryTGeo::extractMatrixSensor(int index) const return &matTmp; } -//__________________________________________________________________________ -float GeometryTGeo::getAlphaFromGlobalITS3(const o2::math_utils::Point3D& gloXYZ) -{ - // since ITS3 is cylindrical alpha = phi in global - auto alpha = std::atan2(gloXYZ.Y(), gloXYZ.X()); - o2::math_utils::bringTo02Pi(alpha); - return alpha; -} - //__________________________________________________________________________ const o2::math_utils::Transform3D GeometryTGeo::getT2LMatrixITS3(int isn, float alpha) { @@ -893,11 +884,20 @@ void GeometryTGeo::extractSensorXAlpha(int isn, float& x, float& alp) #ifdef ENABLE_UPGRADES if (mIsLayerITS3[iLayer]) { - // in this case we need the line tangent to the circumference - double radius = 0.; - radius = o2::its3::constants::radii[iLayer]; - locA[1] = radius; - locB[1] = radius; + // We need to calcualte the line tangent at the mid-point in the geometry + const auto radius = o2::its3::constants::radii[iLayer]; + const auto phi1 = o2::its3::constants::tile::width / radius; + const auto phi2 = o2::its3::constants::pixelarray::width / radius + phi1; + const auto phi3 = (phi2 - phi1) / 2.; // mid-point in phi + const auto x = radius * std::cos(phi3); + const auto y = radius * std::sin(phi3); + // For the tangent we make the parametric line equation y = m * x - c + const auto m = x / y; + const auto c = y - m * x; + // Now we can given any x calulate points along this line, we pick points far away, + // the calculation of the normal should work then below. + locA[1] = m * locA[0] + c; + locB[1] = m * locB[0] + c; } #endif diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx index 918ca26c3ac5b..1b71301b5a333 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx @@ -98,14 +98,12 @@ int loadROFrameDataITS3(its::TimeFrame* tf, auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ; // for cylindrical layers we have a different alpha for each cluster, for regular silicon detectors instead a single alpha for the whole sensor - float alpha = 0.; + float alpha = geom->getSensorRefAlpha(sensorID); o2::math_utils::Point3D trkXYZ; if (isITS3) { - alpha = geom->getAlphaFromGlobalITS3(gloXYZ); // Inverse transformation to the local --> tracking trkXYZ = geom->getT2LMatrixITS3(sensorID, alpha) ^ locXYZ; } else { - alpha = geom->getSensorRefAlpha(sensorID); // Inverse transformation to the local --> tracking trkXYZ = geom->getMatrixT2L(sensorID) ^ locXYZ; } diff --git a/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx b/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx index 3be90d6eeaf1b..cc3476a2b75e4 100644 --- a/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx +++ b/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx @@ -342,7 +342,7 @@ void TrackerDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) return; } if (matcher == ConcreteDataMatcher("ITS", "GEOMTGEO", 0)) { - LOG(info) << "IT3 GeomtetryTGeo loaded from ccdb"; + LOG(info) << "IT3 GeometryTGeo loaded from ccdb"; o2::its::GeometryTGeo::adopt((o2::its::GeometryTGeo*)obj); return; }