1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 // Checks the quality assurance.
21 // By comparing with reference data
25 // --- ROOT system ---
29 #include <TIterator.h>
34 // --- Standard library ---
36 // --- AliRoot header files ---
39 #include "AliQAChecker.h"
40 #include "AliT0QAChecker.h"
42 ClassImp(AliT0QAChecker)
44 //__________________________________________________________________
45 AliT0QAChecker& AliT0QAChecker::operator = (const AliT0QAChecker& qac )
48 this->~AliT0QAChecker();
49 new(this) AliT0QAChecker(qac);
52 //__________________________________________________________________
54 const Double_t AliT0QAChecker::Check(TObjArray * list)
57 // Super-basic check on the QA histograms on the input list:
58 // look whether they are empty!
63 memset(nent,0,100*sizeof(Double_t));
65 memset(w,1.,100*sizeof(Double_t));
68 if (list->GetEntries() == 0){
69 test = 1. ; // nothing to check
76 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
78 nent[count] = hdata->GetEntries();
79 AliDebug(1,Form("count %i %s -> %f",count, hdata->GetName(),nent[count])) ;
82 if(hdata->GetEntries()>0) rv = 1;
88 AliError("Data type cannot be processed") ;
95 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
96 test = 0.5; //upper limit value to set kWARNING flag for a task
100 AliDebug(10,Form(" MaxElement %f ", TMath::MaxElement(count,nent)));
101 if(TMath::MaxElement(count,nent) > 1000) {
102 Double_t mean = TMath::Mean(count,nent,w);
103 AliDebug(10,Form(" Mean %f ", mean));
104 for (Int_t i=0; i<count; i++)
106 Double_t diff = TMath::Abs(nent[i]-mean);
107 if (diff > 0.1*mean )
108 AliInfo(Form("Problem in Number of entried in hist %i is %f\n", i, nent[i])) ;
114 AliInfo(Form("Test Result = %f", test)) ;