]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASDDDataMakerRec.cxx
Minor issues solved. Additional printouts for debugging purposes (H. Tydesjo)
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDDataMakerRec.cxx
CommitLineData
8c823e5a 1/**************************************************************************\r
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15\r
16/* $Id: AliITSQADataMakerRec.cxx 23528 2008-01-24 23:46:36Z masera $ */\r
17\r
18// *************************************************************\r
19// Checks the quality assurance \r
20// by comparing with reference data\r
21// contained in a DB\r
22// -------------------------------------------------------------\r
23// W. Ferrarese + P. Cerello Feb 2008\r
24// INFN Torino\r
25\r
26// --- ROOT system ---\r
27#include <TH2D.h>\r
28#include <TBranch.h>\r
29#include <TTree.h>\r
30#include <TGaxis.h>\r
31#include <TMath.h>\r
32// --- Standard library ---\r
33\r
34// --- AliRoot header files ---\r
35#include "AliITSQASDDDataMakerRec.h"\r
36#include "AliLog.h"\r
37#include "AliQA.h"\r
38#include "AliQAChecker.h"\r
39#include "AliRawReader.h"\r
40#include "AliITSRawStreamSDD.h"\r
41#include "AliITSRecPoint.h"\r
42#include "AliITSgeomTGeo.h"\r
43\r
44#include "AliCDBManager.h"\r
45#include "AliCDBStorage.h"\r
46#include "AliCDBEntry.h"\r
47\r
48\r
49ClassImp(AliITSQASDDDataMakerRec)\r
50\r
51//____________________________________________________________________________ \r
52AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :\r
53TObject(),\r
54fAliITSQADataMakerRec(aliITSQADataMakerRec),\r
55fkOnline(kMode),\r
56fLDC(ldc),\r
57fSDDhRaws(0),\r
58fSDDhRecs(0),\r
59fRawsOffset(0),\r
60fRecsOffset(0),\r
61fSDDDDLModuleMap(0)\r
62{\r
63 //ctor used to discriminate OnLine-Offline analysis\r
64 if(fLDC < 0 || fLDC > 4) {\r
65 AliError("Error: LDC number out of range; return\n");\r
66 }\r
67 for(Int_t i=0;i<2*fgknSDDmodules;i++){\r
68 fModuleChargeMap[i] = NULL;\r
69 fmonoD[i] = NULL;\r
70 }\r
71}\r
72\r
73//____________________________________________________________________________ \r
74AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :\r
75TObject(),\r
76fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),\r
77fkOnline(qadm.fkOnline),\r
78fLDC(qadm.fLDC),\r
79fSDDhRaws(qadm.fSDDhRaws),\r
80fSDDhRecs(qadm.fSDDhRecs),\r
81fRawsOffset(qadm.fRawsOffset),\r
82fRecsOffset(qadm.fRecsOffset),\r
83fSDDDDLModuleMap(0)\r
84{\r
85 //copy ctor \r
86 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; \r
87 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());\r
88}\r
89\r
90//____________________________________________________________________________ \r
91AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){\r
92 // destructor\r
93 for(Int_t i=0;i<2*fgknSDDmodules;i++){\r
94 if(fModuleChargeMap[i]) delete fModuleChargeMap[i];\r
95 if(fmonoD[i]) delete fmonoD[i];\r
96 }\r
97 if(fSDDDDLModuleMap) delete fSDDDDLModuleMap; \r
98}\r
99//__________________________________________________________________\r
100AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )\r
101{\r
102 // Equal operator.\r
103 this->~AliITSQASDDDataMakerRec();\r
104 new(this) AliITSQASDDDataMakerRec(qac);\r
105 return *this;\r
106}\r
107\r
108//____________________________________________________________________________ \r
109void AliITSQASDDDataMakerRec::StartOfDetectorCycle()\r
110{\r
111 //Detector specific actions at start of cycle\r
112 AliDebug(1,"AliITSQADM::Start of SDD Cycle\n");\r
113}\r
114\r
115//____________________________________________________________________________ \r
116void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX /*task*/, TObjArray* /*list*/)\r
117{\r
118 // launch the QA checking\r
119 AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); \r
120 \r
121 //AliQAChecker::Instance()->Run( AliQA::kITS , task, list);\r
122}\r
123\r
124//____________________________________________________________________________ \r
125void AliITSQASDDDataMakerRec::InitRaws()\r
126{ \r
127 // Initialization for RAW data - SDD -\r
128 fRawsOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries();\r
129\r
130 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");\r
131 if( !ddlMapSDD){\r
132 AliFatal("Calibration object retrieval failed! ");\r
133 } \r
134 AliITSDDLModuleMapSDD *ddlsdd=(AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();\r
135 ddlMapSDD->SetOwner(kTRUE);\r
136 fSDDDDLModuleMap = ddlsdd;\r
137 \r
138 Int_t lay, lad, det;\r
139 Int_t LAY = -1; //, LAD = -1;\r
140 char hname0[50];\r
141 Int_t indexlast = 0;\r
142 Int_t index1 = 0;\r
143\r
144 if(fLDC == 1 || fLDC == 2) LAY = 2;\r
145 if(fLDC == 3 || fLDC == 4) LAY = 3;\r
146 \r
147 if(fkOnline) {\r
148 AliInfo("Book Online Histograms for SDD\n");\r
149 }\r
150 else {\r
151 AliInfo("Book Offline Histograms for SDD\n ");\r
152 }\r
153 TH1F *h0 = new TH1F("ModPattern","Modules pattern",fgknSDDmodules,-0.5,259.5);\r
154 h0->GetXaxis()->SetTitle("Module Number");\r
155 h0->GetYaxis()->SetTitle("Counts");\r
156 fAliITSQADataMakerRec->Add2RawsList(h0,0+fRawsOffset);\r
157 fSDDhRaws++;\r
158 if(fLDC==0 || fLDC==1 || fLDC==2){\r
159 TH1F *h1 = new TH1F("LadPatternL3","Ladder pattern L3",14,0.5,14.5); \r
160 h1->GetXaxis()->SetTitle("Ladder Number on Lay3");\r
161 h1->GetYaxis()->SetTitle("Counts");\r
162 fAliITSQADataMakerRec->Add2RawsList(h1,1+fRawsOffset);\r
163 fSDDhRaws++;\r
164 } \r
165 if(fLDC==0 || fLDC==3 || fLDC==4){\r
166 TH1F *h2 = new TH1F("LadPatternL4","Ladder pattern L4",22,0.5,22.5); \r
167 h2->GetXaxis()->SetTitle("Ladder Number on Lay4");\r
168 h2->GetYaxis()->SetTitle("Counts");\r
169 fAliITSQADataMakerRec->Add2RawsList(h2,2+fRawsOffset);\r
170 fSDDhRaws++;\r
171 }\r
172 if(fLDC==0 || fLDC==1 || fLDC==2){\r
173 TH1D *h3[fgkLADDonLAY3] ; \r
174 for(Int_t i=1; i<=fgkLADDonLAY3; i++) {\r
175 sprintf(hname0,"ModPattern_L3_%d",i);\r
176 h3[i-1] = new TH1D(hname0,hname0,6,0.5,6.5);\r
177 h3[i-1]->GetXaxis()->SetTitle("Channel Number");\r
178 h3[i-1]->GetYaxis()->SetTitle("Counts");\r
179 fAliITSQADataMakerRec->Add2RawsList(h3[i-1],i-1+3+fRawsOffset);\r
180 fSDDhRaws++;\r
181 }\r
182 }\r
183 if(fLDC==0 || fLDC==3 || fLDC==4){\r
184 TH1D *h4[fgkLADDonLAY4] ; \r
185 for(Int_t i=1; i<=fgkLADDonLAY4; i++) {\r
186 sprintf(hname0,"ModPattern_L4_%d",i);\r
187 h4[i-1] = new TH1D(hname0,hname0,8,0.5,8.5);\r
188 h4[i-1]->GetXaxis()->SetTitle("Channel Number");\r
189 h4[i-1]->GetYaxis()->SetTitle("Counts");\r
190 fAliITSQADataMakerRec->Add2RawsList(h4[i-1],i-1+17+fRawsOffset);\r
191 fSDDhRaws++;\r
192 }\r
193 }\r
194\r
195 Int_t indexlast1 = 0;\r
196 Int_t indexlast2 = 0;\r
197\r
198 if(fkOnline) {\r
199 indexlast = 0;\r
200 TH1D *h5[fgknSDDmodules*2] ; \r
201 index1 = 0;\r
202\r
203/*\r
204 if(fLDC == 0 || fLDC == 1 || fLDC == 4){\r
205 \r
206 for(Int_t lad=0; lad<fgkLADDonLAY3; lad++){\r
207 for(Int_t ichan=0; det<3; det++){\r
208 for(Int_t iside=0; iside<fgknSide; iside++){\r
209 sprintf(hname0,"ProjYMap_L%d_%d_%d_%d",lay,lad,det+sideflag*3,iside); //need to define "lay"\r
210 h5[index1] = new TH1D(hname0,hname0,256,-0.5,255.5);\r
211 h5[index1]->GetXaxis()->SetTitle("Anode Number");\r
212 h5[index1]->GetYaxis()->SetTitle("Counts");\r
213 fAliITSQADataMakerRec->Add2RawsList(h5[index1],index1+39+fRawsOffset);\r
214 fSDDhRaws++;\r
215 index1++;\r
216 indexlast = index1+39;\r
217 }\r
218 } \r
219 }\r
220 }\r
221*/ \r
222 for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
223 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {\r
224 for(Int_t iside=0; iside<fgknSide; iside++){\r
225 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);\r
226 //if(fLDC == 0 || ((fLDC == 1 || fLDC == 2) && lay == 2) || ((fLDC == 3 || fLDC == 4) && lay == 3)\r
227 sprintf(hname0,"ProjYMap_L%d_%d_%d_%d",lay,lad,det,iside);\r
228 h5[index1] = new TH1D(hname0,hname0,256,-0.5,255.5);\r
229 h5[index1]->GetXaxis()->SetTitle("Anode Number");\r
230 h5[index1]->GetYaxis()->SetTitle("Counts");\r
231 fAliITSQADataMakerRec->Add2RawsList(h5[index1],index1+39+fRawsOffset);\r
232 fSDDhRaws++;\r
233 index1++;\r
234 indexlast = index1+39;\r
235 }\r
236 }\r
237 }\r
238 \r
239 TH1D *h6[fgknSDDmodules*8] ; \r
240 Int_t indextot = 0;\r
241 indexlast1 = 0;\r
242 for(Int_t htype=0; htype<4; htype++){\r
243 for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
244 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) { \r
245 for(Int_t iside=0; iside<fgknSide; iside++){\r
246 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);\r
247 if(htype == 0) sprintf(hname0,"CountsVSAnode_L%d_%d_%d_%d",lay,lad,det,iside);\r
248 if(htype == 1) sprintf(hname0,"ChargeVSAnode_L%d_%d_%d_%d",lay,lad,det,iside);\r
249 if(htype == 2) sprintf(hname0,"CountsVSTbin_L%d_%d_%d_%d",lay,lad,det,iside);\r
250 if(htype == 3) sprintf(hname0,"ChargeVSTbin_L%d_%d_%d_%d",lay,lad,det,iside);\r
251 h6[indextot] = new TH1D(hname0,hname0,256,-0.5,255.5);\r
252 if(htype == 0){\r
253 h6[indextot]->GetXaxis()->SetTitle("Anode Number");\r
254 h6[indextot]->GetYaxis()->SetTitle("Counts");\r
255 }\r
256 if(htype == 1){\r
257 h6[indextot]->GetXaxis()->SetTitle("Anode Number");\r
258 h6[indextot]->GetYaxis()->SetTitle("Charge (ADC)");\r
259 }\r
260 if(htype == 2){\r
261 h6[indextot]->GetXaxis()->SetTitle("Time bin");\r
262 h6[indextot]->GetYaxis()->SetTitle("Counts");\r
263 }\r
264 if(htype == 3){\r
265 h6[indextot]->GetXaxis()->SetTitle("Time bin");\r
266 h6[indextot]->GetYaxis()->SetTitle("Charge (ADC)");\r
267 }\r
268 fAliITSQADataMakerRec->Add2RawsList(h6[indextot],indexlast + indextot + fRawsOffset);\r
269 fSDDhRaws++;\r
270 indextot++;\r
271 indexlast1 = indexlast + indextot;\r
272 }\r
273 }\r
274 }\r
275 }\r
276\r
277\r
278 indexlast2 = 0;\r
279 index1 = 0;\r
280 char *hname[3];\r
281 for(Int_t i=0; i<3; i++) hname[i]= new char[50];\r
282 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
283 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {\r
284 for(Int_t iside=0;iside<fgknSide;iside++){\r
285 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);\r
286 sprintf(hname[0],"chargeMap_L%d_%d_%d_%d",lay,lad,det,iside);\r
287 sprintf(hname[1],"TotalCharge_L%d_%d_%d_%d",lay,lad,det,iside);\r
288 sprintf(hname[2],"hmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);\r
289 fModuleChargeMap[index1] = new TH2D(hname[0],hname[1],256,-0.5,255.5,256,-0.5,255.5);\r
290 fModuleChargeMap[index1]->GetXaxis()->SetTitle("Time Bin");\r
291 fModuleChargeMap[index1]->GetYaxis()->SetTitle("Anode");\r
292 fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap[index1],indexlast1 + index1 + fRawsOffset);\r
293 fSDDhRaws++;\r
294 fmonoD[index1] = new TH1D(hname[2],hname[2],256,-0.5,255.5);\r
295 index1++; \r
296 indexlast2 = indexlast1 + index1;\r
297 }\r
298 }\r
299 }\r
300 \r
301 \r
302 TH2D *h7[fgknSDDmodules*2] ;\r
303 index1 = 0;\r
304 for(Int_t moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
305 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {\r
306 for(Int_t iside=0; iside<fgknSide; iside++){\r
307 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);\r
308 sprintf(hname0,"Anode_vs_Charge_L%d_%d_%d_%d",lay,lad,det,iside);\r
309 h7[index1] = new TH2D(hname0,hname0,fgknSDDmodules*2,-0.5,-0.5+fgknSDDmodules*2,256,0.5,256.5);\r
310 h7[index1]->GetXaxis()->SetTitle("Charge Value (ADC)");\r
311 h7[index1]->GetYaxis()->SetTitle("Anode");\r
312 fAliITSQADataMakerRec->Add2RawsList(h7[index1],indexlast2 + index1 + fRawsOffset);\r
313 fSDDhRaws++;\r
314 index1++;\r
315 }\r
316 }\r
317 }\r
318 /*\r
319 TH2F *h8[3];\r
320 for(Int_t htype =0; htype<3; htype++){\r
321 if(htype == 0) sprintf(hname0,"BLcompare");\r
322 if(htype == 1) sprintf(hname0,"NoiseCompare");\r
323 if(htype == 2) sprintf(hname0,"VdriftCompare");\r
324 h8[htype]= new TH2F(hname0,hname0,520,0,260,100,-0.5,99.5);\r
325 if(htype == 0){\r
326 h8[htype]->GetXaxis()->SetTitle("Module Number");\r
327 h8[htype]->GetYaxis()->SetTitle("Time #");\r
328 }\r
329 if(htype == 1){\r
330 h8[htype]->GetXaxis()->SetTitle("Module Number");\r
331 h8[htype]->GetYaxis()->SetTitle("Time #)");\r
332 }\r
333 if(htype == 2){\r
334 h8[htype]->GetXaxis()->SetTitle("Module Number");\r
335 h8[htype]->GetYaxis()->SetTitle("Time #");\r
336 }\r
337\r
338 fAliITSQADataMakerRec->Add2RawsList(h8[htype],indexlast2 + index1 + htype+1 + fRawsOffset);\r
339 fSDDhRaws++;\r
340 printf("added histos %c, at position %d \n", hname0, indexlast2 + index1 + htype+1 + fRawsOffset);\r
341 }\r
342 */\r
343} // kONLINE\r
344\r
345\r
346 AliDebug(1,Form("%d SDD Raws histograms booked\n",fSDDhRaws));\r
347}\r
348\r
349\r
350//____________________________________________________________________________\r
351void AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)\r
352{ \r
353 // Fill QA for RAW - SDD -\r
354 if(rawReader->GetType() != 7) return; // skips non physical triggers\r
355 AliDebug(1,"entering MakeRaws\n"); \r
356 rawReader->SelectEquipment(17,fgkeqOffset,fgkeqOffset + fgkDDLidRange); \r
357\r
358 /*\r
359 if(rawReader->GetEventId()!=fEvtId){\r
360 TFile *DAoutput = new TFile::Open(filename);\r
361 TH1F *BLhisto;\r
362 for(Int_t imod=0; imod<nSDDmodules; imod++){ \r
363 BLhisto = (TH1F*)DAoutput->Get("BLhistoname[imod]");\r
364 mean = BLhisto->take mean;\r
365 fAliITSQADataMakerRec->GetRawsData(i+1887)->Fill(mean, imod);\r
366 Noisehisto....;\r
367 Vdrifthisto...;\r
368 <Q>histo....;\r
369 }\r
370 }\r
371 fEvtId==rawReader->GetEventId();\r
372 */\r
373\r
374 rawReader->Reset(); \r
375 AliITSRawStreamSDD s(rawReader); \r
376 s.SetDDLModuleMap(fSDDDDLModuleMap);\r
377 Int_t lay, lad, det; \r
378\r
379 Int_t index=0;\r
380 if(fkOnline) {\r
381 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
382 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {\r
383 for(Int_t iside=0;iside<fgknSide;iside++) {\r
384 if(fSDDhRaws > 39+12 * 132 + index) fAliITSQADataMakerRec->GetRawsData(39+12 * 132 + index +fRawsOffset)->Reset();\r
385 index++;\r
386 }\r
387 }\r
388 }\r
389 }\r
390 Int_t cnt = 0;\r
391 Int_t ildcID = -1;\r
392 Int_t iddl = -1;\r
393 Int_t isddmod = -1;\r
394 Int_t coord1, coord2, signal, moduleSDD, ioffset, iorder, activeModule, index1 ,nBins , iside, bin ;\r
395 while(s.Next()) {\r
396 ildcID = rawReader->GetLDCId();\r
397 iddl = rawReader->GetDDLID() - fgkDDLIDshift;\r
398 isddmod = s.GetModuleNumber(iddl,s.GetCarlosId());\r
399 if(isddmod==-1){\r
400 AliDebug(1,Form("Found module with iddl: %d, s.GetCarlosId: %d \n",iddl,s.GetCarlosId() ));\r
401 continue;\r
402 }\r
403 if(s.IsCompletedModule()) {\r
404 AliDebug(1,Form("IsCompletedModule == KTRUE\n"));\r
405 continue;\r
406 } \r
407 \r
408 coord1 = s.GetCoord1();\r
409 coord2 = s.GetCoord2();\r
410 signal = s.GetSignal();\r
411 \r
412 moduleSDD = isddmod - fgkmodoffset;\r
413 if(moduleSDD < 0 || moduleSDD>fgknSDDmodules) {\r
414 AliDebug(1,Form( "Module SDD = %d, resetting it to 1 \n",moduleSDD));\r
415 moduleSDD = 1;\r
416 }\r
417 fAliITSQADataMakerRec->GetRawsData(0 +fRawsOffset)->Fill(moduleSDD); \r
418 \r
419 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);\r
420 ioffset = 3;\r
421 iorder = 1;\r
422 if(lay==4) { \r
423 ioffset += 14;\r
424 iorder = 2; \r
425 } \r
426 fAliITSQADataMakerRec->GetRawsData(iorder +fRawsOffset)->Fill(lad);\r
427 fAliITSQADataMakerRec->GetRawsData(ioffset+lad-1 +fRawsOffset)->Fill(det); //-1 because ladder# starts from 1 \r
428 \r
429 Short_t iside = s.GetChannel();\r
430 activeModule = moduleSDD;\r
431 if(moduleSDD > 35) activeModule -= 48;\r
432 index1 = activeModule * 2 + iside;\r
433 \r
434 if(index1<0){\r
435 AliDebug(1,Form("Wrong index number %d - patched to 0\n",index1));\r
436 index1 = 0;\r
437 }\r
438 \r
439 if(fkOnline) {\r
440 if(fSDDhRaws > 39+12 * 132 + index1) {\r
441 \r
442 fAliITSQADataMakerRec->GetRawsData(39+ 2 * 132 + index1 +fRawsOffset)->Fill(coord1); \r
443 fAliITSQADataMakerRec->GetRawsData(39+ 4 * 132 + index1 +fRawsOffset)->Fill(coord1,signal); \r
444 fAliITSQADataMakerRec->GetRawsData(39+ 6 * 132 + index1 +fRawsOffset)->Fill(coord2); \r
445 fAliITSQADataMakerRec->GetRawsData(39+ 8 * 132 + index1 +fRawsOffset)->Fill(coord2,signal); \r
446 fAliITSQADataMakerRec->GetRawsData(39+12 * 132 + index1 +fRawsOffset)->Fill(signal,coord1);\r
447 ((TH2D *)(fAliITSQADataMakerRec->GetRawsData(39+10 * 132 + index1 +fRawsOffset)))->Fill(coord2, coord1, signal);\r
448\r
449 }\r
450 }\r
451 cnt++;\r
452 if(!(cnt%10000)) AliDebug(1,Form(" %d raw digits read",cnt));\r
453 }\r
454 AliDebug(1,Form("Event completed, %d raw digits read",cnt)); \r
455\r
456 if(fkOnline) {\r
457 nBins = 256;\r
458 for(moduleSDD=0; moduleSDD<fgknSDDmodules; moduleSDD++){\r
459 if((moduleSDD >= 0 && moduleSDD < 36) || (moduleSDD >= 84 && moduleSDD < 180)) {\r
460 for(iside=0; iside<fgknSide; iside++){\r
461 activeModule = moduleSDD;\r
462 if(moduleSDD > 35) activeModule -= 48;\r
463 index1 = activeModule * 2 + iside;\r
464 if(fSDDhRaws > 39 + 2 * 132 + index1) {\r
465 fmonoD[index1] = ((TH2D *) (fAliITSQADataMakerRec->GetRawsData(39+10 * 132 + index1 +fRawsOffset)))->ProjectionY();\r
466 for(bin=0; bin<nBins; bin++) fAliITSQADataMakerRec->GetRawsData(index1+39 +fRawsOffset)->Fill(bin,fmonoD[index1]->GetBinContent(bin+1) );\r
467 } \r
468 }\r
469 }\r
470 }\r
471 for(Int_t i=0; i<fSDDhRaws; i++){\r
472 Int_t entries = static_cast<Int_t>(fAliITSQADataMakerRec->GetRawsData(i +fRawsOffset)->GetEntries());\r
473 if(entries != 0)\r
474 AliDebug(1,Form("histo %d, name %s , entries %d ",i,fAliITSQADataMakerRec->GetRawsData(i +fRawsOffset)->GetName(),entries));\r
475 }\r
476 }\r
477}\r
478\r
479//____________________________________________________________________________ \r
480void AliITSQASDDDataMakerRec::InitRecPoints()\r
481{\r
482 // Initialization for RECPOINTS - SDD -\r
483 fRecsOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries();\r
484 \r
485 TH1F * h0 = new TH1F("Lay3TotCh","Layer 3 total charge",1000,-0.5, 499.5);\r
486 h0->GetXaxis()->SetTitle("ADC value");\r
487 h0->GetYaxis()->SetTitle("Entries");\r
488 fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fRecsOffset);\r
489 fSDDhRecs++;\r
490 \r
491 TH1F * h1 = new TH1F("Lay4TotCh","Layer 4 total charge",1000,-0.5, 499.5);\r
492 h1->GetXaxis()->SetTitle("ADC value");\r
493 h1->GetYaxis()->SetTitle("Entries");\r
494 fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fRecsOffset);\r
495 fSDDhRecs++;\r
496\r
497 \r
498 char hisnam[50];\r
499 TH1F *h2[3]; \r
500 for(Int_t i=1; i<=3; i++){\r
501 sprintf(hisnam,"Charge_L3_Strip%d",i);\r
502 h2[i] = new TH1F(hisnam,hisnam,1000,-0.5, 499.5);\r
503 fAliITSQADataMakerRec->Add2RecPointsList(h2[i],i+1 +fRecsOffset);\r
504 fSDDhRecs++;\r
505 }\r
506 \r
507 TH1F *h3[4]; \r
508 for(Int_t i=1; i<=4; i++){\r
509 sprintf(hisnam,"Charge_L4_Strip%d",i);\r
510 h3[i] = new TH1F(hisnam,hisnam,1000,-0.5, 499.5);\r
511 fAliITSQADataMakerRec->Add2RecPointsList(h3[i],i+4 +fRecsOffset);\r
512 fSDDhRecs++;\r
513 }\r
514 \r
515 TH1F *h4 = new TH1F("ModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); \r
516 h4->GetXaxis()->SetTitle("Module number");\r
517 h4->GetYaxis()->SetTitle("Entries");\r
518 fAliITSQADataMakerRec->Add2RecPointsList(h4,9 +fRecsOffset);\r
519 fSDDhRecs++;\r
520 TH1F *h5 = new TH1F("ModPatternL3 RP","Ladder pattern L3 RP",14,0.5,14.5); \r
521 h5->GetXaxis()->SetTitle("Ladder #, Layer 3");\r
522 h5->GetYaxis()->SetTitle("Entries");\r
523 fAliITSQADataMakerRec->Add2RecPointsList(h5,10 +fRecsOffset);\r
524 fSDDhRecs++;\r
525 TH1F *h6 = new TH1F("ModPatternL4 RP","Ladder pattern L4 RP",22,0.5,22.5); \r
526 h6->GetXaxis()->SetTitle("Ladder #, Layer 4");\r
527 h6->GetYaxis()->SetTitle("Entries");\r
528 fAliITSQADataMakerRec->Add2RecPointsList(h6,11 +fRecsOffset);\r
529 fSDDhRecs++;\r
530 TH2F *h7 = new TH2F("Local Coord Distrib","Local Coord Distrib",1000,-4,4,1000,-4,4);\r
531 h7->GetXaxis()->SetTitle("X local coord, drift, cm");\r
532 h7->GetYaxis()->SetTitle("Z local coord, anode, cm");\r
533 fAliITSQADataMakerRec->Add2RecPointsList(h7,12 +fRecsOffset);\r
534 fSDDhRecs++;\r
535 TH2F *h8 = new TH2F("Global Coord Distrib","Global Coord Distrib",6000,-30,30,6000,-30,30);\r
536 h8->GetYaxis()->SetTitle("Y glob coord, cm");\r
537 h8->GetXaxis()->SetTitle("X glob coord, cm");\r
538 fAliITSQADataMakerRec->Add2RecPointsList(h8,13 +fRecsOffset);\r
539 fSDDhRecs++;\r
540 \r
541 TH1F *h9[2]; \r
542 for(Int_t iLay=0; iLay<=1; iLay++){\r
543 sprintf(hisnam,"hr_Layer%d",iLay+3);\r
544 h9[iLay] = new TH1F(hisnam,hisnam,100,10.,30.);\r
545 h9[iLay]->GetXaxis()->SetTitle("r (cm)");\r
546 h9[iLay]->GetXaxis()->CenterTitle();\r
547 h9[iLay]->GetYaxis()->SetTitle("Entries");\r
548 fAliITSQADataMakerRec->Add2RecPointsList(h9[iLay],iLay+14 +fRecsOffset);\r
549 fSDDhRecs++;\r
550 }\r
551 TH1F *h10[2]; \r
552 for(Int_t iLay=0; iLay<=1; iLay++){\r
553 sprintf(hisnam,"hphi_Layer%d",iLay+3);\r
554 h10[iLay] = new TH1F(hisnam,hisnam,100,-TMath::Pi(),TMath::Pi());\r
555 h10[iLay]->GetXaxis()->SetTitle("#varphi (rad)");\r
556 h10[iLay]->GetXaxis()->CenterTitle();\r
557 h10[iLay]->GetYaxis()->SetTitle("Entries");\r
558 fAliITSQADataMakerRec->Add2RecPointsList(h10[iLay],iLay+16 +fRecsOffset);\r
559 fSDDhRecs++;\r
560 }\r
561\r
562 AliDebug(1,Form("%d SDD Recs histograms booked\n",fSDDhRecs));\r
563}\r
564\r
565//____________________________________________________________________________ \r
566void AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)\r
567{\r
568 // Fill QA for RecPoints - SDD -\r
569 Int_t lay, lad, det; \r
570 TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");\r
571 if (!branchRecP) { \r
572 AliError("can't get the branch with the ITS clusters !");\r
573 return;\r
574 }\r
575 TClonesArray * recpoints = new TClonesArray("AliITSRecPoint") ;\r
576 branchRecP->SetAddress(&recpoints);\r
577 Int_t npoints = 0; \r
578 Float_t cluglo[3]={0.,0.,0.}; \r
579 for(Int_t module=0; module<clustersTree->GetEntries();module++){\r
580 branchRecP->GetEvent(module);\r
581 npoints += recpoints->GetEntries();\r
582 AliITSgeomTGeo::GetModuleId(module, lay, lad, det);\r
583 //printf("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det);\r
584 \r
585 for(Int_t j=0;j<recpoints->GetEntries();j++){\r
586 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j); \r
587 fAliITSQADataMakerRec->GetRecPointsData(9 +fRecsOffset)->Fill(module);\r
588 recp->GetGlobalXYZ(cluglo);\r
589 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); \r
590 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);\r
591 if(recp->GetLayer() ==2) {\r
592 fAliITSQADataMakerRec->GetRecPointsData(0 +fRecsOffset)->Fill(recp->GetQ()) ;\r
593 fAliITSQADataMakerRec->GetRecPointsData(10 +fRecsOffset)->Fill(lad);\r
594 fAliITSQADataMakerRec->GetRecPointsData(14 +fRecsOffset)->Fill(rad);\r
595 fAliITSQADataMakerRec->GetRecPointsData(16 +fRecsOffset)->Fill(phi);\r
596 fAliITSQADataMakerRec->GetRecPointsData(9 +fRecsOffset)->Fill(module);\r
597 fAliITSQADataMakerRec->GetRecPointsData(12 +fRecsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());\r
598 fAliITSQADataMakerRec->GetRecPointsData(13 +fRecsOffset)->Fill(cluglo[0],cluglo[1]);\r
599 }\r
600 else if(recp->GetLayer() ==3) {\r
601 fAliITSQADataMakerRec->GetRecPointsData(1 +fRecsOffset)->Fill(recp->GetQ()) ;\r
602 fAliITSQADataMakerRec->GetRecPointsData(11 +fRecsOffset)->Fill(lad);\r
603 fAliITSQADataMakerRec->GetRecPointsData(15 +fRecsOffset)->Fill(rad);\r
604 fAliITSQADataMakerRec->GetRecPointsData(17 +fRecsOffset)->Fill(phi);\r
605 fAliITSQADataMakerRec->GetRecPointsData(9 +fRecsOffset)->Fill(module);\r
606 fAliITSQADataMakerRec->GetRecPointsData(12 +fRecsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());\r
607 fAliITSQADataMakerRec->GetRecPointsData(13 +fRecsOffset)->Fill(cluglo[0],cluglo[1]);\r
608 }\r
609 }\r
610 }\r
611 recpoints->Delete();\r
612 delete recpoints;\r
613\r
614}\r
615\r