]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDEPainter.cxx
ALIROOT-5420 Changes for CDH v3
[u/mrichter/AliRoot.git] / MUON / AliMUONDEPainter.cxx
index b2e69be8a563052a78b62de7d22d228c236024ee..0a586c58c67dbb377c39bd0bd756fcf56d14cd58 100644 (file)
@@ -32,7 +32,9 @@
 #include "AliMpSector.h"
 #include "AliMpSlat.h"
 #include "AliLog.h"
+#include <TMap.h>
 #include <TObjString.h>
+#include "AliMUONPainterGroup.h"
 
 /// \class AliMUONDEPainter
 ///
@@ -336,3 +338,39 @@ AliMUONDEPainter::Validate(const AliMUONAttPainter& attributes) const
   return norm;
 }
 
+//_____________________________________________________________________________
+void
+AliMUONDEPainter::SetResponder(Int_t depth)
+{
+  /// Select as responder the *first* group that has a given depth
+
+  AliDebug(1,Form("depth=%d",depth));
+  
+  if (!fPainterGroups)
+  {
+    CreateGroups();
+  }
+  
+  TIter next(fPainterGroups);
+  TObjString* str;
+  
+  fResponderGroup = 0x0;
+  
+  while ( ( str = static_cast<TObjString*>(next()) ) )
+  {
+    AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
+    if ( str->String() == "BUSPATCH" ) 
+    {
+      AliDebug(1,Form("group %s is indeed buspatch, using as responder %d",
+                      group->Type(),depth));
+      group->SetResponder(kTRUE);
+      fResponderGroup = group;
+      break;
+    }
+    else
+    {
+      group->SetResponder(kFALSE);
+    }
+  }
+}
+