}
//_____________________________________________________________________________
-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 {