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