From 4fc82f8530a14a0cbfba107003d6715310d04c84 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Wed, 8 May 2019 19:00:53 +0200
Subject: [PATCH] Add debug printout in material conversion

---
 DDCore/src/AlignmentsCalculator.cpp |  2 --
 DDG4/src/Geant4Converter.cpp        | 11 ++++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/DDCore/src/AlignmentsCalculator.cpp b/DDCore/src/AlignmentsCalculator.cpp
index ed09c3408..2022a1b79 100644
--- a/DDCore/src/AlignmentsCalculator.cpp
+++ b/DDCore/src/AlignmentsCalculator.cpp
@@ -217,7 +217,6 @@ Result AlignmentsCalculator::compute(const OrderedDeltas& deltas,
 Result AlignmentsCalculator::compute(const std::map<DetElement, Delta>& deltas,
                                      ConditionsMap& alignments)  const
 {
-  Result  result;
   Calculator::Context context(alignments);
   // This is a tricky one. We absolutely need the detector elements ordered
   // by their depth aka. the distance to /world.
@@ -238,7 +237,6 @@ Result AlignmentsCalculator::compute(const std::map<DetElement, Delta>& deltas,
 Result AlignmentsCalculator::compute(const std::map<DetElement, const Delta*>& deltas,
                                      ConditionsMap& alignments)  const
 {
-  Result  result;
   Calculator::Context context(alignments);
   // This is a tricky one. We absolutely need the detector elements ordered
   // by their depth aka. the distance to /world.
diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp
index f083f554c..fc52e3387 100644
--- a/DDG4/src/Geant4Converter.cpp
+++ b/DDG4/src/Geant4Converter.cpp
@@ -401,9 +401,6 @@ void* Geant4Converter::handleMaterial(const string& name, Material medium) const
         mat = new G4Material(name, z, a, density, state, 
                              material->GetTemperature(), material->GetPressure());
       }
-      stringstream str;
-      str << (*mat);
-      printout(lvl, "Geant4Converter", "++ Created G4 %s", str.str().c_str());
 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0)
       /// Attach the material properties if any
       G4MaterialPropertiesTable* tab = 0;
@@ -447,6 +444,14 @@ void* Geant4Converter::handleMaterial(const string& name, Material medium) const
         tab->AddConstProperty(n->GetName(), v);
       }
 #endif
+      auto* ionization = mat->GetIonisation();
+      stringstream str;
+      str << (*mat) << endl;
+      if ( ionization )
+        str << "              log(MEE): " << ionization->GetLogMeanExcEnergy();
+      else
+        str << "              log(MEE): UNKNOWN";
+      printout(lvl, "Geant4Converter", "++ Created G4 %s", str.str().c_str());
     }
     info.g4Materials[medium] = mat;
   }
-- 
GitLab