Fix to make the analysis for multiple isolation cuts parameters work again
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDChecker.cxx
CommitLineData
5b716935 1/**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18// *****************************************
19// Checks the quality assurance
20// by comparing with reference data
21// P. Cerello Apr 2008
22// INFN Torino
23
24// --- ROOT system ---
3647765c 25#include "TH1.h"
80b9610c 26#include <TH1D.h>
27#include <TH2.h>
8db5c9f9 28#include "TCanvas.h"
29#include "TPaveText.h"
30#include "TPad.h"
31//#include "TPaletteAxis.h"
5b716935 32// --- AliRoot header files ---
f09c0b42 33#include "AliITSQADataMakerRec.h"
5b716935 34#include "AliITSQASDDChecker.h"
c71529b0 35#include "AliLog.h"
3647765c 36#include "AliCDBEntry.h"
f09c0b42 37#include "AliCDBManager.h"
80b9610c 38#include "AliITSCalibrationSDD.h"
39#include "AliITSgeomTGeo.h"
8db5c9f9 40#include "AliQAManager.h"
41#include "AliQAv1.h"
42#include "AliQAChecker.h"
43#include "AliQACheckerBase.h"
f09c0b42 44
5b716935 45
3647765c 46ClassImp(AliITSQASDDChecker)
2abfa09f 47
48
49
50//_____________________________________________________________________
51
52AliITSQASDDChecker::AliITSQASDDChecker():
53fSubDetOffset(0),
54 fStepBitSDD(NULL),
55 fLowSDDValue(NULL),
56 fHighSDDValue(NULL),
57 fCalibration(NULL),
58 fThresholdForRelativeOccupancy(0.01),
59 fThresholdForRecToRawRatio(0.04),
60 fImage(NULL),
61 fESforCheck(0)
62{
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++)
68 {
69 fStepBitSDD[ibit]=0.;
70 fLowSDDValue[ibit]=0.;
71 fHighSDDValue[ibit]=0.;
72 }
73
74} // ctor
75
76
5b716935 77
80b9610c 78AliITSQASDDChecker::~AliITSQASDDChecker()
79{
f09c0b42 80
81 //destructor
80b9610c 82 if(fStepBitSDD)
83 {
84 delete[] fStepBitSDD ;
85 fStepBitSDD = NULL;
86 }
87 if(fLowSDDValue)
88 {
89 delete[]fLowSDDValue;
90 fLowSDDValue=NULL;
91 }
92 if(fHighSDDValue)
93 {
94 delete[]fHighSDDValue;
95 fHighSDDValue=NULL;
96 }
97 if(fCalibration)
98 {
99 delete fCalibration;
100 fCalibration=NULL;
101 }
8db5c9f9 102 if(fImage)
103 {
104 delete []fImage;
105 fImage=NULL;
106 }
80b9610c 107} // dtor
108
5b716935 109//__________________________________________________________________
f09c0b42 110Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/)
111{
112 //check histograms of the different lists
80b9610c 113 AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
114
3647765c 115 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
3647765c 116
62b7a70f 117 Double_t sddQACheckerValue = 0.;
80b9610c 118 TH1 *hdata=NULL;
119 Double_t entries=0.;
120 Double_t entries2[2];
121 for(Int_t i=0;i<2;i++)entries2[i]=0.;
80118b05 122
123 if(!fCalibration){
124 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
125 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
126 if(!calibSDD)
127 {
128 AliError("Calibration object retrieval failed! SDD will not be processed");
129 fCalibration = NULL;
62b7a70f 130 sddQACheckerValue= fHighSDDValue[AliQAv1::kWARNING];
80118b05 131 }
d2f99642 132 else{
133 fCalibration = (TObjArray *)calibSDD->GetObject();
134
135 if(!cacheStatus)calibSDD->SetObject(NULL);
136 calibSDD->SetOwner(kTRUE);
137 if(!cacheStatus)
138 {
139 delete calibSDD;
140 }
141 }//end calibsdd
142 }//end f calibration
80118b05 143
78fb0b3d 144 AliInfo("Calib SDD Created\n ");
80118b05 145
78fb0b3d 146 TIter next(list);
8a55554e 147 TString results1;
148 TString results2;
149 Int_t color=1;
78fb0b3d 150
6bf3d857 151 switch(index) {
152 case AliQAv1::kRAW:{
80b9610c 153 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
6bf3d857 154// if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
155// if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
156// if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
62b7a70f 157 if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");sddQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
6bf3d857 158 TH1 *hmodule=NULL;
159 TH2 *hlayer[2];
d2f99642 160 hdata=NULL;
8a55554e 161 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
162
163 //check counters
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
171 Int_t empty=0;
172 Int_t filled=0;
173 Int_t emptydr=0;
174 Int_t filleddr=0;
175 //Int_t emptyactivemodule=0;
176 Int_t emptyactivemoduleperlayer[2];
177 //Int_t emptydractivemodule=0;
178 Int_t emptyactivedrperlayer[2];
179 Int_t emptysum=0;
180 Int_t emptydiff=0;
181 Int_t emptydrsum=0;
182 Int_t emptydrdiff=0;
183
184 for(Int_t i=0;i<2;i++)
185 {
186 emptymodules[i]=0;
187 filledmodules[i]=0;
188 emptyladders[i]=0;
189 filledladders[i]=0;
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;
200 }
201
202 Int_t neventsraw=0;
203
204 //take the number of events
205
206 while( (hdata = dynamic_cast<TH1* >(next())) ){
207 if (hdata){
208 TString hname=hdata->GetName();
209
210 if(hname.Contains("SDDRawDataCheck"))
211 {
212 neventsraw=(Int_t)hdata->GetBinContent(1);
213 //break;
214 }
215 else continue;
216 }//end if hdata
217 }//end while
218
219 next.Begin();
78fb0b3d 220 while( (hdata = dynamic_cast<TH1* >(next())) ){
6bf3d857 221 if (hdata){TString hname=hdata->GetName();
78fb0b3d 222 if(hname.Contains("SDDchargeMap"))continue;
8a55554e 223 if(hname.Contains("SDDDDLPattern"))continue;
224 if(hname.Contains("SDDEventSize"))continue;
225 if(hname.Contains("_RelativeOccupancy"))continue;
78fb0b3d 226 if(hname.Contains("SDDModPattern")){
6bf3d857 227 if(hname.Contains("NORM")) continue;
228 hmodule=(TH1*)hdata->Clone();
229 entries= hdata->GetEntries();
62b7a70f 230 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
8a55554e 231 else{
232 int modmax=hdata->GetNbinsX();
6bf3d857 233 Double_t content=0;
8a55554e 234 Int_t llay=0;
235 for(Int_t i=1;i<=modmax;i++)
236 {
237 if(i<85)llay=0;
238 else llay=1;
239 content=hdata->GetBinContent(i);
240 if(AliITSQADataMakerRec::AreEqual(content,0.))
241 {
242 empty++;
243 emptymodules[llay]++;
244 }
245 else
246 {
247 filled++;
248 filledmodules[llay]++;
249 }
250 }//end for
251 //output of the check at the level of the modules. Drift region in the following checks
252
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)
78fb0b3d 258 if(hname.Contains("_RelativeOccupancy")) {
6bf3d857 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()));
78fb0b3d 263 Int_t aboveThreshold = 0;
6bf3d857 264 for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
6753619d 265 Float_t fractionAboveThreshold=0.;
266 if(hdata->GetEntries()>0.)fractionAboveThreshold=((Float_t) aboveThreshold)/hdata->GetEntries();
78fb0b3d 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));
62b7a70f 269 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
78fb0b3d 270 if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
8a55554e 271 if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
272
6bf3d857 273 if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
6bf3d857 274 Int_t layer=0;
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()));
62b7a70f 279 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
6bf3d857 280 else{
281 Int_t layer1=0;
282 if(hname.Contains("3"))layer1=0;
283 else if(hname.Contains("4"))layer1=1;
284 TH2* htemp=dynamic_cast<TH2*>(hdata);
d2f99642 285 if(htemp){
286 hlayer[layer1]=(TH2*)htemp->Clone();
287 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
8a55554e 288 //hlayer[layer1]->RebinX(2);
d2f99642 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
8a55554e 296 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
d2f99642 297 delete hproj;
298 hproj=NULL;
299 }//end if htemp
300 }//end else entries !=0
6bf3d857 301 }//end check on phiz
78fb0b3d 302 }//end if hdata
303 }//end while
8a55554e 304 for(Int_t ii=0;ii<2;ii++)
305 {
306 filledmodules[ii]=0;
307 emptymodules[ii]=0;
308 }
309 filled=0;
310 empty=0;
311 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
78fb0b3d 312 //else{
313 if(hmodule || (hlayer[0] && hlayer[1])){
78fb0b3d 314 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
315 Int_t lay=0;
316 Int_t lad=0;
317 Int_t det=0;
318 Int_t module=0;
319 module=imod+fgkmodoffset;
320 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
d2f99642 321 if(cal==0) { continue;}
78fb0b3d 322 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
323 if (cal->IsBad()){
324 excluded++;
8a55554e 325 excludedmoduleperlayer[lay-3]++;
78fb0b3d 326 Double_t content=0.;
327 Double_t contentlayer[2];
328 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
8a55554e 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) {
78fb0b3d 332 filledmodules[lay-3]++;
8a55554e 333 filled++;
334 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
78fb0b3d 335 exactive++;
8a55554e 336 exactivemoduleperlayer[lay-3]++;
337 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
338 {
339 emptymodules[lay-3]++; //it has to be empty
340 empty++;
341 }
78fb0b3d 342 } else {
8a55554e 343 Int_t totside=0;
344 Int_t totactiveside=0;
345 //Int_t totbadside=0;
78fb0b3d 346 Double_t contentgood=0.;
8a55554e 347
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))
351 {
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]++;
358 filleddr++;
359 filleddriftregion[lay-3]++;
360 }
361 }//end wingbad
362 else{
363 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
364 {
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));
366 }
367 else
368 {
369 totside++;
370 }
371 totactiveside++;
372 }
373 }//end for
374 if(totside==0){
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));
78fb0b3d 376 emptymodules[lay-3]++;
8a55554e 377 empty++;
378
379 }
380 else
381 if(totside==2){
382 filledmodules[lay-3]++;
383 filled++;
384 }
385 else
386 if(totside==1)
387 {
388 // emptydr++;
389 //emptydriftregion[lay-3]++; //it has to be empty
390 emptydriftregion[lay-3]++;
391 emptydr++;
392 filleddr++;
393 filleddriftregion[lay-3]++;
394 }
395 if(totactiveside==1)
396 {
397 activedriftregion++;
398 activedrperlayer[lay-3]++;
399 }else if(totactiveside==2)
400 {
401 active++;
402 activemoduleperlayer[lay-3]++;
403 }
404
78fb0b3d 405 }
406 }//end for
8a55554e 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++)
410 {
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]));
413 }//end else layers
414 emptysum=emptymodules[0]+emptymodules[1];
415 emptydiff=emptysum-excluded;
416 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
417 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
418
419 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
420 emptydrdiff=emptydrsum-excludeddriftregion;
421 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
422 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
423
62b7a70f 424 Int_t numlimit=1000;
8a55554e 425
62b7a70f 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));
25b4170b 431 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE){
432 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
62b7a70f 433
434 results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
435 if(neventsraw<numlimit)
436 {
437 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
438 color=5;
439 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
440 }
441 else
442 {
7b7ea883 443 results2.Form(" Events %d. If PHYISICS, follow the TWiki instruction and call the Expert ",neventsraw);
62b7a70f 444 color=2;
445 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
446 }
447 }
8a55554e 448 else
25b4170b 449 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
450 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic)
451 {
62b7a70f 452 numlimit=10000;
453 if(neventsraw<numlimit)
454 {
455 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
25b4170b 456 results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
62b7a70f 457 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
458 color=5;
459 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
460 }
461 else
462 {
25b4170b 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);
62b7a70f 465 color=2;
466 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
467 }
468 }
8a55554e 469 }
62b7a70f 470
8a55554e 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");
475 color=3;
62b7a70f 476 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
3647765c 477 }
8a55554e 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 ");
484 color=2;
62b7a70f 485 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
78fb0b3d 486 }
8a55554e 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 ");
491 color=6;
62b7a70f 492 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
78fb0b3d 493 }
8a55554e 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 ");
498 color=6;
62b7a70f 499 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
78fb0b3d 500 }
8a55554e 501
502 TPaveText *pave[2];
503 next.Begin();
504
505 while( (hdata=dynamic_cast<TH1* >(next())) )
506 {
507 if (hdata){
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");
512 Int_t lay=0;
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]);
522 }
523 else
524 if(hname.Contains("SDDRawDataCheck"))
525 {
526
527 //AliInfo("========================================Found histo\n");
528 ((TH1F*)hdata)->SetBinContent(5,active);
529 ((TH1F*)hdata)->SetBinContent(6,filled);
530 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
531 ((TH1F*)hdata)->SetBinContent(8,filleddr);
532 ((TH1F*)hdata)->SetBinContent(9,excluded);
533 ((TH1F*)hdata)->SetBinContent(10,empty);
534 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
535 ((TH1F*)hdata)->SetBinContent(12,emptydr);
536 ((TH1F*)hdata)->SetBinContent(13,exactive);
537 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
538 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
539 ((TH1F*)hdata)->SetBinContent(16,emptydr);
540
541 //layer 3
542 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
543 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
544 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
545 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
546 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
547 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
548 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
549 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
550 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
551 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
552 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
553 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
554
555 //layer 4
556 ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
557 ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
558 ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
559 ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
560 ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
561 ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
562 ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
563 ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
564 ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
565 ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
566 ((TH1F*)hdata)->SetBinContent(43,activedrperlayer[1]);
567 ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
568 //break;
569 }
570 }//if hdata
571
572 }//end while
6bf3d857 573
78fb0b3d 574 }//end else
6bf3d857 575 delete hmodule;
576 hmodule=NULL;
577 for(Int_t i=0;i<2;i++) {
578 delete hlayer[i];
579 hlayer[i]=NULL;
8a55554e 580 }//end for
78fb0b3d 581
8a55554e 582 }//end raw
6bf3d857 583
80b9610c 584 break;
6bf3d857 585
586 case AliQAv1::kNULLTASK:{
587 AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index)));
62b7a70f 588 sddQACheckerValue=1.;
6bf3d857 589 }
590 break;
591
592 case AliQAv1::kREC:
593 {
8db5c9f9 594 Int_t uidrec=list->GetUniqueID();
80b9610c 595 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
7b7ea883 596 if(uidrec==20){
8db5c9f9 597 //recpoints
598 if (list->GetEntries() == 0){ //check if the list is empty
62b7a70f 599 //printf("sddQACheckerValue = %f \t value %f\n",sddQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
600 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
8a55554e 601 //break;
8db5c9f9 602 }//end if getentries
6bf3d857 603
8a55554e 604
605 TH1 *hmodule=NULL;
606 TH2 *hlayer[2];
607 hdata=NULL;
608 for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
609
610 //check counters
611 Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
612 Int_t excluded=0; //excluded modules
613 Int_t excludeddriftregion=0; //excluded single drift region
614 Int_t active=0; //active modules
615 Int_t activedriftregion=0; //active single drift region
616 Int_t exactive=0; //excluded modules but taking data
617 Int_t exactivedriftregion=0; //excluded single drift region but taking data
618 Int_t empty=0;
619 Int_t filled=0;
620 Int_t emptydr=0;
621 Int_t filleddr=0;
622 //Int_t emptyactivemodule=0;
623 Int_t emptyactivemoduleperlayer[2];
624 //Int_t emptydractivemodule=0;
625 Int_t emptyactivedrperlayer[2];
626 Int_t emptysum=0;
627 Int_t emptydiff=0;
628 Int_t emptydrsum=0;
629 Int_t emptydrdiff=0;
630
631 for(Int_t i=0;i<2;i++)
632 {
633 emptymodules[i]=0;
634 filledmodules[i]=0;
635 emptyladders[i]=0;
636 filledladders[i]=0;
637 emptydriftregion[i]=0;
638 filleddriftregion[i]=0;
639 excludedmoduleperlayer[i]=0;
640 excludeddrperlayer[i]=0;
641 activemoduleperlayer[i]=0;
642 activedrperlayer[i]=0;
643 exactivemoduleperlayer[i]=0;
644 exactivedrperlayer[i]=0;
645 emptyactivemoduleperlayer[i]=0;
646 emptyactivedrperlayer[i]=0;
647 }
648
649 Int_t neventsrecpoints=0;
650
651 while( (hdata = dynamic_cast<TH1* >(next())) ){
652 if (hdata){
653 TString hname=hdata->GetName();
654
655 if(hname.Contains("SDDRecPointCheck"))
656 {
657 neventsrecpoints=(Int_t)hdata->GetBinContent(1);
658 //break;
659 }
660 else{continue;}
661 }//end if hdata
662 }//end while
663
664 next.Begin();
665
8db5c9f9 666 while((hdata=dynamic_cast<TH1* >(next()))){
667 if (hdata){
668 TString hname=hdata->GetName();
669 if(hname.Contains("_RelativeOccupancy")) {
670 Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
671 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
672 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
673 Int_t aboveThreshold = 0;
674 for(Int_t k=0; k<= ((Int_t)hdata->GetNbinsX()); k++) {
675 if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (Int_t)(hdata->GetBinContent(k));
676 }
6753619d 677 Float_t fractionAboveThreshold=0.;
678 if(hdata->GetEntries()>0.) fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
8db5c9f9 679 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3, L3: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
680 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4, L4: RecPoints fractionAboveThreshold: %f",fractionAboveThreshold));
681 if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {
62b7a70f 682 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
8db5c9f9 683 if(hname.Contains("L3")) AliInfo(Form("SDD check number 3: Set Warning (L3 RecPoints)"));
684 if(hname.Contains("L4")) AliInfo(Form("SDD check number 4: Set Warning (L4 RecPoints)"));
685 }
78fb0b3d 686 }
8db5c9f9 687 if(hname.Contains("Rec2Raw") && !hname.Contains("2D")) {
688 //Float_t threshold = 0.;
689 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: L3 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
690 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: L4 R2R mean: %f, rms: ,%f",((TH1F *) hdata)->GetMean(),((TH1F *) hdata)->GetRMS()));
691 Int_t belowThreshold = 0;
692 for(Int_t k=0; k<=((TH1F *)hdata)->GetNbinsX(); k++) {
693 if(((TH1F *) hdata)->GetBinLowEdge(k) < fThresholdForRecToRawRatio) belowThreshold += ((Int_t)((TH1F *) hdata)->GetBinContent(k));
694 }
695 Double_t fractionBelowThreshold =0.;
696 Double_t entries3=((TH1F *)hdata)->GetEntries();
697 if(entries3>0.001)fractionBelowThreshold = ((Double_t)(belowThreshold))/entries3;
698 else{ AliWarning(Form("No entries on %s. The check will retuns zero.\n",hdata->GetName() )); }
699 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5, L3: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
700 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6, L4: RecPoints2Raws fractionBelowThreshold: %f",fractionBelowThreshold));
701 if(fractionBelowThreshold > fThresholdForRelativeOccupancy) {
62b7a70f 702 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
8db5c9f9 703 if(hname.Contains("L3")) AliInfo(Form("SDD check number 5: Set Warning (L3 RecPoints2Raws)"));
704 if(hname.Contains("L4")) AliInfo(Form("SDD check number 6: Set Warning (L4 RecPoints2Raws)"));
705 }
78fb0b3d 706 }
8db5c9f9 707 if(hname.Contains("dedx")) {
708 if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
709 if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
8a55554e 710 }//end if dedx
711 if(hname.Contains("SDDModPatternRP")){
712 if(hname.Contains("NORM")) continue;
713 hmodule=(TH1*)hdata->Clone();
714 entries= hdata->GetEntries();
62b7a70f 715 if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
8a55554e 716 else{
717 int modmax=hdata->GetNbinsX();
718 Double_t content=0;
719 Int_t llay=0;
720 for(Int_t i=1;i<=modmax;i++)
721 {
722 if(i<85)llay=0;
723 else llay=1;
724 content=hdata->GetBinContent(i);
725 if(AliITSQADataMakerRec::AreEqual(content,0.))
726 {
727 empty++;
728 emptymodules[llay]++;
729 }
730 else
731 {
732 filled++;
733 filledmodules[llay]++;
734 }
735 }//end for
736 //output of the check at the level of the modules. Drift region in the following checks
737
738 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
739 AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
740 AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
741 }//end else pattern entries !=0
742 } //modpattern (1d histogram)
743
744 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
745 Int_t layer=0;
746 if(hname.Contains("3"))layer=0;
747 else if(hname.Contains("4"))layer=1;
748 entries2[layer]=hdata->GetEntries();
749 if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
62b7a70f 750 sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
8a55554e 751 else{
752 Int_t layer1=0;
753 if(hname.Contains("3"))layer1=0;
754 else if(hname.Contains("4"))layer1=1;
755 TH2* htemp=dynamic_cast<TH2*>(hdata);
756 if(htemp){
757 hlayer[layer1]=(TH2*)htemp->Clone();
758 hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
759 //hlayer[layer1]->RebinX(2);
760 int modmay=hlayer[layer1]->GetNbinsY();
761 TH1D* hproj= hlayer[layer1]->ProjectionY();
762 Double_t ladcontent=0;
763 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
764 ladcontent=hproj->GetBinContent(i);
765 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
766 else filledladders[layer1]++;}//end for
767 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
768 delete hproj;
769 hproj=NULL;
770 }//end if htemp
771 }//end else entries !=0
772 }//end check on phiz
773 }//end if hdata
774 }//end while
775 for(Int_t ii=0;ii<2;ii++)
776 {
777 filledmodules[ii]=0;
778 emptymodules[ii]=0;
779 }
780 filled=0;
781 empty=0;
782 if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
783 //else{
784 if(hmodule || (hlayer[0] && hlayer[1])){
785 for(Int_t imod=0;imod<fgknSDDmodules;imod++){
786 Int_t lay=0;
787 Int_t lad=0;
788 Int_t det=0;
789 Int_t module=0;
790 module=imod+fgkmodoffset;
791 AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
792 if(cal==0) { continue;}
793 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
794 if (cal->IsBad()){
795 excluded++;
796 excludedmoduleperlayer[lay-3]++;
797 Double_t content=0.;
798 Double_t contentlayer[2];
799 for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
800 if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
801 // if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
802 if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
803 filledmodules[lay-3]++;
804 filled++;
805 AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
806 exactive++;
807 exactivemoduleperlayer[lay-3]++;
808 } else if(AliITSQADataMakerRec::AreEqual(content,0.))
809 {
810 emptymodules[lay-3]++; //it has to be empty
811 empty++;
812 }
813 } else {
814 Int_t totside=0;
815 Int_t totactiveside=0;
816 //Int_t totbadside=0;
817 Double_t contentgood=0.;
818
819 for(Int_t i=0;i<2;i++){
820 if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
821 if(cal->IsWingBad(i))
822 {
823 excludeddriftregion++;
824 excludeddrperlayer[lay-3]++;
825 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
826 AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, has recpoints \n ",i,module,lay,lad,det));
827 exactivedriftregion++;
828 exactivedrperlayer[lay-3]++;
829 filleddr++;
830 filleddriftregion[lay-3]++;
831 }
832 }//end wingbad
833 else{
834 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
835 {
836 AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present\n ",i,module, lay, lad, det));
837 }
838 else
839 {
840 totside++;
841 }
842 totactiveside++;
843 }
844 }//end for
845 if(totside==0){
846 AliWarning(Form("The module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
847 emptymodules[lay-3]++;
848 empty++;
849
78fb0b3d 850 }
8a55554e 851 else
852 if(totside==2){
853 filledmodules[lay-3]++;
854 filled++;
855 }
856 else
857 if(totside==1)
858 {
859 // emptydr++;
860 //emptydriftregion[lay-3]++; //it has to be empty
861 emptydriftregion[lay-3]++;
862 emptydr++;
863 filleddr++;
864 filleddriftregion[lay-3]++;
865 }
866 if(totactiveside==1)
867 {
868 activedriftregion++;
869 activedrperlayer[lay-3]++;
870 }else if(totactiveside==2)
871 {
872 active++;
873 activemoduleperlayer[lay-3]++;
874 }
875
78fb0b3d 876 }
8a55554e 877 }//end for
878 AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
879 AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
880 for(Int_t i=0;i<2;i++)
881 {
882 AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
883 AliInfo(Form("Layer %i \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
884 }//end else layers
885 emptysum=emptymodules[0]+emptymodules[1];
886 emptydiff=emptysum-excluded;
887 emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
888 emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
889
890 emptydrsum=emptydriftregion[0]+emptydriftregion[1];
891 emptydrdiff=emptydrsum-excludeddriftregion;
892 emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
893 emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
894
62b7a70f 895 Int_t numlimit=1000;
8a55554e 896 if(emptysum>excluded||emptydrsum>excludeddriftregion){
62b7a70f 897 AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! \n",emptydiff,emptydrdiff));
898 AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
899 AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! \n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
8a55554e 900
62b7a70f 901 //sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
902 Int_t numlimits=1000;
903
8a55554e 904 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
25b4170b 905 // if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kFALSE)
906 if(AliRecoParam::Convert(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){
907
62b7a70f 908 if(neventsrecpoints<numlimits)
909 {
910 results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
911 color=5;
912 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
913 }
914 else
915 {
7b7ea883 916 results2.Form(" Events %d .If PHYISICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
62b7a70f 917 color=2;
918 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
919 }
8a55554e 920 }
921 else
25b4170b 922 //if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
923 if(AliRecoParam::Convert(GetEventSpecieForCheck())==AliRecoParam::kCosmic){
62b7a70f 924 numlimit=10000;
25b4170b 925 if( neventsrecpoints<numlimit)
62b7a70f 926 {
927 AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
25b4170b 928 results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
62b7a70f 929 results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
930 color=5;
931 sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
932 }
933 else
934 {
935 results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
25b4170b 936 results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
62b7a70f 937 color=2;
938 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
939 }
940 }
8a55554e 941 }
942
6bf3d857 943
8a55554e 944
945 if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
946 AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
947 results1.Form("OK.");
948 results2.Form(" All active modules have recpoints");
949 color=3;
62b7a70f 950 sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
8a55554e 951 }
952 if(exactive!=0||exactivedriftregion!=0){
953 AliError(Form("%i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
954 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
955 AliError(Form("Layer 3: %i modules and %i single drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
956 results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
957 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
958 color=2;
62b7a70f 959 sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
8a55554e 960 }
961 if(excluded==exactive||excludeddriftregion==exactivedriftregion){
962 AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition have recpoints!\n Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
963 results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
964 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
965 color=6;
62b7a70f 966 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
8a55554e 967 }
968 if(active==0||activedriftregion==0){
969 AliError(Form("No modules or single drift regions have recpoints: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion));
970 results1.Form("No modules or drift region have recpoints: excluded modules %i excluded drift regions %i ", excluded, excludeddriftregion );
971 results2.Form("Follow the TWiki instructions and Call the SDD expert ");
972 color=6;
62b7a70f 973 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
8a55554e 974 }
975
976 TPaveText *pave[2];
977 next.Begin();
978
979 while( (hdata=dynamic_cast<TH1* >(next())) )
980 {
981 if (hdata){
982 TString hname=hdata->GetName();
983 if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
984 if(hname.Contains("NORM"))continue;
985 //AliInfo("========================================Found histo 11\n");
986 Int_t lay=0;
987 if(hname.Contains("3"))lay=0;
988 else if(hname.Contains("4"))lay=1;
989 pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
990 pave[lay]->AddText(results1.Data());
991 pave[lay]->AddText(results2.Data());
992 pave[lay]->SetFillColor(color);
993 pave[lay]->SetBorderSize(1);
994 pave[lay]->SetLineWidth(1);
995 hdata->GetListOfFunctions()->Add(pave[lay]);
996 }
997 else
998 if(hname.Contains("SDDRecPointCheck"))
999 {
1000
1001 //AliInfo("========================================Found histo\n");
1002 ((TH1F*)hdata)->SetBinContent(5,active);
1003 ((TH1F*)hdata)->SetBinContent(6,filled);
1004 ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
1005 ((TH1F*)hdata)->SetBinContent(8,filleddr);
1006 ((TH1F*)hdata)->SetBinContent(9,excluded);
1007 ((TH1F*)hdata)->SetBinContent(10,empty);
1008 ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
1009 ((TH1F*)hdata)->SetBinContent(12,emptydr);
1010 ((TH1F*)hdata)->SetBinContent(13,exactive);
1011 ((TH1F*)hdata)->SetBinContent(14,emptydiff);
1012 ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
1013 ((TH1F*)hdata)->SetBinContent(16,emptydr);
1014
1015 //layer 3
1016 ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
1017 ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
1018 ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
1019 ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
1020 ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
1021 ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
1022 ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
1023 ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
1024 ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
1025 ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
1026 ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
1027 ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
1028
1029 //layer 4
1030 ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
1031 ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
1032 ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
1033 ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
1034 ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
1035 ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
1036 ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
1037 ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
1038 ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
1039 ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
1040 ((TH1F*)hdata)->SetBinContent(45,activedrperlayer[1]);
1041 ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
1042
1043 }
1044 }//if hadata
1045
1046 }//end while
1047
1048 }//end else
1049 delete hmodule;
1050 hmodule=NULL;
1051 for(Int_t i=0;i<2;i++) {
1052 delete hlayer[i];
1053 hlayer[i]=NULL;
1054 }//end for
1055
1056
62b7a70f 1057 //sddQACheckerValue=1.;
7b7ea883 1058 }//end recpoint list uid = 20
4f016aac 1059 if(uidrec==40)
8db5c9f9 1060 {
1061 //digitsr
1062 if (list->GetEntries() == 0){
62b7a70f 1063 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
8db5c9f9 1064 break;
1065 } else{
1066
1067 while( (hdata = dynamic_cast<TH1* >(next())) ){
1068 if (hdata){
62b7a70f 1069 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
8db5c9f9 1070 else {
1071 TString hname=hdata->GetName();
1072 if(hname.Contains("SDD DIGITS Module Pattern")) {
1073 //see raws
1074
62b7a70f 1075 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
8db5c9f9 1076 } else if(hname.Contains("SDD Anode Distribution")) {
62b7a70f 1077 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
8db5c9f9 1078 } else if(hname.Contains("SDD Tbin Distribution")) {
1079 //to do as rp
62b7a70f 1080 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
8db5c9f9 1081 } else if(hname.Contains("SDD ADC Counts Distribution")) {
62b7a70f 1082 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
8db5c9f9 1083 }//end adc counts
1084
1085 }//end entries !=0
1086 }//end hdata
1087 }//end while
1088 }//end else
62b7a70f 1089 sddQACheckerValue=1.;
8db5c9f9 1090 }
1091
6bf3d857 1092 }
1093 break;
1094 case AliQAv1::kANA:
1095 {
80118b05 1096 AliInfo(Form("===================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
62b7a70f 1097 sddQACheckerValue=1.;
6bf3d857 1098 }
1099 break;
1100 case AliQAv1::kESD:
1101 {
80118b05 1102 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
62b7a70f 1103 sddQACheckerValue=1.;
6bf3d857 1104 }
1105 break;
1106 case AliQAv1::kNTASK:{
1107 AliInfo(Form("==================> No Check on %s\n",AliQAv1::GetAliTaskName(index)));
62b7a70f 1108 sddQACheckerValue=1.;
6bf3d857 1109 }
1110 break;
1111 case AliQAv1::kSIM:{
1112 AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
1113 Int_t uid=list->GetUniqueID();
1114 if(uid==60) {
1115 //digits
1116 if (list->GetEntries() == 0){
62b7a70f 1117 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
6bf3d857 1118 break;
1119 } else{
1120
1121 while( (hdata = dynamic_cast<TH1* >(next())) ){
1122 if (hdata){
62b7a70f 1123 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
6bf3d857 1124 else {
1125 TString hname=hdata->GetName();
1126 if(hname.Contains("SDDDIGITSModulePattern")) {
1127 //see raws
1128
62b7a70f 1129 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1130 } else if(hname.Contains("SDDAnodeDistribution")) {
62b7a70f 1131 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1132 } else if(hname.Contains("SDDTbinDistribution")) {
1133 //to do as rp
62b7a70f 1134 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1135 } else if(hname.Contains("SDDADCCountsDistribution")) {
62b7a70f 1136 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1137 }//end adc counts
1138
1139 }//end entries !=0
1140 }//end hdata
1141 }//end while
1142 }//end else
1143 } else if(uid==50)
1144 {
1145 //hits
1146 if (list->GetEntries() == 0){
62b7a70f 1147 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
6bf3d857 1148 break;
1149 }
1150 else{
1151
1152 while( (hdata = dynamic_cast<TH1* >(next())) ){
1153 if (hdata){
62b7a70f 1154 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
6bf3d857 1155 else {
1156 TString hname=hdata->GetName();
1157 if(hname.Contains("SDDHITSModulePattern")) {
1158 //to do as raws
62b7a70f 1159 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1160 } else if(hname.Contains("SDDHITlenghtalonglocalYCoord")) {
62b7a70f 1161 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1162 } else if(hname.Contains("SDDHITlenghtalonglocalYCoordZoom")) {
62b7a70f 1163 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1164 } else if(hname.Contains("SDDDepositedEnergyDistribution")) {
62b7a70f 1165 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1166 }//end deposited energy
1167
1168 }//end entries !=0
1169 }//end hdata
1170 }//end while
1171 }//end else
1172 } else if(uid==70)
1173 {
1174 //sdigits
78fb0b3d 1175 if (list->GetEntries() == 0){
62b7a70f 1176 sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
6bf3d857 1177 break;
78fb0b3d 1178 } else{
6bf3d857 1179
78fb0b3d 1180 while( (hdata = dynamic_cast<TH1* >(next())) ){
1181 if (hdata){
62b7a70f 1182 if(hdata->GetEntries()==0)sddQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];
78fb0b3d 1183 else {
1184 TString hname=hdata->GetName();
6bf3d857 1185 if(hname.Contains("SDDSDIGITSModulePattern")) {
1186 //to do as raws
62b7a70f 1187 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
78fb0b3d 1188 } else if(hname.Contains("SDDAnodeDistribution")) {
62b7a70f 1189 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
78fb0b3d 1190 } else if(hname.Contains("SDDTbinDistribution")) {
1191 //to do as rp
62b7a70f 1192 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
78fb0b3d 1193 } else if(hname.Contains("SDDADCCountsDistribution")) {
62b7a70f 1194 sddQACheckerValue += fStepBitSDD[AliQAv1::kINFO];
6bf3d857 1195 }//end adc counts bindistribution
78fb0b3d 1196 }//end entries !=0
1197 }//end hdata
1198 }//end while
1199 }//end else
6bf3d857 1200 }//end sdigits
62b7a70f 1201 sddQACheckerValue=1.;
6bf3d857 1202 }
1203 break;
1204
1205 }//end switch
1206
80118b05 1207 fCalibration=NULL;
d2f99642 1208 if(hdata) delete hdata;
6bf3d857 1209
1210
62b7a70f 1211 return sddQACheckerValue;
5b716935 1212}
6bf3d857 1213
3647765c 1214//__________________________________________________________________
80b9610c 1215void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
1216{
f09c0b42 1217 //set the number of the histograms already present in the list before the SDD histograms
80b9610c 1218 fSubDetOffset = taskoffset;
1219}
1220
1221
1222//__________________________________________________________________
f09c0b42 1223void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
80b9610c 1224{
f09c0b42 1225 //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
2abfa09f 1226 //if(fStepBitSDD){/*delete fStepBitSDD;*/ fStepBitSDD=NULL;}
1227 //fStepBitSDD = new Double_t[AliQAv1::kNBIT];
80b9610c 1228 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1229 {
1230 fStepBitSDD[bit]=steprange[bit];
1231 }
1232}
1233
1234//__________________________________________________________________
f09c0b42 1235void AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
3647765c 1236{
f09c0b42 1237 //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
2abfa09f 1238 // fLowSDDValue = new Float_t[AliQAv1::kNBIT];
1239 // fHighSDDValue= new Float_t[AliQAv1::kNBIT];
80b9610c 1240
1241 for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
1242 {
1243 fLowSDDValue[bit]=lowvalue[bit];
1244 fHighSDDValue[bit]= highvalue[bit];
1245 }
1246
3647765c 1247}
8db5c9f9 1248//__________________________________________________________________
1249Bool_t AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode)
1250{
62b7a70f 1251 //create the image for raws and recpoints. In the other case, the default methodof CheckerBase class will be used
1252 //
8db5c9f9 1253 Bool_t rval=kFALSE;
1254 fImage=(TCanvas**)AliQAChecker::Instance()->GetDetQAChecker(0)->GetImage();
62b7a70f 1255
8db5c9f9 1256 switch(task)
1257 {
1258 case AliQAv1::kRAWS:{
1259 rval=MakeSDDRawsImage(list, task,mode);
1260 }
1261 break;
1262 case AliQAv1::kRECPOINTS:{ rval=MakeSDDRecPointsImage(list, task,mode); }
1263 break;
1264 case AliQAv1::kHITS:; case AliQAv1::kESDS:; case AliQAv1::kDIGITS:;case AliQAv1::kDIGITSR:;case AliQAv1::kSDIGITS:;case AliQAv1::kTRACKSEGMENTS:;case AliQAv1::kRECPARTICLES:; default:
1265 {
1266 rval=kFALSE;
1267 //AliQAChecker::Instance()->GetDetQAChecker(0)->MakeImage(list,task,mode);
1268 }
1269 break;
1270 case AliQAv1::kNULLTASKINDEX:; case AliQAv1::kNTASKINDEX:
1271 {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
1272 break;
1273 }
1274return rval;
1275}
1276
1277
1278//_______________________________________________________________________
1279Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1280{
62b7a70f 1281 // MakeSDDRawsImage: raw data QA plots
8db5c9f9 1282
1283 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1284 //printf("-------------------------> %i \n", esIndex);
1285 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1286 {//printf ("Nothing for %s \n", AliRecoParam::GetEventSpecieName(esIndex));
1287 continue;
1288 }
1289 else{
1290 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1291 if ( !fImage[esIndex] ) {
1292 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1293 }
1294
1295 fImage[esIndex]->Clear() ;
1296 fImage[esIndex]->SetTitle(title) ;
1297 fImage[esIndex]->cd();
1298
1299 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1300 someText.AddText(title);
1301 someText.Draw();
1302 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1303 fImage[esIndex]->Clear() ;
1304 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
8a55554e 1305 Int_t ny =2; // nx ;
8db5c9f9 1306 //if (nx < TMath::Sqrt(nImages))
1307 //ny++ ;
1308 fImage[esIndex]->Divide(nx, ny) ;
1309 TIter nexthist(list[esIndex]) ;
1310 TH1* hist = NULL ;
1311 Int_t npad = 1 ;
1312 fImage[esIndex]->cd(npad);
1313 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1314 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1315 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1316 TString cln(hist->ClassName()) ;
1317 if ( ! cln.Contains("TH") )
1318 continue ;
1319
1320 if(hist->TestBit(AliQAv1::GetImageBit())) {
1321 hist->GetXaxis()->SetTitleSize(0.02);
1322 hist->GetYaxis()->SetTitleSize(0.02);
1323 hist->GetXaxis()->SetLabelSize(0.02);
1324 hist->GetYaxis()->SetLabelSize(0.02);
1325 if(cln.Contains("TH2"))
1326 {
1327 gPad->SetRightMargin(0.15);
1328 gPad->SetLeftMargin(0.05);
1329 hist->SetStats(0);
1330 hist->SetOption("colz") ;
1331 //hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
1332 //gPad->Update();
1333 }
1334 hist->DrawCopy() ;
1335 fImage[esIndex]->cd(++npad) ;
1336 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1337 }
1338 }
1339 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1340 }
1341 }
1342 return kTRUE;
1343}
1344
1345
1346
1347
1348//_______________________________________________________________________
1349Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode )
1350{
62b7a70f 1351 // MakeSDDRecPointsImage: rec point QA plots
80b9610c 1352
8db5c9f9 1353 for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
1354 if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0)
1355 {
1356 //printf ("Nothing for %s \n", AliQAv1::GetTaskName(task).Data());
1357 continue;
1358 }
1359 const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
1360 if ( !fImage[esIndex] ) {
1361 fImage[esIndex] = new TCanvas(title, title,1280,980) ;
1362 }
1363 fImage[esIndex]->Clear() ;
1364 fImage[esIndex]->SetTitle(title) ;
1365 fImage[esIndex]->cd();
1366 fImage[esIndex]->SetBorderMode(0) ;
1367 TPaveText someText(0.015, 0.015, 0.98, 0.98);
1368 someText.AddText(title);
1369 someText.Draw();
1370 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1371 fImage[esIndex]->Clear() ;
1372 Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
1373 Int_t ny =4; // nx ;
1374 //if (nx < TMath::Sqrt(nImages))
1375 //ny++ ;
1376 fImage[esIndex]->Divide(nx, ny) ;
1377 TIter nexthist(list[esIndex]) ;
1378 TH1* hist = NULL ;
1379 Int_t npad = 1 ;
1380 fImage[esIndex]->cd(npad) ;
1381 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1382 while ( (hist=static_cast<TH1*>(nexthist())) ) {
1383 //gPad=fImage[esIndex]->cd(npad)->GetPad(npad);
1384 TString cln(hist->ClassName()) ;
1385 //printf("=====================> Class name %s \n",cln.Data());
1386 if ( ! cln.Contains("TH") )
1387 continue ;
1388 if(hist->TestBit(AliQAv1::GetImageBit())) {
1389 hist->GetXaxis()->SetTitleSize(0.02);
1390 hist->GetYaxis()->SetTitleSize(0.02);
1391 hist->GetXaxis()->SetLabelSize(0.02);
1392 hist->GetYaxis()->SetLabelSize(0.02);
1393 if(cln.Contains("TH1"))
1394 {
1395 hist->SetFillColor(kOrange+7);
1396 //SetFrameFillColor(kAzure-9);
1397 //hist->DrawCopy() ;
1398 }
1399 if(cln.Contains("TH2"))
1400 {
1401 gPad->SetRightMargin(0.15);
1402 gPad->SetLeftMargin(0.05);
1403 hist->SetStats(0);
1404 hist->SetOption("colz") ;
1405 // TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
1406 //paletta->SetLabelSize(0.025);
1407 //gPad->Update();
1408 }
1409 hist->DrawCopy();
1410 fImage[esIndex]->cd(++npad) ;
1411 fImage[esIndex]->cd(npad)->SetBorderMode(0) ;
1412 }
1413 }
1414 fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ;
1415 }
1416 // }
1417 return kTRUE;
1418}