]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackerQAChecker.cxx
Using the rescaling using angular rescaling only.
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerQAChecker.cxx
index 6263ee9b2d70d5534265eac0c5d74b46d490cc07..e05e80b9b919d818c84c9240bcc1c74a6afc6482 100644 (file)
@@ -43,6 +43,8 @@
 #include "TMath.h"
 #include "TPaveText.h"
 #include "TVirtualPad.h"
+#include "TStyle.h"
+#include "TLatex.h"
 
 /// \cond CLASSIMP
 ClassImp(AliMUONTrackerQAChecker)
@@ -141,15 +143,10 @@ namespace {
   //___________________________________________________________________________  
   Int_t GetColorFromCheckCode(AliMUONVQAChecker::ECheckCode code)
   {
-    const Int_t INFOCOLOR(kGreen);  // green = INFO
-    const Int_t WARNINGCOLOR(kYellow); // yellow = WARNING
-    const Int_t ERRORCOLOR(kOrange); // orange = ERROR
-    const Int_t FATALCOLOR(kRed); // red = FATAL
-    
-    if ( code == AliMUONVQAChecker::kInfo ) return INFOCOLOR;
-    else if ( code == AliMUONVQAChecker::kWarning ) return WARNINGCOLOR;
-    else if ( code ==  AliMUONVQAChecker::kFatal) return FATALCOLOR;
-    else return ERRORCOLOR;
+    if ( code == AliMUONVQAChecker::kInfo ) return AliMUONVQAChecker::kInfoColor;
+    else if ( code == AliMUONVQAChecker::kWarning ) return AliMUONVQAChecker::kWarningColor;
+    else if ( code ==  AliMUONVQAChecker::kFatal) return AliMUONVQAChecker::kFatalColor;
+    else return AliMUONVQAChecker::kErrorColor;
   }
   
   const char* NOTENOUGHEVENTMESSAGE = "Not enough event to judge. Please wait a bit";
@@ -197,16 +194,38 @@ namespace {
     sopt += extraopt;
     histo.SetOption(sopt.Data());
     
-    histo.SetTitle(kFALSE);
+    histo.SetBit(TH1::kNoTitle); 
     
-    TObject* title = histo.GetListOfFunctions()->FindObject("title");
-    if (title) title->Delete();
+    TList* lstF = histo.GetListOfFunctions();
+    TObject* title = lstF->FindObject("title");
+    if (title) delete lstF->Remove(title);
+    // 
+    lstF->Add(text);  
+    
+  }
 
-    histo.GetListOfFunctions()->Add(text);
+  //___________________________________________________________________________  
+  void ShowTrueValue(TH1& hrostatusnorm, Int_t v)
+  {
+    // For a bar > 100% we put the text inside the bar (as TEXT45 option is putting above which
+    // would go offscreen)
+    
+    Int_t bin = hrostatusnorm.FindBin(1.0*v);
+    
+    Double_t value = hrostatusnorm.GetBinContent(bin);
+    
+    if ( value > 100.0 ) 
+    {
+      TLatex* l = new TLatex(hrostatusnorm.GetBinCenter(bin),50,Form("%g",value));
+      l->SetTextFont(gStyle->GetTextFont());
+      l->SetTextAlign(22);
+      l->SetTextAngle(45);
+      l->SetTextSize(0.02*hrostatusnorm.GetMarkerSize());
+      hrostatusnorm.GetListOfFunctions()->Add(l);
+    }
   }
-  
-}
 
+}
 //__________________________________________________________________
 AliMUONTrackerQAChecker::AliMUONTrackerQAChecker() : AliMUONVQAChecker()
 {
@@ -219,13 +238,6 @@ AliMUONTrackerQAChecker::~AliMUONTrackerQAChecker()
        /// dtor
 }
 
-//__________________________________________________________________
-AliMUONTrackerQAChecker::AliMUONTrackerQAChecker(const AliMUONTrackerQAChecker& qac) : 
-    AliMUONVQAChecker(qac) 
-{
-       /// copy ctor 
-}   
-
 //______________________________________________________________________________
 AliMUONVQAChecker::ECheckCode*
 AliMUONTrackerQAChecker::CheckRecPoints(TObjArray ** list, const AliMUONRecoParam* /*recoParam*/)
@@ -321,11 +333,6 @@ AliMUONTrackerQAChecker::CheckRaws(TObjArray ** list, const AliMUONRecoParam* re
     Int_t neventsseen = TMath::Nint(hneventsseen->GetBinContent(1));
     Int_t neventsused = TMath::Nint(hneventsused->GetBinContent(1));
         
-    if ( !hneventsseen || !hneventsused )
-    {
-      continue;
-    }
-    
     AliMUONVQAChecker::ECheckCode c1 = AliMUONVQAChecker::kInfo;
     AliMUONVQAChecker::ECheckCode c2 = AliMUONVQAChecker::kInfo;
     AliMUONVQAChecker::ECheckCode c3 = AliMUONVQAChecker::kInfo;
@@ -416,8 +423,6 @@ AliMUONTrackerQAChecker::BeautifyOccupancyHistograms(TH1& hddl,
     }
   }
   
-  hbp.GetListOfFunctions()->Delete();
-  hddl.GetListOfFunctions()->Delete();
   hddl.SetStats(kFALSE);
   hbp.SetXTitle("Absolute Bus Patch Id");
   hbp.SetYTitle("Occupancy (percent)");
@@ -437,6 +442,15 @@ AliMUONTrackerQAChecker::BeautifyOccupancyHistograms(TH1& hddl,
   line2->SetLineColor(1);
   line2->SetLineWidth(1);
   
+  TList* lstF = hbp.GetListOfFunctions();
+  if (lstF) {
+    TObject *stats = lstF->FindObject("stats");
+    lstF->Remove(stats);
+    TObject *obj;
+    while ((obj = lstF->First())) { while(lstF->Remove(obj)) { } delete obj; }
+    if (stats) lstF->Add(stats);
+  } 
+  
   hbp.GetListOfFunctions()->Add(line1);
   hbp.GetListOfFunctions()->Add(line2);
     
@@ -591,10 +605,7 @@ AliMUONTrackerQAChecker::BeautifyReadoutHistograms(TH1& hrostatus,
   /// Normalize and put some text on the readout error histogram
   /// Note in particular the treatment of tokenlost errors !
   
-  hrostatus.GetListOfFunctions()->Delete();
-  hrostatusnorm.GetListOfFunctions()->Delete();
   hrostatusnorm.Reset();
-  hrostatusnorm.SetFillStyle(0);
   
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
   
@@ -610,6 +621,7 @@ AliMUONTrackerQAChecker::BeautifyReadoutHistograms(TH1& hrostatus,
     hrostatusnorm.Add(&hrostatus,100.0/neventsseen);
     hrostatusnorm.SetOption("TEXT45"); // note : cannot use HIST option, otherwise the associated function (i.e. the tpavetext) is not drawn...
     hrostatusnorm.SetMinimum(0.0);
+    hrostatusnorm.SetMaximum(100.0);
     
     Double_t tokenLost = hrostatusnorm.GetBinContent(hrostatusnorm.FindBin(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors));
     
@@ -635,13 +647,17 @@ AliMUONTrackerQAChecker::BeautifyReadoutHistograms(TH1& hrostatus,
     {
       messages.Add(new TObjString("Too many empty events !"));
       messages.Add(new TObjString(NOTIFYEXPERTMESSAGE));
-      rv = AliMUONVQAChecker::kFatal;
-      
-    }
+      rv = AliMUONVQAChecker::kFatal;      
+    }    
   }
    
   SetupHisto(neventsseen,neventsused,messages,hrostatusnorm,rv,"text45");
   
+  ShowTrueValue(hrostatusnorm,AliMUONQAIndices::kTrackerRawNofTokenLostErrors);
+  ShowTrueValue(hrostatusnorm,AliMUONQAIndices::kTrackerRawNofParityErrors);
+  ShowTrueValue(hrostatusnorm,AliMUONQAIndices::kTrackerRawNofPaddingErrors);
+  ShowTrueValue(hrostatusnorm,AliMUONQAIndices::kTrackerRawNofGlitchErrors);
+  
   return rv;
 }
 
@@ -657,8 +673,6 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
 
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
 
-  heventsizeperevent.GetListOfFunctions()->Delete();
   heventsizeperevent.Reset();
 
   TObjArray messages;
@@ -670,8 +684,7 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
   }
   else
   {
-    heventsizeperevent.Add(&heventsize);
-    heventsizeperevent.Scale(1.0/neventsseen/1024.0);
+    heventsizeperevent.Add(&heventsize,1.0/neventsseen/1024.0);
     heventsizeperevent.SetMinimum(0);
     
     Double_t totalEventSizePerEvent = heventsizeperevent.Integral();
@@ -681,7 +694,7 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
     
     if ( totalEventSizePerEvent > recoParam.EventSizeHardLimit() ) 
     {
-      rv = AliMUONVQAChecker::kFatal;
+      rv = AliMUONVQAChecker::kError;
       msg = "That is really too high.";
       action = NOTIFYEXPERTMESSAGE;
     }
@@ -689,7 +702,7 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
     {
       msg = "That is a bit high.";
       action = "Please keep an eye on it.";
-      rv = AliMUONVQAChecker::kError;
+      rv = AliMUONVQAChecker::kWarning;
     }
     else 
     {