]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFQAChecker.cxx
reducing macro to minimum AliReconstruction functionality, disable QA and TriggerESD...
[u/mrichter/AliRoot.git] / TOF / AliTOFQAChecker.cxx
CommitLineData
6a9d0c9d 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
17/* $Id$ */
18
8fd6fd6c 19/////////////////////////////////////////////////////////////////////
20// //
21// Checks the quality assurance. //
22// By analysis of the histograms & comparing with reference data //
23// S.Arcelli //
24// //
25/////////////////////////////////////////////////////////////////////
26
693a790d 27#include "TH1.h"
0ef6fc71 28#include "TObjArray.h"
5c7c93fa 29
30#include "AliLog.h"
31//#include "AliQA.h"
32//#include "AliQAChecker.h"
33
6a9d0c9d 34#include "AliTOFQAChecker.h"
35
36ClassImp(AliTOFQAChecker)
37
38//__________________________________________________________________
39AliTOFQAChecker& AliTOFQAChecker::operator = (const AliTOFQAChecker& qac )
40{
41 // Equal operator.
42 this->~AliTOFQAChecker();
43 new(this) AliTOFQAChecker(qac);
44 return *this;
45}
46
693a790d 47//____________________________________________________________________________
6b374954 48const Double_t AliTOFQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list)
693a790d 49{
50
51 // Super-basic check on the QA histograms on the input list:
52 // look whether they are empty!
53
54 Double_t test = 0.0 ;
55 Int_t count = 0 ;
56
57 if (list->GetEntries() == 0){
58 test = 1. ; // nothing to check
59 }
60 else {
61 TIter next(list) ;
62 TH1 * hdata ;
63 count = 0 ;
64 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
65 if (hdata) {
66 Double_t rv = 0.;
67 if(hdata->GetEntries()>0)rv=1;
68 AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
69 count++ ;
70 test += rv ;
71 }
72 else{
73 AliError("Data type cannot be processed") ;
74 }
75
76 }
77 if (count != 0) {
78 if (test==0) {
79 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
80 test = 0.5; //upper limit value to set kWARNING flag for a task
81 }
82 else {
83 test /= count ;
84 }
85 }
86 }
87
88 AliInfo(Form("Test Result = %f", test)) ;
89 return test ;
90}
91
92
93