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