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