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.;
78 AliITSQASDDChecker::~AliITSQASDDChecker()
84 delete[] fStepBitSDD ;
94 delete[]fHighSDDValue;
109 //__________________________________________________________________
110 Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
112 //check histograms of the different lists
113 AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
115 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
117 Double_t sddQACheckerValue = 0.;
120 Double_t entries2[2];
121 for(Int_t i=0;i<2;i++)entries2[i]=0.;
124 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
125 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
128 AliError("Calibration object retrieval failed! SDD will not be processed");
130 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
133 fCalibration = (TObjArray *)calibSDD->GetObject();
135 if(!cacheStatus)calibSDD->SetObject(NULL);
136 calibSDD->SetOwner(kTRUE);
144 AliInfo("Calib SDD Created\n ");
153 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
154 // if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
155 // if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
156 // if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
157 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
161 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
164 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];
165 Int_t excluded=0; //excluded modules
166 Int_t excludeddriftregion=0; //excluded single drift region
167 Int_t active=0; //active modules
168 Int_t activedriftregion=0; //active single drift region
169 Int_t exactive=0; //excluded modules but taking data
170 Int_t exactivedriftregion=0; //excluded single drift region but taking data
175 //Int_t emptyactivemodule=0;
176 Int_t emptyactivemoduleperlayer[2];
177 //Int_t emptydractivemodule=0;
178 Int_t emptyactivedrperlayer[2];
184 for(Int_t i=0;i<2;i++)
190 emptydriftregion[i]=0;
191 filleddriftregion[i]=0;
192 excludedmoduleperlayer[i]=0;
193 excludeddrperlayer[i]=0;
194 activemoduleperlayer[i]=0;
195 activedrperlayer[i]=0;
196 exactivemoduleperlayer[i]=0;
197 exactivedrperlayer[i]=0;
198 emptyactivemoduleperlayer[i]=0;
199 emptyactivedrperlayer[i]=0;
204 //take the number of events
206 while( (hdata = dynamic_cast<TH1* >(next())) ){
208 TString hname=hdata->GetName();
210 if(hname.Contains("SDDRawDataCheck"))
212 neventsraw=(Int_t)hdata->GetBinContent(1);
220 while( (hdata = dynamic_cast<TH1* >(next())) ){
221 if (hdata){TString hname=hdata->GetName();
222 if(hname.Contains("SDDchargeMap"))continue;
223 if(hname.Contains("SDDDDLPattern"))continue;
224 if(hname.Contains("SDDEventSize"))continue;
225 if(hname.Contains("_RelativeOccupancy"))continue;
226 if(hname.Contains("SDDModPattern")){
227 if(hname.Contains("NORM")) continue;
228 hmodule=(TH1*)hdata->Clone();
229 entries= hdata->GetEntries();
230 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
232 int modmax=hdata->GetNbinsX();
235 for(Int_t i=1;i<=modmax;i++)
239 content=hdata->GetBinContent(i);
240 if(AliITSQADataMakerRec::AreEqual(content,0.))
243 emptymodules[llay]++;
248 filledmodules[llay]++;
251 //output of the check at the level of the modules. Drift region in the following checks
253 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
254 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
255 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
256 }//end else pattern entries !=0
257 } //modpattern (1d histogram)
258 if(hname.Contains("_RelativeOccupancy")) {
259 //fRawModulePattern = (TH1F *) hdata;
260 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
261 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
262 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
263 Int_t aboveThreshold = 0;
264 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
265 Float_t fractionAboveThreshold=0.;
266 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
267 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
268 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
269 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
270 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
271 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
273 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
275 if(hname.Contains("3"))layer=0;
276 else if(hname.Contains("4"))layer=1;
277 entries2[layer]=hdata->GetEntries();
278 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
279 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
282 if(hname.Contains("3"))layer1=0;
283 else if(hname.Contains("4"))layer1=1;
284 TH2* htemp=dynamic_cast<TH2*>(hdata);
286 hlayer[layer1]=(TH2*)htemp->Clone();
287 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
288 //hlayer[layer1]->RebinX(2);
289 int modmay=hlayer[layer1]->GetNbinsY();
290 TH1D* hproj= hlayer[layer1]->ProjectionY();
291 Double_t ladcontent=0;
292 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
293 ladcontent=hproj->GetBinContent(i);
294 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
295 else filledladders[layer1]++;}//end for
296 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
300 }//end else entries !=0
304 for(Int_t ii=0;ii<2;ii++)
311 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
313 if(hmodule || (hlayer[0] && hlayer[1])){
314 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
319 module=imod+fgkmodoffset;
320 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
321 if(cal==0) { continue;}
322 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
325 excludedmoduleperlayer[lay-3]++;
327 Double_t contentlayer[2];
328 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
329 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
330 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
331 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
332 filledmodules[lay-3]++;
334 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
336 exactivemoduleperlayer[lay-3]++;
337 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
339 emptymodules[lay-3]++; //it has to be empty
344 Int_t totactiveside=0;
345 //Int_t totbadside=0;
346 Double_t contentgood=0.;
348 for(Int_t i=0;i<2;i++){
349 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
350 if(cal->IsWingBad(i))
352 excludeddriftregion++;
353 excludeddrperlayer[lay-3]++;
354 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
355 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));
356 exactivedriftregion++;
357 exactivedrperlayer[lay-3]++;
359 filleddriftregion[lay-3]++;
363 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
365 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));
375 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));
376 emptymodules[lay-3]++;
382 filledmodules[lay-3]++;
389 //emptydriftregion[lay-3]++; //it has to be empty
390 emptydriftregion[lay-3]++;
393 filleddriftregion[lay-3]++;
398 activedrperlayer[lay-3]++;
399 }else if(totactiveside==2)
402 activemoduleperlayer[lay-3]++;
407 AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
408 AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
409 for(Int_t i=0;i<2;i++)
411 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
412 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
414 emptysum=emptymodules[0]+emptymodules[1];
415 emptydiff=emptysum-excluded;
416 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
417 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
419 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
420 emptydrdiff=emptydrsum-excludeddriftregion;
421 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
422 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
426 if(emptysum>excluded||emptydrsum>excludeddriftregion){
427 AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! \n",emptydiff,emptydrdiff));
428 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
429 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
430 //printf("========================= %d",AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::kCosmic));
431 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
432 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
434 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
435 if(neventsraw<numlimit)
437 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
439 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
443 results2.Form(" Events %d. If PHYISICS, follow the TWiki instruction and call the Expert ",neventsraw);
445 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
449 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
450 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic)
453 if(neventsraw<numlimit)
455 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
456 results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
457 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
459 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
463 results1.Form("%i good module(s) and %i good drift region(s) have no data!",emptydiff,emptydrdiff);
464 results2.Form(" Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
466 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
471 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
472 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));
473 results1.Form("OK.");
474 results2.Form(" All active modules and drift regions in acquisition");
476 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
478 if(exactive!=0||exactivedriftregion!=0){
479 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));
480 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]));
481 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]));
482 results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
483 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
485 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
487 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
488 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));
489 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
490 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
492 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
494 if(active==0||activedriftregion==0){
495 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));
496 results1.Form("No modules or drift region took data: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
497 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
499 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
505 while( (hdata=dynamic_cast<TH1* >(next())) )
508 TString hname=hdata->GetName();
509 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
510 if(hname.Contains("NORM"))continue;
511 //AliInfo("========================================Found histo 11\n");
513 if(hname.Contains("3"))lay=0;
514 else if(hname.Contains("4"))lay=1;
515 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
516 pave[lay]->AddText(results1.Data());
517 pave[lay]->AddText(results2.Data());
518 pave[lay]->SetFillColor(color);
519 pave[lay]->SetBorderSize(1);
520 pave[lay]->SetLineWidth(1);
521 hdata->GetListOfFunctions()->Add(pave[lay]);
524 if(hname.Contains("SDDRawDataCheck"))
527 //AliInfo("========================================Found histo\n");
528 ((TH1F*)hdata)->SetBinContent(5,active);
529 ((TH1F*)hdata)->SetBinContent(6,filled);
530 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
531 ((TH1F*)hdata)->SetBinContent(8,filleddr);
532 ((TH1F*)hdata)->SetBinContent(9,excluded);
533 ((TH1F*)hdata)->SetBinContent(10,empty);
534 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
535 ((TH1F*)hdata)->SetBinContent(12,emptydr);
536 ((TH1F*)hdata)->SetBinContent(13,exactive);
537 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
538 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
539 ((TH1F*)hdata)->SetBinContent(16,emptydr);
542 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
543 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
544 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
545 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
546 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
547 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
548 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
549 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
550 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
551 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
552 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
553 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
556 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
557 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
558 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
559 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
560 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
561 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
562 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
563 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
564 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
565 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
566 ((TH1F*)hdata)->SetBinContent(43,activedrperlayer[1]);
567 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
577 for(Int_t i=0;i<2;i++) {
586 case AliQAv1::kNULLTASK:{
587 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
588 sddQACheckerValue=1.;
594 Int_t uidrec=list->GetUniqueID();
595 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
598 if (list->GetEntries() == 0){ //check if the list is empty
599 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
600 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
608 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
611 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];
612 Int_t excluded=0; //excluded modules
613 Int_t excludeddriftregion=0; //excluded single drift region
614 Int_t active=0; //active modules
615 Int_t activedriftregion=0; //active single drift region
616 Int_t exactive=0; //excluded modules but taking data
617 Int_t exactivedriftregion=0; //excluded single drift region but taking data
622 //Int_t emptyactivemodule=0;
623 Int_t emptyactivemoduleperlayer[2];
624 //Int_t emptydractivemodule=0;
625 Int_t emptyactivedrperlayer[2];
631 for(Int_t i=0;i<2;i++)
637 emptydriftregion[i]=0;
638 filleddriftregion[i]=0;
639 excludedmoduleperlayer[i]=0;
640 excludeddrperlayer[i]=0;
641 activemoduleperlayer[i]=0;
642 activedrperlayer[i]=0;
643 exactivemoduleperlayer[i]=0;
644 exactivedrperlayer[i]=0;
645 emptyactivemoduleperlayer[i]=0;
646 emptyactivedrperlayer[i]=0;
649 Int_t neventsrecpoints=0;
651 while( (hdata = dynamic_cast<TH1* >(next())) ){
653 TString hname=hdata->GetName();
655 if(hname.Contains("SDDRecPointCheck"))
657 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
666 while((hdata=dynamic_cast<TH1* >(next()))){
668 TString hname=hdata->GetName();
669 if(hname.Contains("_RelativeOccupancy")) {
670 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
671 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
672 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
673 Int_t aboveThreshold = 0;
674 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
675 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
677 Float_t fractionAboveThreshold=0.;
678 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
679 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
680 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
681 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
682 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
683 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
684 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
687 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
688 //Float_t threshold = 0.;
689 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
690 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
691 Int_t belowThreshold = 0;
692 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
693 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
695 Double_t fractionBelowThreshold =0.;
696 Double_t entries3=((TH1F *)hdata)->GetEntries();
697 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
698 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
699 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
700 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
701 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
702 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
703 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
704 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
707 if(hname.Contains("dedx")) {
708 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
709 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
711 if(hname.Contains("SDDModPatternRP")){
712 if(hname.Contains("NORM")) continue;
713 hmodule=(TH1*)hdata->Clone();
714 entries= hdata->GetEntries();
715 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
717 int modmax=hdata->GetNbinsX();
720 for(Int_t i=1;i<=modmax;i++)
724 content=hdata->GetBinContent(i);
725 if(AliITSQADataMakerRec::AreEqual(content,0.))
728 emptymodules[llay]++;
733 filledmodules[llay]++;
736 //output of the check at the level of the modules. Drift region in the following checks
738 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
739 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
740 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
741 }//end else pattern entries !=0
742 } //modpattern (1d histogram)
744 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
746 if(hname.Contains("3"))layer=0;
747 else if(hname.Contains("4"))layer=1;
748 entries2[layer]=hdata->GetEntries();
749 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
750 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
753 if(hname.Contains("3"))layer1=0;
754 else if(hname.Contains("4"))layer1=1;
755 TH2* htemp=dynamic_cast<TH2*>(hdata);
757 hlayer[layer1]=(TH2*)htemp->Clone();
758 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
759 //hlayer[layer1]->RebinX(2);
760 int modmay=hlayer[layer1]->GetNbinsY();
761 TH1D* hproj= hlayer[layer1]->ProjectionY();
762 Double_t ladcontent=0;
763 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
764 ladcontent=hproj->GetBinContent(i);
765 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
766 else filledladders[layer1]++;}//end for
767 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
771 }//end else entries !=0
775 for(Int_t ii=0;ii<2;ii++)
782 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
784 if(hmodule || (hlayer[0] && hlayer[1])){
785 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
790 module=imod+fgkmodoffset;
791 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
792 if(cal==0) { continue;}
793 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
796 excludedmoduleperlayer[lay-3]++;
798 Double_t contentlayer[2];
799 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
800 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
801 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
802 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
803 filledmodules[lay-3]++;
805 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
807 exactivemoduleperlayer[lay-3]++;
808 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
810 emptymodules[lay-3]++; //it has to be empty
815 Int_t totactiveside=0;
816 //Int_t totbadside=0;
817 Double_t contentgood=0.;
819 for(Int_t i=0;i<2;i++){
820 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
821 if(cal->IsWingBad(i))
823 excludeddriftregion++;
824 excludeddrperlayer[lay-3]++;
825 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
826 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));
827 exactivedriftregion++;
828 exactivedrperlayer[lay-3]++;
830 filleddriftregion[lay-3]++;
834 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
836 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));
846 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
847 emptymodules[lay-3]++;
853 filledmodules[lay-3]++;
860 //emptydriftregion[lay-3]++; //it has to be empty
861 emptydriftregion[lay-3]++;
864 filleddriftregion[lay-3]++;
869 activedrperlayer[lay-3]++;
870 }else if(totactiveside==2)
873 activemoduleperlayer[lay-3]++;
878 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
879 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
880 for(Int_t i=0;i<2;i++)
882 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
883 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
885 emptysum=emptymodules[0]+emptymodules[1];
886 emptydiff=emptysum-excluded;
887 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
888 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
890 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
891 emptydrdiff=emptydrsum-excludeddriftregion;
892 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
893 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
896 if(emptysum>excluded||emptydrsum>excludeddriftregion){
897 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
898 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
899 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
901 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
902 Int_t numlimits=1000;
904 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
905 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
906 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
908 if(neventsrecpoints<numlimits)
910 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
912 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
916 results2.Form(" Events %d .If PHYISICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
918 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
922 //if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
923 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic){
925 if( neventsrecpoints<numlimit)
927 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
928 results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
929 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
931 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
935 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
936 results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
938 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
945 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
946 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));
947 results1.Form("OK.");
948 results2.Form(" All active modules have recpoints");
950 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
952 if(exactive!=0||exactivedriftregion!=0){
953 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));
954 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]));
955 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]));
956 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
957 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
959 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
961 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
962 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));
963 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
964 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
966 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
968 if(active==0||activedriftregion==0){
969 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));
970 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
971 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
973 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
979 while( (hdata=dynamic_cast<TH1* >(next())) )
982 TString hname=hdata->GetName();
983 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
984 if(hname.Contains("NORM"))continue;
985 //AliInfo("========================================Found histo 11\n");
987 if(hname.Contains("3"))lay=0;
988 else if(hname.Contains("4"))lay=1;
989 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
990 pave[lay]->AddText(results1.Data());
991 pave[lay]->AddText(results2.Data());
992 pave[lay]->SetFillColor(color);
993 pave[lay]->SetBorderSize(1);
994 pave[lay]->SetLineWidth(1);
995 hdata->GetListOfFunctions()->Add(pave[lay]);
998 if(hname.Contains("SDDRecPointCheck"))
1001 //AliInfo("========================================Found histo\n");
1002 ((TH1F*)hdata)->SetBinContent(5,active);
1003 ((TH1F*)hdata)->SetBinContent(6,filled);
1004 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
1005 ((TH1F*)hdata)->SetBinContent(8,filleddr);
1006 ((TH1F*)hdata)->SetBinContent(9,excluded);
1007 ((TH1F*)hdata)->SetBinContent(10,empty);
1008 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
1009 ((TH1F*)hdata)->SetBinContent(12,emptydr);
1010 ((TH1F*)hdata)->SetBinContent(13,exactive);
1011 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
1012 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
1013 ((TH1F*)hdata)->SetBinContent(16,emptydr);
1016 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
1017 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
1018 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
1019 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
1020 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
1021 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
1022 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
1023 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
1024 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1025 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1026 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
1027 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1030 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1031 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1032 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1033 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1034 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1035 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1036 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1037 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1038 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1039 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1040 ((TH1F*)hdata)->SetBinContent(45,activedrperlayer[1]);
1041 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1051 for(Int_t i=0;i<2;i++) {
1057 //sddQACheckerValue=1.;
1058 }//end recpoint list uid = 20
1062 if (list->GetEntries() == 0){
1063 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1067 while( (hdata = dynamic_cast<TH1* >(next())) ){
1069 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1071 TString hname=hdata->GetName();
1072 if(hname.Contains("SDD DIGITS Module Pattern")) {
1075 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1076 } else if(hname.Contains("SDD Anode Distribution")) {
1077 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1078 } else if(hname.Contains("SDD Tbin Distribution")) {
1080 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1081 } else if(hname.Contains("SDD ADC Counts Distribution")) {
1082 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1089 sddQACheckerValue=1.;
1096 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1097 sddQACheckerValue=1.;
1102 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1103 sddQACheckerValue=1.;
1106 case AliQAv1::kNTASK:{
1107 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1108 sddQACheckerValue=1.;
1111 case AliQAv1::kSIM:{
1112 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1113 Int_t uid=list->GetUniqueID();
1116 if (list->GetEntries() == 0){
1117 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1121 while( (hdata = dynamic_cast<TH1* >(next())) ){
1123 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1125 TString hname=hdata->GetName();
1126 if(hname.Contains("SDDDIGITSModulePattern")) {
1129 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1130 } else if(hname.Contains("SDDAnodeDistribution")) {
1131 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1132 } else if(hname.Contains("SDDTbinDistribution")) {
1134 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1135 } else if(hname.Contains("SDDADCCountsDistribution")) {
1136 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1146 if (list->GetEntries() == 0){
1147 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1152 while( (hdata = dynamic_cast<TH1* >(next())) ){
1154 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1156 TString hname=hdata->GetName();
1157 if(hname.Contains("SDDHITSModulePattern")) {
1159 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1160 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
1161 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1162 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
1163 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1164 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
1165 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1166 }//end deposited energy
1175 if (list->GetEntries() == 0){
1176 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1180 while( (hdata = dynamic_cast<TH1* >(next())) ){
1182 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1184 TString hname=hdata->GetName();
1185 if(hname.Contains("SDDSDIGITSModulePattern")) {
1187 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1188 } else if(hname.Contains("SDDAnodeDistribution")) {
1189 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1190 } else if(hname.Contains("SDDTbinDistribution")) {
1192 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1193 } else if(hname.Contains("SDDADCCountsDistribution")) {
1194 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1195 }//end adc counts bindistribution
1201 sddQACheckerValue=1.;
1208 if(hdata) delete hdata;
1211 return sddQACheckerValue;
1214 //__________________________________________________________________
1215 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1217 //set the number of the histograms already present in the list before the SDD histograms
1218 fSubDetOffset = taskoffset;
1222 //__________________________________________________________________
1223 void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
1225 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
1226 //if(fStepBitSDD){/*delete fStepBitSDD;*/ fStepBitSDD=NULL;}
1227 //fStepBitSDD = new Double_t[AliQAv1::kNBIT];
1228 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1230 fStepBitSDD[bit]=steprange[bit];
1234 //__________________________________________________________________
1235 void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
1237 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
1238 // fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1239 // fHighSDDValue= new Float_t[AliQAv1::kNBIT];
1241 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1243 fLowSDDValue[bit]=lowvalue[bit];
1244 fHighSDDValue[bit]= highvalue[bit];
1248 //__________________________________________________________________
1249 Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1251 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1254 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
1258 case AliQAv1::kRAWS:{
1259 rval=MakeSDDRawsImage(list, task,mode);
1262 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1264 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1267 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1270 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1271 {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
1278 //_______________________________________________________________________
1279 Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1281 // MakeSDDRawsImage: raw data QA plots
1283 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1284 //printf("-------------------------> %i \n", esIndex);
1285 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1286 {//printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1290 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1291 if ( !fImage[esIndex] ) {
1292 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1295 fImage[esIndex]->Clear() ;
1296 fImage[esIndex]->SetTitle(title) ;
1297 fImage[esIndex]->cd();
1299 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1300 someText.AddText(title);
1302 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1303 fImage[esIndex]->Clear() ;
1304 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1305 Int_t ny =2; // nx ;
1306 //if (nx < TMath::Sqrt(nImages))
1308 fImage[esIndex]->Divide(nx, ny) ;
1309 TIter nexthist(list[esIndex]) ;
1312 fImage[esIndex]->cd(npad);
1313 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1314 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1315 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1316 TString cln(hist->ClassName()) ;
1317 if ( ! cln.Contains("TH") )
1320 if(hist->TestBit(AliQAv1::GetImageBit())) {
1321 hist->GetXaxis()->SetTitleSize(0.02);
1322 hist->GetYaxis()->SetTitleSize(0.02);
1323 hist->GetXaxis()->SetLabelSize(0.02);
1324 hist->GetYaxis()->SetLabelSize(0.02);
1325 if(cln.Contains("TH2"))
1327 gPad->SetRightMargin(0.15);
1328 gPad->SetLeftMargin(0.05);
1330 hist->SetOption("colz") ;
1331 //hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1335 fImage[esIndex]->cd(++npad) ;
1336 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1339 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1348 //_______________________________________________________________________
1349 Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1351 // MakeSDDRecPointsImage: rec point QA plots
1353 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1354 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1356 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1359 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1360 if ( !fImage[esIndex] ) {
1361 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1363 fImage[esIndex]->Clear() ;
1364 fImage[esIndex]->SetTitle(title) ;
1365 fImage[esIndex]->cd();
1366 fImage[esIndex]->SetBorderMode(0) ;
1367 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1368 someText.AddText(title);
1370 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1371 fImage[esIndex]->Clear() ;
1372 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1373 Int_t ny =4; // nx ;
1374 //if (nx < TMath::Sqrt(nImages))
1376 fImage[esIndex]->Divide(nx, ny) ;
1377 TIter nexthist(list[esIndex]) ;
1380 fImage[esIndex]->cd(npad) ;
1381 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1382 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1383 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1384 TString cln(hist->ClassName()) ;
1385 //printf("=====================> Class name %s \n",cln.Data());
1386 if ( ! cln.Contains("TH") )
1388 if(hist->TestBit(AliQAv1::GetImageBit())) {
1389 hist->GetXaxis()->SetTitleSize(0.02);
1390 hist->GetYaxis()->SetTitleSize(0.02);
1391 hist->GetXaxis()->SetLabelSize(0.02);
1392 hist->GetYaxis()->SetLabelSize(0.02);
1393 if(cln.Contains("TH1"))
1395 hist->SetFillColor(kOrange+7);
1396 //SetFrameFillColor(kAzure-9);
1397 //hist->DrawCopy() ;
1399 if(cln.Contains("TH2"))
1401 gPad->SetRightMargin(0.15);
1402 gPad->SetLeftMargin(0.05);
1404 hist->SetOption("colz") ;
1405 // TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1406 //paletta->SetLabelSize(0.025);
1410 fImage[esIndex]->cd(++npad) ;
1411 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1414 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;