Fixes for bug #49914: Compilation breaks in trunk, and bug #48629: Trunk cannot read...
[u/mrichter/AliRoot.git] / ITS / AliITSQASPDDataMakerRec.cxx
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 /* $Id$  */
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"
38 #include "AliQAv1.h"
39 #include "AliRawReader.h"
40 #include "AliITSRawStreamSPD.h"
41 #include "AliITSRawStreamSPDErrorLog.h"
42 #include "AliITSRecPoint.h"
43
44 ClassImp(AliITSQASPDDataMakerRec)
45
46 //____________________________________________________________________________
47 AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc, AliITSRawStreamSPDErrorLog *aliITSRawStreamSPDErrorLog) :
48 TObject(),
49 fAliITSQADataMakerRec(aliITSQADataMakerRec),
50 fkOnline(kMode),
51 fLDC(ldc),
52 fSPDhRawsTask(0),
53 fSPDhRecPointsTask(0),
54 fGenRawsOffset(0),
55 fGenRecPointsOffset(0),
56 fAdvLogger(aliITSRawStreamSPDErrorLog) 
57 {
58   //ctor used to discriminate OnLine-Offline analysis  
59 }
60
61 //____________________________________________________________________________ 
62 AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(const AliITSQASPDDataMakerRec& qadm) :
63 TObject(),
64 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
65 fkOnline(qadm.fkOnline),
66 fLDC(qadm.fLDC),
67 fSPDhRawsTask(qadm.fSPDhRawsTask),
68 fSPDhRecPointsTask(qadm.fSPDhRecPointsTask),
69 fGenRawsOffset(qadm.fGenRawsOffset),
70 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
71 fAdvLogger(qadm.fAdvLogger)
72 {
73   //copy ctor 
74   fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; 
75   fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
76   }
77
78 //__________________________________________________________________
79 AliITSQASPDDataMakerRec::~AliITSQASPDDataMakerRec(){
80   // destructor
81 //  delete fAdvLogger;
82 }
83 //__________________________________________________________________
84
85 AliITSQASPDDataMakerRec& AliITSQASPDDataMakerRec::operator = (const AliITSQASPDDataMakerRec& qac )
86 {
87   // Equal operator.
88   this->~AliITSQASPDDataMakerRec();
89   new(this) AliITSQASPDDataMakerRec(qac);
90   return *this;
91 }
92
93 //____________________________________________________________________________ 
94 void AliITSQASPDDataMakerRec::StartOfDetectorCycle()
95 {
96   //Detector specific actions at start of cycle
97   AliDebug(1,"AliITSQADM::Start of SPD Cycle\n");
98 }
99
100 //____________________________________________________________________________ 
101 void AliITSQASPDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
102 {
103   // launch the QA checking
104   AliDebug(1,"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
105   
106   //AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);
107 }
108
109 //____________________________________________________________________________ 
110 void AliITSQASPDDataMakerRec::InitRaws()
111
112   // Initialization for RAW data - SPD -
113   fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
114   fAdvLogger = new AliITSRawStreamSPDErrorLog();  
115   AliInfo("Book Offline Histograms for SPD\n ");
116
117   Char_t name[50];
118   Char_t title[50];
119
120   TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
121   hlayer->GetXaxis()->SetTitle("Layer number");
122   hlayer->GetYaxis()->SetTitle("Entries");
123   fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset, kTRUE);
124   fSPDhRawsTask++;
125
126   TH1F **hmod = new TH1F*[2];
127   TH2F **hhitMap = new TH2F*[20];
128   TH1F **herrors = new TH1F*[20];
129   for (Int_t iLay=0; iLay<2; iLay++) {
130     sprintf(name,"SPDModPattern_SPD%d",iLay+1);
131     sprintf(title,"Module map - SPD Layer %d",iLay+1);
132     hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
133     hmod[iLay]->GetXaxis()->SetTitle("Module number");
134     hmod[iLay]->GetYaxis()->SetTitle("Entries");
135     fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset);
136     fSPDhRawsTask++;
137   }
138   for (Int_t iDDL=0; iDDL<20; iDDL++) {
139     sprintf(name,"SPDHitMap_SPD_DDL%d",iDDL+1);
140     sprintf(title,"Hit map - SPD DDL %d",iDDL+1);
141     hhitMap[iDDL]=new TH2F(name,title,320,0,10*32,1536,0,6*256);
142     hhitMap[iDDL]->GetXaxis()->SetTitle("Column");
143     hhitMap[iDDL]->GetYaxis()->SetTitle("Row");
144     fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 3+(2*iDDL)+fGenRawsOffset, kTRUE);
145     fSPDhRawsTask++;
146     sprintf(name,"SPDErrors_SPD_DDL%d",iDDL+1);
147     sprintf(title,"Error codes - SPD DDL %d",iDDL+1);
148     herrors[iDDL] = new TH1F (name,title,fAdvLogger->GetNrErrorCodes(),0,fAdvLogger->GetNrErrorCodes());
149     herrors[iDDL]->SetXTitle("Error Code");
150     herrors[iDDL]->SetYTitle("Nr of errors");
151     fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 4+(2*iDDL)+fGenRawsOffset, kTRUE);
152     fSPDhRawsTask++;
153   }
154
155   TH1F** hMultSPDhits = new TH1F*[2];
156   for (Int_t iLay=0; iLay<2; iLay++) {
157     sprintf(name,"SPDHitsMultiplicity_SPD%d",iLay+1);
158     sprintf(title,"Hit multiplicity - SPD Layer %d",iLay+1);
159     hMultSPDhits[iLay]=new TH1F(name,title,200,0.,200.);
160     hMultSPDhits[iLay]->GetXaxis()->SetTitle("Hit multiplicity");
161     hMultSPDhits[iLay]->GetYaxis()->SetTitle("Entries");
162     fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 43+iLay+fGenRawsOffset, kTRUE);
163     fSPDhRawsTask++;
164   }
165
166   TH2F *hMultSPDhits2MultSPDhits1 
167          = new TH2F("SPDHitMultCorrelation_SPD","Hit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
168   hMultSPDhits2MultSPDhits1->GetXaxis()->SetTitle("Hit multiplicity (Layer 1)");
169   hMultSPDhits2MultSPDhits1->GetYaxis()->SetTitle("Hit multiplicity (Layer 2)");
170   fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 45+fGenRawsOffset);
171   fSPDhRawsTask++;
172  
173   AliDebug(1,Form("%d SPD Raws histograms booked\n",fSPDhRawsTask));
174 }
175
176
177 //____________________________________________________________________________
178 void AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader)
179
180   // Fill QA for RAW - SPD -
181   rawReader->Reset();
182   AliITSRawStreamSPD *rawStreamSPD = new AliITSRawStreamSPD(rawReader);
183   rawStreamSPD->ActivateAdvancedErrorLog(kTRUE,fAdvLogger);
184
185   Int_t nDigitsL1 = 0;
186   Int_t nDigitsL2 = 0;
187   Int_t iEq;
188   Int_t iLayer;
189   Int_t iHalfStave, iChip;
190   Int_t col, row; 
191   UInt_t module, colM, rowM;
192   while(rawStreamSPD->Next()) {
193
194     iEq = rawReader->GetDDLID();
195     if (iEq>=0 && iEq<20) {
196       iHalfStave = rawStreamSPD->GetHalfStaveNr();
197       iChip = rawStreamSPD->GetChipAddr();
198       col  = rawStreamSPD->GetChipCol();
199       row  = rawStreamSPD->GetChipRow();
200
201       rawStreamSPD->OnlineToOffline(iEq, iHalfStave, iChip, col, row, module, colM, rowM);
202
203       if (iHalfStave>=0 && iHalfStave<2) iLayer=0;
204       else iLayer=1;
205       
206       fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset)->Fill(iLayer);
207       if (iLayer==0) {
208         fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(module);
209         nDigitsL1++;
210       } else {
211         fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(module);
212         nDigitsL2++;
213       }
214       
215       fAliITSQADataMakerRec->GetRawsData((2*iEq)+3+fGenRawsOffset)->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
216     }
217
218   }
219   for (Int_t ieq=0; ieq<20; ieq++)
220     for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++)
221       fAliITSQADataMakerRec->GetRawsData((2*ieq)+4+fGenRawsOffset)->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
222
223   fAdvLogger->Reset();
224  
225   fAliITSQADataMakerRec->GetRawsData(43+fGenRawsOffset)->Fill(nDigitsL1);
226   fAliITSQADataMakerRec->GetRawsData(44+fGenRawsOffset)->Fill(nDigitsL2);
227   fAliITSQADataMakerRec->GetRawsData(45+fGenRawsOffset)->Fill(nDigitsL1,nDigitsL2);
228   
229   delete rawStreamSPD;  
230   AliDebug(1,Form("Event completed, %d raw digits read",nDigitsL1+nDigitsL2));
231 }
232
233 //____________________________________________________________________________ 
234 void AliITSQASPDDataMakerRec::InitRecPoints()
235 {
236   // Initialization for RECPOINTS - SPD -
237   fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
238   TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
239   hlayer->GetXaxis()->SetTitle("Layer number");
240   hlayer->GetYaxis()->SetTitle("Entries");
241   fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset, kTRUE); 
242   fSPDhRecPointsTask++;
243
244   TH1F** hmod = new TH1F*[2];
245   TH1F** hxl  = new TH1F*[2];
246   TH1F** hzl  = new TH1F*[2];
247   TH1F** hxg  = new TH1F*[2];
248   TH1F** hyg  = new TH1F*[2];
249   TH1F** hzg  = new TH1F*[2];
250   TH1F** hr   = new TH1F*[2];
251   TH1F** hphi = new TH1F*[2];
252   TH1F** hMultSPDcl = new TH1F*[2];
253   TH2F** hNyNz = new TH2F*[2];  // y and z cluster length
254   TH2F** hPhiZ = new TH2F*[2];
255
256   Float_t xlim[2]={4.5,8.};
257   Float_t zlim[2]={15.,15.};
258
259   Char_t name[50];
260   Char_t title[50];
261   for (Int_t iLay=0;iLay<2;iLay++) {
262     sprintf(name,"SPDModPattern_SPD%d",iLay+1);
263     sprintf(title,"Module map - SPD Layer %d",iLay+1);
264     hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
265     hmod[iLay]->GetXaxis()->SetTitle("Module number");
266     hmod[iLay]->GetYaxis()->SetTitle("Entries");
267     fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(10*iLay)+fGenRecPointsOffset, kTRUE); 
268     fSPDhRecPointsTask++;
269
270     sprintf(name,"SPDxLoc_SPD%d",iLay+1);
271     sprintf(title,"Local x coordinate - SPD Layer %d",iLay+1);
272     hxl[iLay]=new TH1F(name,title,100,-4.,4.);
273     hxl[iLay]->GetXaxis()->SetTitle("Local x [cm]");
274     hxl[iLay]->GetYaxis()->SetTitle("Entries");
275     fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(10*iLay)+fGenRecPointsOffset, kTRUE);
276     fSPDhRecPointsTask++;
277
278     sprintf(name,"SPDzLoc_SPD%d",iLay+1);
279     sprintf(title,"Local z coordinate - SPD Layer %d",iLay+1);
280     hzl[iLay]=new TH1F(name,title,100,-4.,4.);
281     hzl[iLay]->GetXaxis()->SetTitle("Local z [cm]");
282     hzl[iLay]->GetYaxis()->SetTitle("Entries");
283     fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(10*iLay)+fGenRecPointsOffset, kTRUE); 
284     fSPDhRecPointsTask++;
285
286     sprintf(name,"SPDxGlob_SPD%d",iLay+1);
287     sprintf(title,"Global x coordinate - SPD Layer %d",iLay+1);
288     hxg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
289     hxg[iLay]->GetXaxis()->SetTitle("Global x [cm]");
290     hxg[iLay]->GetYaxis()->SetTitle("Entries");
291     fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(10*iLay)+fGenRecPointsOffset, kTRUE);  
292     fSPDhRecPointsTask++;
293
294     sprintf(name,"SPDyGlob_SPD%d",iLay+1);
295     sprintf(title,"Global y coordinate - SPD Layer %d",iLay+1);
296     hyg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
297     hyg[iLay]->GetXaxis()->SetTitle("Global y [cm]");
298     hyg[iLay]->GetYaxis()->SetTitle("Entries");
299     fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(10*iLay)+fGenRecPointsOffset, kTRUE); 
300     fSPDhRecPointsTask++;
301
302     sprintf(name,"SPDzGlob_SPD%d",iLay+1);
303     sprintf(title,"Global z coordinate - SPD Layer %d",iLay+1);
304     hzg[iLay]=new TH1F(name,title,150,-zlim[iLay],zlim[iLay]);
305     hzg[iLay]->GetXaxis()->SetTitle("Global z [cm]");
306     hzg[iLay]->GetYaxis()->SetTitle("Entries");
307     fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(10*iLay)+fGenRecPointsOffset, kTRUE); 
308     fSPDhRecPointsTask++;
309
310     sprintf(name,"SPDr_SPD%d",iLay+1);
311     sprintf(title,"Radius - SPD Layer %d",iLay+1);
312     hr[iLay]=new TH1F(name,title,100,0.,10.);
313     hr[iLay]->GetXaxis()->SetTitle("r [cm]");
314     hr[iLay]->GetYaxis()->SetTitle("Entries");
315     fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(10*iLay)+fGenRecPointsOffset, kTRUE);  
316     fSPDhRecPointsTask++;
317
318     sprintf(name,"SPDphi_SPD%d",iLay+1);
319     sprintf(title,"#varphi - SPD Layer %d",iLay+1);
320     hphi[iLay]=new TH1F(name,title,1000,0.,2*TMath::Pi());
321     hphi[iLay]->GetXaxis()->SetTitle("#varphi [rad]");
322     hphi[iLay]->GetYaxis()->SetTitle("Entries");
323     fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(10*iLay)+fGenRecPointsOffset, kTRUE);
324     fSPDhRecPointsTask++;
325     
326     sprintf(name,"SPDSizeYvsZ_SPD%d",iLay+1);
327     sprintf(title,"Cluster dimension - SPD Layer %d",iLay+1);
328     hNyNz[iLay]=new TH2F(name,title,100,0.,100.,100,0.,100.);
329     hNyNz[iLay]->GetXaxis()->SetTitle("z length");
330     hNyNz[iLay]->GetYaxis()->SetTitle("y length");
331     fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(10*iLay)+fGenRecPointsOffset, kTRUE); 
332     fSPDhRecPointsTask++;
333
334     sprintf(name,"SPDphi_z_SPD%d",iLay+1);
335     sprintf(title,"#varphi vs z - SPD Layer %d",iLay+1);
336     hPhiZ[iLay]=new TH2F(name,title,150,-zlim[iLay],zlim[iLay],200,0.,2*TMath::Pi());
337     hPhiZ[iLay]->GetXaxis()->SetTitle("Global z [cm]");
338     hPhiZ[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
339     fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 10+(10*iLay)+fGenRecPointsOffset);
340     fSPDhRecPointsTask++;
341
342   }
343
344   TH2F *hrPhi=new TH2F("SPDr_phi_SPD","#varphi vs r - SPD",100,0.,10.,100,0.,2*TMath::Pi());
345   hrPhi->GetXaxis()->SetTitle("r [cm]");
346   hrPhi->GetYaxis()->SetTitle("#varphi [rad]");
347   fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 21+fGenRecPointsOffset, kTRUE);
348   fSPDhRecPointsTask++;
349
350   TH2F *hxy=new TH2F("SPDx_y_SPD","Global y vs x - SPD",200,-10.,10.,200,-10.,10.);
351   hxy->GetXaxis()->SetTitle("Global x [cm]");
352   hxy->GetYaxis()->SetTitle("Global y [cm]");
353   fAliITSQADataMakerRec->Add2RecPointsList(hxy, 22+fGenRecPointsOffset);
354   fSPDhRecPointsTask++;
355
356   for (Int_t iLay=0;iLay<2;iLay++) {
357     sprintf(name,"SPDMultiplicity_SPD%d",iLay+1);
358     sprintf(title,"Cluster multiplicity - SPD Layer %d",iLay+1);
359     hMultSPDcl[iLay]=new TH1F(name,title,200,0.,200.);
360     hMultSPDcl[iLay]->GetXaxis()->SetTitle("Cluster multiplicity");
361     hMultSPDcl[iLay]->GetYaxis()->SetTitle("Entries");
362     fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 23+iLay+fGenRecPointsOffset);
363     fSPDhRecPointsTask++;
364   } 
365
366   TH2F *hMultSPDcl2MultSPDcl1 =
367         new TH2F("SPDMultCorrelation_SPD","Cluster multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
368   hMultSPDcl2MultSPDcl1->GetXaxis()->SetTitle("Clusters multiplicity (Layer 1)");
369   hMultSPDcl2MultSPDcl1->GetYaxis()->SetTitle("Clusters multiplicity (Layer 2)"); 
370   fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 25+fGenRecPointsOffset, kFALSE);
371   fSPDhRecPointsTask++;
372
373   AliDebug(1,Form("%d SPD Recs histograms booked\n",fSPDhRecPointsTask));
374
375
376 }
377
378 //____________________________________________________________________________ 
379 void AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
380 {
381   // Fill QA for RecPoints - SPD -
382   static TClonesArray statITSCluster("AliITSRecPoint");
383   TClonesArray *ITSCluster = &statITSCluster;
384   TBranch* itsClusterBranch=clusterTree->GetBranch("ITSRecPoints");
385   if (!itsClusterBranch) {
386     AliError("can't get the branch with the ITS clusters !");
387     return;
388   }
389   itsClusterBranch->SetAddress(&ITSCluster);
390   Int_t nItsMods = (Int_t)clusterTree->GetEntries();
391   
392   Float_t cluGlo[3] = {0.,0.,0.};
393   Int_t nClusters[2] = {0,0};
394   
395   for (Int_t iIts=0; iIts < nItsMods; iIts++) {
396     
397     if (!clusterTree->GetEvent(iIts))    continue;
398     Int_t nCluster = ITSCluster->GetEntriesFast();
399     // loop over clusters
400     while(nCluster--) {
401       AliITSRecPoint* cluster = (AliITSRecPoint*)ITSCluster->UncheckedAt(nCluster);
402       
403       if (cluster->GetLayer()>1)        continue;
404       Int_t lay=cluster->GetLayer();
405       fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(lay);
406       cluster->GetGlobalXYZ(cluGlo);
407       Float_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
408         Float_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
409         if (lay==0) {
410           fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(iIts);
411           fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
412           fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
413           fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluGlo[0]);
414           fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluGlo[1]);
415           fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(cluGlo[2]);
416           fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(rad);
417           fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(phi);
418           fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
419           fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
420         } else  {
421           fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(iIts);
422           fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
423           fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
424           fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluGlo[0]);
425           fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluGlo[1]);
426           fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset)->Fill(cluGlo[2]);
427           fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset)->Fill(rad);
428           fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset)->Fill(phi);
429           fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
430           fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
431         }
432         fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset)->Fill(rad,phi);
433         fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset)->Fill(cluGlo[0],cluGlo[1]);
434         
435         nClusters[lay]++; 
436     } // end of cluster loop
437   } // end of its "subdetector" loop
438   
439   for (Int_t iLay=0; iLay<2; iLay++)
440     fAliITSQADataMakerRec->GetRecPointsData(23+iLay +fGenRecPointsOffset)->Fill(nClusters[iLay]);
441   
442   fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset)->Fill(nClusters[0],nClusters[1]);
443   
444   statITSCluster.Clear();
445 }
446
447
448
449 //_______________________________________________________________
450
451 Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
452   // Returns offset number according to the specified task
453   Int_t offset=0;
454   if( task == AliQAv1::kRAWS ) {
455     offset=fGenRawsOffset;
456   }
457   else if( task == AliQAv1::kRECPOINTS ) {
458     offset=fGenRecPointsOffset;
459   }
460   else {
461     AliInfo("No task has been selected. Offset set to zero.\n");
462   }
463
464   return offset;
465 }
466
467 //_______________________________________________________________
468
469 Int_t AliITSQASPDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {
470   // Returns the number of histograms associated to the specified task
471   Int_t histotot=0;
472
473   if( task == AliQAv1::kRAWS ) {
474     histotot=fSPDhRawsTask;
475   }
476   else if( task == AliQAv1::kRECPOINTS ){
477     histotot=fSPDhRecPointsTask;
478   }
479   else {
480     AliInfo("No task has been selected. TaskHisto set to zero.\n");
481   }
482
483   return histotot;
484 }