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];
68 for(Int_t ibit=0;ibit<AliQAv1::kNBIT;ibit++)
71 fLowSDDValue[ibit]=0.;
72 fHighSDDValue[ibit]=0.;
74 for(Int_t i=0;i<AliRecoParam::kNSpecies;i++) fPaveText[i] = NULL;
79 AliITSQASDDChecker::~AliITSQASDDChecker()
85 delete[] fStepBitSDD ;
95 delete[]fHighSDDValue;
108 for(Int_t i=0;i<AliRecoParam::kNSpecies;i++) {
117 //__________________________________________________________________
118 Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
120 //check histograms of the different lists
121 AliInfo(Form("AliITSQASDDChecker called with offset: %d \t and specie %d\n", fSubDetOffset,fESforCheck));
123 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
125 Double_t sddQACheckerValue = 0.;
128 Double_t entries2[2];
129 for(Int_t i=0;i<2;i++)entries2[i]=0.;
132 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
133 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
136 AliError("Calibration object retrieval failed! SDD will not be processed");
138 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
141 fCalibration = (TObjArray *)calibSDD->GetObject();
143 if(!cacheStatus)calibSDD->SetObject(NULL);
144 calibSDD->SetOwner(kTRUE);
152 AliInfo("Calib SDD Created\n ");
158 Int_t textcolor=kBlack;
162 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
163 // if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
164 // if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
165 // if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
166 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
170 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
173 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];
174 Int_t excluded=0; //excluded modules
175 Int_t excludeddriftregion=0; //excluded single drift region
176 Int_t active=0; //active modules
177 Int_t activedriftregion=0; //active single drift region
178 Int_t exactive=0; //excluded modules but taking data
179 Int_t exactivedriftregion=0; //excluded single drift region but taking data
184 //Int_t emptyactivemodule=0;
185 Int_t emptyactivemoduleperlayer[2];
186 //Int_t emptydractivemodule=0;
187 Int_t emptyactivedrperlayer[2];
193 for(Int_t i=0;i<2;i++)
199 emptydriftregion[i]=0;
200 filleddriftregion[i]=0;
201 excludedmoduleperlayer[i]=0;
202 excludeddrperlayer[i]=0;
203 activemoduleperlayer[i]=0;
204 activedrperlayer[i]=0;
205 exactivemoduleperlayer[i]=0;
206 exactivedrperlayer[i]=0;
207 emptyactivemoduleperlayer[i]=0;
208 emptyactivedrperlayer[i]=0;
213 //take the number of events
215 while( (hdata = dynamic_cast<TH1* >(next())) ){
217 TString hname=hdata->GetName();
219 if(hname.Contains("SDDRawDataCheck"))
221 neventsraw=(Int_t)hdata->GetBinContent(1);
229 while( (hdata = dynamic_cast<TH1* >(next())) ){
231 TString hname=hdata->GetName();
232 if(hname.Contains("SDDchargeMap"))continue;
233 if(hname.Contains("SDDDDLPattern"))continue;
234 if(hname.Contains("SDDEventSize"))continue;
235 if(hname.Contains("_RelativeOccupancy"))continue;
236 if(hname.Contains("SDDModPattern")){
237 if(hname.Contains("NORM")) continue;
238 hmodule=(TH1*)hdata->Clone();
239 entries= hdata->GetEntries();
240 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
242 int modmax=hdata->GetNbinsX();
245 for(Int_t i=1;i<=modmax;i++)
249 content=hdata->GetBinContent(i);
250 if(AliITSQADataMakerRec::AreEqual(content,0.))
253 emptymodules[llay]++;
258 filledmodules[llay]++;
261 //output of the check at the level of the modules. Drift region in the following checks
263 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
264 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
265 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
266 }//end else pattern entries !=0
267 } //modpattern (1d histogram)
268 if(hname.Contains("_RelativeOccupancy")) {
269 //fRawModulePattern = (TH1F *) hdata;
270 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
271 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
272 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
273 Int_t aboveThreshold = 0;
274 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
275 Float_t fractionAboveThreshold=0.;
276 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
277 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
278 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
279 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
280 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
281 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
283 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
285 if(hname.Contains("3"))layer=0;
286 else if(hname.Contains("4"))layer=1;
287 entries2[layer]=hdata->GetEntries();
288 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
289 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
292 if(hname.Contains("3"))layer1=0;
293 else if(hname.Contains("4"))layer1=1;
294 TH2* htemp=dynamic_cast<TH2*>(hdata);
296 hlayer[layer1]=(TH2*)htemp->Clone();
297 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
298 int modmay=hlayer[layer1]->GetNbinsY();
299 TH1D* hproj= hlayer[layer1]->ProjectionY();
300 Double_t ladcontent=0;
301 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
302 ladcontent=hproj->GetBinContent(i);
303 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
304 else filledladders[layer1]++;}//end for
305 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
309 }//end else entries !=0
315 for(Int_t ii=0;ii<2;ii++)
322 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
324 if(hmodule || (hlayer[0] && hlayer[1])){
325 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
330 module=imod+fgkmodoffset;
331 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
332 if(cal==0) { continue;}
333 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
336 excludedmoduleperlayer[lay-3]++;
338 //Double_t contentlayer[2];
339 //for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
340 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
341 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
342 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
343 filledmodules[lay-3]++;
345 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
347 exactivemoduleperlayer[lay-3]++;
348 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
350 emptymodules[lay-3]++; //it has to be empty
355 Int_t totactiveside=0;
356 //Int_t totbadside=0;
357 Double_t contentgood=0.;
359 for(Int_t i=0;i<2;i++){
360 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
361 if(cal->IsWingBad(i))
363 excludeddriftregion++;
364 excludeddrperlayer[lay-3]++;
365 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
366 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));
367 exactivedriftregion++;
368 exactivedrperlayer[lay-3]++;
370 filleddriftregion[lay-3]++;
374 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
376 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));
386 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));
387 emptymodules[lay-3]++;
393 filledmodules[lay-3]++;
400 //emptydriftregion[lay-3]++; //it has to be empty
401 emptydriftregion[lay-3]++;
404 filleddriftregion[lay-3]++;
409 activedrperlayer[lay-3]++;
410 }else if(totactiveside==2)
413 activemoduleperlayer[lay-3]++;
418 AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
419 AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
420 for(Int_t i=0;i<2;i++)
422 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
423 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
425 emptysum=emptymodules[0]+emptymodules[1];
426 emptydiff=emptysum-excluded;
427 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
428 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
430 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
431 emptydrdiff=emptydrsum-excludeddriftregion;
432 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
433 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
437 if(emptysum>excluded||emptydrsum>excludeddriftregion){
438 AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! \n",emptydiff,emptydrdiff));
439 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
440 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
441 //printf("========================= %d",AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::kCosmic));
442 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
443 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
445 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
446 if(neventsraw<numlimit) {
447 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
450 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
452 results2.Form(" Events %d. If PHYSICS, follow the TWiki instruction and call the Expert ",neventsraw);
455 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
459 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
460 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())==AliRecoParam::kCosmic)
463 if(neventsraw<numlimit)
465 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
466 results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
467 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
470 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
474 results1.Form("%i good module(s) and %i good drift region(s) have no data!",emptydiff,emptydrdiff);
475 results2.Form(" Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
478 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
483 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
484 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));
485 results1.Form("OK.");
486 results2.Form(" All active modules and drift regions in acquisition");
489 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
491 if(exactive!=0||exactivedriftregion!=0){
492 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));
493 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]));
494 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]));
495 results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
496 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
499 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
501 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
502 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));
503 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
504 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
507 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
509 if(active==0||activedriftregion==0){
510 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));
511 results1.Form("No modules or drift region took data: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
512 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
515 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
518 //TPaveText *pave[2]={0,0};
521 while( (hdata=dynamic_cast<TH1* >(next())) ) {
523 TString hname=hdata->GetName();
524 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
525 if(hname.Contains("NORM"))continue;
526 //AliInfo("========================================Found histo 11\n");
527 TPaveText *ptext = ((TPaveText *)hdata->GetListOfFunctions()->FindObject("TPave"));
530 ptext->AddText(results1.Data());
531 ptext->AddText(results2.Data());
532 ptext->SetFillColor(color);
533 ptext->SetTextColor(textcolor);
535 } else if(hname.Contains("SDDRawDataCheck")) {
537 //AliInfo("========================================Found histo\n");
538 ((TH1F*)hdata)->SetBinContent(5,active);
539 ((TH1F*)hdata)->SetBinContent(6,filled);
540 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
541 ((TH1F*)hdata)->SetBinContent(8,filleddr);
542 ((TH1F*)hdata)->SetBinContent(9,excluded);
543 ((TH1F*)hdata)->SetBinContent(10,empty);
544 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
545 ((TH1F*)hdata)->SetBinContent(12,emptydr);
546 ((TH1F*)hdata)->SetBinContent(13,exactive);
547 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
548 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
549 ((TH1F*)hdata)->SetBinContent(16,emptydrdiff);
552 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
553 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
554 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
555 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
556 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
557 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
558 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
559 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
560 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
561 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
562 ((TH1F*)hdata)->SetBinContent(29,exactivedrperlayer[0]);
563 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
566 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
567 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
568 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
569 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
570 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
571 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
572 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
573 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
574 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
575 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
576 ((TH1F*)hdata)->SetBinContent(43,exactivedrperlayer[1]);
577 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
587 for(Int_t i=0;i<2;i++) {
596 case AliQAv1::kNULLTASK:{
597 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
598 sddQACheckerValue=1.;
604 Int_t uidrec=list->GetUniqueID();
605 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
608 if (list->GetEntries() == 0){ //check if the list is empty
609 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
610 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
618 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
621 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];
622 Int_t excluded=0; //excluded modules
623 Int_t excludeddriftregion=0; //excluded single drift region
624 Int_t active=0; //active modules
625 Int_t activedriftregion=0; //active single drift region
626 Int_t exactive=0; //excluded modules but taking data
627 Int_t exactivedriftregion=0; //excluded single drift region but taking data
632 //Int_t emptyactivemodule=0;
633 Int_t emptyactivemoduleperlayer[2];
634 //Int_t emptydractivemodule=0;
635 Int_t emptyactivedrperlayer[2];
641 for(Int_t i=0;i<2;i++)
647 emptydriftregion[i]=0;
648 filleddriftregion[i]=0;
649 excludedmoduleperlayer[i]=0;
650 excludeddrperlayer[i]=0;
651 activemoduleperlayer[i]=0;
652 activedrperlayer[i]=0;
653 exactivemoduleperlayer[i]=0;
654 exactivedrperlayer[i]=0;
655 emptyactivemoduleperlayer[i]=0;
656 emptyactivedrperlayer[i]=0;
659 Int_t neventsrecpoints=0;
661 while( (hdata = dynamic_cast<TH1* >(next())) ){
663 TString hname=hdata->GetName();
665 if(hname.Contains("SDDRecPointCheck"))
667 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
676 while((hdata=dynamic_cast<TH1* >(next()))){
678 TString hname=hdata->GetName();
679 if(hname.Contains("_RelativeOccupancy")) {
680 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
681 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
682 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
683 Int_t aboveThreshold = 0;
684 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
685 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
687 Float_t fractionAboveThreshold=0.;
688 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
689 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
690 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
691 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
692 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
693 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
694 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
697 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
698 //Float_t threshold = 0.;
699 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
700 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
701 Int_t belowThreshold = 0;
702 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
703 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
705 Double_t fractionBelowThreshold =0.;
706 Double_t entries3=((TH1F *)hdata)->GetEntries();
707 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
708 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
709 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
710 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
711 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
712 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
713 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
714 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
717 if(hname.Contains("dedx")) {
718 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
719 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
721 if(hname.Contains("SDDModPatternRP")){
722 if(hname.Contains("NORM")) continue;
723 hmodule=(TH1*)hdata->Clone();
724 entries= hdata->GetEntries();
725 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
727 int modmax=hdata->GetNbinsX();
730 for(Int_t i=1;i<=modmax;i++)
734 content=hdata->GetBinContent(i);
735 if(AliITSQADataMakerRec::AreEqual(content,0.))
738 emptymodules[llay]++;
743 filledmodules[llay]++;
746 //output of the check at the level of the modules. Drift region in the following checks
748 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
749 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
750 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
751 }//end else pattern entries !=0
752 } //modpattern (1d histogram)
754 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
756 if(hname.Contains("3"))layer=0;
757 else if(hname.Contains("4"))layer=1;
758 entries2[layer]=hdata->GetEntries();
759 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
760 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
763 if(hname.Contains("3"))layer1=0;
764 else if(hname.Contains("4"))layer1=1;
765 TH2* htemp=dynamic_cast<TH2*>(hdata);
767 hlayer[layer1]=(TH2*)htemp->Clone();
768 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
769 //hlayer[layer1]->RebinX(2);
770 int modmay=hlayer[layer1]->GetNbinsY();
771 TH1D* hproj= hlayer[layer1]->ProjectionY();
772 Double_t ladcontent=0;
773 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
774 ladcontent=hproj->GetBinContent(i);
775 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
776 else filledladders[layer1]++;}//end for
777 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
781 }//end else entries !=0
785 for(Int_t ii=0;ii<2;ii++)
792 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
794 if(hmodule || (hlayer[0] && hlayer[1])){
795 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
800 module=imod+fgkmodoffset;
801 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
802 if(cal==0) { continue;}
803 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
806 excludedmoduleperlayer[lay-3]++;
808 //Double_t contentlayer[2];
809 //for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
810 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
811 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
812 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
813 filledmodules[lay-3]++;
815 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
817 exactivemoduleperlayer[lay-3]++;
818 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
820 emptymodules[lay-3]++; //it has to be empty
825 Int_t totactiveside=0;
826 //Int_t totbadside=0;
827 Double_t contentgood=0.;
829 for(Int_t i=0;i<2;i++){
830 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
831 if(cal->IsWingBad(i))
833 excludeddriftregion++;
834 excludeddrperlayer[lay-3]++;
835 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
836 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));
837 exactivedriftregion++;
838 exactivedrperlayer[lay-3]++;
840 filleddriftregion[lay-3]++;
844 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
846 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));
856 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
857 emptymodules[lay-3]++;
863 filledmodules[lay-3]++;
870 //emptydriftregion[lay-3]++; //it has to be empty
871 emptydriftregion[lay-3]++;
874 filleddriftregion[lay-3]++;
879 activedrperlayer[lay-3]++;
880 }else if(totactiveside==2)
883 activemoduleperlayer[lay-3]++;
888 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
889 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
890 for(Int_t i=0;i<2;i++)
892 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
893 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
895 emptysum=emptymodules[0]+emptymodules[1];
896 emptydiff=emptysum-excluded;
897 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
898 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
900 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
901 emptydrdiff=emptydrsum-excludeddriftregion;
902 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
903 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
906 if(emptysum>excluded||emptydrsum>excludeddriftregion){
907 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
908 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
909 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
911 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
912 Int_t numlimits=1000;
914 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
915 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
916 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
918 if(neventsrecpoints<numlimits)
920 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
923 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
927 results2.Form(" Events %d .If PHYSICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
930 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
934 //if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
935 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())==AliRecoParam::kCosmic){
937 if( neventsrecpoints<numlimit)
939 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
940 results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
941 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
944 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
948 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
949 results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
952 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
959 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
960 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));
961 results1.Form("OK.");
962 results2.Form(" All active modules have recpoints");
965 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
967 if(exactive!=0||exactivedriftregion!=0){
968 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));
969 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]));
970 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]));
971 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
972 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
975 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
977 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
978 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));
979 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
980 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
983 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
985 if(active==0||activedriftregion==0){
986 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));
987 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
988 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
991 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
994 //TPaveText *pave[2]={0,0};
997 while( (hdata=dynamic_cast<TH1* >(next())) )
1000 TString hname=hdata->GetName();
1001 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
1002 if(hname.Contains("NORM"))continue;
1003 //AliInfo("========================================Found histo 11\n");
1004 TPaveText *ptext = ((TPaveText *)hdata->GetListOfFunctions()->FindObject("TPave"));
1007 ptext->AddText(results1.Data());
1008 ptext->AddText(results2.Data());
1009 ptext->SetFillColor(color);
1010 ptext->SetTextColor(textcolor);
1014 if(hname.Contains("SDDRecPointCheck"))
1017 //AliInfo("========================================Found histo\n");
1018 ((TH1F*)hdata)->SetBinContent(5,active);
1019 ((TH1F*)hdata)->SetBinContent(6,filled);
1020 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
1021 ((TH1F*)hdata)->SetBinContent(8,filleddr);
1022 ((TH1F*)hdata)->SetBinContent(9,excluded);
1023 ((TH1F*)hdata)->SetBinContent(10,empty);
1024 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
1025 ((TH1F*)hdata)->SetBinContent(12,emptydr);
1026 ((TH1F*)hdata)->SetBinContent(13,exactive);
1027 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
1028 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
1029 ((TH1F*)hdata)->SetBinContent(16,emptydrdiff);
1032 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
1033 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
1034 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
1035 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
1036 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
1037 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
1038 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
1039 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
1040 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1041 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1042 ((TH1F*)hdata)->SetBinContent(29,exactivedrperlayer[0]);
1043 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1046 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1047 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1048 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1049 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1050 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1051 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1052 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1053 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1054 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1055 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1056 ((TH1F*)hdata)->SetBinContent(45,exactivedrperlayer[1]);
1057 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1058 //hdata->GetListOfFunctions()->Add(pave[0]);
1068 for(Int_t i=0;i<2;i++) {
1074 //sddQACheckerValue=1.;
1075 }//end recpoint list uid = 20
1079 if (list->GetEntries() == 0){
1080 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1084 while( (hdata = dynamic_cast<TH1* >(next())) ){
1086 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1088 TString hname=hdata->GetName();
1089 if(hname.Contains("SDD DIGITS Module Pattern")) {
1092 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1093 } else if(hname.Contains("SDD Anode Distribution")) {
1094 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1095 } else if(hname.Contains("SDD Tbin Distribution")) {
1097 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1098 } else if(hname.Contains("SDD ADC Counts Distribution")) {
1099 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1106 sddQACheckerValue=1.;
1113 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1114 sddQACheckerValue=1.;
1119 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1120 sddQACheckerValue=1.;
1123 case AliQAv1::kNTASK:{
1124 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1125 sddQACheckerValue=1.;
1128 case AliQAv1::kSIM:{
1129 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1130 Int_t uid=list->GetUniqueID();
1133 if (list->GetEntries() == 0){
1134 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1138 while( (hdata = dynamic_cast<TH1* >(next())) ){
1140 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1142 TString hname=hdata->GetName();
1143 if(hname.Contains("SDDDIGITSModulePattern")) {
1146 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1147 } else if(hname.Contains("SDDAnodeDistribution")) {
1148 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1149 } else if(hname.Contains("SDDTbinDistribution")) {
1151 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1152 } else if(hname.Contains("SDDADCCountsDistribution")) {
1153 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1163 if (list->GetEntries() == 0){
1164 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1169 while( (hdata = dynamic_cast<TH1* >(next())) ){
1171 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1173 TString hname=hdata->GetName();
1174 if(hname.Contains("SDDHITSModulePattern")) {
1176 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1177 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
1178 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1179 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
1180 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1181 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
1182 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1183 }//end deposited energy
1192 if (list->GetEntries() == 0){
1193 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1197 while( (hdata = dynamic_cast<TH1* >(next())) ){
1199 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1201 TString hname=hdata->GetName();
1202 if(hname.Contains("SDDSDIGITSModulePattern")) {
1204 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1205 } else if(hname.Contains("SDDAnodeDistribution")) {
1206 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1207 } else if(hname.Contains("SDDTbinDistribution")) {
1209 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1210 } else if(hname.Contains("SDDADCCountsDistribution")) {
1211 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1212 }//end adc counts bindistribution
1219 sddQACheckerValue=1.;
1226 return sddQACheckerValue;
1229 //__________________________________________________________________
1230 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1232 //set the number of the histograms already present in the list before the SDD histograms
1233 fSubDetOffset = taskoffset;
1237 //__________________________________________________________________
1238 void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
1240 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
1241 //if(fStepBitSDD){/*delete fStepBitSDD;*/ fStepBitSDD=NULL;}
1242 //fStepBitSDD = new Double_t[AliQAv1::kNBIT];
1243 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1245 fStepBitSDD[bit]=steprange[bit];
1249 //__________________________________________________________________
1250 void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
1252 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
1253 // fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1254 // fHighSDDValue= new Float_t[AliQAv1::kNBIT];
1256 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1258 fLowSDDValue[bit]=lowvalue[bit];
1259 fHighSDDValue[bit]= highvalue[bit];
1263 //__________________________________________________________________
1264 Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1266 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1269 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
1272 case AliQAv1::kRAWS:{
1273 rval=MakeSDDRawsImage(list, task,mode);
1276 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1278 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1281 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1284 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1286 Int_t ts=(Int_t)task;
1287 AliWarning(Form("No histograms for this task number %d \n", ts));
1296 //_______________________________________________________________________
1297 Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1299 // MakeSDDRawsImage: raw data QA plots
1301 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1302 //printf("-------------------------> %i \n", esIndex);
1303 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0) {
1304 //printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1307 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1308 if ( !fImage[esIndex] ) {
1309 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1311 fImage[esIndex]->Clear() ;
1312 fImage[esIndex]->SetTitle(title) ;
1313 fImage[esIndex]->cd();
1314 fPaveText[esIndex] = new TPaveText(0.015, 0.015, 0.98, 0.98);
1315 fPaveText[esIndex]->AddText(title);
1316 fPaveText[esIndex]->Draw();
1317 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1318 fImage[esIndex]->Clear() ;
1319 Int_t nx =2;//TMath::Nint(TMath::Sqrt(nImages));//2
1320 Int_t ny =3;//nx ; //2
1321 // if (nx < TMath::Sqrt(nImages))
1323 fImage[esIndex]->Divide(nx, ny) ;
1324 TIter nexthist(list[esIndex]) ;
1326 fImage[esIndex]->cd(npad);
1327 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1330 TH1* hist = static_cast<TH1*>(nexthist());
1331 if(hist == NULL) break;
1333 TString hname(hist->GetName());
1335 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1336 TString cln(hist->ClassName()) ;
1337 if ( ! cln.Contains("TH") )
1340 if(hist->TestBit(AliQAv1::GetImageBit())) {
1341 hist->GetXaxis()->SetTitleSize(0.04);
1342 hist->GetYaxis()->SetTitleSize(0.04);
1343 hist->GetXaxis()->SetLabelSize(0.02);
1344 hist->GetYaxis()->SetLabelSize(0.02);
1345 if(cln.Contains("TH2")) {
1346 gPad->SetRightMargin(0.15);
1347 gPad->SetLeftMargin(0.05);
1349 hist->SetOption("colz") ;
1351 ////hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1355 fImage[esIndex]->cd(++npad) ;
1356 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1359 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1368 //_______________________________________________________________________
1369 Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1371 // MakeSDDRecPointsImage: rec point QA plots
1373 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1374 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1376 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1379 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1380 if ( !fImage[esIndex] ) {
1381 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1383 fImage[esIndex]->Clear() ;
1384 fImage[esIndex]->SetTitle(title) ;
1385 fImage[esIndex]->cd();
1386 fImage[esIndex]->SetBorderMode(0) ;
1387 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1388 someText.AddText(title);
1390 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1391 fImage[esIndex]->Clear() ;
1392 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1393 Int_t ny =6; // nx ;
1394 //if (nx < TMath::Sqrt(nImages))
1396 fImage[esIndex]->Divide(nx, ny) ;
1397 TIter nexthist(list[esIndex]) ;
1400 fImage[esIndex]->cd(npad) ;
1401 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1402 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1403 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1404 TString cln(hist->ClassName()) ;
1406 TString hname(hist->GetName());
1408 //printf("=====================> Class name %s \n",cln.Data());
1409 if ( ! cln.Contains("TH") )
1411 if(hist->TestBit(AliQAv1::GetImageBit())) {
1412 hist->GetXaxis()->SetTitleSize(0.04);
1413 hist->GetYaxis()->SetTitleSize(0.04);
1414 hist->GetXaxis()->SetLabelSize(0.02);
1415 hist->GetYaxis()->SetLabelSize(0.02);
1416 if(cln.Contains("TH1"))
1418 if(!hname.Contains("Check")) hist->SetFillColor(kOrange+7);
1419 //SetFrameFillColor(kAzure-9);
1420 //hist->DrawCopy() ;
1422 if(cln.Contains("TH2"))
1424 gPad->SetRightMargin(0.15);
1425 gPad->SetLeftMargin(0.05);
1427 hist->SetOption("colz") ;
1428 //// TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1429 //paletta->SetLabelSize(0.025);
1434 fImage[esIndex]->cd(++npad) ;
1435 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1438 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;