]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSQAChecker.cxx
Overlap fixed (M. Sitta)
[u/mrichter/AliRoot.git] / ITS / AliITSQAChecker.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 //  W. Ferrarese Oct 2007
22 //  INFN Torino
23
24 // --- ROOT system ---
25 #include "TH1.h"
26
27 // --- AliRoot header files ---
28 #include "AliITSQAChecker.h"
29 #include "AliITSQASPDChecker.h"
30 #include "AliITSQASDDChecker.h"
31 #include "AliITSQASSDChecker.h"
32
33 ClassImp(AliITSQAChecker)
34
35 //____________________________________________________________________________
36 AliITSQAChecker::AliITSQAChecker(Bool_t kMode, Short_t subDet, Short_t ldc) :
37 AliQACheckerBase("ITS","SDD Quality Assurance Checker"),
38 fkOnline(0),
39 fDet(0),  
40 fLDC(0),
41 fSPDOffset(0), 
42 fSDDOffset(0), 
43 fSSDOffset(0),
44 fSPDChecker(0),  // SPD Checker
45 fSDDChecker(0),  // SDD Checker
46 fSSDChecker(0)  // SSD Checker
47 {
48   fkOnline = kMode; fDet = subDet; fLDC = ldc;
49   if(fDet == 0 || fDet == 1) {
50     AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
51   }
52   if(fDet == 0 || fDet == 2) {
53     AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
54   }
55   if(fDet == 0 || fDet == 3) {
56     AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
57   }
58
59 }
60
61 //__________________________________________________________________
62 AliITSQAChecker& AliITSQAChecker::operator = (const AliITSQAChecker& qac )
63 {
64   // Equal operator.
65   this->~AliITSQAChecker();
66   new(this) AliITSQAChecker(qac);
67   return *this;
68 }
69
70 //____________________________________________________________________________
71 const Double_t AliITSQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
72 {
73
74   // Super-basic check on the QA histograms on the input list:
75   // look whether they are empty!
76   Double_t spdCheck, sddCheck, ssdCheck;
77   Double_t retval = 0.;
78   if(fDet == 0 || fDet == 1) {
79     AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
80     if(!fSPDChecker) fSPDChecker = new AliITSQASPDChecker();
81     spdCheck = fSPDChecker->Check(index, list, fSPDOffset);
82     if(spdCheck>retval)retval = spdCheck;
83   }
84   if(fDet == 0 || fDet == 2) {
85     AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
86     if(!fSDDChecker) fSDDChecker = new AliITSQASDDChecker();
87     sddCheck = fSDDChecker->Check(index, list, fSDDOffset);
88     if(sddCheck>retval)retval = sddCheck;
89   }
90   if(fDet == 0 || fDet == 3) {
91     AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
92     if(!fSSDChecker) fSSDChecker = new AliITSQASSDChecker();
93     //AliInfo(Form("Number of monitored objects SSD: %d", list->GetEntries()));      
94     ssdCheck = fSSDChecker->Check(index, list, fSSDOffset);
95     if(ssdCheck>retval)retval = ssdCheck;
96   }
97   // here merging part for common ITS QA result
98   // 
99   return retval;
100 }
101
102
103 //____________________________________________________________________________
104 void AliITSQAChecker::SetTaskOffset(Int_t SPDOffset, Int_t SDDOffset, Int_t SSDOffset)
105 {
106   //Setting the 3 offsets for each task called
107   fSPDOffset = SPDOffset;
108   fSDDOffset = SDDOffset;
109   fSSDOffset = SSDOffset;
110 }