Obsolete.
[u/mrichter/AliRoot.git] / T0 / AliT0QAChecker.cxx
CommitLineData
c03351ac 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
18
19//...
20// Checks the quality assurance.
21// By comparing with reference data
22// Skeleton for T0
23//...
24
25// --- ROOT system ---
26#include <TClass.h>
27#include <TH1F.h>
28#include <TH1I.h>
29#include <TIterator.h>
30#include <TKey.h>
31#include <TFile.h>
32
33// --- Standard library ---
34
35// --- AliRoot header files ---
36#include "AliLog.h"
37#include "AliQA.h"
38#include "AliQAChecker.h"
39#include "AliT0QAChecker.h"
40
41ClassImp(AliT0QAChecker)
42
43//__________________________________________________________________
44AliT0QAChecker& AliT0QAChecker::operator = (const AliT0QAChecker& qac )
45{
46 // Equal operator.
47 this->~AliT0QAChecker();
48 new(this) AliT0QAChecker(qac);
49 return *this;
50}
3685c21c 51//__________________________________________________________________
52
53const Double_t AliT0QAChecker::Check(TObjArray * list)
54{
55
56 // Super-basic check on the QA histograms on the input list:
57 // look whether they are empty!
58 printf (" AliT0QAChecker >>check start ");
59 Double_t test = 0.0 ;
60 Int_t count = 0 ;
c03351ac 61
3685c21c 62 if (list->GetEntries() == 0){
63 test = 1. ; // nothing to check
64 printf (" AliT0QAChecker >> list->GetEntries() == 0");
65 }
66 else {
67
68 printf (" AliT0QAChecker >> list->GetEntries() %i",list->GetEntries() );
69 TIter next(list) ;
70 TH1 * hdata ;
71 count = 0 ;
72 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
73 if (hdata) {
74 printf("!!!! inside count %i; test %f ", count,test);
75 Double_t rv = 0.;
76 if(hdata->GetEntries()>0) rv = 1;
77 AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
78 count++ ;
79 test += rv ;
80 }
81 else{
82 AliError("Data type cannot be processed") ;
83 }
84
85 }
86 if (count != 0) {
87 if (test==0) {
88 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
89 test = 0.5; //upper limit value to set kWARNING flag for a task
90 }
91 else {
92 test /= count ;
93 }
94 }
95 }
96
97 AliInfo(Form("Test Result = %f", test)) ;
98 return test ;
99}