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"
40 ClassImp(AliVZEROQAChecker)
42 //__________________________________________________________________
43 AliVZEROQAChecker::AliVZEROQAChecker() : AliQACheckerBase("VZERO","VZERO Quality Assurance Data Checker"),
48 // Default constructor
52 //__________________________________________________________________
53 void AliVZEROQAChecker::Check(Double_t * check, AliQAv1::ALITASK_t index, TObjArray ** list, const AliDetectorRecoParam * /*recoParam*/)
55 // Main check function: Depending on the TASK, different checks will be applied
56 // Check for missing channels and check on the trigger type for raw data
57 // Check for missing disk or rings for esd (to be redone)
59 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
61 // no check on cosmic or calibration events
62 if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic || AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib)
64 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
66 if (index == AliQAv1::kRAW) {
67 check[specie] = CheckRaws(list[specie]);
68 } else if (index == AliQAv1::kESD) {
69 // Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs (to be redone)
70 check[specie] = CheckEsds(list[specie]);
75 //_________________________________________________________________
76 Double_t AliVZEROQAChecker::CheckRaws(TObjArray * list) const
79 // Check on the QA histograms on the raw-data input list:
80 // Two things are checked: the presence of data in all channels and
81 // the ratio between different trigger types
84 if (list->GetEntries() == 0){
85 AliWarning("There are no histograms to be checked");
87 TH1F *hTriggers = (TH1F*)list->At(AliVZEROQADataMakerRec::kTriggers);
89 AliWarning("Trigger type histogram is not found");
91 else if (hTriggers->GetEntries() < fLowEventCut) {
92 AliInfo("Not enough events to perform QA checks");
95 Double_t nANDs = hTriggers->GetBinContent(hTriggers->FindBin(0));
96 Double_t nORs = hTriggers->GetBinContent(hTriggers->FindBin(1));
97 Double_t nBGAs = hTriggers->GetBinContent(hTriggers->FindBin(2));
98 Double_t nBGCs = hTriggers->GetBinContent(hTriggers->FindBin(3));
99 if ((nORs - nANDs) > fORvsANDCut*nANDs) test = 0.001;
100 if ((nBGAs + nBGCs) > fBGvsBBCut*nANDs) test = 0.002;
102 TH1F *hBBflags = (TH1F*)list->At(AliVZEROQADataMakerRec::kBBFlagsPerChannel);
104 AliWarning("BB-flags per channel histogram is not found");
106 else if (hBBflags->GetEntries() < fLowEventCut) {
107 AliInfo("Not enough events to perform QA checks");
110 for(Int_t iBin = 1; iBin <= 64; ++iBin) {
111 if (hBBflags->GetBinContent(iBin) < 1.0) test = -1.0;
118 //_________________________________________________________________
119 Double_t AliVZEROQAChecker::CheckEsds(TObjArray * list) const
122 // check the ESDs for missing disk or ring
123 // printf(" Number of entries in ESD list = %d\n", list->GetEntries());
126 Double_t test = 1.0; // initialisation to OK
128 Double_t multV0A = 0.0;
129 Double_t multV0C = 0.0;
130 Double_t v0ABBRing[4], v0CBBRing[4];
131 Double_t v0ABGRing[4], v0CBGRing[4];
132 for (Int_t i=0; i<4; i++) {
133 v0ABBRing[i]= v0CBBRing[i]= 0.0;
134 v0ABGRing[i]= v0CBGRing[i]= 0.0;
139 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
142 case AliVZEROQADataMakerRec::kCellMultiV0A:
143 multV0A = hdata->GetMean();
145 case AliVZEROQADataMakerRec::kCellMultiV0C:
146 multV0C = hdata->GetMean();
148 case AliVZEROQADataMakerRec::kBBFlag:
149 for (Int_t i=0; i<8; i++) {
150 if(i<4) v0CBBRing[i] = hdata->Integral((i*8)+1, (i*8) +8);
151 else v0ABBRing[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
154 case AliVZEROQADataMakerRec::kBGFlag:
155 for (Int_t i=0; i<8; i++) {
156 if(i<4) v0CBGRing[i] = hdata->Integral((i*8)+1, (i*8) +8);
157 else v0ABGRing[i-4] = hdata->Integral((i*8)+1, (i*8) +8);
165 if(multV0A == 0.0 || multV0C == 0.0) {
166 AliWarning(Form("One of the two disks is missing !") );
167 test = 0.0; // bit FATAL set
169 if( v0ABBRing[0]+v0ABGRing[0] == 0.0 ||
170 v0ABBRing[1]+v0ABGRing[1] == 0.0 ||
171 v0ABBRing[2]+v0ABGRing[2] == 0.0 ||
172 v0ABBRing[3]+v0ABGRing[3] == 0.0 ||
173 v0CBBRing[0]+v0CBGRing[0] == 0.0 ||
174 v0CBBRing[1]+v0CBGRing[1] == 0.0 ||
175 v0CBBRing[2]+v0CBGRing[2] == 0.0 ||
176 v0CBBRing[3]+v0CBGRing[3] == 0.0 ){
177 AliWarning(Form("One ring is missing !") );
178 test = 0.1; // bit ERROR set
184 //______________________________________________________________________________
185 void AliVZEROQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
187 // intialises QA and QA checker settings
188 AliQAv1::Instance(det) ;
189 Float_t * hiValue = new Float_t[AliQAv1::kNBIT] ;
190 Float_t * lowValue = new Float_t[AliQAv1::kNBIT] ;
191 lowValue[AliQAv1::kINFO] = 0.5 ;
192 hiValue[AliQAv1::kINFO] = 1.0 ;
193 lowValue[AliQAv1::kWARNING] = 0.2 ;
194 hiValue[AliQAv1::kWARNING] = 0.5 ;
195 lowValue[AliQAv1::kERROR] = 0.0 ;
196 hiValue[AliQAv1::kERROR] = 0.2 ;
197 lowValue[AliQAv1::kFATAL] = -1.0 ;
198 hiValue[AliQAv1::kFATAL] = 0.0 ;
199 SetHiLo(hiValue, lowValue) ;
204 //______________________________________________________________________________
205 void AliVZEROQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
207 // sets the QA word according to return value of the Check
208 AliQAv1 * qa = AliQAv1::Instance(index);
209 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
210 qa->UnSet(AliQAv1::kFATAL, specie);
211 qa->UnSet(AliQAv1::kWARNING, specie);
212 qa->UnSet(AliQAv1::kERROR, specie);
213 qa->UnSet(AliQAv1::kINFO, specie);
214 if ( ! value ) { // No checker is implemented, set all QA to Fatal
215 qa->Set(AliQAv1::kFATAL, specie) ;
217 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] && value[specie] < fUpTestValue[AliQAv1::kFATAL] )
218 qa->Set(AliQAv1::kFATAL, specie) ;
219 else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] && value[specie] <= fUpTestValue[AliQAv1::kERROR] )
220 qa->Set(AliQAv1::kERROR, specie) ;
221 else if ( value[specie] > fLowTestValue[AliQAv1::kWARNING] && value[specie] <= fUpTestValue[AliQAv1::kWARNING] )
222 qa->Set(AliQAv1::kWARNING, specie) ;
223 else if ( value[specie] > fLowTestValue[AliQAv1::kINFO] && value[specie] <= fUpTestValue[AliQAv1::kINFO] )
224 qa->Set(AliQAv1::kINFO, specie) ;