]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant4/TG4IntMap.cxx
added boolean argument (option fir printing warning) in GetSecond()
[u/mrichter/AliRoot.git] / TGeant4 / TG4IntMap.cxx
index f078c29cd5d1d90b26416e292a28aaf7c8583b0e..fbe89ee49e803fb7a6632db964ba1174eda93eb4 100644 (file)
@@ -75,16 +75,18 @@ G4bool TG4IntMap::Add(const G4String& first, G4int second)
 }
 
 //_____________________________________________________________________________
-G4int TG4IntMap::GetSecond(const G4String& name)
+G4int TG4IntMap::GetSecond(const G4String& name, G4bool warn)
 {
 // Gets second name associated with given name.
 // ---
 
   MapIterator i = fMap.find(name);
   if (i == fMap.end()) {
-    G4String text = "   TG4IntMap::GetSecond: ";
-    text = text + name + " is not defined.";
-    TG4Globals::Warning(text);
+    if (warn) {
+      G4String text = "   TG4IntMap::GetSecond: ";
+      text = text + name + " is not defined.";
+      TG4Globals::Warning(text);
+    }  
     return 0;
   }  
   else {