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 **************************************************************************/
20 // Checks the quality assurance.
21 // By comparing with reference data
25 // --- ROOT system ---
26 #include <Riostream.h>
30 #include <TIterator.h>
35 // --- Standard library ---
37 // --- AliRoot header files ---
40 #include "AliQAChecker.h"
41 #include "AliT0QAChecker.h"
43 ClassImp(AliT0QAChecker)
45 //__________________________________________________________________
46 AliT0QAChecker& AliT0QAChecker::operator = (const AliT0QAChecker& qac )
49 this->~AliT0QAChecker();
50 new(this) AliT0QAChecker(qac);
54 //__________________________________________________________________
55 const Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list)
58 // Super-basic check on the QA histograms on the input list:
59 // look whether they are empty!
61 cout<<" GetAliTaskName "<<AliQA::GetAliTaskName(index)<<" index "<<index<<endl;
64 Double_t test = 10.0 ;
67 Double_t nent[200], nentraw[200];
70 memset(nent,0,200*sizeof(Double_t));
72 memset(w,1,200*sizeof(Double_t));
73 TH1 *fhRecLEDAmp[24]; TH1 * fhRecQTC[24];
74 TH1 *fhOnlineMean = 0x0;
75 TH1 * fhRecMean = 0x0;
76 TString dataType = AliQA::GetAliTaskName(index);
78 if (list->GetEntries() == 0){
79 test = 1. ; // nothing to check
87 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
89 nent[count] = hdata->GetEntries();
90 cname = hdata->GetName();
92 AliDebug(10,Form("count %i %s -> %f",count, hname[count].Data(),nent[count])) ;
95 if(count>23 && count<48)fhRecLEDAmp[count-24] = hdata;
96 if(count>47 && count<72)fhRecQTC[count-48] = hdata;
97 if(count == 72) fhOnlineMean = hdata;
98 if(count == 73) fhRecMean = hdata;
104 if(hdata->GetEntries()>0) rv = 1;
105 // AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
110 AliError("Data type cannot be processed") ;
117 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
118 test = 0.5; //upper limit value to set kWARNING flag for a task
123 if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5)
124 AliWarning(Form("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean())) ;
125 Double_t meanLED, meanQTC;
126 for (Int_t idet=0; idet<24; idet++) {
127 meanLED = fhRecLEDAmp[idet]->GetMean();
128 meanQTC = fhRecQTC[idet]->GetMean();
129 if (TMath::Abs(meanLED-meanQTC)> 1.)
130 AliWarning(Form("Amplitude measurements are different in channel %i : Amp LED %f -> Amp QTC %f",idet,meanLED, meanQTC)) ;
136 Int_t realNumber = Int_t(nent[0]);
137 for (Int_t i=77; i<count; i++)
139 Double_t diff = TMath::Abs(nent[i]-realNumber);
140 if (diff > 0.1*realNumber )
141 AliWarning(Form("Problem in Number of entried in hist %s is %f\n",hname[i].Data() , nent[i])) ;
149 } // if (list->GetEntries() != 0
151 AliInfo(Form("Test Result = %f", test)) ;