Small fix w.r.t. rev. 32687
[u/mrichter/AliRoot.git] / ITS / AliITSQASPDDataMakerRec.cxx
CommitLineData
096292ae 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 **************************************************************************/
3f905799 15/* $Id$ */
096292ae 16// *************************************************************
17// Checks the quality assurance
18// by comparing with reference data
19// contained in a DB
20// -------------------------------------------------------------
21// W. Ferrarese + P. Cerello Feb 2008
22// INFN Torino
23// M. Nicassio D. Elia INFN Bari March 2008
24// maria.nicassio@ba.infn.it
25
26
27// --- ROOT system ---
28#include <TTree.h>
29#include <TH1.h>
30#include <TH2.h>
31#include <TMath.h>
32// --- Standard library ---
33
34// --- AliRoot header files ---
35#include "AliITSQADataMakerRec.h"
36#include "AliITSQASPDDataMakerRec.h"
37#include "AliLog.h"
4e25ac79 38#include "AliQAv1.h"
096292ae 39#include "AliRawReader.h"
379510c2 40#include "AliITSRawStreamSPD.h"
41#include "AliITSRawStreamSPDErrorLog.h"
5192f264 42#include "AliITSdigit.h"
096292ae 43#include "AliITSRecPoint.h"
379510c2 44
096292ae 45ClassImp(AliITSQASPDDataMakerRec)
46
47//____________________________________________________________________________
379510c2 48AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc, AliITSRawStreamSPDErrorLog *aliITSRawStreamSPDErrorLog) :
096292ae 49TObject(),
50fAliITSQADataMakerRec(aliITSQADataMakerRec),
51fkOnline(kMode),
52fLDC(ldc),
7a0e5776 53fSPDhRawsTask(0),
44ed7a66 54fSPDhDigitsTask(0),
7a0e5776 55fSPDhRecPointsTask(0),
56fGenRawsOffset(0),
44ed7a66 57fGenDigitsOffset(0),
7a0e5776 58fGenRecPointsOffset(0),
379510c2 59fAdvLogger(aliITSRawStreamSPDErrorLog)
096292ae 60{
61 //ctor used to discriminate OnLine-Offline analysis
62}
63
64//____________________________________________________________________________
65AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(const AliITSQASPDDataMakerRec& qadm) :
66TObject(),
67fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
68fkOnline(qadm.fkOnline),
69fLDC(qadm.fLDC),
7a0e5776 70fSPDhRawsTask(qadm.fSPDhRawsTask),
44ed7a66 71fSPDhDigitsTask(qadm.fSPDhDigitsTask),
7a0e5776 72fSPDhRecPointsTask(qadm.fSPDhRecPointsTask),
73fGenRawsOffset(qadm.fGenRawsOffset),
44ed7a66 74fGenDigitsOffset(qadm.fGenDigitsOffset),
7a0e5776 75fGenRecPointsOffset(qadm.fGenRecPointsOffset),
379510c2 76fAdvLogger(qadm.fAdvLogger)
096292ae 77{
78 //copy ctor
79 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
80 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
81 }
82
83//__________________________________________________________________
84AliITSQASPDDataMakerRec::~AliITSQASPDDataMakerRec(){
85 // destructor
379510c2 86// delete fAdvLogger;
096292ae 87}
88//__________________________________________________________________
89
90AliITSQASPDDataMakerRec& AliITSQASPDDataMakerRec::operator = (const AliITSQASPDDataMakerRec& qac )
91{
92 // Equal operator.
93 this->~AliITSQASPDDataMakerRec();
94 new(this) AliITSQASPDDataMakerRec(qac);
95 return *this;
96}
97
98//____________________________________________________________________________
99void AliITSQASPDDataMakerRec::StartOfDetectorCycle()
100{
101 //Detector specific actions at start of cycle
5379c4a3 102 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SPD Cycle\n");
096292ae 103}
104
105//____________________________________________________________________________
4e25ac79 106void AliITSQASPDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
096292ae 107{
108 // launch the QA checking
5379c4a3 109 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
096292ae 110
4e25ac79 111 //AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);
096292ae 112}
113
114//____________________________________________________________________________
115void AliITSQASPDDataMakerRec::InitRaws()
116{
117 // Initialization for RAW data - SPD -
7d297381 118 const Bool_t expert = kTRUE ;
119 const Bool_t saveCorr = kTRUE ;
120 const Bool_t image = kTRUE ;
121
57acd2d2 122 fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
b467364b 123 fAdvLogger = new AliITSRawStreamSPDErrorLog();
5379c4a3 124 AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SPD\n ");
439e7a8a 125
379510c2 126 Char_t name[50];
127 Char_t title[50];
096292ae 128
26ee9565 129 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
379510c2 130 hlayer->GetXaxis()->SetTitle("Layer number");
131 hlayer->GetYaxis()->SetTitle("Entries");
7d297381 132 fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 133 fSPDhRawsTask++;
379510c2 134
135 TH1F **hmod = new TH1F*[2];
136 TH2F **hhitMap = new TH2F*[20];
137 TH1F **herrors = new TH1F*[20];
138 for (Int_t iLay=0; iLay<2; iLay++) {
26ee9565 139 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
379510c2 140 sprintf(title,"Module map - SPD Layer %d",iLay+1);
141 hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
142 hmod[iLay]->GetXaxis()->SetTitle("Module number");
143 hmod[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 144 fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset, !expert, image, !saveCorr);
7a0e5776 145 fSPDhRawsTask++;
379510c2 146 }
379510c2 147 for (Int_t iDDL=0; iDDL<20; iDDL++) {
26ee9565 148 sprintf(name,"SPDHitMap_SPD_DDL%d",iDDL+1);
379510c2 149 sprintf(title,"Hit map - SPD DDL %d",iDDL+1);
150 hhitMap[iDDL]=new TH2F(name,title,320,0,10*32,1536,0,6*256);
151 hhitMap[iDDL]->GetXaxis()->SetTitle("Column");
152 hhitMap[iDDL]->GetYaxis()->SetTitle("Row");
7d297381 153 fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 3+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 154 fSPDhRawsTask++;
26ee9565 155 sprintf(name,"SPDErrors_SPD_DDL%d",iDDL+1);
379510c2 156 sprintf(title,"Error codes - SPD DDL %d",iDDL+1);
b467364b 157 herrors[iDDL] = new TH1F (name,title,fAdvLogger->GetNrErrorCodes(),0,fAdvLogger->GetNrErrorCodes());
379510c2 158 herrors[iDDL]->SetXTitle("Error Code");
159 herrors[iDDL]->SetYTitle("Nr of errors");
7d297381 160 fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 4+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 161 fSPDhRawsTask++;
379510c2 162 }
096292ae 163
379510c2 164 TH1F** hMultSPDhits = new TH1F*[2];
165 for (Int_t iLay=0; iLay<2; iLay++) {
26ee9565 166 sprintf(name,"SPDHitsMultiplicity_SPD%d",iLay+1);
379510c2 167 sprintf(title,"Hit multiplicity - SPD Layer %d",iLay+1);
168 hMultSPDhits[iLay]=new TH1F(name,title,200,0.,200.);
169 hMultSPDhits[iLay]->GetXaxis()->SetTitle("Hit multiplicity");
170 hMultSPDhits[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 171 fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 43+iLay+fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 172 fSPDhRawsTask++;
379510c2 173 }
174
954ef57a 175 TH2F *hMultSPDhits2MultSPDhits1
26ee9565 176 = new TH2F("SPDHitMultCorrelation_SPD","Hit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
379510c2 177 hMultSPDhits2MultSPDhits1->GetXaxis()->SetTitle("Hit multiplicity (Layer 1)");
178 hMultSPDhits2MultSPDhits1->GetYaxis()->SetTitle("Hit multiplicity (Layer 2)");
7d297381 179 fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 45+fGenRawsOffset, !expert, image, !saveCorr);
7a0e5776 180 fSPDhRawsTask++;
379510c2 181
5379c4a3 182 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Raws histograms booked\n",fSPDhRawsTask));
096292ae 183}
184
185
186//____________________________________________________________________________
379510c2 187void AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader)
096292ae 188{
189 // Fill QA for RAW - SPD -
379510c2 190 rawReader->Reset();
191 AliITSRawStreamSPD *rawStreamSPD = new AliITSRawStreamSPD(rawReader);
192 rawStreamSPD->ActivateAdvancedErrorLog(kTRUE,fAdvLogger);
193
194 Int_t nDigitsL1 = 0;
195 Int_t nDigitsL2 = 0;
196 Int_t iEq;
197 Int_t iLayer;
198 Int_t iHalfStave, iChip;
199 Int_t col, row;
200 UInt_t module, colM, rowM;
201 while(rawStreamSPD->Next()) {
202
203 iEq = rawReader->GetDDLID();
204 if (iEq>=0 && iEq<20) {
205 iHalfStave = rawStreamSPD->GetHalfStaveNr();
206 iChip = rawStreamSPD->GetChipAddr();
207 col = rawStreamSPD->GetChipCol();
208 row = rawStreamSPD->GetChipRow();
209
210 rawStreamSPD->OnlineToOffline(iEq, iHalfStave, iChip, col, row, module, colM, rowM);
211
212 if (iHalfStave>=0 && iHalfStave<2) iLayer=0;
213 else iLayer=1;
214
7a0e5776 215 fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset)->Fill(iLayer);
379510c2 216 if (iLayer==0) {
7a0e5776 217 fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(module);
379510c2 218 nDigitsL1++;
219 } else {
7a0e5776 220 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(module);
379510c2 221 nDigitsL2++;
222 }
223
7a0e5776 224 fAliITSQADataMakerRec->GetRawsData((2*iEq)+3+fGenRawsOffset)->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
379510c2 225 }
226
227 }
228 for (Int_t ieq=0; ieq<20; ieq++)
c71529b0 229 for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++)
7a0e5776 230 fAliITSQADataMakerRec->GetRawsData((2*ieq)+4+fGenRawsOffset)->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
379510c2 231
232 fAdvLogger->Reset();
233
7a0e5776 234 fAliITSQADataMakerRec->GetRawsData(43+fGenRawsOffset)->Fill(nDigitsL1);
235 fAliITSQADataMakerRec->GetRawsData(44+fGenRawsOffset)->Fill(nDigitsL2);
236 fAliITSQADataMakerRec->GetRawsData(45+fGenRawsOffset)->Fill(nDigitsL1,nDigitsL2);
379510c2 237
238 delete rawStreamSPD;
5379c4a3 239 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",nDigitsL1+nDigitsL2));
096292ae 240}
241
242//____________________________________________________________________________
44ed7a66 243void AliITSQASPDDataMakerRec::InitDigits()
244{
245 // Initialization for DIGIT data - SPD -
246 const Bool_t expert = kTRUE ;
247 const Bool_t image = kTRUE ;
248
249 fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
250 //fSPDhDigitsTask must be incremented by one unit every time a histogram is ADDED to the QA List
251
252 Char_t name[50];
253 Char_t title[50];
254
255 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
256 hlayer->GetXaxis()->SetTitle("Layer number");
257 hlayer->GetYaxis()->SetTitle("Entries");
258 fAliITSQADataMakerRec->Add2DigitsList(hlayer,fGenDigitsOffset, expert, !image);
259 fSPDhDigitsTask++;
260
261 TH1F **hmod = new TH1F*[2];
262 for (Int_t iLay=0; iLay<2; iLay++) {
263 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
264 sprintf(title,"Module map - SPD Layer %d",iLay+1);
265 hmod[iLay]=new TH1F(name,title,240,0,240);
266 hmod[iLay]->GetXaxis()->SetTitle("Module number");
267 hmod[iLay]->GetYaxis()->SetTitle("Entries");
268 fAliITSQADataMakerRec->Add2DigitsList(hmod[iLay],1+iLay+fGenDigitsOffset, !expert, image);
269 fSPDhDigitsTask++;
270 }
271
272 TH1F *hcolumns = new TH1F("SPDColumns_SPD","Columns - SPD",160,0.,160.);
273 hcolumns->GetXaxis()->SetTitle("Column number");
274 hcolumns->GetYaxis()->SetTitle("Entries");
275 fAliITSQADataMakerRec->Add2DigitsList(hcolumns,3+fGenDigitsOffset, expert, !image);
276 fSPDhDigitsTask++;
277
278 TH1F *hrows = new TH1F("SPDRows_SPD","Rows - SPD",256,0.,256.);
279 hrows->GetXaxis()->SetTitle("Row number");
280 hrows->GetYaxis()->SetTitle("Entries");
281 fAliITSQADataMakerRec->Add2DigitsList(hrows,4+fGenDigitsOffset, expert, !image);
282 fSPDhDigitsTask++;
283
284 TH1F** hMultSPDdigits = new TH1F*[2];
285 for (Int_t iLay=0; iLay<2; ++iLay) {
286 sprintf(name,"SPDDigitMultiplicity_SPD%d",iLay+1);
287 sprintf(title,"Digit multiplicity - SPD Layer %d",iLay+1);
288 hMultSPDdigits[iLay]=new TH1F(name,title,200,0.,200.);
289 hMultSPDdigits[iLay]->GetXaxis()->SetTitle("Digit multiplicity");
290 hMultSPDdigits[iLay]->GetYaxis()->SetTitle("Entries");
291 fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdigits[iLay], 5+iLay+fGenDigitsOffset, !expert, image);
292 fSPDhDigitsTask++;
293 }
294
295 TH2F *hMultSPDdig2MultSPDdig1
296 = new TH2F("SPDDigitMultCorrelation_SPD","Digit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
297 hMultSPDdig2MultSPDdig1->GetXaxis()->SetTitle("Digit multiplicity (Layer 1)");
298 hMultSPDdig2MultSPDdig1->GetYaxis()->SetTitle("Digit multiplicity (Layer 2)");
299 fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdig2MultSPDdig1,7+fGenDigitsOffset, !expert, image);
300 fSPDhDigitsTask++;
301
302 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Digits histograms booked\n",fSPDhDigitsTask));
303
304}
305
306//____________________________________________________________________________
307void AliITSQASPDDataMakerRec::MakeDigits(TTree *digits)
308{
309 // Fill QA for DIGIT - SPD -
310// AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
311// fITS->SetTreeAddress();
312// TClonesArray *iITSdigits = fITS->DigitsAddress(0); // 0->SPD
313 TBranch *branchD = digits->GetBranch("ITS");
314 if (!branchD) {
315 AliError("can't get the branch with the ITS digits !");
316 return;
317 }
318 static TClonesArray statDigits("AliITSDigit");
319 TClonesArray *iITSdigits = &statDigits;
320 branchD->SetAddress(&iITSdigits);
321 Int_t nDigitsL1=0;
322 Int_t nDigitsL2=0;
323
324 for (Int_t imod=0; imod<240; ++imod){
325 digits->GetEvent(imod);
326 Int_t ndigits = iITSdigits->GetEntries();
327 if (imod<80) {
328 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset)->Fill(0.5,ndigits);
329 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset)->Fill(imod,ndigits);
330 nDigitsL1+=ndigits;
331 }
332 else {
333 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset)->Fill(1,ndigits);
334 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset)->Fill(imod,ndigits);
335 nDigitsL2+=ndigits;
336 }
337 for (Int_t idig=0; idig<ndigits; ++idig) {
338 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
339 Int_t col=dig->GetCoord1(); // cell number z
340 Int_t row=dig->GetCoord2(); // cell number x
341 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset)->Fill(col);
342 fAliITSQADataMakerRec->GetDigitsData(4+fGenDigitsOffset)->Fill(row);
343 }
344 }
345 fAliITSQADataMakerRec->GetDigitsData(5+fGenDigitsOffset)->Fill(nDigitsL1);
346 fAliITSQADataMakerRec->GetDigitsData(6+fGenDigitsOffset)->Fill(nDigitsL2);
347 fAliITSQADataMakerRec->GetDigitsData(7+fGenDigitsOffset)->Fill(nDigitsL1,nDigitsL2);
348}
349
350//____________________________________________________________________________
096292ae 351void AliITSQASPDDataMakerRec::InitRecPoints()
352{
353 // Initialization for RECPOINTS - SPD -
7d297381 354 const Bool_t expert = kTRUE ;
355 const Bool_t image = kTRUE ;
356
57acd2d2 357 fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
26ee9565 358 TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
096292ae 359 hlayer->GetXaxis()->SetTitle("Layer number");
360 hlayer->GetYaxis()->SetTitle("Entries");
7d297381 361 fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset, expert, !image);
7a0e5776 362 fSPDhRecPointsTask++;
096292ae 363
364 TH1F** hmod = new TH1F*[2];
365 TH1F** hxl = new TH1F*[2];
366 TH1F** hzl = new TH1F*[2];
367 TH1F** hxg = new TH1F*[2];
368 TH1F** hyg = new TH1F*[2];
369 TH1F** hzg = new TH1F*[2];
370 TH1F** hr = new TH1F*[2];
371 TH1F** hphi = new TH1F*[2];
372 TH1F** hMultSPDcl = new TH1F*[2];
373 TH2F** hNyNz = new TH2F*[2]; // y and z cluster length
374 TH2F** hPhiZ = new TH2F*[2];
375
376 Float_t xlim[2]={4.5,8.};
377 Float_t zlim[2]={15.,15.};
378
379 Char_t name[50];
380 Char_t title[50];
381 for (Int_t iLay=0;iLay<2;iLay++) {
26ee9565 382 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
096292ae 383 sprintf(title,"Module map - SPD Layer %d",iLay+1);
384 hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
385 hmod[iLay]->GetXaxis()->SetTitle("Module number");
386 hmod[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 387 fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 388 fSPDhRecPointsTask++;
096292ae 389
26ee9565 390 sprintf(name,"SPDxLoc_SPD%d",iLay+1);
096292ae 391 sprintf(title,"Local x coordinate - SPD Layer %d",iLay+1);
392 hxl[iLay]=new TH1F(name,title,100,-4.,4.);
393 hxl[iLay]->GetXaxis()->SetTitle("Local x [cm]");
394 hxl[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 395 fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 396 fSPDhRecPointsTask++;
096292ae 397
26ee9565 398 sprintf(name,"SPDzLoc_SPD%d",iLay+1);
096292ae 399 sprintf(title,"Local z coordinate - SPD Layer %d",iLay+1);
400 hzl[iLay]=new TH1F(name,title,100,-4.,4.);
401 hzl[iLay]->GetXaxis()->SetTitle("Local z [cm]");
402 hzl[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 403 fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 404 fSPDhRecPointsTask++;
096292ae 405
26ee9565 406 sprintf(name,"SPDxGlob_SPD%d",iLay+1);
096292ae 407 sprintf(title,"Global x coordinate - SPD Layer %d",iLay+1);
408 hxg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
409 hxg[iLay]->GetXaxis()->SetTitle("Global x [cm]");
410 hxg[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 411 fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 412 fSPDhRecPointsTask++;
096292ae 413
26ee9565 414 sprintf(name,"SPDyGlob_SPD%d",iLay+1);
096292ae 415 sprintf(title,"Global y coordinate - SPD Layer %d",iLay+1);
416 hyg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
417 hyg[iLay]->GetXaxis()->SetTitle("Global y [cm]");
418 hyg[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 419 fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 420 fSPDhRecPointsTask++;
096292ae 421
26ee9565 422 sprintf(name,"SPDzGlob_SPD%d",iLay+1);
096292ae 423 sprintf(title,"Global z coordinate - SPD Layer %d",iLay+1);
424 hzg[iLay]=new TH1F(name,title,150,-zlim[iLay],zlim[iLay]);
425 hzg[iLay]->GetXaxis()->SetTitle("Global z [cm]");
426 hzg[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 427 fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 428 fSPDhRecPointsTask++;
096292ae 429
26ee9565 430 sprintf(name,"SPDr_SPD%d",iLay+1);
096292ae 431 sprintf(title,"Radius - SPD Layer %d",iLay+1);
432 hr[iLay]=new TH1F(name,title,100,0.,10.);
433 hr[iLay]->GetXaxis()->SetTitle("r [cm]");
434 hr[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 435 fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 436 fSPDhRecPointsTask++;
096292ae 437
26ee9565 438 sprintf(name,"SPDphi_SPD%d",iLay+1);
096292ae 439 sprintf(title,"#varphi - SPD Layer %d",iLay+1);
439e7a8a 440 hphi[iLay]=new TH1F(name,title,1000,0.,2*TMath::Pi());
096292ae 441 hphi[iLay]->GetXaxis()->SetTitle("#varphi [rad]");
442 hphi[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 443 fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 444 fSPDhRecPointsTask++;
096292ae 445
26ee9565 446 sprintf(name,"SPDSizeYvsZ_SPD%d",iLay+1);
096292ae 447 sprintf(title,"Cluster dimension - SPD Layer %d",iLay+1);
448 hNyNz[iLay]=new TH2F(name,title,100,0.,100.,100,0.,100.);
449 hNyNz[iLay]->GetXaxis()->SetTitle("z length");
450 hNyNz[iLay]->GetYaxis()->SetTitle("y length");
7d297381 451 fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(10*iLay)+fGenRecPointsOffset, expert, !image);
7a0e5776 452 fSPDhRecPointsTask++;
096292ae 453
26ee9565 454 sprintf(name,"SPDphi_z_SPD%d",iLay+1);
096292ae 455 sprintf(title,"#varphi vs z - SPD Layer %d",iLay+1);
439e7a8a 456 hPhiZ[iLay]=new TH2F(name,title,150,-zlim[iLay],zlim[iLay],200,0.,2*TMath::Pi());
096292ae 457 hPhiZ[iLay]->GetXaxis()->SetTitle("Global z [cm]");
458 hPhiZ[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
7d297381 459 fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 10+(10*iLay)+fGenRecPointsOffset, !expert, image);
7a0e5776 460 fSPDhRecPointsTask++;
096292ae 461
462 }
463
26ee9565 464 TH2F *hrPhi=new TH2F("SPDr_phi_SPD","#varphi vs r - SPD",100,0.,10.,100,0.,2*TMath::Pi());
096292ae 465 hrPhi->GetXaxis()->SetTitle("r [cm]");
466 hrPhi->GetYaxis()->SetTitle("#varphi [rad]");
7d297381 467 fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 21+fGenRecPointsOffset, expert, !image);
7a0e5776 468 fSPDhRecPointsTask++;
096292ae 469
26ee9565 470 TH2F *hxy=new TH2F("SPDx_y_SPD","Global y vs x - SPD",200,-10.,10.,200,-10.,10.);
096292ae 471 hxy->GetXaxis()->SetTitle("Global x [cm]");
472 hxy->GetYaxis()->SetTitle("Global y [cm]");
7d297381 473 fAliITSQADataMakerRec->Add2RecPointsList(hxy, 22+fGenRecPointsOffset, !expert, image);
7a0e5776 474 fSPDhRecPointsTask++;
096292ae 475
476 for (Int_t iLay=0;iLay<2;iLay++) {
26ee9565 477 sprintf(name,"SPDMultiplicity_SPD%d",iLay+1);
096292ae 478 sprintf(title,"Cluster multiplicity - SPD Layer %d",iLay+1);
479 hMultSPDcl[iLay]=new TH1F(name,title,200,0.,200.);
480 hMultSPDcl[iLay]->GetXaxis()->SetTitle("Cluster multiplicity");
481 hMultSPDcl[iLay]->GetYaxis()->SetTitle("Entries");
7d297381 482 fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 23+iLay+fGenRecPointsOffset, !expert, image);
7a0e5776 483 fSPDhRecPointsTask++;
096292ae 484 }
485
486 TH2F *hMultSPDcl2MultSPDcl1 =
26ee9565 487 new TH2F("SPDMultCorrelation_SPD","Cluster multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
096292ae 488 hMultSPDcl2MultSPDcl1->GetXaxis()->SetTitle("Clusters multiplicity (Layer 1)");
489 hMultSPDcl2MultSPDcl1->GetYaxis()->SetTitle("Clusters multiplicity (Layer 2)");
7d297381 490 fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 25+fGenRecPointsOffset, !expert, image);
7a0e5776 491 fSPDhRecPointsTask++;
096292ae 492
5379c4a3 493 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Recs histograms booked\n",fSPDhRecPointsTask));
096292ae 494
3f905799 495
096292ae 496}
497
498//____________________________________________________________________________
499void AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
500{
501 // Fill QA for RecPoints - SPD -
3647765c 502 static TClonesArray statITSCluster("AliITSRecPoint");
503 TClonesArray *ITSCluster = &statITSCluster;
504 TBranch* itsClusterBranch=clusterTree->GetBranch("ITSRecPoints");
505 if (!itsClusterBranch) {
506 AliError("can't get the branch with the ITS clusters !");
507 return;
508 }
509 itsClusterBranch->SetAddress(&ITSCluster);
510 Int_t nItsMods = (Int_t)clusterTree->GetEntries();
511
512 Float_t cluGlo[3] = {0.,0.,0.};
513 Int_t nClusters[2] = {0,0};
514
515 for (Int_t iIts=0; iIts < nItsMods; iIts++) {
516
517 if (!clusterTree->GetEvent(iIts)) continue;
518 Int_t nCluster = ITSCluster->GetEntriesFast();
519 // loop over clusters
520 while(nCluster--) {
521 AliITSRecPoint* cluster = (AliITSRecPoint*)ITSCluster->UncheckedAt(nCluster);
522
523 if (cluster->GetLayer()>1) continue;
524 Int_t lay=cluster->GetLayer();
7a0e5776 525 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(lay);
3647765c 526 cluster->GetGlobalXYZ(cluGlo);
527 Float_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
096292ae 528 Float_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
529 if (lay==0) {
7a0e5776 530 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(iIts);
531 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
532 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
533 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluGlo[0]);
534 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluGlo[1]);
535 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(cluGlo[2]);
536 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(rad);
537 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(phi);
538 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
539 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
096292ae 540 } else {
7a0e5776 541 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(iIts);
542 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
543 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
544 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluGlo[0]);
545 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluGlo[1]);
546 fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset)->Fill(cluGlo[2]);
547 fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset)->Fill(rad);
548 fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset)->Fill(phi);
549 fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
550 fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
096292ae 551 }
7a0e5776 552 fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset)->Fill(rad,phi);
553 fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset)->Fill(cluGlo[0],cluGlo[1]);
3647765c 554
096292ae 555 nClusters[lay]++;
3647765c 556 } // end of cluster loop
557 } // end of its "subdetector" loop
558
559 for (Int_t iLay=0; iLay<2; iLay++)
7a0e5776 560 fAliITSQADataMakerRec->GetRecPointsData(23+iLay +fGenRecPointsOffset)->Fill(nClusters[iLay]);
3647765c 561
7a0e5776 562 fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset)->Fill(nClusters[0],nClusters[1]);
3647765c 563
564 statITSCluster.Clear();
096292ae 565}
7a0e5776 566
567
568
569//_______________________________________________________________
570
4e25ac79 571Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
7a0e5776 572 // Returns offset number according to the specified task
573 Int_t offset=0;
4e25ac79 574 if( task == AliQAv1::kRAWS ) {
7a0e5776 575 offset=fGenRawsOffset;
576 }
4e25ac79 577 else if( task == AliQAv1::kRECPOINTS ) {
7a0e5776 578 offset=fGenRecPointsOffset;
579 }
580 else {
581 AliInfo("No task has been selected. Offset set to zero.\n");
582 }
583
584 return offset;
585}
586
587//_______________________________________________________________
588
4e25ac79 589Int_t AliITSQASPDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {
7a0e5776 590 // Returns the number of histograms associated to the specified task
591 Int_t histotot=0;
592
4e25ac79 593 if( task == AliQAv1::kRAWS ) {
7a0e5776 594 histotot=fSPDhRawsTask;
595 }
4e25ac79 596 else if( task == AliQAv1::kRECPOINTS ){
7a0e5776 597 histotot=fSPDhRecPointsTask;
598 }
599 else {
600 AliInfo("No task has been selected. TaskHisto set to zero.\n");
601 }
602
603 return histotot;
604}