1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // *****************************************
19 // Checks the quality assurance
20 // by comparing with reference data
21 // P. Cerello Apr 2008
24 // --- ROOT system ---
29 #include "TPaveText.h"
31 //#include "TPaletteAxis.h"
32 // --- AliRoot header files ---
33 #include "AliITSQADataMakerRec.h"
34 #include "AliITSQASDDChecker.h"
36 #include "AliCDBEntry.h"
37 #include "AliCDBManager.h"
38 #include "AliITSCalibrationSDD.h"
39 #include "AliITSgeomTGeo.h"
40 #include "AliQAManager.h"
42 #include "AliQAChecker.h"
43 #include "AliQACheckerBase.h"
46 ClassImp(AliITSQASDDChecker)
50 //_____________________________________________________________________
52 AliITSQASDDChecker::AliITSQASDDChecker():
58 fThresholdForRelativeOccupancy(0.01),
59 fThresholdForRecToRawRatio(0.04),
63 // Default constructor
64 fStepBitSDD=new Double_t[AliQAv1::kNBIT];
65 fLowSDDValue=new Float_t[AliQAv1::kNBIT];
66 fHighSDDValue=new Float_t[AliQAv1::kNBIT];
67 for(Int_t ibit=0;ibit<AliQAv1::kNBIT;ibit++)
70 fLowSDDValue[ibit]=0.;
71 fHighSDDValue[ibit]=0.;
78 AliITSQASDDChecker::~AliITSQASDDChecker()
84 delete[] fStepBitSDD ;
94 delete[]fHighSDDValue;
109 //__________________________________________________________________
110 Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
112 //check histograms of the different lists
113 AliInfo(Form("AliITSQASDDChecker called with offset: %d \t and specie %d\n", fSubDetOffset,fESforCheck));
115 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
117 Double_t sddQACheckerValue = 0.;
120 Double_t entries2[2];
121 for(Int_t i=0;i<2;i++)entries2[i]=0.;
124 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
125 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
128 AliError("Calibration object retrieval failed! SDD will not be processed");
130 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
133 fCalibration = (TObjArray *)calibSDD->GetObject();
135 if(!cacheStatus)calibSDD->SetObject(NULL);
136 calibSDD->SetOwner(kTRUE);
144 AliInfo("Calib SDD Created\n ");
153 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
154 // if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
155 // if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
156 // if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
157 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
161 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
164 Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
165 Int_t excluded=0; //excluded modules
166 Int_t excludeddriftregion=0; //excluded single drift region
167 Int_t active=0; //active modules
168 Int_t activedriftregion=0; //active single drift region
169 Int_t exactive=0; //excluded modules but taking data
170 Int_t exactivedriftregion=0; //excluded single drift region but taking data
175 //Int_t emptyactivemodule=0;
176 Int_t emptyactivemoduleperlayer[2];
177 //Int_t emptydractivemodule=0;
178 Int_t emptyactivedrperlayer[2];
184 for(Int_t i=0;i<2;i++)
190 emptydriftregion[i]=0;
191 filleddriftregion[i]=0;
192 excludedmoduleperlayer[i]=0;
193 excludeddrperlayer[i]=0;
194 activemoduleperlayer[i]=0;
195 activedrperlayer[i]=0;
196 exactivemoduleperlayer[i]=0;
197 exactivedrperlayer[i]=0;
198 emptyactivemoduleperlayer[i]=0;
199 emptyactivedrperlayer[i]=0;
204 //take the number of events
206 while( (hdata = dynamic_cast<TH1* >(next())) ){
208 TString hname=hdata->GetName();
210 if(hname.Contains("SDDRawDataCheck"))
212 neventsraw=(Int_t)hdata->GetBinContent(1);
220 while( (hdata = dynamic_cast<TH1* >(next())) ){
221 if (hdata){TString hname=hdata->GetName();
222 if(hname.Contains("SDDchargeMap"))continue;
223 if(hname.Contains("SDDDDLPattern"))continue;
224 if(hname.Contains("SDDEventSize"))continue;
225 if(hname.Contains("_RelativeOccupancy"))continue;
226 if(hname.Contains("SDDModPattern")){
227 if(hname.Contains("NORM")) continue;
228 hmodule=(TH1*)hdata->Clone();
229 entries= hdata->GetEntries();
230 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
232 int modmax=hdata->GetNbinsX();
235 for(Int_t i=1;i<=modmax;i++)
239 content=hdata->GetBinContent(i);
240 if(AliITSQADataMakerRec::AreEqual(content,0.))
243 emptymodules[llay]++;
248 filledmodules[llay]++;
251 //output of the check at the level of the modules. Drift region in the following checks
253 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
254 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
255 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
256 }//end else pattern entries !=0
257 } //modpattern (1d histogram)
258 if(hname.Contains("_RelativeOccupancy")) {
259 //fRawModulePattern = (TH1F *) hdata;
260 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
261 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
262 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
263 Int_t aboveThreshold = 0;
264 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
265 Float_t fractionAboveThreshold=0.;
266 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
267 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
268 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
269 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
270 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
271 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
273 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
275 if(hname.Contains("3"))layer=0;
276 else if(hname.Contains("4"))layer=1;
277 entries2[layer]=hdata->GetEntries();
278 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
279 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
282 if(hname.Contains("3"))layer1=0;
283 else if(hname.Contains("4"))layer1=1;
284 TH2* htemp=dynamic_cast<TH2*>(hdata);
286 hlayer[layer1]=(TH2*)htemp->Clone();
287 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
288 //hlayer[layer1]->RebinX(2);
289 int modmay=hlayer[layer1]->GetNbinsY();
290 TH1D* hproj= hlayer[layer1]->ProjectionY();
291 Double_t ladcontent=0;
292 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
293 ladcontent=hproj->GetBinContent(i);
294 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
295 else filledladders[layer1]++;}//end for
296 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
300 }//end else entries !=0
304 for(Int_t ii=0;ii<2;ii++)
311 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
313 if(hmodule || (hlayer[0] && hlayer[1])){
314 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
319 module=imod+fgkmodoffset;
320 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
321 if(cal==0) { continue;}
322 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
325 excludedmoduleperlayer[lay-3]++;
327 //Double_t contentlayer[2];
328 //for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
329 if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
330 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
331 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
332 filledmodules[lay-3]++;
334 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
336 exactivemoduleperlayer[lay-3]++;
337 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
339 emptymodules[lay-3]++; //it has to be empty
344 Int_t totactiveside=0;
345 //Int_t totbadside=0;
346 Double_t contentgood=0.;
348 for(Int_t i=0;i<2;i++){
349 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
350 if(cal->IsWingBad(i))
352 excludeddriftregion++;
353 excludeddrperlayer[lay-3]++;
354 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
355 AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",i,module,lay,lad,det));
356 exactivedriftregion++;
357 exactivedrperlayer[lay-3]++;
359 filleddriftregion[lay-3]++;
363 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
365 AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",i,module, lay, lad, det));
375 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",module, lay, lad, det));
376 emptymodules[lay-3]++;
382 filledmodules[lay-3]++;
389 //emptydriftregion[lay-3]++; //it has to be empty
390 emptydriftregion[lay-3]++;
393 filleddriftregion[lay-3]++;
398 activedrperlayer[lay-3]++;
399 }else if(totactiveside==2)
402 activemoduleperlayer[lay-3]++;
407 AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
408 AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
409 for(Int_t i=0;i<2;i++)
411 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
412 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
414 emptysum=emptymodules[0]+emptymodules[1];
415 emptydiff=emptysum-excluded;
416 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
417 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
419 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
420 emptydrdiff=emptydrsum-excludeddriftregion;
421 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
422 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
426 if(emptysum>excluded||emptydrsum>excludeddriftregion){
427 AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! \n",emptydiff,emptydrdiff));
428 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
429 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
430 //printf("========================= %d",AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::kCosmic));
431 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
432 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
434 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
435 if(neventsraw<numlimit)
437 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
439 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
443 results2.Form(" Events %d. If PHYSICS, follow the TWiki instruction and call the Expert ",neventsraw);
445 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
449 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
450 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())==AliRecoParam::kCosmic)
453 if(neventsraw<numlimit)
455 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
456 results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
457 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
459 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
463 results1.Form("%i good module(s) and %i good drift region(s) have no data!",emptydiff,emptydrdiff);
464 results2.Form(" Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
466 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
471 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
472 AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
473 results1.Form("OK.");
474 results2.Form(" All active modules and drift regions in acquisition");
476 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
478 if(exactive!=0||exactivedriftregion!=0){
479 AliError(Form("%i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
480 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
481 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
482 results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
483 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
485 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
487 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
488 AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition took data!\n Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
489 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
490 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
492 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
494 if(active==0||activedriftregion==0){
495 AliError(Form("No modules or single drift regions took data: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion));
496 results1.Form("No modules or drift region took data: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
497 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
499 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
502 TPaveText *pave[2]={0,0};
505 while( (hdata=dynamic_cast<TH1* >(next())) )
508 TString hname=hdata->GetName();
509 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
510 if(hname.Contains("NORM"))continue;
511 //AliInfo("========================================Found histo 11\n");
513 if(hname.Contains("3"))lay=0;
514 else if(hname.Contains("4"))lay=1;
515 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
516 pave[lay]->AddText(results1.Data());
517 pave[lay]->AddText(results2.Data());
518 pave[lay]->SetFillColor(color);
519 pave[lay]->SetBorderSize(1);
520 pave[lay]->SetLineWidth(1);
521 hdata->GetListOfFunctions()->Add(pave[lay]);
524 if(hname.Contains("SDDRawDataCheck"))
527 //AliInfo("========================================Found histo\n");
528 ((TH1F*)hdata)->SetBinContent(5,active);
529 ((TH1F*)hdata)->SetBinContent(6,filled);
530 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
531 ((TH1F*)hdata)->SetBinContent(8,filleddr);
532 ((TH1F*)hdata)->SetBinContent(9,excluded);
533 ((TH1F*)hdata)->SetBinContent(10,empty);
534 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
535 ((TH1F*)hdata)->SetBinContent(12,emptydr);
536 ((TH1F*)hdata)->SetBinContent(13,exactive);
537 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
538 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
539 ((TH1F*)hdata)->SetBinContent(16,emptydrdiff);
542 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
543 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
544 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
545 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
546 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
547 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
548 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
549 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
550 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
551 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
552 ((TH1F*)hdata)->SetBinContent(29,exactivedrperlayer[0]);
553 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
556 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
557 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
558 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
559 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
560 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
561 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
562 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
563 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
564 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
565 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
566 ((TH1F*)hdata)->SetBinContent(43,exactivedrperlayer[1]);
567 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
568 hdata->GetListOfFunctions()->Add(pave[0]);
578 for(Int_t i=0;i<2;i++) {
587 case AliQAv1::kNULLTASK:{
588 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
589 sddQACheckerValue=1.;
595 Int_t uidrec=list->GetUniqueID();
596 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
599 if (list->GetEntries() == 0){ //check if the list is empty
600 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
601 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
609 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
612 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];
613 Int_t excluded=0; //excluded modules
614 Int_t excludeddriftregion=0; //excluded single drift region
615 Int_t active=0; //active modules
616 Int_t activedriftregion=0; //active single drift region
617 Int_t exactive=0; //excluded modules but taking data
618 Int_t exactivedriftregion=0; //excluded single drift region but taking data
623 //Int_t emptyactivemodule=0;
624 Int_t emptyactivemoduleperlayer[2];
625 //Int_t emptydractivemodule=0;
626 Int_t emptyactivedrperlayer[2];
632 for(Int_t i=0;i<2;i++)
638 emptydriftregion[i]=0;
639 filleddriftregion[i]=0;
640 excludedmoduleperlayer[i]=0;
641 excludeddrperlayer[i]=0;
642 activemoduleperlayer[i]=0;
643 activedrperlayer[i]=0;
644 exactivemoduleperlayer[i]=0;
645 exactivedrperlayer[i]=0;
646 emptyactivemoduleperlayer[i]=0;
647 emptyactivedrperlayer[i]=0;
650 Int_t neventsrecpoints=0;
652 while( (hdata = dynamic_cast<TH1* >(next())) ){
654 TString hname=hdata->GetName();
656 if(hname.Contains("SDDRecPointCheck"))
658 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
667 while((hdata=dynamic_cast<TH1* >(next()))){
669 TString hname=hdata->GetName();
670 if(hname.Contains("_RelativeOccupancy")) {
671 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
672 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
673 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
674 Int_t aboveThreshold = 0;
675 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
676 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
678 Float_t fractionAboveThreshold=0.;
679 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
680 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
681 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
682 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
683 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
684 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
685 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
688 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
689 //Float_t threshold = 0.;
690 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
691 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
692 Int_t belowThreshold = 0;
693 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
694 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
696 Double_t fractionBelowThreshold =0.;
697 Double_t entries3=((TH1F *)hdata)->GetEntries();
698 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
699 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
700 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
701 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
702 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
703 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
704 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
705 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
708 if(hname.Contains("dedx")) {
709 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
710 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
712 if(hname.Contains("SDDModPatternRP")){
713 if(hname.Contains("NORM")) continue;
714 hmodule=(TH1*)hdata->Clone();
715 entries= hdata->GetEntries();
716 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
718 int modmax=hdata->GetNbinsX();
721 for(Int_t i=1;i<=modmax;i++)
725 content=hdata->GetBinContent(i);
726 if(AliITSQADataMakerRec::AreEqual(content,0.))
729 emptymodules[llay]++;
734 filledmodules[llay]++;
737 //output of the check at the level of the modules. Drift region in the following checks
739 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
740 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
741 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
742 }//end else pattern entries !=0
743 } //modpattern (1d histogram)
745 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
747 if(hname.Contains("3"))layer=0;
748 else if(hname.Contains("4"))layer=1;
749 entries2[layer]=hdata->GetEntries();
750 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
751 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
754 if(hname.Contains("3"))layer1=0;
755 else if(hname.Contains("4"))layer1=1;
756 TH2* htemp=dynamic_cast<TH2*>(hdata);
758 hlayer[layer1]=(TH2*)htemp->Clone();
759 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
760 //hlayer[layer1]->RebinX(2);
761 int modmay=hlayer[layer1]->GetNbinsY();
762 TH1D* hproj= hlayer[layer1]->ProjectionY();
763 Double_t ladcontent=0;
764 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
765 ladcontent=hproj->GetBinContent(i);
766 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
767 else filledladders[layer1]++;}//end for
768 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
772 }//end else entries !=0
776 for(Int_t ii=0;ii<2;ii++)
783 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
785 if(hmodule || (hlayer[0] && hlayer[1])){
786 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
791 module=imod+fgkmodoffset;
792 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
793 if(cal==0) { continue;}
794 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
797 excludedmoduleperlayer[lay-3]++;
799 //Double_t contentlayer[2];
800 //for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
801 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
802 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
803 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
804 filledmodules[lay-3]++;
806 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
808 exactivemoduleperlayer[lay-3]++;
809 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
811 emptymodules[lay-3]++; //it has to be empty
816 Int_t totactiveside=0;
817 //Int_t totbadside=0;
818 Double_t contentgood=0.;
820 for(Int_t i=0;i<2;i++){
821 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
822 if(cal->IsWingBad(i))
824 excludeddriftregion++;
825 excludeddrperlayer[lay-3]++;
826 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
827 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));
828 exactivedriftregion++;
829 exactivedrperlayer[lay-3]++;
831 filleddriftregion[lay-3]++;
835 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
837 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));
847 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
848 emptymodules[lay-3]++;
854 filledmodules[lay-3]++;
861 //emptydriftregion[lay-3]++; //it has to be empty
862 emptydriftregion[lay-3]++;
865 filleddriftregion[lay-3]++;
870 activedrperlayer[lay-3]++;
871 }else if(totactiveside==2)
874 activemoduleperlayer[lay-3]++;
879 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
880 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
881 for(Int_t i=0;i<2;i++)
883 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
884 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
886 emptysum=emptymodules[0]+emptymodules[1];
887 emptydiff=emptysum-excluded;
888 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
889 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
891 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
892 emptydrdiff=emptydrsum-excludeddriftregion;
893 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
894 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
897 if(emptysum>excluded||emptydrsum>excludeddriftregion){
898 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
899 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
900 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
902 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
903 Int_t numlimits=1000;
905 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
906 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
907 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
909 if(neventsrecpoints<numlimits)
911 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
913 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
917 results2.Form(" Events %d .If PHYSICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
919 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
923 //if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
924 if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())==AliRecoParam::kCosmic){
926 if( neventsrecpoints<numlimit)
928 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
929 results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
930 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
932 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
936 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
937 results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
939 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
946 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
947 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));
948 results1.Form("OK.");
949 results2.Form(" All active modules have recpoints");
951 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
953 if(exactive!=0||exactivedriftregion!=0){
954 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));
955 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
956 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]));
957 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
958 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
960 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
962 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
963 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));
964 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
965 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
967 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
969 if(active==0||activedriftregion==0){
970 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));
971 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
972 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
974 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
977 TPaveText *pave[2]={0,0};
980 while( (hdata=dynamic_cast<TH1* >(next())) )
983 TString hname=hdata->GetName();
984 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
985 if(hname.Contains("NORM"))continue;
986 //AliInfo("========================================Found histo 11\n");
988 if(hname.Contains("3"))lay=0;
989 else if(hname.Contains("4"))lay=1;
990 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
991 pave[lay]->AddText(results1.Data());
992 pave[lay]->AddText(results2.Data());
993 pave[lay]->SetFillColor(color);
994 pave[lay]->SetBorderSize(1);
995 pave[lay]->SetLineWidth(1);
996 hdata->GetListOfFunctions()->Add(pave[lay]);
999 if(hname.Contains("SDDRecPointCheck"))
1002 //AliInfo("========================================Found histo\n");
1003 ((TH1F*)hdata)->SetBinContent(5,active);
1004 ((TH1F*)hdata)->SetBinContent(6,filled);
1005 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
1006 ((TH1F*)hdata)->SetBinContent(8,filleddr);
1007 ((TH1F*)hdata)->SetBinContent(9,excluded);
1008 ((TH1F*)hdata)->SetBinContent(10,empty);
1009 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
1010 ((TH1F*)hdata)->SetBinContent(12,emptydr);
1011 ((TH1F*)hdata)->SetBinContent(13,exactive);
1012 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
1013 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
1014 ((TH1F*)hdata)->SetBinContent(16,emptydrdiff);
1017 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
1018 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
1019 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
1020 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
1021 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
1022 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
1023 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
1024 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
1025 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1026 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1027 ((TH1F*)hdata)->SetBinContent(29,exactivedrperlayer[0]);
1028 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1031 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1032 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1033 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1034 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1035 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1036 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1037 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1038 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1039 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1040 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1041 ((TH1F*)hdata)->SetBinContent(45,exactivedrperlayer[1]);
1042 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1043 hdata->GetListOfFunctions()->Add(pave[0]);
1053 for(Int_t i=0;i<2;i++) {
1059 //sddQACheckerValue=1.;
1060 }//end recpoint list uid = 20
1064 if (list->GetEntries() == 0){
1065 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1069 while( (hdata = dynamic_cast<TH1* >(next())) ){
1071 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1073 TString hname=hdata->GetName();
1074 if(hname.Contains("SDD DIGITS Module Pattern")) {
1077 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1078 } else if(hname.Contains("SDD Anode Distribution")) {
1079 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1080 } else if(hname.Contains("SDD Tbin Distribution")) {
1082 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1083 } else if(hname.Contains("SDD ADC Counts Distribution")) {
1084 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1091 sddQACheckerValue=1.;
1098 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1099 sddQACheckerValue=1.;
1104 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1105 sddQACheckerValue=1.;
1108 case AliQAv1::kNTASK:{
1109 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
1110 sddQACheckerValue=1.;
1113 case AliQAv1::kSIM:{
1114 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1115 Int_t uid=list->GetUniqueID();
1118 if (list->GetEntries() == 0){
1119 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1123 while( (hdata = dynamic_cast<TH1* >(next())) ){
1125 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1127 TString hname=hdata->GetName();
1128 if(hname.Contains("SDDDIGITSModulePattern")) {
1131 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1132 } else if(hname.Contains("SDDAnodeDistribution")) {
1133 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1134 } else if(hname.Contains("SDDTbinDistribution")) {
1136 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1137 } else if(hname.Contains("SDDADCCountsDistribution")) {
1138 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1148 if (list->GetEntries() == 0){
1149 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1154 while( (hdata = dynamic_cast<TH1* >(next())) ){
1156 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1158 TString hname=hdata->GetName();
1159 if(hname.Contains("SDDHITSModulePattern")) {
1161 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1162 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
1163 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1164 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
1165 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1166 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
1167 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1168 }//end deposited energy
1177 if (list->GetEntries() == 0){
1178 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
1182 while( (hdata = dynamic_cast<TH1* >(next())) ){
1184 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
1186 TString hname=hdata->GetName();
1187 if(hname.Contains("SDDSDIGITSModulePattern")) {
1189 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1190 } else if(hname.Contains("SDDAnodeDistribution")) {
1191 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1192 } else if(hname.Contains("SDDTbinDistribution")) {
1194 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1195 } else if(hname.Contains("SDDADCCountsDistribution")) {
1196 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
1197 }//end adc counts bindistribution
1203 sddQACheckerValue=1.;
1210 if(hdata) delete hdata;
1213 return sddQACheckerValue;
1216 //__________________________________________________________________
1217 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1219 //set the number of the histograms already present in the list before the SDD histograms
1220 fSubDetOffset = taskoffset;
1224 //__________________________________________________________________
1225 void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
1227 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
1228 //if(fStepBitSDD){/*delete fStepBitSDD;*/ fStepBitSDD=NULL;}
1229 //fStepBitSDD = new Double_t[AliQAv1::kNBIT];
1230 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1232 fStepBitSDD[bit]=steprange[bit];
1236 //__________________________________________________________________
1237 void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
1239 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
1240 // fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1241 // fHighSDDValue= new Float_t[AliQAv1::kNBIT];
1243 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1245 fLowSDDValue[bit]=lowvalue[bit];
1246 fHighSDDValue[bit]= highvalue[bit];
1250 //__________________________________________________________________
1251 Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1253 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1256 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
1260 case AliQAv1::kRAWS:{
1261 rval=MakeSDDRawsImage(list, task,mode);
1264 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1266 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1269 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1272 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1273 {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
1280 //_______________________________________________________________________
1281 Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1283 // MakeSDDRawsImage: raw data QA plots
1285 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1286 //printf("-------------------------> %i \n", esIndex);
1287 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1288 {//printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1292 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1293 if ( !fImage[esIndex] ) {
1294 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1297 fImage[esIndex]->Clear() ;
1298 fImage[esIndex]->SetTitle(title) ;
1299 fImage[esIndex]->cd();
1301 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1302 someText.AddText(title);
1304 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1305 fImage[esIndex]->Clear() ;
1306 Int_t nx =2;//TMath::Nint(TMath::Sqrt(nImages));//2
1307 Int_t ny =3;//nx ; //2
1308 // if (nx < TMath::Sqrt(nImages))
1310 fImage[esIndex]->Divide(nx, ny) ;
1311 TIter nexthist(list[esIndex]) ;
1314 fImage[esIndex]->cd(npad);
1315 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1316 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1317 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1318 TString cln(hist->ClassName()) ;
1319 if ( ! cln.Contains("TH") )
1322 if(hist->TestBit(AliQAv1::GetImageBit())) {
1323 hist->GetXaxis()->SetTitleSize(0.02);
1324 hist->GetYaxis()->SetTitleSize(0.02);
1325 hist->GetXaxis()->SetLabelSize(0.02);
1326 hist->GetYaxis()->SetLabelSize(0.02);
1327 if(cln.Contains("TH2"))
1329 gPad->SetRightMargin(0.15);
1330 gPad->SetLeftMargin(0.05);
1332 hist->SetOption("colz") ;
1333 //hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1337 fImage[esIndex]->cd(++npad) ;
1338 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1341 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1350 //_______________________________________________________________________
1351 Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1353 // MakeSDDRecPointsImage: rec point QA plots
1355 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1356 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1358 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1361 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1362 if ( !fImage[esIndex] ) {
1363 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1365 fImage[esIndex]->Clear() ;
1366 fImage[esIndex]->SetTitle(title) ;
1367 fImage[esIndex]->cd();
1368 fImage[esIndex]->SetBorderMode(0) ;
1369 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1370 someText.AddText(title);
1372 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1373 fImage[esIndex]->Clear() ;
1374 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1375 Int_t ny =6; // nx ;
1376 //if (nx < TMath::Sqrt(nImages))
1378 fImage[esIndex]->Divide(nx, ny) ;
1379 TIter nexthist(list[esIndex]) ;
1382 fImage[esIndex]->cd(npad) ;
1383 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1384 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1385 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1386 TString cln(hist->ClassName()) ;
1388 TString hname(hist->GetName());
1389 //printf("=====================> Class name %s \n",cln.Data());
1390 if ( ! cln.Contains("TH") )
1392 if(hist->TestBit(AliQAv1::GetImageBit())) {
1393 hist->GetXaxis()->SetTitleSize(0.02);
1394 hist->GetYaxis()->SetTitleSize(0.02);
1395 hist->GetXaxis()->SetLabelSize(0.02);
1396 hist->GetYaxis()->SetLabelSize(0.02);
1397 if(cln.Contains("TH1"))
1399 if(!hname.Contains("Check")) hist->SetFillColor(kOrange+7);
1400 //SetFrameFillColor(kAzure-9);
1401 //hist->DrawCopy() ;
1403 if(cln.Contains("TH2"))
1405 gPad->SetRightMargin(0.15);
1406 gPad->SetLeftMargin(0.05);
1408 hist->SetOption("colz") ;
1409 // TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1410 //paletta->SetLabelSize(0.025);
1414 fImage[esIndex]->cd(++npad) ;
1415 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1418 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;