From bcc6d832dd4c5efcecb79f4e107ccf74efad451b Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Mon, 5 Dec 2022 19:57:47 +0100
Subject: [PATCH] Checksum debugging

---
 DDCore/src/plugins/DetectorChecksum.cpp | 10 +++-------
 examples/CLICSiD/CMakeLists.txt         |  4 ++--
 examples/ClientTests/CMakeLists.txt     |  4 ++--
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/DDCore/src/plugins/DetectorChecksum.cpp b/DDCore/src/plugins/DetectorChecksum.cpp
index 51d78d54f..cfb25c2e9 100644
--- a/DDCore/src/plugins/DetectorChecksum.cpp
+++ b/DDCore/src/plugins/DetectorChecksum.cpp
@@ -173,10 +173,6 @@ const DetectorChecksum::entry_t& DetectorChecksum::handleSolid(Solid solid) cons
     const TGeoShape* shape = solid.ptr();
     auto  log = logger();
 
-    if ( strncmp(solid.name(), "LumiCal_envelope_shape_0x", strlen("LumiCal_envelope_shape_0x"))==0 )    {
-      printout(INFO, "DetectorChecksum","---> %s", solid.name());
-    }
-
     if ( !shape )  {
       log << "<shape type=\"INVALID\"></shape>)";
       iso = geo.emplace(solid, make_entry(log)).first;
@@ -1273,7 +1269,7 @@ void DetectorChecksum::dump_sensitives()   const   {
 
 static long create_checksum(Detector& description, int argc, char** argv) {
   std::vector<std::string> detectors;
-  int precision = 6, newline = 0, level = 1, readout = 0, debug = 0;
+  int precision = 6, newline = 1, level = 1, readout = 0, debug = 0;
   int dump_elements = 0, dump_materials = 0, dump_solids = 0, dump_volumes = 0;
   int dump_placements = 0, dump_detelements = 0, dump_sensitives = 0;
   int dump_iddesc = 0, dump_segmentations = 0;
@@ -1298,8 +1294,8 @@ static long create_checksum(Detector& description, int argc, char** argv) {
       level = ::atol(argv[++i]);
     else if ( 0 == ::strncmp("-debug", argv[i],5) && (i+1)<argc )
       debug = ::atol(argv[++i]);
-    else if ( 0 == ::strncmp("-newline",argv[i],5) )
-      newline = 1;
+    else if ( 0 == ::strncmp("+newline",argv[i],5) )
+      newline = 0;
     else if ( 0 == ::strncmp("-readout",argv[i],5) )
       readout = 1;
     else if ( 0 == ::strncmp("-dump_elements",argv[i],10) )
diff --git a/examples/CLICSiD/CMakeLists.txt b/examples/CLICSiD/CMakeLists.txt
index 6d03f40eb..d17d446d9 100644
--- a/examples/CLICSiD/CMakeLists.txt
+++ b/examples/CLICSiD/CMakeLists.txt
@@ -132,7 +132,7 @@ endif()
 # Checksum test of the EcalBarrel sub-detector
 dd4hep_add_test_reg( CLICSiD_check_checksum_EcalBarrel
   COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
-  EXEC_ARGS  geoPluginRun -input ${DD4hep_ROOT}/DDDetectors/compact/SiD.xml -plugin DD4hepDetectorChecksum -newline -readout -detector EcalBarrel
+  EXEC_ARGS  geoPluginRun -input ${DD4hep_ROOT}/DDDetectors/compact/SiD.xml -plugin DD4hepDetectorChecksum -readout -detector EcalBarrel
   REGEX_PASS "Combined hash code                      91ac921728a25197  \\(10375 sub-codes\\)"
   REGEX_FAIL "Exception;EXCEPTION;ERROR"
 )
@@ -140,7 +140,7 @@ dd4hep_add_test_reg( CLICSiD_check_checksum_EcalBarrel
 # Checksum test of the full detector
 dd4hep_add_test_reg( CLICSiD_check_checksum_full
   COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
-  EXEC_ARGS  geoPluginRun -input ${DD4hep_ROOT}/DDDetectors/compact/SiD.xml -plugin DD4hepDetectorChecksum -newline -readout -dump_detelements -dump_placements -dump_volumes -dump_solids -debug 3
+  EXEC_ARGS  geoPluginRun -input ${DD4hep_ROOT}/DDDetectors/compact/SiD.xml -plugin DD4hepDetectorChecksum -readout 
   REGEX_PASS "Combined hash code                      15a55d11308fce12  \\(3395674 sub-codes\\)"
   REGEX_FAIL "Exception;EXCEPTION;ERROR"
 )
diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt
index 721d03b88..49f544d49 100644
--- a/examples/ClientTests/CMakeLists.txt
+++ b/examples/ClientTests/CMakeLists.txt
@@ -373,7 +373,7 @@ endforeach()
 # Checksum test of the Minitel3 sub-detector
 dd4hep_add_test_reg( MiniTel_check_checksum_Minitel3
   COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
-  EXEC_ARGS  geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/MiniTelGenerate.xml -plugin DD4hepDetectorChecksum -newline -readout -detector Minitel3
+  EXEC_ARGS  geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/MiniTelGenerate.xml -plugin DD4hepDetectorChecksum -readout -detector Minitel3
   REGEX_PASS "Combined hash code                      36773df7c4d6cf2b  \\(52 sub-codes\\)"
   REGEX_FAIL "Exception;EXCEPTION;ERROR"
 )
@@ -381,7 +381,7 @@ dd4hep_add_test_reg( MiniTel_check_checksum_Minitel3
 # Checksum test of the full detector
 dd4hep_add_test_reg( MiniTel_check_checksum_full
   COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
-  EXEC_ARGS  geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/MiniTelGenerate.xml -plugin DD4hepDetectorChecksum -newline -readout
+  EXEC_ARGS  geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/MiniTelGenerate.xml -plugin DD4hepDetectorChecksum -readout
   REGEX_PASS "Combined hash code                      99b55eb7a563d587  \\(201 sub-codes\\)"
   REGEX_FAIL "Exception;EXCEPTION;ERROR"
 )
-- 
GitLab