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)
47 //__________________________________________________________________
48 AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qac )
51 this->~AliITSQASDDChecker();
52 new(this) AliITSQASDDChecker(qac);
56 AliITSQASDDChecker::~AliITSQASDDChecker()
62 delete[] fStepBitSDD ;
72 delete[]fHighSDDValue;
87 //__________________________________________________________________
88 Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
90 //check histograms of the different lists
91 AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
93 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
95 Double_t sddQACheckerValue = 0.;
99 for(Int_t i=0;i<2;i++)entries2[i]=0.;
102 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
103 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
106 AliError("Calibration object retrieval failed! SDD will not be processed");
108 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
111 fCalibration = (TObjArray *)calibSDD->GetObject();
113 if(!cacheStatus)calibSDD->SetObject(NULL);
114 calibSDD->SetOwner(kTRUE);
122 AliInfo("Calib SDD Created\n ");
131 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
132 // if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
133 // if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
134 // if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
135 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
139 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
142 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];
143 Int_t excluded=0; //excluded modules
144 Int_t excludeddriftregion=0; //excluded single drift region
145 Int_t active=0; //active modules
146 Int_t activedriftregion=0; //active single drift region
147 Int_t exactive=0; //excluded modules but taking data
148 Int_t exactivedriftregion=0; //excluded single drift region but taking data
153 //Int_t emptyactivemodule=0;
154 Int_t emptyactivemoduleperlayer[2];
155 //Int_t emptydractivemodule=0;
156 Int_t emptyactivedrperlayer[2];
162 for(Int_t i=0;i<2;i++)
168 emptydriftregion[i]=0;
169 filleddriftregion[i]=0;
170 excludedmoduleperlayer[i]=0;
171 excludeddrperlayer[i]=0;
172 activemoduleperlayer[i]=0;
173 activedrperlayer[i]=0;
174 exactivemoduleperlayer[i]=0;
175 exactivedrperlayer[i]=0;
176 emptyactivemoduleperlayer[i]=0;
177 emptyactivedrperlayer[i]=0;
182 //take the number of events
184 while( (hdata = dynamic_cast<TH1* >(next())) ){
186 TString hname=hdata->GetName();
188 if(hname.Contains("SDDRawDataCheck"))
190 neventsraw=(Int_t)hdata->GetBinContent(1);
198 while( (hdata = dynamic_cast<TH1* >(next())) ){
199 if (hdata){TString hname=hdata->GetName();
200 if(hname.Contains("SDDchargeMap"))continue;
201 if(hname.Contains("SDDDDLPattern"))continue;
202 if(hname.Contains("SDDEventSize"))continue;
203 if(hname.Contains("_RelativeOccupancy"))continue;
204 if(hname.Contains("SDDModPattern")){
205 if(hname.Contains("NORM")) continue;
206 hmodule=(TH1*)hdata->Clone();
207 entries= hdata->GetEntries();
208 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
210 int modmax=hdata->GetNbinsX();
213 for(Int_t i=1;i<=modmax;i++)
217 content=hdata->GetBinContent(i);
218 if(AliITSQADataMakerRec::AreEqual(content,0.))
221 emptymodules[llay]++;
226 filledmodules[llay]++;
229 //output of the check at the level of the modules. Drift region in the following checks
231 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
232 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
233 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
234 }//end else pattern entries !=0
235 } //modpattern (1d histogram)
236 if(hname.Contains("_RelativeOccupancy")) {
237 //fRawModulePattern = (TH1F *) hdata;
238 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
239 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
240 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
241 Int_t aboveThreshold = 0;
242 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
243 Float_t fractionAboveThreshold=0.;
244 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
245 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
246 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
247 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
248 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
249 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
251 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
253 if(hname.Contains("3"))layer=0;
254 else if(hname.Contains("4"))layer=1;
255 entries2[layer]=hdata->GetEntries();
256 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
257 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
260 if(hname.Contains("3"))layer1=0;
261 else if(hname.Contains("4"))layer1=1;
262 TH2* htemp=dynamic_cast<TH2*>(hdata);
264 hlayer[layer1]=(TH2*)htemp->Clone();
265 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
266 //hlayer[layer1]->RebinX(2);
267 int modmay=hlayer[layer1]->GetNbinsY();
268 TH1D* hproj= hlayer[layer1]->ProjectionY();
269 Double_t ladcontent=0;
270 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
271 ladcontent=hproj->GetBinContent(i);
272 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
273 else filledladders[layer1]++;}//end for
274 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
278 }//end else entries !=0
282 for(Int_t ii=0;ii<2;ii++)
289 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
291 if(hmodule || (hlayer[0] && hlayer[1])){
292 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
297 module=imod+fgkmodoffset;
298 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
299 if(cal==0) { continue;}
300 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
303 excludedmoduleperlayer[lay-3]++;
305 Double_t contentlayer[2];
306 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
307 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
308 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
309 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
310 filledmodules[lay-3]++;
312 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
314 exactivemoduleperlayer[lay-3]++;
315 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
317 emptymodules[lay-3]++; //it has to be empty
322 Int_t totactiveside=0;
323 //Int_t totbadside=0;
324 Double_t contentgood=0.;
326 for(Int_t i=0;i<2;i++){
327 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
328 if(cal->IsWingBad(i))
330 excludeddriftregion++;
331 excludeddrperlayer[lay-3]++;
332 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
333 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));
334 exactivedriftregion++;
335 exactivedrperlayer[lay-3]++;
337 filleddriftregion[lay-3]++;
341 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
343 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));
353 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));
354 emptymodules[lay-3]++;
360 filledmodules[lay-3]++;
367 //emptydriftregion[lay-3]++; //it has to be empty
368 emptydriftregion[lay-3]++;
371 filleddriftregion[lay-3]++;
376 activedrperlayer[lay-3]++;
377 }else if(totactiveside==2)
380 activemoduleperlayer[lay-3]++;
385 AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
386 AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
387 for(Int_t i=0;i<2;i++)
389 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
390 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
392 emptysum=emptymodules[0]+emptymodules[1];
393 emptydiff=emptysum-excluded;
394 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
395 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
397 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
398 emptydrdiff=emptydrsum-excludeddriftregion;
399 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
400 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
404 if(emptysum>excluded||emptydrsum>excludeddriftregion){
405 AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! \n",emptydiff,emptydrdiff));
406 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
407 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
408 //printf("========================= %d",AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::kCosmic));
409 if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
411 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
412 if(neventsraw<numlimit)
414 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
416 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
420 results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
422 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
426 if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
429 if(neventsraw<numlimit)
431 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
432 results1.Form("OK. Thi is a cosmic run. you need a lot of events");
433 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
435 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
439 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
440 results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
442 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
447 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
448 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));
449 results1.Form("OK.");
450 results2.Form(" All active modules and drift regions in acquisition");
452 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
454 if(exactive!=0||exactivedriftregion!=0){
455 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));
456 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]));
457 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]));
458 results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
459 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
461 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
463 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
464 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));
465 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
466 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
468 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
470 if(active==0||activedriftregion==0){
471 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));
472 results1.Form("No modules or drift region took data: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
473 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
475 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
481 while( (hdata=dynamic_cast<TH1* >(next())) )
484 TString hname=hdata->GetName();
485 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
486 if(hname.Contains("NORM"))continue;
487 //AliInfo("========================================Found histo 11\n");
489 if(hname.Contains("3"))lay=0;
490 else if(hname.Contains("4"))lay=1;
491 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
492 pave[lay]->AddText(results1.Data());
493 pave[lay]->AddText(results2.Data());
494 pave[lay]->SetFillColor(color);
495 pave[lay]->SetBorderSize(1);
496 pave[lay]->SetLineWidth(1);
497 hdata->GetListOfFunctions()->Add(pave[lay]);
500 if(hname.Contains("SDDRawDataCheck"))
503 //AliInfo("========================================Found histo\n");
504 ((TH1F*)hdata)->SetBinContent(5,active);
505 ((TH1F*)hdata)->SetBinContent(6,filled);
506 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
507 ((TH1F*)hdata)->SetBinContent(8,filleddr);
508 ((TH1F*)hdata)->SetBinContent(9,excluded);
509 ((TH1F*)hdata)->SetBinContent(10,empty);
510 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
511 ((TH1F*)hdata)->SetBinContent(12,emptydr);
512 ((TH1F*)hdata)->SetBinContent(13,exactive);
513 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
514 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
515 ((TH1F*)hdata)->SetBinContent(16,emptydr);
518 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
519 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
520 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
521 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
522 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
523 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
524 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
525 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
526 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
527 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
528 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
529 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
532 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
533 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
534 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
535 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
536 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
537 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
538 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
539 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
540 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
541 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
542 ((TH1F*)hdata)->SetBinContent(43,activedrperlayer[1]);
543 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
553 for(Int_t i=0;i<2;i++) {
562 case AliQAv1::kNULLTASK:{
563 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
564 sddQACheckerValue=1.;
570 Int_t uidrec=list->GetUniqueID();
571 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
574 if (list->GetEntries() == 0){ //check if the list is empty
575 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
576 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
584 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
587 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];
588 Int_t excluded=0; //excluded modules
589 Int_t excludeddriftregion=0; //excluded single drift region
590 Int_t active=0; //active modules
591 Int_t activedriftregion=0; //active single drift region
592 Int_t exactive=0; //excluded modules but taking data
593 Int_t exactivedriftregion=0; //excluded single drift region but taking data
598 //Int_t emptyactivemodule=0;
599 Int_t emptyactivemoduleperlayer[2];
600 //Int_t emptydractivemodule=0;
601 Int_t emptyactivedrperlayer[2];
607 for(Int_t i=0;i<2;i++)
613 emptydriftregion[i]=0;
614 filleddriftregion[i]=0;
615 excludedmoduleperlayer[i]=0;
616 excludeddrperlayer[i]=0;
617 activemoduleperlayer[i]=0;
618 activedrperlayer[i]=0;
619 exactivemoduleperlayer[i]=0;
620 exactivedrperlayer[i]=0;
621 emptyactivemoduleperlayer[i]=0;
622 emptyactivedrperlayer[i]=0;
625 Int_t neventsrecpoints=0;
627 while( (hdata = dynamic_cast<TH1* >(next())) ){
629 TString hname=hdata->GetName();
631 if(hname.Contains("SDDRecPointCheck"))
633 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
642 while((hdata=dynamic_cast<TH1* >(next()))){
644 TString hname=hdata->GetName();
645 if(hname.Contains("_RelativeOccupancy")) {
646 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
647 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
648 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
649 Int_t aboveThreshold = 0;
650 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
651 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
653 Float_t fractionAboveThreshold=0.;
654 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
655 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
656 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
657 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
658 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
659 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
660 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
663 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
664 //Float_t threshold = 0.;
665 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
666 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
667 Int_t belowThreshold = 0;
668 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
669 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
671 Double_t fractionBelowThreshold =0.;
672 Double_t entries3=((TH1F *)hdata)->GetEntries();
673 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
674 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
675 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
676 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
677 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
678 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
679 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
680 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
683 if(hname.Contains("dedx")) {
684 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
685 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
687 if(hname.Contains("SDDModPatternRP")){
688 if(hname.Contains("NORM")) continue;
689 hmodule=(TH1*)hdata->Clone();
690 entries= hdata->GetEntries();
691 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
693 int modmax=hdata->GetNbinsX();
696 for(Int_t i=1;i<=modmax;i++)
700 content=hdata->GetBinContent(i);
701 if(AliITSQADataMakerRec::AreEqual(content,0.))
704 emptymodules[llay]++;
709 filledmodules[llay]++;
712 //output of the check at the level of the modules. Drift region in the following checks
714 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
715 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
716 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
717 }//end else pattern entries !=0
718 } //modpattern (1d histogram)
720 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
722 if(hname.Contains("3"))layer=0;
723 else if(hname.Contains("4"))layer=1;
724 entries2[layer]=hdata->GetEntries();
725 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
726 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
729 if(hname.Contains("3"))layer1=0;
730 else if(hname.Contains("4"))layer1=1;
731 TH2* htemp=dynamic_cast<TH2*>(hdata);
733 hlayer[layer1]=(TH2*)htemp->Clone();
734 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
735 //hlayer[layer1]->RebinX(2);
736 int modmay=hlayer[layer1]->GetNbinsY();
737 TH1D* hproj= hlayer[layer1]->ProjectionY();
738 Double_t ladcontent=0;
739 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
740 ladcontent=hproj->GetBinContent(i);
741 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
742 else filledladders[layer1]++;}//end for
743 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
747 }//end else entries !=0
751 for(Int_t ii=0;ii<2;ii++)
758 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
760 if(hmodule || (hlayer[0] && hlayer[1])){
761 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
766 module=imod+fgkmodoffset;
767 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
768 if(cal==0) { continue;}
769 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
772 excludedmoduleperlayer[lay-3]++;
774 Double_t contentlayer[2];
775 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
776 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
777 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
778 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
779 filledmodules[lay-3]++;
781 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
783 exactivemoduleperlayer[lay-3]++;
784 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
786 emptymodules[lay-3]++; //it has to be empty
791 Int_t totactiveside=0;
792 //Int_t totbadside=0;
793 Double_t contentgood=0.;
795 for(Int_t i=0;i<2;i++){
796 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
797 if(cal->IsWingBad(i))
799 excludeddriftregion++;
800 excludeddrperlayer[lay-3]++;
801 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
802 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));
803 exactivedriftregion++;
804 exactivedrperlayer[lay-3]++;
806 filleddriftregion[lay-3]++;
810 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
812 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));
822 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
823 emptymodules[lay-3]++;
829 filledmodules[lay-3]++;
836 //emptydriftregion[lay-3]++; //it has to be empty
837 emptydriftregion[lay-3]++;
840 filleddriftregion[lay-3]++;
845 activedrperlayer[lay-3]++;
846 }else if(totactiveside==2)
849 activemoduleperlayer[lay-3]++;
854 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
855 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
856 for(Int_t i=0;i<2;i++)
858 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
859 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
861 emptysum=emptymodules[0]+emptymodules[1];
862 emptydiff=emptysum-excluded;
863 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
864 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
866 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
867 emptydrdiff=emptydrsum-excludeddriftregion;
868 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
869 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
872 if(emptysum>excluded||emptydrsum>excludeddriftregion){
873 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
874 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
875 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
877 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
878 Int_t numlimits=1000;
880 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
881 if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
883 if(neventsrecpoints<numlimits)
885 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
887 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
891 results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
893 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
897 if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
900 if(neventsrecpoints<numlimit)
902 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
903 results1.Form("OK. Thi is a cosmic run. You need a lot of events");
904 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
906 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
910 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
911 results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
913 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
920 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
921 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));
922 results1.Form("OK.");
923 results2.Form(" All active modules have recpoints");
925 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
927 if(exactive!=0||exactivedriftregion!=0){
928 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));
929 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]));
930 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]));
931 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
932 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
934 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
936 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
937 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));
938 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
939 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
941 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
943 if(active==0||activedriftregion==0){
944 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));
945 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
946 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
948 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
954 while( (hdata=dynamic_cast<TH1* >(next())) )
957 TString hname=hdata->GetName();
958 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
959 if(hname.Contains("NORM"))continue;
960 //AliInfo("========================================Found histo 11\n");
962 if(hname.Contains("3"))lay=0;
963 else if(hname.Contains("4"))lay=1;
964 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
965 pave[lay]->AddText(results1.Data());
966 pave[lay]->AddText(results2.Data());
967 pave[lay]->SetFillColor(color);
968 pave[lay]->SetBorderSize(1);
969 pave[lay]->SetLineWidth(1);
970 hdata->GetListOfFunctions()->Add(pave[lay]);
973 if(hname.Contains("SDDRecPointCheck"))
976 //AliInfo("========================================Found histo\n");
977 ((TH1F*)hdata)->SetBinContent(5,active);
978 ((TH1F*)hdata)->SetBinContent(6,filled);
979 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
980 ((TH1F*)hdata)->SetBinContent(8,filleddr);
981 ((TH1F*)hdata)->SetBinContent(9,excluded);
982 ((TH1F*)hdata)->SetBinContent(10,empty);
983 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
984 ((TH1F*)hdata)->SetBinContent(12,emptydr);
985 ((TH1F*)hdata)->SetBinContent(13,exactive);
986 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
987 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
988 ((TH1F*)hdata)->SetBinContent(16,emptydr);
991 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
992 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
993 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
994 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
995 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
996 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
997 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
998 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
999 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1000 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1001 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
1002 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1005 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1006 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1007 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1008 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1009 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1010 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1011 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1012 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1013 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1014 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1015 ((TH1F*)hdata)->SetBinContent(45,activedrperlayer[1]);
1016 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1026 for(Int_t i=0;i<2;i++) {
1032 //sddQACheckerValue=1.;
1033 }//end recpoint list uid = 20
1037 if (list->GetEntries() == 0){
1038 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1042 while( (hdata = dynamic_cast<TH1* >(next())) ){
1044 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1046 TString hname=hdata->GetName();
1047 if(hname.Contains("SDD DIGITS Module Pattern")) {
1050 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1051 } else if(hname.Contains("SDD Anode Distribution")) {
1052 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1053 } else if(hname.Contains("SDD Tbin Distribution")) {
1055 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1056 } else if(hname.Contains("SDD ADC Counts Distribution")) {
1057 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1064 sddQACheckerValue=1.;
1071 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1072 sddQACheckerValue=1.;
1077 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1078 sddQACheckerValue=1.;
1081 case AliQAv1::kNTASK:{
1082 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1083 sddQACheckerValue=1.;
1086 case AliQAv1::kSIM:{
1087 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1088 Int_t uid=list->GetUniqueID();
1091 if (list->GetEntries() == 0){
1092 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1096 while( (hdata = dynamic_cast<TH1* >(next())) ){
1098 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1100 TString hname=hdata->GetName();
1101 if(hname.Contains("SDDDIGITSModulePattern")) {
1104 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1105 } else if(hname.Contains("SDDAnodeDistribution")) {
1106 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1107 } else if(hname.Contains("SDDTbinDistribution")) {
1109 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1110 } else if(hname.Contains("SDDADCCountsDistribution")) {
1111 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1121 if (list->GetEntries() == 0){
1122 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1127 while( (hdata = dynamic_cast<TH1* >(next())) ){
1129 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1131 TString hname=hdata->GetName();
1132 if(hname.Contains("SDDHITSModulePattern")) {
1134 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1135 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
1136 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1137 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
1138 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1139 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
1140 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1141 }//end deposited energy
1150 if (list->GetEntries() == 0){
1151 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1155 while( (hdata = dynamic_cast<TH1* >(next())) ){
1157 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1159 TString hname=hdata->GetName();
1160 if(hname.Contains("SDDSDIGITSModulePattern")) {
1162 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1163 } else if(hname.Contains("SDDAnodeDistribution")) {
1164 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1165 } else if(hname.Contains("SDDTbinDistribution")) {
1167 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1168 } else if(hname.Contains("SDDADCCountsDistribution")) {
1169 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1170 }//end adc counts bindistribution
1176 sddQACheckerValue=1.;
1183 if(hdata) delete hdata;
1186 return sddQACheckerValue;
1189 //__________________________________________________________________
1190 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1192 //set the number of the histograms already present in the list before the SDD histograms
1193 fSubDetOffset = taskoffset;
1197 //__________________________________________________________________
1198 void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
1200 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
1201 fStepBitSDD = new Double_t[AliQAv1::kNBIT];
1202 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1204 fStepBitSDD[bit]=steprange[bit];
1208 //__________________________________________________________________
1209 void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
1211 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
1212 fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1213 fHighSDDValue= new Float_t[AliQAv1::kNBIT];
1215 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1217 fLowSDDValue[bit]=lowvalue[bit];
1218 fHighSDDValue[bit]= highvalue[bit];
1222 //__________________________________________________________________
1223 Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1225 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1228 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
1232 case AliQAv1::kRAWS:{
1233 rval=MakeSDDRawsImage(list, task,mode);
1236 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1238 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1241 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1244 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1245 {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
1252 //_______________________________________________________________________
1253 Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1255 // MakeSDDRawsImage: raw data QA plots
1257 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1258 //printf("-------------------------> %i \n", esIndex);
1259 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1260 {//printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1264 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1265 if ( !fImage[esIndex] ) {
1266 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1269 fImage[esIndex]->Clear() ;
1270 fImage[esIndex]->SetTitle(title) ;
1271 fImage[esIndex]->cd();
1273 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1274 someText.AddText(title);
1276 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1277 fImage[esIndex]->Clear() ;
1278 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1279 Int_t ny =2; // nx ;
1280 //if (nx < TMath::Sqrt(nImages))
1282 fImage[esIndex]->Divide(nx, ny) ;
1283 TIter nexthist(list[esIndex]) ;
1286 fImage[esIndex]->cd(npad);
1287 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1288 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1289 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1290 TString cln(hist->ClassName()) ;
1291 if ( ! cln.Contains("TH") )
1294 if(hist->TestBit(AliQAv1::GetImageBit())) {
1295 hist->GetXaxis()->SetTitleSize(0.02);
1296 hist->GetYaxis()->SetTitleSize(0.02);
1297 hist->GetXaxis()->SetLabelSize(0.02);
1298 hist->GetYaxis()->SetLabelSize(0.02);
1299 if(cln.Contains("TH2"))
1301 gPad->SetRightMargin(0.15);
1302 gPad->SetLeftMargin(0.05);
1304 hist->SetOption("colz") ;
1305 //hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1309 fImage[esIndex]->cd(++npad) ;
1310 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1313 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1322 //_______________________________________________________________________
1323 Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1325 // MakeSDDRecPointsImage: rec point QA plots
1327 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1328 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1330 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1333 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1334 if ( !fImage[esIndex] ) {
1335 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1337 fImage[esIndex]->Clear() ;
1338 fImage[esIndex]->SetTitle(title) ;
1339 fImage[esIndex]->cd();
1340 fImage[esIndex]->SetBorderMode(0) ;
1341 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1342 someText.AddText(title);
1344 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1345 fImage[esIndex]->Clear() ;
1346 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1347 Int_t ny =4; // nx ;
1348 //if (nx < TMath::Sqrt(nImages))
1350 fImage[esIndex]->Divide(nx, ny) ;
1351 TIter nexthist(list[esIndex]) ;
1354 fImage[esIndex]->cd(npad) ;
1355 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1356 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1357 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1358 TString cln(hist->ClassName()) ;
1359 //printf("=====================> Class name %s \n",cln.Data());
1360 if ( ! cln.Contains("TH") )
1362 if(hist->TestBit(AliQAv1::GetImageBit())) {
1363 hist->GetXaxis()->SetTitleSize(0.02);
1364 hist->GetYaxis()->SetTitleSize(0.02);
1365 hist->GetXaxis()->SetLabelSize(0.02);
1366 hist->GetYaxis()->SetLabelSize(0.02);
1367 if(cln.Contains("TH1"))
1369 hist->SetFillColor(kOrange+7);
1370 //SetFrameFillColor(kAzure-9);
1371 //hist->DrawCopy() ;
1373 if(cln.Contains("TH2"))
1375 gPad->SetRightMargin(0.15);
1376 gPad->SetLeftMargin(0.05);
1378 hist->SetOption("colz") ;
1379 // TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1380 //paletta->SetLabelSize(0.025);
1384 fImage[esIndex]->cd(++npad) ;
1385 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1388 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;