]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFQAChecker.cxx
MergeQA is now an intrinsic part of AliReconstruction
[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"
4e25ac79 31//#include "AliQAv1.h"
5c7c93fa 32//#include "AliQAChecker.h"
33
6a9d0c9d 34#include "AliTOFQAChecker.h"
35
36ClassImp(AliTOFQAChecker)
37
693a790d 38//____________________________________________________________________________
4e25ac79 39Double_t * AliTOFQAChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray ** list)
693a790d 40{
41
42 // Super-basic check on the QA histograms on the input list:
43 // look whether they are empty!
44
57acd2d2 45 Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
46 Int_t count[AliRecoParam::kNSpecies] = { 0 };
47
48 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
49 test[specie] = 1.0 ;
4e25ac79 50 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
57acd2d2 51 continue ;
52 if (list[specie]->GetEntries() == 0){
53 test[specie] = 0.0 ; // nothing to check
693a790d 54 }
57acd2d2 55 else {
56 TIter next(list[specie]) ;
57 TH1 * hdata ;
58 count[specie] = 0 ;
59 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
60 if (hdata) {
61 Double_t rv = 0.;
62 if(hdata->GetEntries()>0)rv=1;
5379c4a3 63 AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
57acd2d2 64 count[specie]++ ;
65 test[specie] += rv ;
66 }
67 else{
68 AliError("Data type cannot be processed") ;
69 }
693a790d 70 }
57acd2d2 71 if (count[specie] != 0) {
72 if (test[specie]==0) {
73 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
74 test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
75 }
76 else {
77 test[specie] /= count[specie] ;
78 }
5379c4a3 79 AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ;
693a790d 80 }
81 }
82 }
693a790d 83 return test ;
84}
85
86
87