]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFQAChecker.cxx
reducing macro to minimum AliReconstruction functionality, disable QA and TriggerESD...
[u/mrichter/AliRoot.git] / TOF / AliTOFQAChecker.cxx
index b568cfef8f891651b2948c7a0ad0f20967cf7126..8db916662315824c47e7879938bde0867ef687dd 100644 (file)
 //                                                                 //
 /////////////////////////////////////////////////////////////////////
 
+#include "TH1.h"
+#include "TObjArray.h"
+
 #include "AliLog.h"
-#include "AliQA.h"
-#include "AliQAChecker.h"
+//#include "AliQA.h"
+//#include "AliQAChecker.h"
+
 #include "AliTOFQAChecker.h"
 
 ClassImp(AliTOFQAChecker)
@@ -40,3 +44,50 @@ AliTOFQAChecker& AliTOFQAChecker::operator = (const AliTOFQAChecker& qac )
   return *this;
 }
 
+//____________________________________________________________________________
+const Double_t AliTOFQAChecker::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<TH1 *>(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 ; 
+}  
+
+
+