]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASSDChecker.cxx
New survey data for V0A (Lizardo)
[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)
5dfa9b71 34//__________________________________________________________________
35AliITSQASSDChecker& AliITSQASSDChecker::operator = (const AliITSQASSDChecker& qac )
36{
37 // Equal operator.
38 this->~AliITSQASSDChecker();
39 new(this) AliITSQASSDChecker(qac);
40 return *this;
41}
42
43//__________________________________________________________________
4e25ac79 44Double_t AliITSQASSDChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray * list) {
5379c4a3 45 AliDebug(AliQAv1::GetQADebugLevel(),Form("AliITSQASSDChecker called with offset: %d\n", fSubDetOffset));
83c81861 46
5dfa9b71 47 Double_t test = 0.0 ;
48 Int_t count = 0 ;
5dfa9b71 49 if (list->GetEntries() == 0){
50 test = 1. ; // nothing to check
51 }
52 else {
53 TIter next(list) ;
54 TH1 * hdata ;
55 count = 0 ;
56 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
57 if (hdata) {
c71529b0 58 TString histname = hdata->GetName();
59 if(!histname.Contains("fHistSSD")) continue;
5dfa9b71 60 Double_t rv = 0.;
c71529b0 61 if(hdata->GetEntries()>0) rv = 1;
5379c4a3 62 //AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
c71529b0 63 //cout<<hdata->GetName()<<" - "<<rv<<endl;
5dfa9b71 64 count++ ;
65 test += rv ;
66 }
67 else{
68 AliError("Data type cannot be processed") ;
69 }
5dfa9b71 70 }
71 if (count != 0) {
72 if (test==0) {
73 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
74 test = 0.5; //upper limit value to set kWARNING flag for a task
75 }
76 else {
77 test /= count ;
78 }
79 }
80 }
c71529b0 81
5379c4a3 82 //AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test)) ;
c71529b0 83 //cout<<"Test result: "<<test<<endl;
5dfa9b71 84
5dfa9b71 85 return test ;
c71529b0 86
87 //return 0.;
83c81861 88
5dfa9b71 89}
90
3647765c 91//__________________________________________________________________
92void AliITSQASSDChecker::SetTaskOffset(Int_t TaskOffset)
93{
94 fSubDetOffset = TaskOffset;
95}