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