]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPCBPainter.cxx
Fixes for #86059: Install data when ALICE_ROOT does not point to source (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONPCBPainter.cxx
index c07aa4a8a46b026153b5cb3fb26a81c56c5a97c7..4553643c40c12dbb320607d863029165ecea2376 100644 (file)
@@ -24,7 +24,7 @@
 #include "AliMUONPCBPainter.h"
 
 #include "AliMUONManuPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
 ClassImp(AliMUONPCBPainter)
 /// \endcond
 
+//_____________________________________________________________________________
+AliMUONPCBPainter::AliMUONPCBPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1),
+fPCBIndex(-1)
+{
+  /// root streaming ctor
+}
+
 //_____________________________________________________________________________
 AliMUONPCBPainter::AliMUONPCBPainter()
 : AliMUONVPainter(),
@@ -56,52 +65,52 @@ AliMUONPCBPainter::AliMUONPCBPainter(const AliMUONAttPainter& att,
   fDetElemId(detElemId),
   fPCBIndex(pcbNumber)
 {
-    /// Ctor
-
-    SetAttributes(att);
-    
-    AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-    
-    AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
-    
-    const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
-    
-    SetID(detElemId,pcbNumber);
-    SetName(h->PCBName(pcbNumber));
-    SetPathName(h->PCBPathName(detElemId,pcbNumber));
-    
-    AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
-    
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
-    TObjArray contourArray;
-    
-    for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp ) 
-    {
-      AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
-      AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
-                      mp->GetID(),fPCBIndex,fDetElemId));
-      AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
-      Add(painter);
-      if (!contour)
-      {
-        contourArray.Add(painter->Contour());
-      }
-    }
-    
-    Double_t x,y,z;
-    
-    h->Local2Global(fDetElemId,
-                                                   pcb->X()-slat->Position().X(),
-                                                   pcb->Y()-slat->Position().Y(),
-                                                   0.0,
-                                                   x,y,z);
-    
+  /// Ctor
+  
+  SetAttributes(att);
+  
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
+  
+  AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
+  
+  const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
+  
+  SetID(detElemId,pcbNumber);
+  SetName(h->PCBName(pcbNumber));
+  SetPathName(h->PCBPathName(detElemId,pcbNumber));
+  
+  AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
+  
+  AliMUONContour* contour = h->GetContour(ContourName());
+  TObjArray contourArray;
+  
+  for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp ) 
+  {
+    AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
+    AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
+                    mp->GetID(),fPCBIndex,fDetElemId));
+    AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
+    Add(painter);
     if (!contour)
     {
-      contour = h->MergeContours(contourArray,ContourName());
+      contourArray.Add(painter->Contour());
     }
-    
-    SetContour(contour);
+  }
+  
+  Double_t x,y,z;
+  
+  h->Local2Global(fDetElemId,
+                  pcb->X()-slat->GetPositionX(),
+                  pcb->Y()-slat->GetPositionY(),
+                  0.0,
+                  x,y,z);
+  
+  if (!contour)
+  {
+    contour = h->MergeContours(contourArray,ContourName());
+  }
+  
+  SetContour(contour);
 }
 
 //_____________________________________________________________________________
@@ -151,6 +160,28 @@ AliMUONPCBPainter::Copy(TObject& object) const
   ((AliMUONPCBPainter&)(object)).fPCBIndex = fPCBIndex;
 }
 
+//_____________________________________________________________________________
+TString
+AliMUONPCBPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
+                                Double_t, Double_t)
+{
+  /// Describe data at this PCB
+  
+  if (!data.HasPCB(fDetElemId,fPCBIndex)) return "";
+  
+  Double_t value = data.PCB(fDetElemId,fPCBIndex,dataIndex);
+  
+  return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONPCBPainter::IsIncluded() const
+{
+  /// Whether this PCB is included in the read out or not
+  return ( InteractiveReadOutConfig()->PCB(fDetElemId,fPCBIndex) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONPCBPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
@@ -165,6 +196,6 @@ AliMUONPCBPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }