First implementation of Checker for ACORDE-QA (we check only if the objects are empty...
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQAChecker.cxx
CommitLineData
51504028 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15//...
16// Checks the quality assurance for ACORDE.
17// Default implementation
18// Authors:
19// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
20// Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
21// Arturo Fernandez <afernan@mail.cern.ch> (FCFM-BUAP)
22//...
23
24// --- ROOT system ---
25#include <TClass.h>
26#include <TH1F.h>
27#include <TH1I.h>
28#include <TIterator.h>
29#include <TKey.h>
30#include <TFile.h>
31
32// --- Standard library ---
33
34// --- AliRoot header files ---
35#include "AliLog.h"
36#include "AliQA.h"
37#include "AliQAChecker.h"
38#include "AliACORDEQAChecker.h"
39
40ClassImp(AliACORDEQAChecker)
41
42//__________________________________________________________________
f307c383 43
44const Double_t AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list)
45{
46
47
48// Super-basic check on the QA histograms on the input list:
49 // look whether they are empty!
50 Double_t test = 0.0 ;
51 Int_t count = 0 ;
52
53 if (list->GetEntries() == 0){
54 test = 1. ; // nothing to check
55 }
56 else {
57 TIter next(list) ;
58 TH1 * hdata ;
59 count = 0 ;
60 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
61 if (hdata) {
62 Double_t rv = 0.;
63 if(hdata->GetEntries()>0)rv=1;
64 AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
65 count++ ;
66 test += rv ;
67 }
68 else{
69 AliError("Data type cannot be processed") ;
70 }
71
72 }
73 if (count != 0) {
74 if (test==0) {
75 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
76 test = 0.5; //upper limit value to set kWARNING flag for a task
77 }
78 else {
79 test /= count ;
80 }
81 }
82 }
83
84 AliInfo(Form("Test Result = %f", test)) ;
85 return test ;
86
87
88
89}
90