]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSQASSDChecker.cxx
From Alex: updated and new macros for TRD.
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDChecker.cxx
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 ---
25 #include "TH1.h"
26 #include "TString.h"
27 #include "Riostream.h"
28
29 // --- AliRoot header files ---
30 #include "AliITSQASSDChecker.h"
31 #include "AliLog.h"
32
33 ClassImp(AliITSQASSDChecker)
34
35 //__________________________________________________________________
36 AliITSQASSDChecker& AliITSQASSDChecker::operator = (const AliITSQASSDChecker& qac ) 
37 {
38   // Equal operator.
39   this->~AliITSQASSDChecker();
40   new(this) AliITSQASSDChecker(qac);
41   return *this;
42 }
43
44 //__________________________________________________________________
45 const Double_t AliITSQASSDChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list, Int_t SubDetOffset) 
46 {  
47   AliDebug(1,Form("AliITSQASSDChecker called with offset: %d\n", SubDetOffset));
48   /*
49   Double_t test = 0.0  ;
50   Int_t count = 0 ;
51   if (list->GetEntries() == 0){
52     test = 1. ; // nothing to check
53   }
54   else {
55     TIter next(list) ;
56     TH1 * hdata ;
57     count = 0 ;
58     while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
59       if (hdata) {
60         TString histname = hdata->GetName();
61         if(!histname.Contains("fHistSSD")) continue;
62         Double_t rv = 0.;
63         if(hdata->GetEntries()>0) rv = 1;
64         //AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
65         //cout<<hdata->GetName()<<" - "<<rv<<endl;
66         count++ ;
67         test += rv ;
68       }
69       else{
70         AliError("Data type cannot be processed") ;
71       }
72     }
73     if (count != 0) {
74       if (test==0) {
75         AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
76         test = 0.5;  //upper limit value to set kWARNING flag for a task
77       }
78       else {
79         test /= count ;
80       }
81     }
82   }
83   
84   //AliInfo(Form("Test Result = %f", test)) ;
85   //cout<<"Test result: "<<test<<endl;
86
87   return test ;
88
89   //return 0.;
90   */
91 }
92
93