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 **************************************************************************/
17 // --- ROOT system ---
19 #include <TIterator.h>
22 // --- Standard library ---
24 // --- AliRoot header files ---
26 #include "AliZDCQAChecker.h"
28 ClassImp(AliZDCQAChecker)
30 //__________________________________________________________________
31 AliZDCQAChecker& AliZDCQAChecker::operator = (const AliZDCQAChecker& qac )
34 this->~AliZDCQAChecker();
35 new(this) AliZDCQAChecker(qac);
40 //____________________________________________________________________________
41 const Double_t AliZDCQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
43 // Checks the QA histograms on the input list:
46 Int_t count=0, ntests=0;
48 const char* taskName = AliQA::GetAliTaskName(index);
50 // -------------------------------------------------------------------
51 if(!(strncmp(taskName,"SIM",3))){
53 if(list->GetEntries()==0){
54 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
55 test = 1.; // nothing to check
58 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
62 Double_t meanX=0., meanY=0.;
63 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
64 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
65 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
66 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
68 Int_t digInd=0, testgood=0;
72 while((hdata = dynamic_cast<TH1 *>(next()))){
74 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
76 if(!(strncmp(hdata->GetName(),"hZNCh",5))){
78 meanX = hdata->GetMean(1);
79 meanY = hdata->GetMean(2);
80 // check if the spot is centered
81 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
86 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
88 // Check DIGITS histos
90 // [1] check response of ZNC vs. ZNA
91 if(digInd==0 || digInd==1){
93 if(hdata->GetEntries() != 0.){
95 meanZNA = hdata->GetMean();
96 rmsZNA = hdata->GetRMS();
100 if(hdata->GetEntries() != 0.){
102 meanZNC = hdata->GetMean();
105 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
107 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
113 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
118 // [2] check response of ZPC vs. ZPA
119 else if(digInd==2 || digInd==3){
121 if(hdata->GetEntries() != 0.){
123 meanZPA = hdata->GetMean();
124 rmsZPA = hdata->GetRMS();
128 if(hdata->GetEntries() != 0.){
130 meanZPC = hdata->GetMean();
132 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
134 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
140 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
145 // [2] check PMC responses vs. summed PMQ responses
146 else if(digInd>3 && digInd<12){
147 if(digInd==4) pmQZNC = hdata->GetMean();
148 else if(digInd==5) pmQZNA = hdata->GetMean();
149 else if(digInd==6) pmQZPC = hdata->GetMean();
150 else if(digInd==7) pmQZPA = hdata->GetMean();
152 pmCZNC = hdata->GetMean();
153 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
158 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
161 pmCZNA = hdata->GetMean();
162 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
167 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
170 pmCZPC = hdata->GetMean();
171 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
176 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
179 pmCZPA = hdata->GetMean();
180 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
185 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
195 AliError("AliZDCQAChecker-> No histos!!!\n");
198 if(ntests!=0) test = test/ntests;
199 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
202 // -------------------------------------------------------------------
203 else if(!(strncmp(taskName,"RAW",3))){
205 if(list->GetEntries()==0){
206 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
207 test = 1.; // nothing to check
210 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
214 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
215 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
216 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
217 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
219 Int_t rawInd=0, testgood=0;
222 while((hdata = dynamic_cast<TH1 *>(next()))){
224 // [1] check response of ZNC vs. ZNA
225 if(rawInd==0 || rawInd==1){
227 if(hdata->GetEntries() != 0.){
229 meanZNA = hdata->GetMean();
230 rmsZNA = hdata->GetRMS();
234 if(hdata->GetEntries() != 0.){
236 meanZNC = hdata->GetMean();
239 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
241 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
250 // [2] check response of ZPC vs. ZPA
251 else if(rawInd==2 || rawInd==3){
253 if(hdata->GetEntries() != 0.){
255 meanZPA = hdata->GetMean();
256 rmsZPA = hdata->GetRMS();
260 if(hdata->GetEntries() != 0.){
262 meanZPC = hdata->GetMean();
264 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
266 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
275 // [2] check PMC responses vs. summed PMQ responses
276 else if(rawInd>3 && rawInd<12){
277 if(rawInd==4) pmQZNC = hdata->GetMean();
278 else if(rawInd==5) pmQZNA = hdata->GetMean();
279 else if(rawInd==6) pmQZPC = hdata->GetMean();
280 else if(rawInd==7) pmQZPA = hdata->GetMean();
282 pmCZNC = hdata->GetMean();
283 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
289 pmCZNA = hdata->GetMean();
290 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
296 pmCZPC = hdata->GetMean();
297 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
303 pmCZPA = hdata->GetMean();
304 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
315 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
317 AliError("\t AliZDCQAChecker->No histos!!!\n");
320 if(ntests!=0) test = test/ntests;
321 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
324 // -------------------------------------------------------------------
325 else if(!(strncmp(taskName,"ESD",3))){
327 if(list->GetEntries()==0){
328 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
329 test = 1.; // nothing to check
332 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
336 Double_t meanX=0., meanY=0.;
337 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
338 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
339 Double_t eneCZNA=0., eneCZNC=0., eneCZPA=0., eneCZPC=0.;
340 Double_t eneQZNA=0., eneQZNC=0., eneQZPA=0., eneQZPC=0.;
342 Int_t esdInd=0, testgood=0;
346 while((hdata = dynamic_cast<TH1 *>(next()))){
348 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
351 meanX = hdata->GetMean(1);
352 meanY = hdata->GetMean(2);
353 // check if the spot is centered
354 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
361 // [1] check response of ZNC vs. ZNA
362 if(esdInd==0 || esdInd==1){
364 if(hdata->GetEntries() != 0.){
366 meanZNA = hdata->GetMean();
367 rmsZNA = hdata->GetRMS();
371 if(hdata->GetEntries() != 0.){
373 meanZNC = hdata->GetMean();
376 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
378 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
387 // [2] check response of ZPC vs. ZPA
388 else if(esdInd==2 || esdInd==3){
390 if(hdata->GetEntries() != 0.){
392 meanZPA = hdata->GetMean();
393 rmsZPA = hdata->GetRMS();
397 if(hdata->GetEntries() != 0.){
399 meanZPC = hdata->GetMean();
401 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
403 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
412 // [2] check eneC responses vs. summed eneQ responses
413 else if(esdInd>3 && esdInd<12){
414 if(esdInd==4) eneQZNC = hdata->GetMean();
415 else if(esdInd==5) eneQZNA = hdata->GetMean();
416 else if(esdInd==6) eneQZPC = hdata->GetMean();
417 else if(esdInd==7) eneQZPA = hdata->GetMean();
419 eneCZNC = hdata->GetMean();
420 if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2)) res=1.;
426 eneCZNA = hdata->GetMean();
427 if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2)) res=1.;
433 eneCZPC = hdata->GetMean();
434 if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2)) res=1.;
440 eneCZPA = hdata->GetMean();
441 if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2)) res=1.;
451 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
456 AliError("AliZDCQAChecker-> No histos!!!\n");
459 if(ntests!=0) test = test/ntests;
460 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test);
463 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
467 AliInfo(Form("Test Result = %f", test));