1 /**************************************************************************
2 * Copyright(c) 2007-2009, 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 **************************************************************************/
18 // *****************************************
19 // Checks the quality assurance
20 // by comparing with reference data
21 // P. Cerello Apr 2008
24 // --- ROOT system ---
29 #include "TPaveText.h"
31 //#include "TPaletteAxis.h"
32 // --- AliRoot header files ---
33 #include "AliITSQADataMakerRec.h"
34 #include "AliITSQASDDChecker.h"
36 #include "AliCDBEntry.h"
37 #include "AliCDBManager.h"
38 #include "AliITSCalibrationSDD.h"
39 #include "AliITSgeomTGeo.h"
40 #include "AliQAManager.h"
42 #include "AliQAChecker.h"
43 #include "AliQACheckerBase.h"
46 ClassImp(AliITSQASDDChecker)
50 //_____________________________________________________________________
52 AliITSQASDDChecker::AliITSQASDDChecker():
58 fThresholdForRelativeOccupancy(0.01),
59 fThresholdForRecToRawRatio(0.04),
63 // Default constructor
64 fStepBitSDD=new Double_t[AliQAv1::kNBIT];
65 fLowSDDValue=new Float_t[AliQAv1::kNBIT];
66 fHighSDDValue=new Float_t[AliQAv1::kNBIT];
67 for(Int_t ibit=0;ibit<AliQAv1::kNBIT;ibit++)
70 fLowSDDValue[ibit]=0.;
71 fHighSDDValue[ibit]=0.;
77 //__________________________________________________________________
78 AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qac )
81 this->~AliITSQASDDChecker();
82 new(this) AliITSQASDDChecker(qac);
86 AliITSQASDDChecker::~AliITSQASDDChecker()
92 delete[] fStepBitSDD ;
102 delete[]fHighSDDValue;
117 //__________________________________________________________________
118 Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
120 //check histograms of the different lists
121 AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
123 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
125 Double_t sddQACheckerValue = 0.;
128 Double_t entries2[2];
129 for(Int_t i=0;i<2;i++)entries2[i]=0.;
132 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
133 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
136 AliError("Calibration object retrieval failed! SDD will not be processed");
138 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
141 fCalibration = (TObjArray *)calibSDD->GetObject();
143 if(!cacheStatus)calibSDD->SetObject(NULL);
144 calibSDD->SetOwner(kTRUE);
152 AliInfo("Calib SDD Created\n ");
161 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
162 // if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
163 // if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
164 // if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
165 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
169 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
172 Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
173 Int_t excluded=0; //excluded modules
174 Int_t excludeddriftregion=0; //excluded single drift region
175 Int_t active=0; //active modules
176 Int_t activedriftregion=0; //active single drift region
177 Int_t exactive=0; //excluded modules but taking data
178 Int_t exactivedriftregion=0; //excluded single drift region but taking data
183 //Int_t emptyactivemodule=0;
184 Int_t emptyactivemoduleperlayer[2];
185 //Int_t emptydractivemodule=0;
186 Int_t emptyactivedrperlayer[2];
192 for(Int_t i=0;i<2;i++)
198 emptydriftregion[i]=0;
199 filleddriftregion[i]=0;
200 excludedmoduleperlayer[i]=0;
201 excludeddrperlayer[i]=0;
202 activemoduleperlayer[i]=0;
203 activedrperlayer[i]=0;
204 exactivemoduleperlayer[i]=0;
205 exactivedrperlayer[i]=0;
206 emptyactivemoduleperlayer[i]=0;
207 emptyactivedrperlayer[i]=0;
212 //take the number of events
214 while( (hdata = dynamic_cast<TH1* >(next())) ){
216 TString hname=hdata->GetName();
218 if(hname.Contains("SDDRawDataCheck"))
220 neventsraw=(Int_t)hdata->GetBinContent(1);
228 while( (hdata = dynamic_cast<TH1* >(next())) ){
229 if (hdata){TString hname=hdata->GetName();
230 if(hname.Contains("SDDchargeMap"))continue;
231 if(hname.Contains("SDDDDLPattern"))continue;
232 if(hname.Contains("SDDEventSize"))continue;
233 if(hname.Contains("_RelativeOccupancy"))continue;
234 if(hname.Contains("SDDModPattern")){
235 if(hname.Contains("NORM")) continue;
236 hmodule=(TH1*)hdata->Clone();
237 entries= hdata->GetEntries();
238 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
240 int modmax=hdata->GetNbinsX();
243 for(Int_t i=1;i<=modmax;i++)
247 content=hdata->GetBinContent(i);
248 if(AliITSQADataMakerRec::AreEqual(content,0.))
251 emptymodules[llay]++;
256 filledmodules[llay]++;
259 //output of the check at the level of the modules. Drift region in the following checks
261 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
262 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
263 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
264 }//end else pattern entries !=0
265 } //modpattern (1d histogram)
266 if(hname.Contains("_RelativeOccupancy")) {
267 //fRawModulePattern = (TH1F *) hdata;
268 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
269 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
270 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
271 Int_t aboveThreshold = 0;
272 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
273 Float_t fractionAboveThreshold=0.;
274 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
275 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
276 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
277 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
278 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
279 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
281 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
283 if(hname.Contains("3"))layer=0;
284 else if(hname.Contains("4"))layer=1;
285 entries2[layer]=hdata->GetEntries();
286 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
287 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
290 if(hname.Contains("3"))layer1=0;
291 else if(hname.Contains("4"))layer1=1;
292 TH2* htemp=dynamic_cast<TH2*>(hdata);
294 hlayer[layer1]=(TH2*)htemp->Clone();
295 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
296 //hlayer[layer1]->RebinX(2);
297 int modmay=hlayer[layer1]->GetNbinsY();
298 TH1D* hproj= hlayer[layer1]->ProjectionY();
299 Double_t ladcontent=0;
300 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
301 ladcontent=hproj->GetBinContent(i);
302 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
303 else filledladders[layer1]++;}//end for
304 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
308 }//end else entries !=0
312 for(Int_t ii=0;ii<2;ii++)
319 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
321 if(hmodule || (hlayer[0] && hlayer[1])){
322 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
327 module=imod+fgkmodoffset;
328 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
329 if(cal==0) { continue;}
330 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
333 excludedmoduleperlayer[lay-3]++;
335 Double_t contentlayer[2];
336 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
337 if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
338 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
339 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
340 filledmodules[lay-3]++;
342 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
344 exactivemoduleperlayer[lay-3]++;
345 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
347 emptymodules[lay-3]++; //it has to be empty
352 Int_t totactiveside=0;
353 //Int_t totbadside=0;
354 Double_t contentgood=0.;
356 for(Int_t i=0;i<2;i++){
357 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
358 if(cal->IsWingBad(i))
360 excludeddriftregion++;
361 excludeddrperlayer[lay-3]++;
362 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
363 AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",i,module,lay,lad,det));
364 exactivedriftregion++;
365 exactivedrperlayer[lay-3]++;
367 filleddriftregion[lay-3]++;
371 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
373 AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",i,module, lay, lad, det));
383 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",module, lay, lad, det));
384 emptymodules[lay-3]++;
390 filledmodules[lay-3]++;
397 //emptydriftregion[lay-3]++; //it has to be empty
398 emptydriftregion[lay-3]++;
401 filleddriftregion[lay-3]++;
406 activedrperlayer[lay-3]++;
407 }else if(totactiveside==2)
410 activemoduleperlayer[lay-3]++;
415 AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
416 AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
417 for(Int_t i=0;i<2;i++)
419 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
420 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
422 emptysum=emptymodules[0]+emptymodules[1];
423 emptydiff=emptysum-excluded;
424 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
425 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
427 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
428 emptydrdiff=emptydrsum-excludeddriftregion;
429 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
430 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
434 if(emptysum>excluded||emptydrsum>excludeddriftregion){
435 AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! \n",emptydiff,emptydrdiff));
436 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
437 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
438 //printf("========================= %d",AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::kCosmic));
439 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
440 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
442 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
443 if(neventsraw<numlimit)
445 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
447 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
451 results2.Form(" Events %d. If PHYISICS, follow the TWiki instruction and call the Expert ",neventsraw);
453 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
457 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
458 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic)
461 if(neventsraw<numlimit)
463 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
464 results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
465 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
467 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
471 results1.Form("%i good module(s) and %i good drift region(s) have no data!",emptydiff,emptydrdiff);
472 results2.Form(" Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
474 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
479 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
480 AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
481 results1.Form("OK.");
482 results2.Form(" All active modules and drift regions in acquisition");
484 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
486 if(exactive!=0||exactivedriftregion!=0){
487 AliError(Form("%i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
488 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
489 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
490 results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
491 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
493 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
495 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
496 AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition took data!\n Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
497 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
498 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
500 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
502 if(active==0||activedriftregion==0){
503 AliError(Form("No modules or single drift regions took data: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion));
504 results1.Form("No modules or drift region took data: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
505 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
507 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
513 while( (hdata=dynamic_cast<TH1* >(next())) )
516 TString hname=hdata->GetName();
517 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
518 if(hname.Contains("NORM"))continue;
519 //AliInfo("========================================Found histo 11\n");
521 if(hname.Contains("3"))lay=0;
522 else if(hname.Contains("4"))lay=1;
523 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
524 pave[lay]->AddText(results1.Data());
525 pave[lay]->AddText(results2.Data());
526 pave[lay]->SetFillColor(color);
527 pave[lay]->SetBorderSize(1);
528 pave[lay]->SetLineWidth(1);
529 hdata->GetListOfFunctions()->Add(pave[lay]);
532 if(hname.Contains("SDDRawDataCheck"))
535 //AliInfo("========================================Found histo\n");
536 ((TH1F*)hdata)->SetBinContent(5,active);
537 ((TH1F*)hdata)->SetBinContent(6,filled);
538 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
539 ((TH1F*)hdata)->SetBinContent(8,filleddr);
540 ((TH1F*)hdata)->SetBinContent(9,excluded);
541 ((TH1F*)hdata)->SetBinContent(10,empty);
542 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
543 ((TH1F*)hdata)->SetBinContent(12,emptydr);
544 ((TH1F*)hdata)->SetBinContent(13,exactive);
545 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
546 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
547 ((TH1F*)hdata)->SetBinContent(16,emptydr);
550 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
551 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
552 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
553 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
554 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
555 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
556 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
557 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
558 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
559 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
560 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
561 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
564 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
565 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
566 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
567 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
568 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
569 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
570 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
571 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
572 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
573 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
574 ((TH1F*)hdata)->SetBinContent(43,activedrperlayer[1]);
575 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
585 for(Int_t i=0;i<2;i++) {
594 case AliQAv1::kNULLTASK:{
595 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
596 sddQACheckerValue=1.;
602 Int_t uidrec=list->GetUniqueID();
603 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
606 if (list->GetEntries() == 0){ //check if the list is empty
607 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
608 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
616 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
619 Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
620 Int_t excluded=0; //excluded modules
621 Int_t excludeddriftregion=0; //excluded single drift region
622 Int_t active=0; //active modules
623 Int_t activedriftregion=0; //active single drift region
624 Int_t exactive=0; //excluded modules but taking data
625 Int_t exactivedriftregion=0; //excluded single drift region but taking data
630 //Int_t emptyactivemodule=0;
631 Int_t emptyactivemoduleperlayer[2];
632 //Int_t emptydractivemodule=0;
633 Int_t emptyactivedrperlayer[2];
639 for(Int_t i=0;i<2;i++)
645 emptydriftregion[i]=0;
646 filleddriftregion[i]=0;
647 excludedmoduleperlayer[i]=0;
648 excludeddrperlayer[i]=0;
649 activemoduleperlayer[i]=0;
650 activedrperlayer[i]=0;
651 exactivemoduleperlayer[i]=0;
652 exactivedrperlayer[i]=0;
653 emptyactivemoduleperlayer[i]=0;
654 emptyactivedrperlayer[i]=0;
657 Int_t neventsrecpoints=0;
659 while( (hdata = dynamic_cast<TH1* >(next())) ){
661 TString hname=hdata->GetName();
663 if(hname.Contains("SDDRecPointCheck"))
665 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
674 while((hdata=dynamic_cast<TH1* >(next()))){
676 TString hname=hdata->GetName();
677 if(hname.Contains("_RelativeOccupancy")) {
678 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
679 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
680 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
681 Int_t aboveThreshold = 0;
682 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
683 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
685 Float_t fractionAboveThreshold=0.;
686 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
687 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
688 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
689 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
690 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
691 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
692 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
695 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
696 //Float_t threshold = 0.;
697 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
698 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
699 Int_t belowThreshold = 0;
700 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
701 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
703 Double_t fractionBelowThreshold =0.;
704 Double_t entries3=((TH1F *)hdata)->GetEntries();
705 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
706 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
707 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
708 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
709 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
710 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
711 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
712 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
715 if(hname.Contains("dedx")) {
716 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
717 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
719 if(hname.Contains("SDDModPatternRP")){
720 if(hname.Contains("NORM")) continue;
721 hmodule=(TH1*)hdata->Clone();
722 entries= hdata->GetEntries();
723 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
725 int modmax=hdata->GetNbinsX();
728 for(Int_t i=1;i<=modmax;i++)
732 content=hdata->GetBinContent(i);
733 if(AliITSQADataMakerRec::AreEqual(content,0.))
736 emptymodules[llay]++;
741 filledmodules[llay]++;
744 //output of the check at the level of the modules. Drift region in the following checks
746 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
747 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
748 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
749 }//end else pattern entries !=0
750 } //modpattern (1d histogram)
752 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
754 if(hname.Contains("3"))layer=0;
755 else if(hname.Contains("4"))layer=1;
756 entries2[layer]=hdata->GetEntries();
757 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
758 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
761 if(hname.Contains("3"))layer1=0;
762 else if(hname.Contains("4"))layer1=1;
763 TH2* htemp=dynamic_cast<TH2*>(hdata);
765 hlayer[layer1]=(TH2*)htemp->Clone();
766 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
767 //hlayer[layer1]->RebinX(2);
768 int modmay=hlayer[layer1]->GetNbinsY();
769 TH1D* hproj= hlayer[layer1]->ProjectionY();
770 Double_t ladcontent=0;
771 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
772 ladcontent=hproj->GetBinContent(i);
773 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
774 else filledladders[layer1]++;}//end for
775 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
779 }//end else entries !=0
783 for(Int_t ii=0;ii<2;ii++)
790 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
792 if(hmodule || (hlayer[0] && hlayer[1])){
793 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
798 module=imod+fgkmodoffset;
799 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
800 if(cal==0) { continue;}
801 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
804 excludedmoduleperlayer[lay-3]++;
806 Double_t contentlayer[2];
807 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
808 if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
809 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
810 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
811 filledmodules[lay-3]++;
813 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
815 exactivemoduleperlayer[lay-3]++;
816 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
818 emptymodules[lay-3]++; //it has to be empty
823 Int_t totactiveside=0;
824 //Int_t totbadside=0;
825 Double_t contentgood=0.;
827 for(Int_t i=0;i<2;i++){
828 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
829 if(cal->IsWingBad(i))
831 excludeddriftregion++;
832 excludeddrperlayer[lay-3]++;
833 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
834 AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, has recpoints \n ",i,module,lay,lad,det));
835 exactivedriftregion++;
836 exactivedrperlayer[lay-3]++;
838 filleddriftregion[lay-3]++;
842 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
844 AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present\n ",i,module, lay, lad, det));
854 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
855 emptymodules[lay-3]++;
861 filledmodules[lay-3]++;
868 //emptydriftregion[lay-3]++; //it has to be empty
869 emptydriftregion[lay-3]++;
872 filleddriftregion[lay-3]++;
877 activedrperlayer[lay-3]++;
878 }else if(totactiveside==2)
881 activemoduleperlayer[lay-3]++;
886 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
887 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
888 for(Int_t i=0;i<2;i++)
890 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
891 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
893 emptysum=emptymodules[0]+emptymodules[1];
894 emptydiff=emptysum-excluded;
895 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
896 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
898 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
899 emptydrdiff=emptydrsum-excludeddriftregion;
900 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
901 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
904 if(emptysum>excluded||emptydrsum>excludeddriftregion){
905 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
906 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
907 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
909 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
910 Int_t numlimits=1000;
912 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
913 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
914 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
916 if(neventsrecpoints<numlimits)
918 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
920 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
924 results2.Form(" Events %d .If PHYISICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
926 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
930 //if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
931 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic){
933 if( neventsrecpoints<numlimit)
935 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
936 results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
937 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
939 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
943 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
944 results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
946 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
953 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
954 AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
955 results1.Form("OK.");
956 results2.Form(" All active modules have recpoints");
958 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
960 if(exactive!=0||exactivedriftregion!=0){
961 AliError(Form("%i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
962 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
963 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
964 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
965 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
967 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
969 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
970 AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition have recpoints!\n Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
971 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
972 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
974 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
976 if(active==0||activedriftregion==0){
977 AliError(Form("No modules or single drift regions have recpoints: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion));
978 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
979 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
981 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
987 while( (hdata=dynamic_cast<TH1* >(next())) )
990 TString hname=hdata->GetName();
991 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
992 if(hname.Contains("NORM"))continue;
993 //AliInfo("========================================Found histo 11\n");
995 if(hname.Contains("3"))lay=0;
996 else if(hname.Contains("4"))lay=1;
997 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
998 pave[lay]->AddText(results1.Data());
999 pave[lay]->AddText(results2.Data());
1000 pave[lay]->SetFillColor(color);
1001 pave[lay]->SetBorderSize(1);
1002 pave[lay]->SetLineWidth(1);
1003 hdata->GetListOfFunctions()->Add(pave[lay]);
1006 if(hname.Contains("SDDRecPointCheck"))
1009 //AliInfo("========================================Found histo\n");
1010 ((TH1F*)hdata)->SetBinContent(5,active);
1011 ((TH1F*)hdata)->SetBinContent(6,filled);
1012 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
1013 ((TH1F*)hdata)->SetBinContent(8,filleddr);
1014 ((TH1F*)hdata)->SetBinContent(9,excluded);
1015 ((TH1F*)hdata)->SetBinContent(10,empty);
1016 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
1017 ((TH1F*)hdata)->SetBinContent(12,emptydr);
1018 ((TH1F*)hdata)->SetBinContent(13,exactive);
1019 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
1020 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
1021 ((TH1F*)hdata)->SetBinContent(16,emptydr);
1024 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
1025 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
1026 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
1027 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
1028 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
1029 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
1030 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
1031 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
1032 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1033 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1034 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
1035 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1038 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1039 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1040 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1041 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1042 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1043 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1044 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1045 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1046 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1047 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1048 ((TH1F*)hdata)->SetBinContent(45,activedrperlayer[1]);
1049 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1059 for(Int_t i=0;i<2;i++) {
1065 //sddQACheckerValue=1.;
1066 }//end recpoint list uid = 20
1070 if (list->GetEntries() == 0){
1071 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1075 while( (hdata = dynamic_cast<TH1* >(next())) ){
1077 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1079 TString hname=hdata->GetName();
1080 if(hname.Contains("SDD DIGITS Module Pattern")) {
1083 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1084 } else if(hname.Contains("SDD Anode Distribution")) {
1085 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1086 } else if(hname.Contains("SDD Tbin Distribution")) {
1088 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1089 } else if(hname.Contains("SDD ADC Counts Distribution")) {
1090 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1097 sddQACheckerValue=1.;
1104 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1105 sddQACheckerValue=1.;
1110 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1111 sddQACheckerValue=1.;
1114 case AliQAv1::kNTASK:{
1115 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1116 sddQACheckerValue=1.;
1119 case AliQAv1::kSIM:{
1120 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1121 Int_t uid=list->GetUniqueID();
1124 if (list->GetEntries() == 0){
1125 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1129 while( (hdata = dynamic_cast<TH1* >(next())) ){
1131 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1133 TString hname=hdata->GetName();
1134 if(hname.Contains("SDDDIGITSModulePattern")) {
1137 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1138 } else if(hname.Contains("SDDAnodeDistribution")) {
1139 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1140 } else if(hname.Contains("SDDTbinDistribution")) {
1142 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1143 } else if(hname.Contains("SDDADCCountsDistribution")) {
1144 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1154 if (list->GetEntries() == 0){
1155 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1160 while( (hdata = dynamic_cast<TH1* >(next())) ){
1162 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1164 TString hname=hdata->GetName();
1165 if(hname.Contains("SDDHITSModulePattern")) {
1167 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1168 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
1169 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1170 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
1171 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1172 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
1173 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1174 }//end deposited energy
1183 if (list->GetEntries() == 0){
1184 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1188 while( (hdata = dynamic_cast<TH1* >(next())) ){
1190 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1192 TString hname=hdata->GetName();
1193 if(hname.Contains("SDDSDIGITSModulePattern")) {
1195 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1196 } else if(hname.Contains("SDDAnodeDistribution")) {
1197 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1198 } else if(hname.Contains("SDDTbinDistribution")) {
1200 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1201 } else if(hname.Contains("SDDADCCountsDistribution")) {
1202 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1203 }//end adc counts bindistribution
1209 sddQACheckerValue=1.;
1216 if(hdata) delete hdata;
1219 return sddQACheckerValue;
1222 //__________________________________________________________________
1223 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1225 //set the number of the histograms already present in the list before the SDD histograms
1226 fSubDetOffset = taskoffset;
1230 //__________________________________________________________________
1231 void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
1233 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
1234 //if(fStepBitSDD){/*delete fStepBitSDD;*/ fStepBitSDD=NULL;}
1235 //fStepBitSDD = new Double_t[AliQAv1::kNBIT];
1236 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1238 fStepBitSDD[bit]=steprange[bit];
1242 //__________________________________________________________________
1243 void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
1245 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
1246 // fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1247 // fHighSDDValue= new Float_t[AliQAv1::kNBIT];
1249 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1251 fLowSDDValue[bit]=lowvalue[bit];
1252 fHighSDDValue[bit]= highvalue[bit];
1256 //__________________________________________________________________
1257 Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1259 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1262 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
1266 case AliQAv1::kRAWS:{
1267 rval=MakeSDDRawsImage(list, task,mode);
1270 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1272 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1275 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1278 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1279 {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
1286 //_______________________________________________________________________
1287 Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1289 // MakeSDDRawsImage: raw data QA plots
1291 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1292 //printf("-------------------------> %i \n", esIndex);
1293 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1294 {//printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1298 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1299 if ( !fImage[esIndex] ) {
1300 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1303 fImage[esIndex]->Clear() ;
1304 fImage[esIndex]->SetTitle(title) ;
1305 fImage[esIndex]->cd();
1307 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1308 someText.AddText(title);
1310 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1311 fImage[esIndex]->Clear() ;
1312 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1313 Int_t ny =2; // nx ;
1314 //if (nx < TMath::Sqrt(nImages))
1316 fImage[esIndex]->Divide(nx, ny) ;
1317 TIter nexthist(list[esIndex]) ;
1320 fImage[esIndex]->cd(npad);
1321 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1322 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1323 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1324 TString cln(hist->ClassName()) ;
1325 if ( ! cln.Contains("TH") )
1328 if(hist->TestBit(AliQAv1::GetImageBit())) {
1329 hist->GetXaxis()->SetTitleSize(0.02);
1330 hist->GetYaxis()->SetTitleSize(0.02);
1331 hist->GetXaxis()->SetLabelSize(0.02);
1332 hist->GetYaxis()->SetLabelSize(0.02);
1333 if(cln.Contains("TH2"))
1335 gPad->SetRightMargin(0.15);
1336 gPad->SetLeftMargin(0.05);
1338 hist->SetOption("colz") ;
1339 //hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1343 fImage[esIndex]->cd(++npad) ;
1344 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1347 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1356 //_______________________________________________________________________
1357 Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1359 // MakeSDDRecPointsImage: rec point QA plots
1361 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1362 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1364 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1367 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1368 if ( !fImage[esIndex] ) {
1369 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1371 fImage[esIndex]->Clear() ;
1372 fImage[esIndex]->SetTitle(title) ;
1373 fImage[esIndex]->cd();
1374 fImage[esIndex]->SetBorderMode(0) ;
1375 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1376 someText.AddText(title);
1378 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1379 fImage[esIndex]->Clear() ;
1380 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1381 Int_t ny =4; // nx ;
1382 //if (nx < TMath::Sqrt(nImages))
1384 fImage[esIndex]->Divide(nx, ny) ;
1385 TIter nexthist(list[esIndex]) ;
1388 fImage[esIndex]->cd(npad) ;
1389 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1390 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1391 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1392 TString cln(hist->ClassName()) ;
1393 //printf("=====================> Class name %s \n",cln.Data());
1394 if ( ! cln.Contains("TH") )
1396 if(hist->TestBit(AliQAv1::GetImageBit())) {
1397 hist->GetXaxis()->SetTitleSize(0.02);
1398 hist->GetYaxis()->SetTitleSize(0.02);
1399 hist->GetXaxis()->SetLabelSize(0.02);
1400 hist->GetYaxis()->SetLabelSize(0.02);
1401 if(cln.Contains("TH1"))
1403 hist->SetFillColor(kOrange+7);
1404 //SetFrameFillColor(kAzure-9);
1405 //hist->DrawCopy() ;
1407 if(cln.Contains("TH2"))
1409 gPad->SetRightMargin(0.15);
1410 gPad->SetLeftMargin(0.05);
1412 hist->SetOption("colz") ;
1413 // TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1414 //paletta->SetLabelSize(0.025);
1418 fImage[esIndex]->cd(++npad) ;
1419 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1422 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;