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 const Double_t AliZDCQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
33 // Checks the QA histograms on the input list:
36 Int_t count=0, ntests=0;
37 const char* taskName = AliQA::GetAliTaskName(index);
39 // -------------------------------------------------------------------
40 if(index == AliQA::kSIM){
42 if(list->GetEntries()==0){
43 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
44 test = 1.; // nothing to check
47 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
51 Double_t meanX=0., meanY=0.;
52 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
53 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
54 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
55 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
57 Int_t digInd=0, testgood=0;
61 while((hdata = dynamic_cast<TH1 *>(next()))){
63 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
65 if(!(strncmp(hdata->GetName(),"hZNCh",5))){
67 meanX = hdata->GetMean(1);
68 meanY = hdata->GetMean(2);
69 // check if the spot is centered
70 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
75 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
77 // Check DIGITS histos
79 // [1] check response of ZNC vs. ZNA
80 if(digInd==0 || digInd==1){
82 if(hdata->GetEntries() != 0.){
84 meanZNA = hdata->GetMean();
85 rmsZNA = hdata->GetRMS();
89 if(hdata->GetEntries() != 0.){
91 meanZNC = hdata->GetMean();
94 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
96 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
102 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
107 // [2] check response of ZPC vs. ZPA
108 else if(digInd==2 || digInd==3){
110 if(hdata->GetEntries() != 0.){
112 meanZPA = hdata->GetMean();
113 rmsZPA = hdata->GetRMS();
117 if(hdata->GetEntries() != 0.){
119 meanZPC = hdata->GetMean();
121 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
123 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
129 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
134 // [2] check PMC responses vs. summed PMQ responses
135 else if(digInd>3 && digInd<12){
136 if(digInd==4) pmQZNC = hdata->GetMean();
137 else if(digInd==5) pmQZNA = hdata->GetMean();
138 else if(digInd==6) pmQZPC = hdata->GetMean();
139 else if(digInd==7) pmQZPA = hdata->GetMean();
141 pmCZNC = hdata->GetMean();
142 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
147 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
150 pmCZNA = hdata->GetMean();
151 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
156 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
159 pmCZPC = hdata->GetMean();
160 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
165 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
168 pmCZPA = hdata->GetMean();
169 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
174 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
184 AliError("AliZDCQAChecker-> No histos!!!\n");
187 if(ntests!=0) test = test/ntests;
188 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
191 // -------------------------------------------------------------------
192 else if(index == AliQA::kRAW){
194 if(list->GetEntries()==0){
195 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
196 test = 1.; // nothing to check
199 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
203 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
204 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
205 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
206 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
208 Int_t rawInd=0, testgood=0;
211 while((hdata = dynamic_cast<TH1 *>(next()))){
213 // [1] check response of ZNC vs. ZNA
214 if(rawInd==0 || rawInd==1){
216 if(hdata->GetEntries() != 0.){
218 meanZNA = hdata->GetMean();
219 rmsZNA = hdata->GetRMS();
223 if(hdata->GetEntries() != 0.){
225 meanZNC = hdata->GetMean();
228 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
230 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
239 // [2] check response of ZPC vs. ZPA
240 else if(rawInd==2 || rawInd==3){
242 if(hdata->GetEntries() != 0.){
244 meanZPA = hdata->GetMean();
245 rmsZPA = hdata->GetRMS();
249 if(hdata->GetEntries() != 0.){
251 meanZPC = hdata->GetMean();
253 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
255 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
264 // [2] check PMC responses vs. summed PMQ responses
265 else if(rawInd>3 && rawInd<12){
266 if(rawInd==4) pmQZNC = hdata->GetMean();
267 else if(rawInd==5) pmQZNA = hdata->GetMean();
268 else if(rawInd==6) pmQZPC = hdata->GetMean();
269 else if(rawInd==7) pmQZPA = hdata->GetMean();
271 pmCZNC = hdata->GetMean();
272 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
278 pmCZNA = hdata->GetMean();
279 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
285 pmCZPC = hdata->GetMean();
286 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
292 pmCZPA = hdata->GetMean();
293 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
304 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
306 AliError("\t AliZDCQAChecker->No histos!!!\n");
309 if(ntests!=0) test = test/ntests;
310 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
313 // -------------------------------------------------------------------
314 else if(index == AliQA::kESD){
316 if(list->GetEntries()==0){
317 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
318 test = 1.; // nothing to check
321 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
325 Double_t meanX=0., meanY=0.;
326 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
327 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
328 Double_t eneCZNA=0., eneCZNC=0., eneCZPA=0., eneCZPC=0.;
329 Double_t eneQZNA=0., eneQZNC=0., eneQZPA=0., eneQZPC=0.;
331 Int_t esdInd=0, testgood=0;
335 while((hdata = dynamic_cast<TH1 *>(next()))){
337 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
340 meanX = hdata->GetMean(1);
341 meanY = hdata->GetMean(2);
342 // check if the spot is centered
343 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
350 // [1] check response of ZNC vs. ZNA
351 if(esdInd==0 || esdInd==1){
353 if(hdata->GetEntries() != 0.){
355 meanZNA = hdata->GetMean();
356 rmsZNA = hdata->GetRMS();
360 if(hdata->GetEntries() != 0.){
362 meanZNC = hdata->GetMean();
365 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
367 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
376 // [2] check response of ZPC vs. ZPA
377 else if(esdInd==2 || esdInd==3){
379 if(hdata->GetEntries() != 0.){
381 meanZPA = hdata->GetMean();
382 rmsZPA = hdata->GetRMS();
386 if(hdata->GetEntries() != 0.){
388 meanZPC = hdata->GetMean();
390 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
392 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
401 // [2] check eneC responses vs. summed eneQ responses
402 else if(esdInd>3 && esdInd<12){
403 if(esdInd==4) eneQZNC = hdata->GetMean();
404 else if(esdInd==5) eneQZNA = hdata->GetMean();
405 else if(esdInd==6) eneQZPC = hdata->GetMean();
406 else if(esdInd==7) eneQZPA = hdata->GetMean();
408 eneCZNC = hdata->GetMean();
409 if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2)) res=1.;
415 eneCZNA = hdata->GetMean();
416 if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2)) res=1.;
422 eneCZPC = hdata->GetMean();
423 if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2)) res=1.;
429 eneCZPA = hdata->GetMean();
430 if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2)) res=1.;
440 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
445 AliError("AliZDCQAChecker-> No histos!!!\n");
448 if(ntests!=0) test = test/ntests;
449 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test);
452 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
456 AliInfo(Form("Test Result = %f", test));