@@ -420,33 +420,20 @@ TGeoHMatrix* GeometryTGeo::extractMatrixSensor(int index) const
420420 static int chipInGlo{0 };
421421
422422 // account for the difference between physical sensitive layer (where charge collection is simulated) and effective sensor thicknesses
423+ // in the ITS3 case this accounted by specialized functions
423424 double delta = Segmentation::SensorLayerThickness - Segmentation::SensorLayerThicknessEff;
424- #ifdef ENABLE_UPGRADES
425- if (mIsLayerITS3 [getLayer (index)]) {
426- delta = its3::SegmentationSuperAlpide::mSensorLayerThickness - its3::SegmentationSuperAlpide::mSensorLayerThicknessEff ;
427- }
428- #endif
429-
430425 static TGeoTranslation tra (0 ., 0.5 * delta, 0 .);
431-
426+ #ifdef ENABLE_UPGRADES // only apply for non ITS3 OB layers
427+ if (!mIsLayerITS3 [getLayer (index)]) {
428+ matTmp *= tra;
429+ }
430+ #else
432431 matTmp *= tra;
432+ #endif
433433
434434 return &matTmp;
435435}
436436
437- // __________________________________________________________________________
438- const o2::math_utils::Transform3D GeometryTGeo::getT2LMatrixITS3 (int isn, float alpha)
439- {
440- // create for sensor isn the TGeo matrix for Tracking to Local frame transformations
441- static TGeoHMatrix t2l;
442- t2l.Clear ();
443- t2l.RotateZ (alpha * RadToDeg ()); // rotate in direction of normal to the tangent to the cylinder
444- const TGeoHMatrix& matL2G = getMatrixL2G (isn);
445- const auto & matL2Gi = matL2G.Inverse ();
446- t2l.MultiplyLeft (&matL2Gi);
447- return Mat3D (t2l);
448- }
449-
450437// __________________________________________________________________________
451438void GeometryTGeo::Build (int loadTrans)
452439{
@@ -885,7 +872,7 @@ void GeometryTGeo::extractSensorXAlpha(int isn, float& x, float& alp)
885872#ifdef ENABLE_UPGRADES
886873 if (mIsLayerITS3 [iLayer]) {
887874 // We need to calcualte the line tangent at the mid-point in the geometry
888- const auto radius = o2::its3::constants::radii[iLayer];
875+ auto radius = o2::its3::constants::radii[iLayer];
889876 const auto phi1 = o2::its3::constants::tile::width / radius;
890877 const auto phi2 = o2::its3::constants::pixelarray::width / radius + phi1;
891878 const auto phi3 = (phi2 - phi1) / 2 .; // mid-point in phi
@@ -926,6 +913,24 @@ TGeoHMatrix& GeometryTGeo::createT2LMatrix(int isn)
926913 return t2l;
927914}
928915
916+ // __________________________________________________________________________
917+ const o2::math_utils::Transform3D GeometryTGeo::getT2LMatrixITS3 (int isn, float alpha)
918+ {
919+ // create for sensor isn the TGeo matrix for Tracking to Local frame transformations with correction for effective thickness
920+ static TGeoHMatrix t2l;
921+ t2l.Clear ();
922+ t2l.RotateZ (alpha * RadToDeg ()); // rotate in direction of normal to the tangent to the cylinder
923+ const TGeoHMatrix& matL2G = getMatrixL2G (isn);
924+ const auto & matL2Gi = matL2G.Inverse ();
925+ t2l.MultiplyLeft (&matL2Gi);
926+ // correction for effective sensor thickness
927+ static TGeoTranslation tra;
928+ tra.SetDx (SuperSegmentation::mSensorLayerThicknessCorr * std::cos (alpha));
929+ tra.SetDy (SuperSegmentation::mSensorLayerThicknessCorr * std::sin (alpha));
930+ t2l *= tra;
931+ return Mat3D (t2l);
932+ }
933+
929934// __________________________________________________________________________
930935int GeometryTGeo::extractVolumeCopy (const char * name, const char * prefix) const
931936{
0 commit comments