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(AliQAv1::ALITASK_t index, TObjArray ** list)
33 // Checks the QA histograms on the input list:
35 Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
36 Int_t * ntests = new Int_t[AliRecoParam::kNSpecies] ;
37 const char* taskName = AliQAv1::GetAliTaskName(index);
40 //YS Int_t beamType=0; // 0 -> protons, 1 -> ions
41 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
44 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
46 // ====================================================================
47 // Checks for p-p events
48 // ====================================================================
50 if ( specie == AliRecoParam::kLowMult) {
51 if(list[specie]->GetEntries()==0){
52 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); // nothing to check
55 //AliInfo(Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
56 TIter next(list[specie]);
59 while((hdata = dynamic_cast<TH1 *>(next()))){
61 // -------------------------------------------------------------------
62 if(index == AliQAv1::kSIM){
63 //AliInfo(Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
64 // Check DIGITS histos
65 if(!(strncmp(hdata->GetName(),"hDig",4))){
66 if(hdata->GetEntries()>0){
73 if(hdata->GetEntries()>0){
78 // -------------------------------------------------------------------
79 } else if(index == AliQAv1::kRAW) {
80 if(hdata->GetEntries()!=0){
81 if(hdata->GetMean()>10.)
87 // -------------------------------------------------------------------
88 } else if(index == AliQAv1::kESD) {
90 if(hdata->GetEntries()!=0){
92 if(hdata->GetMean()>10.)
100 // -------------------------------------------------------------------
102 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
106 AliError("AliZDCQAChecker-> No histos!!!\n");
109 // ====================================================================
110 // Checks for A-A events
111 // ====================================================================
112 //else if (beamType==1){
113 else if ( specie == AliRecoParam::kHighMult) {
114 if(list[specie]->GetEntries()==0){
115 AliWarning("\tAliZDCQAChecker->The list to be checked is empty!");
118 //AliInfo(Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
120 TIter next(list[specie]);
122 while((hdata = dynamic_cast<TH1 *>(next()))){
124 //AliInfo(Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
126 Double_t meanX=0., meanY=0.;
127 Double_t meanZNA=0., rmsZNA=0., meanZNC=0.;
128 Double_t meanZPA=0., rmsZPA=0., meanZPC=0.;
129 Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
130 Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
133 // -------------------------------------------------------------------
134 if(index == AliQAv1::kSIM){
136 // Check DIGITS histos
137 if (!(strncmp(hdata->GetName(),"hDig",4))){
138 // [1] check response of ZNC vs. ZNA
139 if(digInd==0 || digInd==1){
141 if(hdata->GetEntries() != 0.){
143 meanZNA = hdata->GetMean();
144 rmsZNA = hdata->GetRMS();
148 if(hdata->GetEntries() != 0.){
150 meanZNC = hdata->GetMean();
153 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
155 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA)
162 //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]));
167 // [2] check response of ZPC vs. ZPA
168 else if(digInd==2 || digInd==3){
170 if(hdata->GetEntries() != 0.){
172 meanZPA = hdata->GetMean();
173 rmsZPA = hdata->GetRMS();
177 if(hdata->GetEntries() != 0.){
179 meanZPC = hdata->GetMean();
181 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
183 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA))
190 //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]);
195 // [2] check PMC responses vs. summed PMQ responses
196 else if(digInd>3 && digInd<12){
197 if(digInd==4) pmQZNC = hdata->GetMean();
198 else if(digInd==5) pmQZNA = hdata->GetMean();
199 else if(digInd==6) pmQZPC = hdata->GetMean();
200 else if(digInd==7) pmQZPA = hdata->GetMean();
202 pmCZNC = hdata->GetMean();
203 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2))
209 //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]));
212 pmCZNA = hdata->GetMean();
213 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2))
219 //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]));
222 pmCZPC = hdata->GetMean();
223 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2))
229 //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]);
232 pmCZPA = hdata->GetMean();
233 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2))
239 //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]));
247 meanX = hdata->GetMean(1);
248 meanY = hdata->GetMean(2);
249 // check if the spot is centered
250 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2))
256 //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]);
259 // -------------------------------------------------------------------
260 else if(index == AliQAv1::kRAW){
262 // [1] check response of ZNC vs. ZNA
263 if(rawInd==0 || rawInd==1){
265 if(hdata->GetEntries() != 0.){
267 meanZNA = hdata->GetMean();
268 rmsZNA = hdata->GetRMS();
272 if(hdata->GetEntries() != 0.){
274 meanZNC = hdata->GetMean();
277 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
279 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA)
291 // [2] check response of ZPC vs. ZPA
292 else if(rawInd==2 || rawInd==3){
294 if(hdata->GetEntries() != 0.){
296 meanZPA = hdata->GetMean();
297 rmsZPA = hdata->GetRMS();
301 if(hdata->GetEntries() != 0.){
303 meanZPC = hdata->GetMean();
305 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
307 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA))
319 // [2] check PMC responses vs. summed PMQ responses
320 else if(rawInd>3 && rawInd<12){
321 if(rawInd==4) pmQZNC = hdata->GetMean();
322 else if(rawInd==5) pmQZNA = hdata->GetMean();
323 else if(rawInd==6) pmQZPC = hdata->GetMean();
324 else if(rawInd==7) pmQZPA = hdata->GetMean();
326 pmCZNC = hdata->GetMean();
327 if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2))
335 pmCZNA = hdata->GetMean();
336 if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2))
344 pmCZPC = hdata->GetMean();
345 if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2))
353 pmCZPA = hdata->GetMean();
354 if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2))
364 // -------------------------------------------------------------------
365 else if(index == AliQAv1::kESD){
366 Double_t eneQZNC, eneQZNA ;
367 Double_t eneQZPC, eneQZPA ;
368 Double_t eneCZNC, eneCZNA ;
369 Double_t eneCZPC, eneCZPA ;
373 meanX = hdata->GetMean(1);
374 meanY = hdata->GetMean(2);
375 // check if the spot is centered
376 if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2))
385 // [1] check response of ZNC vs. ZNA
386 if(esdInd==0 || esdInd==1){
388 if(hdata->GetEntries() != 0.){
390 meanZNA = hdata->GetMean();
391 rmsZNA = hdata->GetRMS();
395 if(hdata->GetEntries() != 0.){
397 meanZNC = hdata->GetMean();
400 // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level)
402 if(TMath::Abs(meanZNA-meanZNC)<rmsZNA)
413 // [2] check response of ZPC vs. ZPA
414 else if(esdInd==2 || esdInd==3){
416 if(hdata->GetEntries() != 0.){
418 meanZPA = hdata->GetMean();
419 rmsZPA = hdata->GetRMS();
423 if(hdata->GetEntries() != 0.){
425 meanZPC = hdata->GetMean();
427 // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level)
429 if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA))
440 // [2] check eneC responses vs. summed eneQ responses
441 else if(esdInd>3 && esdInd<12){
442 if(esdInd==4) eneQZNC = hdata->GetMean();
443 else if(esdInd==5) eneQZNA = hdata->GetMean();
444 else if(esdInd==6) eneQZPC = hdata->GetMean();
445 else if(esdInd==7) eneQZPA = hdata->GetMean();
447 eneCZNC = hdata->GetMean();
448 if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2))
456 eneCZNA = hdata->GetMean();
457 if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2))
465 eneCZPC = hdata->GetMean();
466 if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2))
474 eneCZPA = hdata->GetMean();
475 if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2))
485 //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]));
488 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
492 AliError("\t AliZDCQAChecker->No histos!!!\n");
495 AliError(Form("Checking not implemented for %s, %s",
496 AliRecoParam::GetEventSpecieName(AliRecoParam::kCosmic),
497 AliRecoParam::GetEventSpecieName(AliRecoParam::kCalib))) ;
501 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
502 if(ntests[specie]!=0) test[specie] = test[specie]/ntests[specie];
503 printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test[specie]);