From 1d65d916e17bf38e0c3e2e7e2808ce4777fd80c3 Mon Sep 17 00:00:00 2001 From: cholm Date: Wed, 5 Sep 2012 10:55:01 +0000 Subject: [PATCH] Add coloured boxes on DQM plots for easy reading. Add fit status summary to logbook image. Other minor things --- FMD/AliFMDQAChecker.cxx | 68 +++++++++++++++++++++++++++-------------- FMD/AliFMDQAChecker.h | 13 ++++++++ 2 files changed, 58 insertions(+), 23 deletions(-) diff --git a/FMD/AliFMDQAChecker.cxx b/FMD/AliFMDQAChecker.cxx index e397c3c3dd6..09fc02b553c 100644 --- a/FMD/AliFMDQAChecker.cxx +++ b/FMD/AliFMDQAChecker.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -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; } diff --git a/FMD/AliFMDQAChecker.h b/FMD/AliFMDQAChecker.h index 6401a9801e8..028bceb542f 100644 --- a/FMD/AliFMDQAChecker.h +++ b/FMD/AliFMDQAChecker.h @@ -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 * -- 2.39.3