]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPainterHelper.cxx
Clear up a confusion between HV channel alias and name (where there is a -1 offset...
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterHelper.cxx
index 95daa691315abb151b5c68775a80948280315d07..a88ea263f2c8de9da2a2470c351ec7571a96956e 100644 (file)
@@ -19,6 +19,7 @@
 #include "AliMUONPainterHelper.h"
 
 #include "AliCodeTimer.h"
+#include "AliDAQ.h"
 #include "AliLog.h"
 #include "AliMUONContour.h"
 #include "AliMUONContourHandler.h"
@@ -37,6 +38,7 @@
 #include "AliMpDDLStore.h"
 #include "AliMpDEIterator.h"
 #include "AliMpDEManager.h"
+#include "AliMpDetElement.h"
 #include "AliMpExMap.h"
 #include "AliMpMotifMap.h"
 #include "AliMpMotifPosition.h"
@@ -77,6 +79,8 @@
 ///
 ///\author Laurent Aphecetche, Subatech
 
+using std::cout;
+using std::endl;
 ///\cond CLASSIMP
 ClassImp(AliMUONPainterHelper)
 ///\endcond
@@ -323,8 +327,7 @@ AliMUONPainterHelper::ColorFromValue(Double_t value, Double_t min, Double_t max)
   else if (value <= min) rv = 0;
   else
   {
-//    if  ( TMath::AreEqualRel(max,min,1E-6) ) return gStyle->GetColorPalette(1);
-    if ( TMath::Abs(max-min) < 0.5*1E-6*TMath::Abs(max)+TMath::Abs(min) ) return gStyle->GetColorPalette(1);
+    if  ( TMath::AreEqualRel(max,min,1E-6) ) return gStyle->GetColorPalette(1);
     Double_t range = max - min;
     Double_t offset = value - min;
     rv = gStyle->GetColorPalette( 1 + int( offset*(gStyle->GetNumberOfColors()-2)/range - 0.5 ) );
@@ -464,10 +467,20 @@ AliMUONPainterHelper::DEPathName(Int_t detElemId) const
   
   Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
   
-  return Form("%s/%s/%s",
+  Int_t ddl(-1);
+  
+  AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
+  
+  if ( de ) 
+  {
+    ddl = AliDAQ::DdlIDOffset("MUONTRK") + de->GetDdlId();
+  }
+  
+  return Form("%s/%s/%s(DDL%4d)",
               StationName(chamberId/2).Data(),
               ChamberName(chamberId).Data(),
-              DEName(detElemId).Data());
+              DEName(detElemId).Data(),
+              ddl);
 }
 
 //_____________________________________________________________________________