]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONManuPainter.cxx
dEdxSSDAQA added to PilotAnalysis
[u/mrichter/AliRoot.git] / MUON / AliMUONManuPainter.cxx
index d4836ffafa809584d38260b953f3516e9cf0965d..503d526299119256295c64ec179caf9be49ebb05 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 
 #include "AliMUONManuPainter.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 +34,6 @@
 #include "AliMpStationType.h"
 #include "AliMpVMotif.h"
 #include "AliMpVPadIterator.h"
-#include "AliLog.h"
 #include <TArrayI.h>
 #include <float.h>
 
@@ -74,62 +76,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;
+  SetAttributes(att);
     
-    AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
     
-    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;
-    }
-    
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
-    
-    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));
 }
 
 //_____________________________________________________________________________
@@ -223,7 +199,7 @@ AliMUONManuPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________