]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONManuPainter.cxx
added proper handling of EMCAL calibration events
[u/mrichter/AliRoot.git] / MUON / AliMUONManuPainter.cxx
index d797cebd5175ef184fdabb88d77485608a4b81d2..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"
@@ -31,7 +35,6 @@
 #include "AliMpStationType.h"
 #include "AliMpVMotif.h"
 #include "AliMpVPadIterator.h"
-#include "AliLog.h"
 #include <TArrayI.h>
 #include <float.h>
 
@@ -74,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));
-    }
-    
-    Double_t x,y,z;
-    
-    AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
+  SetAttributes(att);
     
-    if ( stationType == AliMp::kStation345 ) 
-    {
-      const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(detElemId,manuId);
-      
-      h->Local2Global(fDetElemId,
-                      mp->GetPositionX() -slat->GetPositionX(),
-                      mp->GetPositionY() -slat->GetPositionY(),
-                      0,
-                      x,y,z);
-    }
-    else if ( stationType != AliMp::kStationTrigger ) 
-    {
-      h->Local2Global(fDetElemId,
-                      mp->GetPositionX(),
-                      mp->GetPositionY(),
-                      0,
-                      x,y,z);      
-    }
-    else
-    {
-      AliError("Hu ho. Not supposed to be used for trigger !");
-      Invalidate();
-      return;
-    }
-    
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
     
-    if (!contour)
-    {
-      contour = h->GenerateManuContour(fDetElemId,
-                                       fManuId,
-                                       Attributes(),
-                                       ContourName());
-    }
-    SetContour(contour);
+  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;    
+  }
     
-    Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
+  TString name = AliMUONManuContourMaker::ManuPathName(detElemId, manuId);
+
+  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));
 }
 
 //_____________________________________________________________________________
@@ -189,7 +166,27 @@ 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;
 }
 
 //_____________________________________________________________________________
@@ -223,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);
 }
 
 //_____________________________________________________________________________