]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONManuPainter.cxx
Hopefully now Coverity will be happy
[u/mrichter/AliRoot.git] / MUON / AliMUONManuPainter.cxx
index 29a417ee2d3b3bf44f5fc6be785865a678dc3822..e416f9ea66ef7e42d34b49172ced5c1c758a2ea1 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 
 #include "AliMUONManuPainter.h"
 
+#include "AliMpDCSNamer.h"
+#include "AliLog.h"
+#include "AliMUONContour.h"
+#include "AliMUONManuContourMaker.h"
 #include "AliMUONManuPadPainter.h"
-#include "AliMUONPainterContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVDigit.h"
 #include "AliMUONVTrackerData.h"
 #include "AliMpDEManager.h"
+#include "AliMpManuUID.h"
 #include "AliMpMotifPosition.h"
 #include "AliMpMotifType.h"
 #include "AliMpSlat.h"
 #include "AliMpStationType.h"
 #include "AliMpVMotif.h"
 #include "AliMpVPadIterator.h"
-#include "AliLog.h"
 #include <TArrayI.h>
 #include <float.h>
 
 ClassImp(AliMUONManuPainter)
 ///\endcond
 
+//_____________________________________________________________________________
+AliMUONManuPainter::AliMUONManuPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1),
+fManuId(-1)
+{
+  /// ctor
+}
+
 //_____________________________________________________________________________
 AliMUONManuPainter::AliMUONManuPainter()
 : AliMUONVPainter(),
@@ -64,62 +77,36 @@ AliMUONManuPainter::AliMUONManuPainter(const AliMUONAttPainter& att,
 {
     /// ctor
     
-    SetAttributes(att);
-    
-    AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-    
-    SetID(detElemId,manuId);
-    SetName(h->ManuName(manuId));
-    SetPathName(h->ManuPathName(detElemId,manuId));
-    
-    AliMpMotifPosition* mp = h->GetMotifPosition(detElemId,manuId);
-    
-    if (!mp)
-    {
-      AliFatal(Form("Could not get manuId %04d from DE %04d",manuId,detElemId));
-    }
+  SetAttributes(att);
     
-    Double_t x,y,z;
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
     
-    AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
-
-    if ( stationType == AliMp::kStation345 ) 
-    {
-      const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(detElemId,manuId);
-
-      h->Local2Global(fDetElemId,
-                                                   mp->Position().X() -slat->Position().X(),
-                                                   mp->Position().Y() -slat->Position().Y(),
-                                                   0,
-                                                   x,y,z);
-    }
-    else if ( stationType != AliMp::kStationTrigger ) 
-    {
-      h->Local2Global(fDetElemId,
-                                                     mp->Position().X(),
-                                                     mp->Position().Y(),
-                                                     0,
-                                                     x,y,z);      
-    }
-    else
-    {
-      AliError("Hu ho. Not supposed to be used for trigger !");
-      Invalidate();
-      return;
-    }
+  SetID(detElemId,manuId);
+  SetName(h->ManuName(manuId));
+  SetPathName(h->ManuPathName(detElemId,manuId));
+  
+  
+  AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
+  
+  if ( stationType == AliMp::kStationTrigger ) 
+  {
+    AliError("Hu ho. Not supposed to be used for trigger !");
+    Invalidate();
+    return;    
+  }
     
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
+  TString name = AliMUONManuContourMaker::ManuPathName(detElemId, manuId);
 
-    if (!contour)
-    {
-      contour = h->GenerateManuContour(fDetElemId,
-                                                                      fManuId,
-                                                                      Attributes(),
-                                                                      ContourName());
-    }
-    SetContour(contour);
-    
-    Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
+  AliMUONContour* contour = h->GetContour(name.Data());
+  
+  if (!contour)
+  {
+    AliError(Form("Could not get manuId %04d from DE %04d (name=%s)",manuId,detElemId,name.Data()));
+  }
+  
+  SetContour(contour);
+  
+  Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
 }
 
 //_____________________________________________________________________________
@@ -179,7 +166,43 @@ AliMUONManuPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Double_t value = data.Manu(fDetElemId,fManuId,dataIndex);
   
-  return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
+  TString rv = AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
+  
+  if ( TString(data.GetName()).Contains("HV") )
+  {
+    rv += "\n";
+    
+    AliMpDCSNamer hvNamer("TRACKER");
+    
+    if ( AliMpDEManager::GetStationType(fDetElemId) == AliMp::kStation12 )
+    {
+      Int_t sector = hvNamer.ManuId2Sector(fDetElemId,fManuId);
+
+      rv += hvNamer.DCSChannelName(fDetElemId,sector);
+    }
+    else
+    {
+      rv += hvNamer.DCSChannelName(fDetElemId);
+    }
+  }
+  
+  return rv;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONManuPainter::FillManuList(TObjArray& manuList) const
+{
+  /// Append our manu to the list
+  manuList.Add(new AliMpManuUID(fDetElemId,fManuId));
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONManuPainter::IsIncluded() const
+{
+  /// whether this manu is included in the readout or not
+  return ( InteractiveReadOutConfig()->Manu(fDetElemId,fManuId) > 0 );
 }
 
 //_____________________________________________________________________________
@@ -197,7 +220,7 @@ AliMUONManuPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________