From d2283f4248ccdfdc5d6420a41dd25a8ff0a0c7ac Mon Sep 17 00:00:00 2001
From: Eoin Clerkin <e.clerkin@gsi.de>
Date: Tue, 13 Jun 2023 11:10:03 +0200
Subject: [PATCH] Remove CorrectMediaId function

Found to be mixing geometry material. See redmine #2885.
---
 core/base/utils/CbmGeometryUtils.cxx | 12 ------------
 core/base/utils/CbmGeometryUtils.h   |  1 -
 2 files changed, 13 deletions(-)

diff --git a/core/base/utils/CbmGeometryUtils.cxx b/core/base/utils/CbmGeometryUtils.cxx
index 6f56baab56..41480c686e 100644
--- a/core/base/utils/CbmGeometryUtils.cxx
+++ b/core/base/utils/CbmGeometryUtils.cxx
@@ -58,17 +58,6 @@ namespace Cbm
       LOG(info) << "****";
     }
 
-    void CorrectMediaId()
-    {
-      TList* media = gGeoManager->GetListOfMedia();
-      TIter next(media);
-      TGeoMedium* med;
-      Int_t counter {0};
-      while ((med = static_cast<TGeoMedium*>(next()))) {
-        med->SetId(counter++);
-      }
-    }
-
     void RemoveDuplicateMaterials()
     {
       // Revove duplicate materials
@@ -177,7 +166,6 @@ namespace Cbm
         }
       }
 
-      Cbm::GeometryUtils::CorrectMediaId();
       Cbm::GeometryUtils::RemoveDuplicateMaterials();
       Cbm::GeometryUtils::RemoveDuplicateMedia();
 
diff --git a/core/base/utils/CbmGeometryUtils.h b/core/base/utils/CbmGeometryUtils.h
index 71644889b1..401e189fbf 100644
--- a/core/base/utils/CbmGeometryUtils.h
+++ b/core/base/utils/CbmGeometryUtils.h
@@ -13,7 +13,6 @@ namespace Cbm
   {
     void PrintMedia();
     void PrintMaterials();
-    void CorrectMediaId();
     void ReAssignMediaId();
     void RemoveDuplicateMaterials();
     void RemoveDuplicateMedia();
-- 
GitLab