From f307c383981485c742c59424190f1e923fa5efe5 Mon Sep 17 00:00:00 2001 From: mrodrigu Date: Mon, 4 Aug 2008 16:20:23 +0000 Subject: [PATCH] First implementation of Checker for ACORDE-QA (we check only if the objects are empty, later we'll have the objects with the ACORDE's data reference) --- ACORDE/AliACORDEQAChecker.cxx | 48 +++++++++++++++++++++++++++++++++++ ACORDE/AliACORDEQAChecker.h | 15 ++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/ACORDE/AliACORDEQAChecker.cxx b/ACORDE/AliACORDEQAChecker.cxx index 89e7ec3531a..892ebe73dc0 100755 --- a/ACORDE/AliACORDEQAChecker.cxx +++ b/ACORDE/AliACORDEQAChecker.cxx @@ -40,3 +40,51 @@ ClassImp(AliACORDEQAChecker) //__________________________________________________________________ + +const Double_t AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list) +{ + + +// Super-basic check on the QA histograms on the input list: + // look whether they are empty! + Double_t test = 0.0 ; + Int_t count = 0 ; + + if (list->GetEntries() == 0){ + test = 1. ; // nothing to check + } + else { + TIter next(list) ; + TH1 * hdata ; + count = 0 ; + while ( (hdata = dynamic_cast(next())) ) { + if (hdata) { + Double_t rv = 0.; + if(hdata->GetEntries()>0)rv=1; + AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; + count++ ; + test += rv ; + } + else{ + AliError("Data type cannot be processed") ; + } + + } + if (count != 0) { + if (test==0) { + AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); + test = 0.5; //upper limit value to set kWARNING flag for a task + } + else { + test /= count ; + } + } + } + + AliInfo(Form("Test Result = %f", test)) ; + return test ; + + + +} + diff --git a/ACORDE/AliACORDEQAChecker.h b/ACORDE/AliACORDEQAChecker.h index f4d0b4198ad..fc3aade02b7 100755 --- a/ACORDE/AliACORDEQAChecker.h +++ b/ACORDE/AliACORDEQAChecker.h @@ -34,7 +34,20 @@ private: virtual const Double_t Check() {return 0.;} ; */ - ClassDef(AliACORDEQAChecker,1) // description +// ClassDef(AliACORDEQAChecker,1) // description + + protected: + + virtual const Double_t Check(AliQA::ALITASK_t /*index*/, TObjArray * list) ; + virtual const Double_t Check(AliQA::ALITASK_t /*index*/) {return 0.;} ; + virtual const Double_t Check() {return 0.;} ; + virtual const Double_t Check(TObjArray*) {return 0.;} ; + + + ClassDef(AliACORDEQAChecker,2) // description + + + }; -- 2.43.0