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