From c3c9838941f76eed06ec01f64f36317b18be2b02 Mon Sep 17 00:00:00 2001
From: Johannes Junggeburth <johannes.josef.junggeburth@cern.ch>
Date: Thu, 9 May 2024 00:26:56 +0200
Subject: [PATCH] Fix TPCnv unit test

---
 .../MuonReadoutGeometry/MMReadoutElement.h               | 2 +-
 .../MuonReadoutGeometry/src/MMReadoutElement.cxx         | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
index c4d798b5cd6c..c3b1a331e428 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
@@ -155,7 +155,7 @@ namespace MuonGM {
         std::array<MuonChannelDesign, 4> m_etaDesign{};
 
         std::array<int, 4> m_nStrips{};     // #of active strips
-        static constexpr int m_nlayers{4};  // #of gas gaps
+        int m_nlayers{0};  // #of gas gaps
 
         const NswPassivationDbData* m_passivData{nullptr};
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
index 3cecc5ac8c02..420a3b2c3622 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
@@ -89,21 +89,20 @@ namespace MuonGM {
             m_lWidthChamber = 2*trd->getYHalfLength2();       // top base length (full chamber)
             m_lengthChamber = 2*trd->getZHalfLength();        // height of the trapezoid (full chamber)         
         } else {
-            THROW_EXCEPTION("Expected a Geo trd "<<printGeoShape(pvc->getLogVol()->getShape()));
+            ATH_MSG_DEBUG("Expected a GeoTrd but got "<<printGeoShape(pvc->getLogVol()->getShape()));
         }
 
         std::vector<GeoChildNodeWithTrf> children{getChildrenWithRef(pvc, false)};
-        int llay = 0;
         for (const GeoChildNodeWithTrf& child : children) {
             ATH_MSG_VERBOSE("Child node "<<child.nodeName<<" "<<child.volume->getLogVol()->getName()); 
             if (child.volume->getLogVol()->getName().find("Sensitive") == std::string::npos) {
                 continue;
             }
-            ++llay;
-            if (llay > 4) {
+            ++m_nlayers;
+            if (m_nlayers > 4) {
                 THROW_EXCEPTION("number of MM layers > 4: increase transform array size" );
             }
-            m_Xlg[llay - 1] =  child.transform;
+            m_Xlg[m_nlayers - 1] =  child.transform;
             // save layer dimensions
             if (foundShape) {
                 continue;
-- 
GitLab