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 Double_t AliZDCQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
33 // Checks the QA histograms on the input list:
37 const char* taskName = AliQA::GetAliTaskName(index);
39 Int_t beamType=0; // 0 -> protons, 1 -> ions
41 // ====================================================================
42 // Checks for p-p events
43 // ====================================================================
45 // -------------------------------------------------------------------
46 if(index == AliQA::kSIM){
48 if(list->GetEntries()==0){
49 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
50 test = 1.; // nothing to check
53 //printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
60 while((hdata = dynamic_cast<TH1 *>(next()))){
62 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
63 // Check DIGITS histos
64 if(!(strncmp(hdata->GetName(),"hDig",4))){
65 if(hdata->GetEntries()>0){
71 if(hdata->GetEntries()>0){
78 AliError("AliZDCQAChecker-> No histos!!!\n");
81 if(ntests!=0) test = test/ntests;
82 //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
85 // -------------------------------------------------------------------
86 else if(index == AliQA::kRAW){
88 if(list->GetEntries()==0){
89 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
90 test = 1.; // nothing to check
93 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
99 while((hdata = dynamic_cast<TH1 *>(next()))){
101 if(hdata->GetEntries()!=0){
102 if(hdata->GetMean()>10.) test += 1.;
108 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
110 AliError("\t AliZDCQAChecker->No histos!!!\n");
113 if(ntests!=0) test = test/ntests;
114 //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
117 // -------------------------------------------------------------------
118 else if(index == AliQA::kESD){
120 if(list->GetEntries()==0){
121 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
122 test = 1.; // nothing to check
125 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
133 while((hdata = dynamic_cast<TH1 *>(next()))){
135 if(hdata->GetEntries()!=0){
137 if(hdata->GetMean()>10.) test += 1.;
146 AliError("AliZDCQAChecker-> No histos!!!\n");
149 if(ntests!=0) test = test/ntests;
150 //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test);
153 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
157 // ====================================================================
158 // Checks for A-A events
159 // ====================================================================
160 else if (beamType==1){
161 // -------------------------------------------------------------------
162 if(index == AliQA::kSIM){
164 if(list->GetEntries()==0){
165 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
166 test = 1.; // nothing to check
169 //printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
173 Double_t meanX=0., meanY=0.;
174 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
175 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
176 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
177 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
179 Int_t digInd=0, testgood=0;
183 while((hdata = dynamic_cast<TH1 *>(next()))){
185 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
186 // Check DIGITS histos
187 if (!(strncmp(hdata->GetName(),"hDig",4))){
188 // [1] check response of ZNC vs. ZNA
189 if(digInd==0 || digInd==1){
191 if(hdata->GetEntries() != 0.){
193 meanZNA = hdata->GetMean();
194 rmsZNA = hdata->GetRMS();
198 if(hdata->GetEntries() != 0.){
200 meanZNC = hdata->GetMean();
203 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
205 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
211 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
216 // [2] check response of ZPC vs. ZPA
217 else if(digInd==2 || digInd==3){
219 if(hdata->GetEntries() != 0.){
221 meanZPA = hdata->GetMean();
222 rmsZPA = hdata->GetRMS();
226 if(hdata->GetEntries() != 0.){
228 meanZPC = hdata->GetMean();
230 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
232 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
238 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
243 // [2] check PMC responses vs. summed PMQ responses
244 else if(digInd>3 && digInd<12){
245 if(digInd==4) pmQZNC = hdata->GetMean();
246 else if(digInd==5) pmQZNA = hdata->GetMean();
247 else if(digInd==6) pmQZPC = hdata->GetMean();
248 else if(digInd==7) pmQZPA = hdata->GetMean();
250 pmCZNC = hdata->GetMean();
251 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
256 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
259 pmCZNA = hdata->GetMean();
260 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
265 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
268 pmCZPC = hdata->GetMean();
269 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
274 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
277 pmCZPA = hdata->GetMean();
278 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
283 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
292 meanX = hdata->GetMean(1);
293 meanY = hdata->GetMean(2);
294 // check if the spot is centered
295 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
300 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
304 AliError("AliZDCQAChecker-> No histos!!!\n");
307 if(ntests!=0) test = test/ntests;
308 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
311 // -------------------------------------------------------------------
312 else if(index == AliQA::kRAW){
314 if(list->GetEntries()==0){
315 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
316 test = 1.; // nothing to check
319 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
323 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
324 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
325 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
326 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
328 Int_t rawInd=0, testgood=0;
331 while((hdata = dynamic_cast<TH1 *>(next()))){
333 // [1] check response of ZNC vs. ZNA
334 if(rawInd==0 || rawInd==1){
336 if(hdata->GetEntries() != 0.){
338 meanZNA = hdata->GetMean();
339 rmsZNA = hdata->GetRMS();
343 if(hdata->GetEntries() != 0.){
345 meanZNC = hdata->GetMean();
348 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
350 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
359 // [2] check response of ZPC vs. ZPA
360 else if(rawInd==2 || rawInd==3){
362 if(hdata->GetEntries() != 0.){
364 meanZPA = hdata->GetMean();
365 rmsZPA = hdata->GetRMS();
369 if(hdata->GetEntries() != 0.){
371 meanZPC = hdata->GetMean();
373 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
375 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
384 // [2] check PMC responses vs. summed PMQ responses
385 else if(rawInd>3 && rawInd<12){
386 if(rawInd==4) pmQZNC = hdata->GetMean();
387 else if(rawInd==5) pmQZNA = hdata->GetMean();
388 else if(rawInd==6) pmQZPC = hdata->GetMean();
389 else if(rawInd==7) pmQZPA = hdata->GetMean();
391 pmCZNC = hdata->GetMean();
392 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.;
398 pmCZNA = hdata->GetMean();
399 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.;
405 pmCZPC = hdata->GetMean();
406 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.;
412 pmCZPA = hdata->GetMean();
413 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.;
423 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
425 AliError("\t AliZDCQAChecker->No histos!!!\n");
428 if(ntests!=0) test = test/ntests;
429 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test);
432 // -------------------------------------------------------------------
433 else if(index == AliQA::kESD){
435 if(list->GetEntries()==0){
436 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
437 test = 1.; // nothing to check
440 printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName);
444 Double_t meanX=0., meanY=0.;
445 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
446 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
447 Double_t eneCZNA=0., eneCZNC=0., eneCZPA=0., eneCZPC=0.;
448 Double_t eneQZNA=0., eneQZNC=0., eneQZPA=0., eneQZPC=0.;
450 Int_t esdInd=0, testgood=0;
454 while((hdata = dynamic_cast<TH1 *>(next()))){
456 //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName());
459 meanX = hdata->GetMean(1);
460 meanY = hdata->GetMean(2);
461 // check if the spot is centered
462 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.;
469 // [1] check response of ZNC vs. ZNA
470 if(esdInd==0 || esdInd==1){
472 if(hdata->GetEntries() != 0.){
474 meanZNA = hdata->GetMean();
475 rmsZNA = hdata->GetRMS();
479 if(hdata->GetEntries() != 0.){
481 meanZNC = hdata->GetMean();
484 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
486 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA) res=1.;
495 // [2] check response of ZPC vs. ZPA
496 else if(esdInd==2 || esdInd==3){
498 if(hdata->GetEntries() != 0.){
500 meanZPA = hdata->GetMean();
501 rmsZPA = hdata->GetRMS();
505 if(hdata->GetEntries() != 0.){
507 meanZPC = hdata->GetMean();
509 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
511 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.;
520 // [2] check eneC responses vs. summed eneQ responses
521 else if(esdInd>3 && esdInd<12){
522 if(esdInd==4) eneQZNC = hdata->GetMean();
523 else if(esdInd==5) eneQZNA = hdata->GetMean();
524 else if(esdInd==6) eneQZPC = hdata->GetMean();
525 else if(esdInd==7) eneQZPA = hdata->GetMean();
527 eneCZNC = hdata->GetMean();
528 if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2)) res=1.;
534 eneCZNA = hdata->GetMean();
535 if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2)) res=1.;
541 eneCZPC = hdata->GetMean();
542 if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2)) res=1.;
548 eneCZPA = hdata->GetMean();
549 if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2)) res=1.;
559 //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests);
562 AliError("AliZDCQAChecker-> No histos!!!\n");
565 if(ntests!=0) test = test/ntests;
566 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test);
569 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
574 AliInfo(Form("Test Result = %f", test));