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