1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Checks the quality assurance. Under construction.
19 By comparing with reference data
23 // --- ROOT system ---
27 #include <TIterator.h>
31 // --- Standard library ---
33 // --- AliRoot header files ---
36 #include "AliQAChecker.h"
37 #include "AliVZEROQAChecker.h"
38 #include "AliVZEROQADataMakerRec.h"
39 //#include "AliCDBEntry.h"
40 //#include "AliCDBManager.h"
42 ClassImp(AliVZEROQAChecker)
44 //__________________________________________________________________
45 Double_t AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
48 // Main check function: Depending on the TASK, different checks will be applied
49 // Check for empty histograms
51 // AliDebug(1,Form("AliVZEROChecker"));
52 // AliCDBEntry *QARefRec = AliCDBManager::Instance()->Get("VZERO/QARef/RAW");
54 // AliInfo("QA reference data NOT retrieved for QA check...");
58 // Check that histos are filled - (FATAL) set if empty
59 if(CheckEntries(list) == 0.0){
60 return CheckEntries(list);
63 // Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs
64 if(index == AliQA::kESD) {
65 return CheckEsds(list);
70 //_________________________________________________________________
71 Double_t AliVZEROQAChecker::CheckEntries(TObjArray * list) const
74 // check on the QA histograms on the input list: list
80 if (list->GetEntries() == 0){
82 AliInfo(Form("There are NO ENTRIES to be checked..."));
87 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
90 if(hdata->GetEntries()>0) rv=1.0;
91 // AliInfo(Form("%s -> %f", hdata->GetName(), rv));
92 count++ ; // number of histos
93 test += rv ; // number of histos filled
95 AliError(Form("Data type cannot be processed"));
100 AliWarning(Form("Histograms are BOOKED for this specific task, but they are all EMPTY"));
109 //_________________________________________________________________
110 Double_t AliVZEROQAChecker::CheckEsds(TObjArray * list) const
113 // check the ESDs for missing disk or ring
115 // printf(" Number of entries in ESD list = %d\n", list->GetEntries());
118 Double_t test = 1.0; // initialisation to OK
120 Double_t Mult_V0A = 0.0;
121 Double_t Mult_V0C = 0.0;
122 Double_t V0A_BB_Ring[4], V0C_BB_Ring[4];
123 Double_t V0A_BG_Ring[4], V0C_BG_Ring[4];
124 for (Int_t i=0; i<4; i++) {
125 V0A_BB_Ring[i]= V0C_BB_Ring[i]= 0.0;
126 V0A_BG_Ring[i]= V0C_BG_Ring[i]= 0.0;
131 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
134 case AliVZEROQADataMakerRec::kCellMultiV0A:
135 Mult_V0A = hdata->GetMean();
137 case AliVZEROQADataMakerRec::kCellMultiV0C:
138 Mult_V0C = hdata->GetMean();
140 case AliVZEROQADataMakerRec::kBBFlag:
141 for (Int_t i=0; i<8; i++) {
142 if(i<4) V0C_BB_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
143 else V0A_BB_Ring[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
146 case AliVZEROQADataMakerRec::kBGFlag:
147 for (Int_t i=0; i<8; i++) {
148 if(i<4) V0C_BG_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
149 else V0A_BG_Ring[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
157 if(Mult_V0A == 0.0 || Mult_V0C == 0.0) {
158 AliWarning(Form("One of the two disks is missing !") );
159 test = 0.0; // bit FATAL set
161 if( V0A_BB_Ring[0]+V0A_BG_Ring[0] == 0.0 ||
162 V0A_BB_Ring[1]+V0A_BG_Ring[1] == 0.0 ||
163 V0A_BB_Ring[2]+V0A_BG_Ring[2] == 0.0 ||
164 V0A_BB_Ring[3]+V0A_BG_Ring[3] == 0.0 ||
165 V0C_BB_Ring[0]+V0C_BG_Ring[0] == 0.0 ||
166 V0C_BB_Ring[1]+V0C_BG_Ring[1] == 0.0 ||
167 V0C_BB_Ring[2]+V0C_BG_Ring[2] == 0.0 ||
168 V0C_BB_Ring[3]+V0C_BG_Ring[3] == 0.0 ){
169 AliWarning(Form("One ring is missing !") );
170 test = 0.1; // bit ERROR set
176 //______________________________________________________________________________
177 void AliVZEROQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t value) const
179 // sets the QA word according to return value of the Check
180 AliQA * qa = AliQA::Instance(index);
182 qa->UnSet(AliQA::kFATAL);
183 qa->UnSet(AliQA::kWARNING);
184 qa->UnSet(AliQA::kERROR);
185 qa->UnSet(AliQA::kINFO);
187 if ( value <= 0.0 ) qa->Set(AliQA::kFATAL) ;
188 else if ( value > 0.0 && value <= 0.2 ) qa->Set(AliQA::kERROR) ;
189 else if ( value > 0.2 && value <= 0.5 ) qa->Set(AliQA::kWARNING) ;
190 else if ( value > 0.5 && value < 1.0 ) qa->Set(AliQA::kINFO) ;