From 98e73f4e94605ccc5e7caa6e67905fb00b269c05 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Mon, 8 Nov 2021 22:34:41 +0100
Subject: [PATCH] In check_media macro, do not stop on 1st missing file and
 print all

---
 macro/geometry/check_media.C | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/macro/geometry/check_media.C b/macro/geometry/check_media.C
index f4e8b2791c..06ecdaf434 100644
--- a/macro/geometry/check_media.C
+++ b/macro/geometry/check_media.C
@@ -28,6 +28,7 @@ void check_media(const char* dataset = "test")
 
 
   int wrong_media {0};
+  int missing_file {0};
   TGeoNode* topNode = gGeoManager->GetTopNode();
   TObjArray* nodes  = topNode->GetNodes();
   for (Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
@@ -37,15 +38,15 @@ void check_media(const char* dataset = "test")
     std::cout << "Checking node " << nodename << std::endl;
     std::pair<int, int> retval = CheckGeometry(nodename);
     if (-1 == retval.second) {
-      RemoveGeoManager();
-      return;
+      ++missing_file;
+      continue;
     }
     wrong_media += retval.second;
     std::cout << "Checked " << retval.first << " sub nodes from " << nodename << " and found " << retval.second
               << " with wrongly assigned media" << std::endl;
   }
 
-  if (0 == wrong_media) {
+  if (0 == wrong_media && 0 == missing_file) {
     std::cout << std::endl;
     std::cout << "Test passed" << std::endl;
     std::cout << "All ok" << std::endl;
@@ -53,6 +54,7 @@ void check_media(const char* dataset = "test")
   else {
     std::cout << std::endl;
     std::cout << "Test failed" << std::endl;
+    std::cout << "In total " << missing_file << " files were missing" << std::endl;
     std::cout << "Found in total " << wrong_media << " nodes with wrongly assigned media" << std::endl;
   }
   RemoveGeoManager();
-- 
GitLab