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*/)
47 Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
48 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
53 //__________________________________________________________________
54 Double_t * AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list)
57 // Main check function: Depending on the TASK, different checks will be applied
58 // Check for empty histograms
60 // AliDebug(1,Form("AliVZEROChecker"));
61 // AliCDBEntry *QARefRec = AliCDBManager::Instance()->Get("VZERO/QARef/RAW");
63 // AliInfo("QA reference data NOT retrieved for QA check...");
67 // Check that histos are filled - (FATAL) set if empty
68 Double_t * check = new Double_t[AliRecoParam::kNSpecies] ;
69 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
71 if ( !AliQA::Instance()->IsEventSpecieSet(specie) )
73 if(CheckEntries(list[specie]) == 0.0){
74 check[specie] = CheckEntries(list[specie]);
76 // Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs
77 if(index == AliQA::kESD)
78 check[specie] = CheckEsds(list[specie]);
84 //_________________________________________________________________
85 Double_t AliVZEROQAChecker::CheckEntries(TObjArray * list) const
88 // check on the QA histograms on the input list: list
94 if (list->GetEntries() == 0){
96 AliInfo(Form("There are NO ENTRIES to be checked..."));
101 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
104 if(hdata->GetEntries()>0) rv=1.0;
105 // AliInfo(Form("%s -> %f", hdata->GetName(), rv));
106 count++ ; // number of histos
107 test += rv ; // number of histos filled
109 AliError(Form("Data type cannot be processed"));
114 AliWarning(Form("Histograms are BOOKED for this specific task, but they are all EMPTY"));
123 //_________________________________________________________________
124 Double_t AliVZEROQAChecker::CheckEsds(TObjArray * list) const
127 // check the ESDs for missing disk or ring
129 // printf(" Number of entries in ESD list = %d\n", list->GetEntries());
132 Double_t test = 1.0; // initialisation to OK
134 Double_t Mult_V0A = 0.0;
135 Double_t Mult_V0C = 0.0;
136 Double_t V0A_BB_Ring[4], V0C_BB_Ring[4];
137 Double_t V0A_BG_Ring[4], V0C_BG_Ring[4];
138 for (Int_t i=0; i<4; i++) {
139 V0A_BB_Ring[i]= V0C_BB_Ring[i]= 0.0;
140 V0A_BG_Ring[i]= V0C_BG_Ring[i]= 0.0;
145 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
148 case AliVZEROQADataMakerRec::kCellMultiV0A:
149 Mult_V0A = hdata->GetMean();
151 case AliVZEROQADataMakerRec::kCellMultiV0C:
152 Mult_V0C = hdata->GetMean();
154 case AliVZEROQADataMakerRec::kBBFlag:
155 for (Int_t i=0; i<8; i++) {
156 if(i<4) V0C_BB_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
157 else V0A_BB_Ring[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
160 case AliVZEROQADataMakerRec::kBGFlag:
161 for (Int_t i=0; i<8; i++) {
162 if(i<4) V0C_BG_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
163 else V0A_BG_Ring[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
171 if(Mult_V0A == 0.0 || Mult_V0C == 0.0) {
172 AliWarning(Form("One of the two disks is missing !") );
173 test = 0.0; // bit FATAL set
175 if( V0A_BB_Ring[0]+V0A_BG_Ring[0] == 0.0 ||
176 V0A_BB_Ring[1]+V0A_BG_Ring[1] == 0.0 ||
177 V0A_BB_Ring[2]+V0A_BG_Ring[2] == 0.0 ||
178 V0A_BB_Ring[3]+V0A_BG_Ring[3] == 0.0 ||
179 V0C_BB_Ring[0]+V0C_BG_Ring[0] == 0.0 ||
180 V0C_BB_Ring[1]+V0C_BG_Ring[1] == 0.0 ||
181 V0C_BB_Ring[2]+V0C_BG_Ring[2] == 0.0 ||
182 V0C_BB_Ring[3]+V0C_BG_Ring[3] == 0.0 ){
183 AliWarning(Form("One ring is missing !") );
184 test = 0.1; // bit ERROR set
190 //______________________________________________________________________________
191 void AliVZEROQAChecker::Init(const AliQA::DETECTORINDEX_t det)
193 // intialises QA and QA checker settings
194 AliQA::Instance(det) ;
195 Float_t * hiValue = new Float_t[AliQA::kNBIT] ;
196 Float_t * lowValue = new Float_t[AliQA::kNBIT] ;
197 lowValue[AliQA::kINFO] = 0.5 ;
198 hiValue[AliQA::kINFO] = 1.0 ;
199 lowValue[AliQA::kWARNING] = 0.2 ;
200 hiValue[AliQA::kWARNING] = 0.5 ;
201 lowValue[AliQA::kERROR] = 0.0 ;
202 hiValue[AliQA::kERROR] = 0.2 ;
203 lowValue[AliQA::kFATAL] = -1.0 ;
204 hiValue[AliQA::kFATAL] = 0.0 ;
205 SetHiLo(hiValue, lowValue) ;
208 //______________________________________________________________________________
209 void AliVZEROQAChecker::SetQA(AliQA::ALITASK_t index, Double_t * value) const
211 // sets the QA word according to return value of the Check
212 AliQA * qa = AliQA::Instance(index);
213 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
214 qa->UnSet(AliQA::kFATAL, specie);
215 qa->UnSet(AliQA::kWARNING, specie);
216 qa->UnSet(AliQA::kERROR, specie);
217 qa->UnSet(AliQA::kINFO, specie);
218 if ( ! value ) { // No checker is implemented, set all QA to Fatal
219 qa->Set(AliQA::kFATAL, specie) ;
221 if ( value[specie] >= fLowTestValue[AliQA::kFATAL] && value[specie] < fUpTestValue[AliQA::kFATAL] )
222 qa->Set(AliQA::kFATAL, specie) ;
223 else if ( value[specie] > fLowTestValue[AliQA::kERROR] && value[specie] <= fUpTestValue[AliQA::kERROR] )
224 qa->Set(AliQA::kERROR, specie) ;
225 else if ( value[specie] > fLowTestValue[AliQA::kWARNING] && value[specie] <= fUpTestValue[AliQA::kWARNING] )
226 qa->Set(AliQA::kWARNING, specie) ;
227 else if ( value[specie] > fLowTestValue[AliQA::kINFO] && value[specie] <= fUpTestValue[AliQA::kINFO] )
228 qa->Set(AliQA::kINFO, specie) ;