@@ -555,20 +555,6 @@ void GeometryTGeo::fillMatrixCache(int mask)
555555 }
556556 }
557557
558- if ((mask & o2::math_utils::bit2Mask (o2::math_utils::TransformType::T2G)) && !getCacheT2G ().isFilled ()) {
559- LOG (warning) << " It is faster to use 2D rotation for T2G instead of full Transform3D matrices" ;
560- // matrices for Tracking to Global frame transformation
561- LOGP (info, " Loading {} T2G matrices from TGeo" , getName ());
562- auto & cacheT2G = getCacheT2G ();
563- cacheT2G.setSize (mSize );
564-
565- for (int i = 0 ; i < mSize ; i++) {
566- TGeoHMatrix& mat = createT2LMatrix (i);
567- mat.MultiplyLeft (extractMatrixSensor (i));
568- cacheT2G.setMatrix (Mat3D (mat), i);
569- }
570- }
571-
572558 if ((mask & o2::math_utils::bit2Mask (o2::math_utils::TransformType::T2GRot)) && !getCacheT2GRot ().isFilled ()) {
573559 // 2D rotation matrices for Tracking frame to Global rotations
574560 LOGP (info, " Loading {} T2G rotation 2D matrices" , getName ());
@@ -578,6 +564,25 @@ void GeometryTGeo::fillMatrixCache(int mask)
578564 cacheT2Gr.setMatrix (Rot2D (getSensorRefAlpha (i)), i);
579565 }
580566 }
567+
568+ if ((mask & o2::math_utils::bit2Mask (o2::math_utils::TransformType::T2G)) && !getCacheT2G ().isFilled ()) {
569+ LOG (debug) << " It is faster to use 2D rotation for T2G instead of full Transform3D matrices" ;
570+ // matrices for Tracking to Global frame transformation
571+ LOGP (info, " Creating {} T2G matrices from TGeo" , getName ());
572+ auto & cacheT2G = getCacheT2G ();
573+ cacheT2G.setSize (mSize );
574+
575+ for (int i = 0 ; i < mSize ; i++) {
576+ /*
577+ TGeoHMatrix& mat = createT2LMatrix(i);
578+ mat.MultiplyLeft(extractMatrixSensor(i));
579+ */
580+ Rot2D r (getSensorRefAlpha (i));
581+ Mat3D mat{};
582+ mat.SetComponents (r.getCos (), -r.getSin (), 0 ., 0 ., r.getSin (), r.getCos (), 0 ., 0 ., 0 ., 0 ., 1 ., 0 .);
583+ cacheT2G.setMatrix (mat, i);
584+ }
585+ }
581586}
582587
583588// __________________________________________________________________________
0 commit comments