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.
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 const 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 // checking for empty histograms
59 // Double_t check = 0.0;
60 // if(CheckEntries(list) == 0) {
61 // AliWarning(Form("Histograms are empty !"));
65 if ( index == AliQA::kRAW )
67 printf(" index = %d, Check = %f\n\n", index,CheckEntries(list));
68 return CheckEntries(list);
71 AliWarning(Form("Checker for task %d not implemented for the moment",index));
75 //_________________________________________________________________
76 Double_t AliVZEROQAChecker::CheckEntries(TObjArray * list) const
79 // check on the QA histograms on the input list:
84 printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
85 printf(" Number of entries = %d \n", list->GetEntries() );
87 if (list->GetEntries() == 0){
89 AliInfo(Form("There are no entries to be checked..."));
95 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
98 Printf("Histogram %s has entries: %f ",hdata->GetName(),hdata->GetEntries());
99 if(hdata->GetEntries()>0)rv=1.0;
102 printf(" count = %d, rv = %f \n", count,rv);
105 AliError(Form("Data type cannot be processed"));
110 AliInfo(Form("Histograms are booked for THIS specific Task, but they are all empty: setting flag to kWARNING"));
111 // test = 0.0; //upper limit value to set kWARNING flag for a task
119 //______________________________________________________________________________
120 void AliVZEROQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t value) const
122 // sets the QA word according the return value of the Check
124 AliQA * qa = AliQA::Instance(index);
126 qa->UnSet(AliQA::kFATAL);
127 qa->UnSet(AliQA::kWARNING);
128 qa->UnSet(AliQA::kERROR);
129 qa->UnSet(AliQA::kINFO);
133 qa->Set(AliQA::kINFO);
135 else if ( value == 0.0 )
137 qa->Set(AliQA::kFATAL);
139 else if ( value > 0.5 )
141 qa->Set(AliQA::kWARNING);
145 qa->Set(AliQA::kERROR);