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 "AliCDBEntry.h"
39 //#include "AliCDBManager.h"
41 ClassImp(AliVZEROQAChecker)
43 //__________________________________________________________________
44 Double_t AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
47 // Main check function: Depending on the TASK, different checks will be applied
48 // Check for empty histograms
50 // AliDebug(1,Form("AliVZEROChecker"));
51 // AliCDBEntry *QARefRec = AliCDBManager::Instance()->Get("VZERO/QARef/RAW");
53 // AliInfo("QA reference data NOT retrieved for QA check...");
57 // Check that histos are filled - (FATAL) set if empty
58 if(CheckEntries(list) == 0.0){
59 return CheckEntries(list);
62 // Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs
63 if(index == AliQA::kESD) {
64 return CheckEsds(list);
69 //_________________________________________________________________
70 Double_t AliVZEROQAChecker::CheckEntries(TObjArray * list) const
73 // check on the QA histograms on the input list: list
79 if (list->GetEntries() == 0){
81 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
96 AliError(Form("Data type cannot be processed"));
101 AliWarning(Form("Histograms are BOOKED for this specific task, but they are all EMPTY"));
111 //_________________________________________________________________
112 Double_t AliVZEROQAChecker::CheckEsds(TObjArray * list) const
115 // check the ESDs for missing disk or ring
117 // printf(" Number of entries in ESD list = %d\n", list->GetEntries());
120 Double_t test = 1.0; // initialisation to OK
122 Double_t Mult_V0A = 0.0;
123 Double_t Mult_V0C = 0.0;
124 Double_t V0A_BB_Ring[4], V0C_BB_Ring[4];
125 Double_t V0A_BG_Ring[4], V0C_BG_Ring[4];
126 for (Int_t i=0; i<4; i++) {
127 V0A_BB_Ring[i]= V0C_BB_Ring[i]= 0.0;
128 V0A_BG_Ring[i]= V0C_BG_Ring[i]= 0.0;
133 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
137 Mult_V0A = hdata->GetMean();
138 // printf(" Histo ESD number %d; Mean Mult on V0A = %f\n",histo_nb, Mult_V0A);
141 Mult_V0C = hdata->GetMean();
142 // printf(" Histo ESD number %d; Mean Mult on V0C = %f\n",histo_nb, Mult_V0C);
145 for (Int_t i=0; i<4; i++) {
146 V0A_BB_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
147 // printf(" Histo ESD number %d; Ring = %d; BB A %f\n",histo_nb, i, V0A_BB_Ring[i]);
151 for (Int_t i=0; i<4; i++) {
152 V0A_BG_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
153 // printf(" Histo ESD number %d; Ring = %d; BG A %f\n",histo_nb, i, V0A_BG_Ring[i]);
157 for (Int_t i=0; i<4; i++) {
158 V0C_BB_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
159 // printf(" Histo ESD number %d; Ring = %d; BB C %f\n",histo_nb, i, V0C_BB_Ring[i]);
163 for (Int_t i=0; i<4; i++) {
164 V0C_BG_Ring[i] = hdata->Integral((i*8)+1, (i*8) +8);
165 // printf(" Histo ESD number %d; Ring = %d; BG C %f\n",histo_nb, i, V0C_BG_Ring[i]);
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::SetQA(AliQA::ALITASK_t index, const Double_t value) const
193 // sets the QA word according to return value of the Check
195 AliQA * qa = AliQA::Instance(index);
197 qa->UnSet(AliQA::kFATAL);
198 qa->UnSet(AliQA::kWARNING);
199 qa->UnSet(AliQA::kERROR);
200 qa->UnSet(AliQA::kINFO);
202 if ( value <= 0.0 ) qa->Set(AliQA::kFATAL) ;
203 else if ( value > 0.0 && value <= 0.2 ) qa->Set(AliQA::kERROR) ;
204 else if ( value > 0.2 && value <= 0.5 ) qa->Set(AliQA::kWARNING) ;
205 else if ( value > 0.5 && value < 1.0 ) qa->Set(AliQA::kINFO) ;