]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDEPainter.cxx
Bug fix for HMPID bits in readout list.
[u/mrichter/AliRoot.git] / MUON / AliMUONDEPainter.cxx
index 6c9f68ddcfba869ab3c391f605de6a924b8ca515..c79b7d6bb1516ccb12580bc9aa7543387f509de4 100644 (file)
@@ -20,7 +20,7 @@
 #include "AliMUONBusPatchPainter.h"
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONPCBPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
@@ -32,7 +32,9 @@
 #include "AliMpSector.h"
 #include "AliMpSlat.h"
 #include "AliLog.h"
+#include <TMap.h>
 #include <TObjString.h>
+#include "AliMUONPainterGroup.h"
 
 /// \class AliMUONDEPainter
 ///
@@ -54,6 +56,14 @@ fDetElemId(-1)
   /// default ctor
 }
 
+//_____________________________________________________________________________
+AliMUONDEPainter::AliMUONDEPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1)
+{
+  /// default streaming ctor
+}
+
 //_____________________________________________________________________________
 AliMUONDEPainter::AliMUONDEPainter(const AliMUONAttPainter& att, Int_t detElemId)
 : AliMUONVPainter("DE"),
@@ -120,8 +130,8 @@ fDetElemId(detElemId)
   {
     const AliMpSector* sector = h->GetSector(DetElemId(),planeType);
 
-    Double_t xl(sector->Dimensions().X());
-    Double_t yl(sector->Dimensions().Y());
+    Double_t xl(sector->GetDimensionX());
+    Double_t yl(sector->GetDimensionY());
     
     h->Local2Global(fDetElemId,xl,yl,0.0,x,y,z);
   }
@@ -130,7 +140,7 @@ fDetElemId(detElemId)
     AliFatal("Not implemented for trigger !!!");
   }
   
-  AliMUONPainterContour* contour = h->GetContour(ContourName());
+  AliMUONContour* contour = h->GetContour(ContourName());
   
   TObjArray contourArray;
     
@@ -232,6 +242,33 @@ AliMUONDEPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
   return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
 }
 
+//_____________________________________________________________________________
+void
+AliMUONDEPainter::FillManuList(TObjArray& manuList) const
+{
+  /// Fill (append to) manu list
+  TIter next(Children());
+  AliMUONVPainter* p;
+  
+  while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
+  {
+    if ( p->IsA() == AliMUONBusPatchPainter::Class() )
+    {
+      // Only consider bus patch painters (and not PCB ones),
+      // in order not to double count some manus
+      p->FillManuList(manuList);
+    }
+  }
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONDEPainter::IsIncluded() const
+{
+  /// whether this detection element is included in the readout or not
+  return ( InteractiveReadOutConfig()->DetectionElement(fDetElemId) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONDEPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
@@ -247,7 +284,7 @@ AliMUONDEPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________
@@ -291,8 +328,8 @@ AliMUONDEPainter::Validate(const AliMUONAttPainter& attributes) const
 
     AliMp::CathodType cathode = AliMpDEManager::GetCathod(fDetElemId,planeType);
     
-    if ( cathode == AliMp::kCath0 && norm.IsCathode1() ||
-         cathode == AliMp::kCath1 && norm.IsCathode0() ) 
+    if ( (cathode == AliMp::kCath0 && norm.IsCathode1()) ||
+         (cathode == AliMp::kCath1 && norm.IsCathode0()) ) 
     {
       norm.SetValid(kFALSE);
     }
@@ -301,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",
+                      group->Type(),depth));
+      group->SetResponder(kTRUE);
+      fResponderGroup = group;
+      break;
+    }
+    else
+    {
+      group->SetResponder(kFALSE);
+    }
+  }
+}
+