]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASSDChecker.cxx
Static TClonesarray cleared at each cycle (Panos)
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDChecker.cxx
CommitLineData
5dfa9b71 1/**************************************************************************
2 * Copyright(c) 2007-2009, 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/* $Id$ */
17
18// *****************************************
19// Checks the quality assurance
20// by comparing with reference data
21// P. Cerello Apr 2008
22// INFN Torino
23
24// --- ROOT system ---
c71529b0 25#include "TH1.h"
26#include "TString.h"
27#include "Riostream.h"
5dfa9b71 28
29// --- AliRoot header files ---
30#include "AliITSQASSDChecker.h"
c71529b0 31#include "AliLog.h"
5dfa9b71 32
33ClassImp(AliITSQASSDChecker)
34
35//__________________________________________________________________
36AliITSQASSDChecker& AliITSQASSDChecker::operator = (const AliITSQASSDChecker& qac )
37{
38 // Equal operator.
39 this->~AliITSQASSDChecker();
40 new(this) AliITSQASSDChecker(qac);
41 return *this;
42}
43
44//__________________________________________________________________
83c81861 45const Double_t AliITSQASSDChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list, Int_t SubDetOffset) {
c71529b0 46 AliDebug(1,Form("AliITSQASSDChecker called with offset: %d\n", SubDetOffset));
83c81861 47
5dfa9b71 48 Double_t test = 0.0 ;
49 Int_t count = 0 ;
5dfa9b71 50 if (list->GetEntries() == 0){
51 test = 1. ; // nothing to check
52 }
53 else {
54 TIter next(list) ;
55 TH1 * hdata ;
56 count = 0 ;
57 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
58 if (hdata) {
c71529b0 59 TString histname = hdata->GetName();
60 if(!histname.Contains("fHistSSD")) continue;
5dfa9b71 61 Double_t rv = 0.;
c71529b0 62 if(hdata->GetEntries()>0) rv = 1;
63 //AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
64 //cout<<hdata->GetName()<<" - "<<rv<<endl;
5dfa9b71 65 count++ ;
66 test += rv ;
67 }
68 else{
69 AliError("Data type cannot be processed") ;
70 }
5dfa9b71 71 }
72 if (count != 0) {
73 if (test==0) {
74 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
75 test = 0.5; //upper limit value to set kWARNING flag for a task
76 }
77 else {
78 test /= count ;
79 }
80 }
81 }
c71529b0 82
83 //AliInfo(Form("Test Result = %f", test)) ;
84 //cout<<"Test result: "<<test<<endl;
5dfa9b71 85
5dfa9b71 86 return test ;
c71529b0 87
88 //return 0.;
83c81861 89
5dfa9b71 90}
91
92