]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add coloured boxes on DQM plots for easy reading.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Sep 2012 10:55:01 +0000 (10:55 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Sep 2012 10:55:01 +0000 (10:55 +0000)
Add fit status summary to logbook image.
Other minor things

FMD/AliFMDQAChecker.cxx
FMD/AliFMDQAChecker.h

index e397c3c3dd60aa2bea08abfa9441dcbf4ff112c3..09fc02b553ce7f5a065140def01543f10e96e468 100644 (file)
@@ -35,7 +35,6 @@
 #include <TFile.h> 
 #include <iostream>
 #include <TCanvas.h>
-#include <TPaveText.h>
 #include <TStyle.h>
 #include <TLatex.h>
 #include <TFitResult.h>
@@ -712,6 +711,9 @@ UShort_t
 AliFMDQAChecker::CheckSim(AliRecoParam::EventSpecie_t /* specie*/, 
                          TH1*                        hist) const
 {
+  // 
+  // Check simulated hits 
+  // 
   return BasicCheck(hist);
 }
 //__________________________________________________________________
@@ -719,9 +721,46 @@ UShort_t
 AliFMDQAChecker::CheckRec(AliRecoParam::EventSpecie_t /* specie*/, 
                          TH1*                        hist) const
 {
+  // 
+  // Check reconstructed data 
+  // 
   return BasicCheck(hist);
 }
 
+//__________________________________________________________________
+void AliFMDQAChecker::AddStatusPave(TH1* hist, Int_t qual, 
+                                   Double_t xl, Double_t yl, 
+                                   Double_t xh, Double_t yh) const
+{
+  //
+  // Add a status pave to a plot
+  // 
+  if (xh < 0) xh = gStyle->GetStatX();
+  if (xl < 0) xl = xh - gStyle->GetStatW(); 
+  if (yh < 0) yh = gStyle->GetStatY();
+  if (yl < 0) yl = xl - gStyle->GetStatH(); 
+  
+  TPaveText* text = new TPaveText(xl, yl, xh, yh, "brNDC");
+  Int_t   bg  = kGreen-10;
+  Int_t   fg  = kBlack;
+  TString msg = "OK";
+  if      (qual >= kWhatTheFk) { bg = kRed+1; fg = kWhite; msg = "Argh!"; }
+  else if (qual >= kBad)       { bg = kRed-3; fg = kWhite; msg = "Bad"; }
+  else if (qual >= kProblem)   { bg = kOrange-4; msg = "Warning"; }
+  text->AddText(msg);
+  text->SetTextFont(62);
+  text->SetTextColor(fg);
+  text->SetFillColor(bg);
+
+  TList*   ll  = hist->GetListOfFunctions();
+  TObject* old = ll->FindObject(text->GetName());
+  if (old) { 
+    ll->Remove(old);
+    delete old;
+  }
+  ll->Add(text);
+}
+
 //__________________________________________________________________
 void AliFMDQAChecker::Check(Double_t*                   rv, 
                            AliQAv1::ALITASK_t          what, 
@@ -774,13 +813,14 @@ void AliFMDQAChecker::Check(Double_t*                   rv,
       
       Int_t qual = CheckOne(what, AliRecoParam::ConvertIndex(specie), hist);
       hist->SetUniqueID(Quality2Bit(qual));
+      hist->SetStats(0);
+      AddStatusPave(hist, qual);
       ret += qual;
 
       if (!status) continue;
 
-      // AliFMDQADataMakerRec::GetHalfringFromIndex(i, d, r, b, mm);
-      // AliWarningF("Got index %2d -> halfring FMD%d%c %s", i, d, r, 
-      //             hist->GetName());
+      // Parse out the detector and ring, calculate the bin, and fill
+      // status histogram.
       TString nme(hist->GetName());
       Char_t cD   = nme[nme.Length()-2];
       Char_t cR   = nme[nme.Length()-1];
@@ -808,25 +848,7 @@ void AliFMDQAChecker::Check(Double_t*                   rv,
        if (status->GetBinContent(i, 4) > 0) qual++;
       }
       status->SetUniqueID(Quality2Bit(qual));
-      TPaveText* text = new TPaveText(.6, .8, .95, .95, "brNDC");
-      Int_t   bg  = kGreen-10;
-      Int_t   fg  = kBlack;
-      TString msg = "OK";
-      if      (qual >= kWhatTheFk) { bg = kRed+1; fg = kWhite; msg = "Argh!"; }
-      else if (qual >= kBad)       { bg = kRed-3; fg = kWhite; msg = "Bad"; }
-      else if (qual >= kProblem)   { bg = kOrange-4; msg = "Warning"; }
-      text->AddText(msg);
-      text->SetTextFont(62);
-      text->SetTextColor(fg);
-      text->SetFillColor(bg);
-
-      TList*   ll  = status->GetListOfFunctions(); 
-      TObject* old = ll->FindObject(text->GetName());
-      if (old) { 
-       ll->Remove(old);
-       delete old;
-      }
-      ll->Add(text);
+      AddStatusPave(status, qual);
     }
     // if (count != 0) rv[specie] /= count;
   }
index 6401a9801e866ed57297a261d80e7a4b09907e8c..028bceb542fb15a0cb918d4bbe56730d20aa5a52 100644 (file)
@@ -60,6 +60,19 @@ protected:
     kBad, 
     kWhatTheFk
   };
+  /** 
+   * Add a status pave to the plot 
+   * 
+   * @param ll   List to add to 
+   * @param qual Quality 
+   * @param xl   X coordinate of lower-left corner (NDC)
+   * @param yl   Y coordinate of lower-left corner (NDC)
+   * @param xh   X coordinate of upper-right corner (NDC)
+   * @param yh          Y coordinate of upper-right corner (NDC)
+   */
+  void AddStatusPave(TH1* hist, Int_t qual, 
+                    Double_t xl=-1, Double_t yl=-1, 
+                    Double_t xh=-1, Double_t yh=-1) const;
   /** 
    * Check one histogram 
    *