1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // *************************************************************
17 // Checks the quality assurance
18 // by comparing with reference data
20 // -------------------------------------------------------------
21 // W. Ferrarese + P. Cerello Feb 2008
23 // M. Nicassio D. Elia INFN Bari March 2008
24 // maria.nicassio@ba.infn.it
27 // --- ROOT system ---
32 // --- Standard library ---
34 // --- AliRoot header files ---
35 #include "AliITSQADataMakerRec.h"
36 #include "AliITSQASPDDataMakerRec.h"
39 #include "AliRawReader.h"
40 #include "AliITSRawStreamSPD.h"
41 #include "AliITSRawStreamSPDErrorLog.h"
42 #include "AliITSdigitSPD.h"
43 #include "AliITSRecPoint.h"
45 ClassImp(AliITSQASPDDataMakerRec)
47 //____________________________________________________________________________
48 AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc, AliITSRawStreamSPDErrorLog *aliITSRawStreamSPDErrorLog) :
50 fAliITSQADataMakerRec(aliITSQADataMakerRec),
55 fSPDhRecPointsTask(0),
58 fGenRecPointsOffset(0),
59 fAdvLogger(aliITSRawStreamSPDErrorLog)
61 //ctor used to discriminate OnLine-Offline analysis
64 //____________________________________________________________________________
65 AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(const AliITSQASPDDataMakerRec& qadm) :
67 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
68 fkOnline(qadm.fkOnline),
70 fSPDhRawsTask(qadm.fSPDhRawsTask),
71 fSPDhDigitsTask(qadm.fSPDhDigitsTask),
72 fSPDhRecPointsTask(qadm.fSPDhRecPointsTask),
73 fGenRawsOffset(qadm.fGenRawsOffset),
74 fGenDigitsOffset(qadm.fGenDigitsOffset),
75 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
76 fAdvLogger(qadm.fAdvLogger)
79 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
80 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
83 //__________________________________________________________________
84 AliITSQASPDDataMakerRec::~AliITSQASPDDataMakerRec(){
88 //__________________________________________________________________
90 AliITSQASPDDataMakerRec& AliITSQASPDDataMakerRec::operator = (const AliITSQASPDDataMakerRec& qac )
93 this->~AliITSQASPDDataMakerRec();
94 new(this) AliITSQASPDDataMakerRec(qac);
98 //____________________________________________________________________________
99 void AliITSQASPDDataMakerRec::StartOfDetectorCycle()
101 //Detector specific actions at start of cycle
102 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SPD Cycle\n");
105 //____________________________________________________________________________
106 void AliITSQASPDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
108 // launch the QA checking
109 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
111 //AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);
114 //____________________________________________________________________________
115 Int_t AliITSQASPDDataMakerRec::InitRaws()
117 // Initialization for RAW data - SPD -
118 const Bool_t expert = kTRUE ;
119 const Bool_t saveCorr = kTRUE ;
120 const Bool_t image = kTRUE ;
122 // fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
123 fAdvLogger = new AliITSRawStreamSPDErrorLog();
124 AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SPD\n ");
129 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
130 hlayer->GetXaxis()->SetTitle("Layer number");
131 hlayer->GetYaxis()->SetTitle("Entries");
132 rv = fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset, expert, !image, !saveCorr);
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++) {
139 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
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");
144 rv = fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset, !expert, image, !saveCorr);
147 for (Int_t iDDL=0; iDDL<20; iDDL++) {
148 sprintf(name,"SPDHitMap_SPD_DDL%d",iDDL+1);
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");
153 rv = fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 3+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
155 sprintf(name,"SPDErrors_SPD_DDL%d",iDDL+1);
156 sprintf(title,"Error codes - SPD DDL %d",iDDL+1);
157 herrors[iDDL] = new TH1F (name,title,fAdvLogger->GetNrErrorCodes(),0,fAdvLogger->GetNrErrorCodes());
158 herrors[iDDL]->SetXTitle("Error Code");
159 herrors[iDDL]->SetYTitle("Nr of errors");
160 rv = fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 4+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
164 TH1F** hMultSPDhits = new TH1F*[2];
165 for (Int_t iLay=0; iLay<2; iLay++) {
166 sprintf(name,"SPDHitsMultiplicity_SPD%d",iLay+1);
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");
171 rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 43+iLay+fGenRawsOffset, expert, !image, !saveCorr);
175 TH2F *hMultSPDhits2MultSPDhits1
176 = new TH2F("SPDHitMultCorrelation_SPD","Hit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
177 hMultSPDhits2MultSPDhits1->GetXaxis()->SetTitle("Hit multiplicity (Layer 1)");
178 hMultSPDhits2MultSPDhits1->GetYaxis()->SetTitle("Hit multiplicity (Layer 2)");
179 rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 45+fGenRawsOffset, !expert, image, !saveCorr);
182 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Raws histograms booked\n",fSPDhRawsTask));
186 //____________________________________________________________________________
187 Int_t AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader)
189 // Fill QA for RAW - SPD -
193 AliITSRawStreamSPD *rawStreamSPD = new AliITSRawStreamSPD(rawReader);
194 rawStreamSPD->ActivateAdvancedErrorLog(kTRUE,fAdvLogger);
200 Int_t iHalfStave, iChip;
202 UInt_t module, colM, rowM;
203 while(rawStreamSPD->Next()) {
205 iEq = rawReader->GetDDLID();
206 if (iEq>=0 && iEq<20) {
207 iHalfStave = rawStreamSPD->GetHalfStaveNr();
208 iChip = rawStreamSPD->GetChipAddr();
209 col = rawStreamSPD->GetChipCol();
210 row = rawStreamSPD->GetChipRow();
212 rawStreamSPD->OnlineToOffline(iEq, iHalfStave, iChip, col, row, module, colM, rowM);
214 if (iHalfStave>=0 && iHalfStave<2) iLayer=0;
217 fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset)->Fill(iLayer);
219 fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(module);
222 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(module);
226 fAliITSQADataMakerRec->GetRawsData((2*iEq)+3+fGenRawsOffset)->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
230 for (Int_t ieq=0; ieq<20; ieq++)
231 for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++)
232 fAliITSQADataMakerRec->GetRawsData((2*ieq)+4+fGenRawsOffset)->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
236 fAliITSQADataMakerRec->GetRawsData(43+fGenRawsOffset)->Fill(nDigitsL1);
237 fAliITSQADataMakerRec->GetRawsData(44+fGenRawsOffset)->Fill(nDigitsL2);
238 fAliITSQADataMakerRec->GetRawsData(45+fGenRawsOffset)->Fill(nDigitsL1,nDigitsL2);
241 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",nDigitsL1+nDigitsL2));
245 //____________________________________________________________________________
246 Int_t AliITSQASPDDataMakerRec::InitDigits()
248 // Initialization for DIGIT data - SPD -
249 const Bool_t expert = kTRUE ;
250 const Bool_t image = kTRUE ;
252 // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
253 //fSPDhDigitsTask must be incremented by one unit every time a histogram is ADDED to the QA List
258 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
259 hlayer->GetXaxis()->SetTitle("Layer number");
260 hlayer->GetYaxis()->SetTitle("Entries");
261 rv = fAliITSQADataMakerRec->Add2DigitsList(hlayer,fGenDigitsOffset, expert, !image);
264 TH1F **hmod = new TH1F*[2];
265 for (Int_t iLay=0; iLay<2; iLay++) {
266 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
267 sprintf(title,"Module map - SPD Layer %d",iLay+1);
268 hmod[iLay]=new TH1F(name,title,240,0,240);
269 hmod[iLay]->GetXaxis()->SetTitle("Module number");
270 hmod[iLay]->GetYaxis()->SetTitle("Entries");
271 rv = fAliITSQADataMakerRec->Add2DigitsList(hmod[iLay],1+iLay+fGenDigitsOffset, !expert, image);
275 TH1F *hcolumns = new TH1F("SPDColumns_SPD","Columns - SPD",160,0.,160.);
276 hcolumns->GetXaxis()->SetTitle("Column number");
277 hcolumns->GetYaxis()->SetTitle("Entries");
278 rv = fAliITSQADataMakerRec->Add2DigitsList(hcolumns,3+fGenDigitsOffset, expert, !image);
281 TH1F *hrows = new TH1F("SPDRows_SPD","Rows - SPD",256,0.,256.);
282 hrows->GetXaxis()->SetTitle("Row number");
283 hrows->GetYaxis()->SetTitle("Entries");
284 rv = fAliITSQADataMakerRec->Add2DigitsList(hrows,4+fGenDigitsOffset, expert, !image);
287 TH1F** hMultSPDdigits = new TH1F*[2];
288 for (Int_t iLay=0; iLay<2; ++iLay) {
289 sprintf(name,"SPDDigitMultiplicity_SPD%d",iLay+1);
290 sprintf(title,"Digit multiplicity - SPD Layer %d",iLay+1);
291 hMultSPDdigits[iLay]=new TH1F(name,title,200,0.,200.);
292 hMultSPDdigits[iLay]->GetXaxis()->SetTitle("Digit multiplicity");
293 hMultSPDdigits[iLay]->GetYaxis()->SetTitle("Entries");
294 rv = fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdigits[iLay], 5+iLay+fGenDigitsOffset, !expert, image);
298 TH2F *hMultSPDdig2MultSPDdig1
299 = new TH2F("SPDDigitMultCorrelation_SPD","Digit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
300 hMultSPDdig2MultSPDdig1->GetXaxis()->SetTitle("Digit multiplicity (Layer 1)");
301 hMultSPDdig2MultSPDdig1->GetYaxis()->SetTitle("Digit multiplicity (Layer 2)");
302 rv = fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdig2MultSPDdig1,7+fGenDigitsOffset, !expert, image);
305 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Digits histograms booked\n",fSPDhDigitsTask));
309 //____________________________________________________________________________
310 Int_t AliITSQASPDDataMakerRec::MakeDigits(TTree *digits)
312 // Fill QA for DIGIT - SPD -
315 // AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
316 // fITS->SetTreeAddress();
317 // TClonesArray *iITSdigits = fITS->DigitsAddress(0); // 0->SPD
318 TBranch *branchD = digits->GetBranch("ITSDigitsSPD");
320 AliError("can't get the branch with the SPD ITS digits !");
323 static TClonesArray statDigits("AliITSdigitSPD");
324 TClonesArray *iITSdigits = &statDigits;
325 branchD->SetAddress(&iITSdigits);
329 for (Int_t imod=0; imod<240; ++imod){
330 digits->GetEvent(imod);
331 Int_t ndigits = iITSdigits->GetEntries();
333 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset)->Fill(0.5,ndigits);
334 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset)->Fill(imod,ndigits);
338 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset)->Fill(1,ndigits);
339 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset)->Fill(imod,ndigits);
342 for (Int_t idig=0; idig<ndigits; ++idig) {
343 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
344 Int_t col=dig->GetCoord1(); // cell number z
345 Int_t row=dig->GetCoord2(); // cell number x
346 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset)->Fill(col);
347 fAliITSQADataMakerRec->GetDigitsData(4+fGenDigitsOffset)->Fill(row);
350 fAliITSQADataMakerRec->GetDigitsData(5+fGenDigitsOffset)->Fill(nDigitsL1);
351 fAliITSQADataMakerRec->GetDigitsData(6+fGenDigitsOffset)->Fill(nDigitsL2);
352 fAliITSQADataMakerRec->GetDigitsData(7+fGenDigitsOffset)->Fill(nDigitsL1,nDigitsL2);
356 //____________________________________________________________________________
357 Int_t AliITSQASPDDataMakerRec::InitRecPoints()
359 // Initialization for RECPOINTS - SPD -
360 const Bool_t expert = kTRUE ;
361 const Bool_t image = kTRUE ;
363 // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
364 TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
365 hlayer->GetXaxis()->SetTitle("Layer number");
366 hlayer->GetYaxis()->SetTitle("Entries");
367 rv = fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset, expert, !image);
368 fSPDhRecPointsTask++;
370 TH1F** hmod = new TH1F*[2];
371 TH1F** hxl = new TH1F*[2];
372 TH1F** hzl = new TH1F*[2];
373 TH1F** hxg = new TH1F*[2];
374 TH1F** hyg = new TH1F*[2];
375 TH1F** hzg = new TH1F*[2];
376 TH1F** hr = new TH1F*[2];
377 TH1F** hphi = new TH1F*[2];
378 TH1F** hMultSPDcl = new TH1F*[2];
379 TH2F** hNyNz = new TH2F*[2]; // y and z cluster length
380 TH2F** hPhiZ = new TH2F*[2];
382 Float_t xlim[2]={4.5,8.};
383 Float_t zlim[2]={15.,15.};
387 for (Int_t iLay=0;iLay<2;iLay++) {
388 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
389 sprintf(title,"Module map - SPD Layer %d",iLay+1);
390 hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
391 hmod[iLay]->GetXaxis()->SetTitle("Module number");
392 hmod[iLay]->GetYaxis()->SetTitle("Entries");
393 rv = fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(10*iLay)+fGenRecPointsOffset, expert, !image);
394 fSPDhRecPointsTask++;
396 sprintf(name,"SPDxLoc_SPD%d",iLay+1);
397 sprintf(title,"Local x coordinate - SPD Layer %d",iLay+1);
398 hxl[iLay]=new TH1F(name,title,100,-4.,4.);
399 hxl[iLay]->GetXaxis()->SetTitle("Local x [cm]");
400 hxl[iLay]->GetYaxis()->SetTitle("Entries");
401 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(10*iLay)+fGenRecPointsOffset, expert, !image);
402 fSPDhRecPointsTask++;
404 sprintf(name,"SPDzLoc_SPD%d",iLay+1);
405 sprintf(title,"Local z coordinate - SPD Layer %d",iLay+1);
406 hzl[iLay]=new TH1F(name,title,100,-4.,4.);
407 hzl[iLay]->GetXaxis()->SetTitle("Local z [cm]");
408 hzl[iLay]->GetYaxis()->SetTitle("Entries");
409 rv = fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(10*iLay)+fGenRecPointsOffset, expert, !image);
410 fSPDhRecPointsTask++;
412 sprintf(name,"SPDxGlob_SPD%d",iLay+1);
413 sprintf(title,"Global x coordinate - SPD Layer %d",iLay+1);
414 hxg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
415 hxg[iLay]->GetXaxis()->SetTitle("Global x [cm]");
416 hxg[iLay]->GetYaxis()->SetTitle("Entries");
417 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(10*iLay)+fGenRecPointsOffset, expert, !image);
418 fSPDhRecPointsTask++;
420 sprintf(name,"SPDyGlob_SPD%d",iLay+1);
421 sprintf(title,"Global y coordinate - SPD Layer %d",iLay+1);
422 hyg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
423 hyg[iLay]->GetXaxis()->SetTitle("Global y [cm]");
424 hyg[iLay]->GetYaxis()->SetTitle("Entries");
425 rv = fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(10*iLay)+fGenRecPointsOffset, expert, !image);
426 fSPDhRecPointsTask++;
428 sprintf(name,"SPDzGlob_SPD%d",iLay+1);
429 sprintf(title,"Global z coordinate - SPD Layer %d",iLay+1);
430 hzg[iLay]=new TH1F(name,title,150,-zlim[iLay],zlim[iLay]);
431 hzg[iLay]->GetXaxis()->SetTitle("Global z [cm]");
432 hzg[iLay]->GetYaxis()->SetTitle("Entries");
433 rv = fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(10*iLay)+fGenRecPointsOffset, expert, !image);
434 fSPDhRecPointsTask++;
436 sprintf(name,"SPDr_SPD%d",iLay+1);
437 sprintf(title,"Radius - SPD Layer %d",iLay+1);
438 hr[iLay]=new TH1F(name,title,100,0.,10.);
439 hr[iLay]->GetXaxis()->SetTitle("r [cm]");
440 hr[iLay]->GetYaxis()->SetTitle("Entries");
441 rv = fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(10*iLay)+fGenRecPointsOffset, expert, !image);
442 fSPDhRecPointsTask++;
444 sprintf(name,"SPDphi_SPD%d",iLay+1);
445 sprintf(title,"#varphi - SPD Layer %d",iLay+1);
446 hphi[iLay]=new TH1F(name,title,1000,0.,2*TMath::Pi());
447 hphi[iLay]->GetXaxis()->SetTitle("#varphi [rad]");
448 hphi[iLay]->GetYaxis()->SetTitle("Entries");
449 rv = fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(10*iLay)+fGenRecPointsOffset, expert, !image);
450 fSPDhRecPointsTask++;
452 sprintf(name,"SPDSizeYvsZ_SPD%d",iLay+1);
453 sprintf(title,"Cluster dimension - SPD Layer %d",iLay+1);
454 hNyNz[iLay]=new TH2F(name,title,100,0.,100.,100,0.,100.);
455 hNyNz[iLay]->GetXaxis()->SetTitle("z length");
456 hNyNz[iLay]->GetYaxis()->SetTitle("y length");
457 rv = fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(10*iLay)+fGenRecPointsOffset, expert, !image);
458 fSPDhRecPointsTask++;
460 sprintf(name,"SPDphi_z_SPD%d",iLay+1);
461 sprintf(title,"#varphi vs z - SPD Layer %d",iLay+1);
462 hPhiZ[iLay]=new TH2F(name,title,150,-zlim[iLay],zlim[iLay],200,0.,2*TMath::Pi());
463 hPhiZ[iLay]->GetXaxis()->SetTitle("Global z [cm]");
464 hPhiZ[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
465 rv = fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 10+(10*iLay)+fGenRecPointsOffset, !expert, image);
466 fSPDhRecPointsTask++;
470 TH2F *hrPhi=new TH2F("SPDr_phi_SPD","#varphi vs r - SPD",100,0.,10.,100,0.,2*TMath::Pi());
471 hrPhi->GetXaxis()->SetTitle("r [cm]");
472 hrPhi->GetYaxis()->SetTitle("#varphi [rad]");
473 rv = fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 21+fGenRecPointsOffset, expert, !image);
474 fSPDhRecPointsTask++;
476 TH2F *hxy=new TH2F("SPDx_y_SPD","Global y vs x - SPD",200,-10.,10.,200,-10.,10.);
477 hxy->GetXaxis()->SetTitle("Global x [cm]");
478 hxy->GetYaxis()->SetTitle("Global y [cm]");
479 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxy, 22+fGenRecPointsOffset, !expert, image);
480 fSPDhRecPointsTask++;
482 for (Int_t iLay=0;iLay<2;iLay++) {
483 sprintf(name,"SPDMultiplicity_SPD%d",iLay+1);
484 sprintf(title,"Cluster multiplicity - SPD Layer %d",iLay+1);
485 hMultSPDcl[iLay]=new TH1F(name,title,200,0.,200.);
486 hMultSPDcl[iLay]->GetXaxis()->SetTitle("Cluster multiplicity");
487 hMultSPDcl[iLay]->GetYaxis()->SetTitle("Entries");
488 rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 23+iLay+fGenRecPointsOffset, !expert, image);
489 fSPDhRecPointsTask++;
492 TH2F *hMultSPDcl2MultSPDcl1 =
493 new TH2F("SPDMultCorrelation_SPD","Cluster multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
494 hMultSPDcl2MultSPDcl1->GetXaxis()->SetTitle("Clusters multiplicity (Layer 1)");
495 hMultSPDcl2MultSPDcl1->GetYaxis()->SetTitle("Clusters multiplicity (Layer 2)");
496 rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 25+fGenRecPointsOffset, !expert, image);
497 fSPDhRecPointsTask++;
499 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Recs histograms booked\n",fSPDhRecPointsTask));
504 //____________________________________________________________________________
505 Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
507 // Fill QA for RecPoints - SPD -
509 static TClonesArray statITSCluster("AliITSRecPoint");
510 TClonesArray *ITSCluster = &statITSCluster;
511 TBranch* itsClusterBranch=clusterTree->GetBranch("ITSRecPoints");
512 if (!itsClusterBranch) {
513 AliError("can't get the branch with the ITS clusters !");
517 itsClusterBranch->SetAddress(&ITSCluster);
518 Int_t nItsMods = (Int_t)clusterTree->GetEntries();
520 Float_t cluGlo[3] = {0.,0.,0.};
521 Int_t nClusters[2] = {0,0};
523 for (Int_t iIts=0; iIts < nItsMods; iIts++) {
525 if (!clusterTree->GetEvent(iIts)) continue;
526 Int_t nCluster = ITSCluster->GetEntriesFast();
527 // loop over clusters
529 AliITSRecPoint* cluster = (AliITSRecPoint*)ITSCluster->UncheckedAt(nCluster);
531 if (cluster->GetLayer()>1) continue;
532 Int_t lay=cluster->GetLayer();
533 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(lay);
534 cluster->GetGlobalXYZ(cluGlo);
535 Float_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
536 Float_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
538 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(iIts);
539 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
540 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
541 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluGlo[0]);
542 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluGlo[1]);
543 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(cluGlo[2]);
544 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(rad);
545 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(phi);
546 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
547 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
549 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(iIts);
550 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
551 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
552 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluGlo[0]);
553 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluGlo[1]);
554 fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset)->Fill(cluGlo[2]);
555 fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset)->Fill(rad);
556 fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset)->Fill(phi);
557 fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
558 fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
560 fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset)->Fill(rad,phi);
561 fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset)->Fill(cluGlo[0],cluGlo[1]);
564 } // end of cluster loop
565 } // end of its "subdetector" loop
567 for (Int_t iLay=0; iLay<2; iLay++)
568 fAliITSQADataMakerRec->GetRecPointsData(23+iLay +fGenRecPointsOffset)->Fill(nClusters[iLay]);
570 fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset)->Fill(nClusters[0],nClusters[1]);
572 statITSCluster.Clear();
578 //_______________________________________________________________
580 Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
581 // Returns offset number according to the specified task
583 if( task == AliQAv1::kRAWS ) {
584 offset=fGenRawsOffset;
586 else if( task == AliQAv1::kDIGITSR ) {
587 offset=fGenDigitsOffset;
589 else if( task == AliQAv1::kRECPOINTS ) {
590 offset=fGenRecPointsOffset;
592 else if( task == AliQAv1::kDIGITS ) {
593 offset=fGenDigitsOffset;
596 AliInfo("No task has been selected. Offset set to zero.\n");
602 //_______________________________________________________________
604 void AliITSQASPDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset) {
605 // Returns offset number according to the specified task
606 if( task == AliQAv1::kRAWS ) {
607 fGenRawsOffset=offset;
609 else if( task == AliQAv1::kDIGITSR ) {
610 fGenDigitsOffset=offset;
612 else if( task == AliQAv1::kRECPOINTS ) {
613 fGenRecPointsOffset=offset;
616 AliInfo("No task has been selected. Offset set to zero.\n");
620 //_______________________________________________________________
622 Int_t AliITSQASPDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {
623 // Returns the number of histograms associated to the specified task
627 if( task == AliQAv1::kRAWS ) {
628 histotot=fSPDhRawsTask;
630 else if( task == AliQAv1::kDIGITSR ) {
631 histotot=fSPDhDigitsTask;
633 else if( task == AliQAv1::kRECPOINTS ){
634 histotot=fSPDhRecPointsTask;
636 else if( task == AliQAv1::kDIGITS ){
637 histotot=fSPDhDigitsTask;
640 AliInfo("No task has been selected. TaskHisto set to zero.\n");