]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding a possibility to supress error message in GetDetElement()
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Nov 2005 15:31:39 +0000 (15:31 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Nov 2005 15:31:39 +0000 (15:31 +0000)
if detection element with given Id does not exist

MUON/AliMUONGeometryModuleTransformer.cxx
MUON/AliMUONGeometryModuleTransformer.h

index e06897d3ac535415c69bfc7905771f8326e8a84f..8a0c6ddc7fa615c6056dfa0cb963483dc5899ee5 100644 (file)
@@ -178,19 +178,20 @@ void  AliMUONGeometryModuleTransformer::SetTransformation(
 
 //______________________________________________________________________________
 AliMUONGeometryDetElement*
-AliMUONGeometryModuleTransformer::GetDetElement(Int_t detElemId) const
+AliMUONGeometryModuleTransformer::GetDetElement(Int_t detElemId, Bool_t warn) const
 {
 /// Return the detection element specified by detElemId.
 /// Give error if detection element is not defined.
 
    // Get detection element
    AliMUONGeometryDetElement* detElement
-     = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId);
+     = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId, warn);
 
    if (!detElement) {
-     AliErrorStream() 
-       << "Detection element " << detElemId
-       << " not found in module " << fModuleId << endl;
+     if (warn)
+       AliErrorStream() 
+         << "Detection element " << detElemId
+         << " not found in module " << fModuleId << endl;
      return 0;
    }  
 
index c31a847440ccd911b88a04d1032a2a116372aa56..f4544a15c2400a35abb72caf874c99ba4e476f15 100644 (file)
@@ -59,7 +59,8 @@ class AliMUONGeometryModuleTransformer : public TObject
     const TGeoCombiTrans*  GetTransformation() const;    
 
     AliMUONGeometryStore*       GetDetElementStore() const;
-    AliMUONGeometryDetElement*  GetDetElement(Int_t detElemId) const;    
+    AliMUONGeometryDetElement*  GetDetElement(
+                                   Int_t detElemId, Bool_t warn = true) const;    
 
   protected:
     AliMUONGeometryModuleTransformer(const AliMUONGeometryModuleTransformer& rhs);