75f573e130f18cf4e844c4212aae6564b1e1e35b
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDDataMakerRec.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
24 // --- ROOT system ---
25 #include <TH2D.h>
26 #include <TTree.h>
27 #include <TMath.h>
28 #include <TString.h>
29 #include <TSystem.h>
30
31 // --- Standard library ---
32
33 // --- AliRoot header files ---
34 #include "AliITSQASSDDataMakerRec.h"
35 #include "AliQADataMakerRec.h"
36 #include "AliLog.h"
37 #include "AliQA.h"
38 #include "AliQAChecker.h"
39 #include "AliRawReader.h"
40 #include "AliRawReaderRoot.h"
41 #include "AliITSRawStreamSSD.h"
42 #include "AliITSgeomTGeo.h"
43 #include "AliRawEventHeaderBase.h"
44 #include "AliITSRecPoint.h"
45
46 #include "AliCDBManager.h"
47 #include "AliCDBEntry.h"
48
49 ClassImp(AliITSQASSDDataMakerRec)
50
51 AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Int_t ldc) :
52 TObject(),
53 fAliITSQADataMakerRec(aliITSQADataMakerRec),
54 fSSDEvent(0),
55 fSSDEventPerCycle(0),
56 fkOnline(kMode),
57 fLDC(ldc),
58 fSSDRawsOffset(0),
59 fSSDRawsCommonLevelOffset(0),
60 fSSDhTask(0),
61 fGenOffset(0) {
62   // Default constructor   
63   //initilize the raw signal vs strip number histograms
64   if(fkOnline) {
65     AliCDBManager * man = AliCDBManager::Instance();
66     man->SetDefaultStorage("local://$ALICE_ROOT");
67     Int_t runNumber = atoi(gSystem->Getenv("DATE_RUN_NUMBER"));
68     if(!runNumber) 
69       AliInfo("DATE_RUN_NUMBER not defined!!!\n");
70     
71     man->SetRun(runNumber);
72     AliCDBEntry *geomGRP = man->Get("GRP/Geometry/Data");
73     if(!geomGRP) AliInfo("GRP geometry not found!!!\n");
74     
75     Int_t gLayer = 0,gLadder = 0, gModule = 0;
76     Int_t gHistCounter = 0;
77     TString gTitle; 
78
79     for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {
80       AliITSgeomTGeo::GetModuleId(iModule,gLayer,gLadder,gModule);
81       gTitle = "SSD_RawSignal_Layer"; gTitle += gLayer;
82       gTitle += "_Ladder"; gTitle += gLadder;
83       gTitle += "_Module"; gTitle += gModule;
84       fHistSSDRawSignalModule[gHistCounter] = new TH1D(gTitle.Data(),gTitle.Data(),
85                                                        2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);
86       gHistCounter += 1;
87       
88       for(Int_t iStrip = 0; iStrip < 2*fgkNumberOfPSideStrips; iStrip++)
89         fOccupancyMatrix[iModule][iStrip] = 0; 
90     }//module loop
91   }//online flag
92   else {
93     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) 
94       fHistSSDRawSignalModule[iModule]=NULL;
95   }
96 }
97
98 //____________________________________________________________________________ 
99 AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm) :
100 TObject(),
101 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
102 fSSDEvent(qadm.fSSDEvent),
103 fSSDEventPerCycle(qadm.fSSDEventPerCycle),
104 fkOnline(qadm.fkOnline),
105 fLDC(qadm.fLDC),
106 fSSDRawsOffset(qadm.fSSDRawsOffset),
107 fSSDRawsCommonLevelOffset(qadm.fSSDRawsCommonLevelOffset),
108 fSSDhTask(qadm.fSSDhTask),
109 fGenOffset(qadm.fGenOffset) {
110   //copy ctor 
111   fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; 
112   fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
113 }
114
115 //__________________________________________________________________
116 AliITSQASSDDataMakerRec& AliITSQASSDDataMakerRec::operator = (const AliITSQASSDDataMakerRec& qac )
117 {
118   // Equal operator.
119   this->~AliITSQASSDDataMakerRec();
120   new(this) AliITSQASSDDataMakerRec(qac);
121   return *this;
122 }
123
124 //__________________________________________________________________
125 AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {
126   // destructor
127   for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
128     if(fHistSSDRawSignalModule[iModule]) delete fHistSSDRawSignalModule[iModule];
129 }
130
131 //____________________________________________________________________________ 
132 void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
133 {
134   //Detector specific actions at start of cycle
135   AliDebug(1,"AliITSQADM::Start of SSD Cycle\n");
136 }
137
138 //____________________________________________________________________________ 
139 void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list)
140 {
141   // launch the QA checking
142   AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); 
143   
144   //online part
145   if(fkOnline) {
146     Int_t gHistPositionOccupancyPerModule = 0;
147     Int_t gLayer = 0, gLadder = 0, gModule = 0;
148     //occupancy per module
149     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
150       AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);
151
152       gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
153       for(Int_t iBins = 1; iBins < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBins++)
154         fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)->SetBinContent(iBins,fOccupancyMatrix[iModule][iBins-1]);
155       
156       if(fSSDEventPerCycle != 0)
157         ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)))->Scale(100./fSSDEventPerCycle);
158     }//module loop
159
160     //occupancy per ladder
161     Int_t gHistPositionOccupancyPerLadder = 0;
162     Int_t lLadderLocationY = 0;
163     Double_t occupancy = 0.0;
164     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
165       AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);
166       
167       gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
168       gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
169       
170       //P-SIDE OCCUPANCY                                                                                            
171       occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerModule),0);
172       fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Fill(gModule,occupancy);
173       lLadderLocationY = 3*gLadder; // sideP=1 sideN=0 
174       if(gLayer == 5)                                                               
175         ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY,occupancy);
176       else if(gLayer == 6)
177         ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY,occupancy);
178
179       //N-SIDE OCCUPANCY                                                                                            
180       occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerModule),1);   
181       fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Fill(gModule,occupancy);
182       if(gLayer == 5)                                                               
183         ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
184       else if(gLayer == 6)
185         ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
186     }//module loop
187   }//online flag for SSD
188
189   fSSDEventPerCycle = 0;
190   
191   AliQAChecker::Instance()->Run( AliQA::kITS , task, list);
192 }
193
194 //____________________________________________________________________________ 
195 void AliITSQASSDDataMakerRec::InitRaws() {  
196   // Initialization for RAW data - SSD -
197     fGenOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries();
198
199   if(fkOnline) {
200     AliInfo("Book Online Histograms for SSD\n");
201   }
202   else {
203     AliInfo("Book Offline Histograms for SSD\n ");
204   }
205   AliInfo(Form("Number of histograms (SPD+SDD): %d\n",fGenOffset));
206   TString gTitle = 0;
207   //book online-offline QA histos
208   TH1F *fHistSSDEventType = new TH1F("fHistSSDEventType",
209                                      ";Event type;Events",
210                                      31,-1,30);
211   fAliITSQADataMakerRec->Add2RawsList(fHistSSDEventType, 
212                                       fGenOffset+fSSDRawsOffset);
213   fSSDRawsOffset += 1;
214   TH1F *fHistSSDDataSize = new TH1F("fHistSSDDataSize",
215                                     ";log(SSD data size) [Bytes];Events",
216                                     100,3,8);
217   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize, 
218                                       fGenOffset+fSSDRawsOffset);
219   fSSDRawsOffset += 1;
220   TH1F *fHistSSDDataSizePercentage = new TH1F("fHistSSDDataSizePercentage",
221                                               ";SSD data size [%];Events",
222                                               100,0,100);
223   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage, 
224                                       fGenOffset+fSSDRawsOffset);
225   fSSDRawsOffset += 1;
226   TH1F *fHistSSDDDLId = new TH1F("fHistSSDDDLId",
227                                  ";DDL id;Events",20,510.5,530.5);
228   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDDLId, 
229                                       fGenOffset+fSSDRawsOffset);
230   fSSDRawsOffset += 1;
231   TH1F *fHistSSDDataSizePerDDL = new TH1F("fHistSSDDataSizePerDDL",
232                                           ";DDL id;<SSD data size> [MB]",
233                                           20,510.5,530.5);
234   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL, 
235                                       fGenOffset+fSSDRawsOffset);
236   fSSDRawsOffset += 1;
237   TH1F *fHistSSDDataSizeDDL[fgkNumOfDDLs];
238   for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {
239     gTitle = "fHistSSDDataSizeDDL"; gTitle += i+511;
240     fHistSSDDataSizeDDL[i-1] = new TH1F(gTitle.Data(),
241                                         ";log(SSD data size) [Bytes];Events",
242                                         100,1,8);
243     fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeDDL[i-1], 
244                                         fGenOffset+fSSDRawsOffset);
245     fSSDRawsOffset += 1;
246   }
247   
248   TH1F *fHistSSDLDCId = new TH1F("fHistSSDLDCId",";LDC id;Events",10,0.5,10.5);
249   fAliITSQADataMakerRec->Add2RawsList(fHistSSDLDCId, 
250                                       fGenOffset+fSSDRawsOffset);
251   fSSDRawsOffset += 1;
252   TH1F *fHistSSDDataSizePerLDC = new TH1F("fHistSSDDataSizePerLDC",
253                                           ";LDC id;<SSD data size> [MB]",
254                                           100,0,20);
255   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC, 
256                                       fGenOffset+fSSDRawsOffset);
257   fSSDRawsOffset += 1;
258   TH1F *fHistSSDDataSizeLDC[fgkNumOfLDCs];
259   for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {
260     gTitle = "fHistSSDDataSizeLDC"; gTitle += i;
261     fHistSSDDataSizeLDC[i-1] = new TH1F(gTitle.Data(),
262                                         ";log(SSD data size) [Bytes];Events",
263                                         100,1,8);
264     fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeLDC[i-1], 
265                                         fGenOffset+fSSDRawsOffset);
266     fSSDRawsOffset += 1;
267   }
268   fSSDRawsCommonLevelOffset = fSSDRawsOffset;
269
270   if(fkOnline) {
271     Int_t gLayer = 0, gLadder = 0, gModule = 0;
272     //occupancy per SSD module
273     TH1D *fHistSSDOccupancyModule[fgkSSDMODULES]; 
274     for(Int_t i = 500; i < fgkSSDMODULES + 500; i++) {
275       AliITSgeomTGeo::GetModuleId(i,gLayer,gLadder,gModule);
276       gTitle = "fHistSSD_Occupancy_Layer"; gTitle += gLayer;
277       gTitle += "_Ladder"; 
278       if(gLayer == 5)
279         gTitle += 499+gLadder;
280       if(gLayer == 6)
281         gTitle += 599+gLadder;
282       gTitle += "_Module"; gTitle += gModule; 
283       fHistSSDOccupancyModule[i-500] = new TH1D(gTitle.Data(),gTitle.Data(),
284                                                 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);
285       fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitleColor(1);
286       fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitle("N_{strip}");
287       fHistSSDOccupancyModule[i-500]->GetYaxis()->SetTitle("Occupancy [%]");
288       fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyModule[i-500], fGenOffset+fSSDRawsOffset);
289       fSSDRawsOffset += 1;
290     }
291
292     //Occupancy per SSD ladder
293     Int_t occupancyCounter = 0;
294     TH1D *fHistSSDOccupancyLadder[2*(fgkSSDLADDERSLAYER5 + fgkSSDLADDERSLAYER6)];
295     for(Int_t iLayer = 5; iLayer < 7; iLayer++) {
296       for(Int_t iLadder = 1; iLadder < AliITSgeomTGeo::GetNLadders(iLayer) + 1; iLadder++) {
297         //P-side occupancy plots
298         gTitle = "fHistSSD_Occupancy_Layer"; gTitle += iLayer;
299         gTitle += "_Ladder"; 
300         if(iLayer == 5)
301           gTitle += 499+iLadder;
302         if(iLayer == 6)
303           gTitle += 599+iLadder;
304         gTitle += "_PSide";
305         fHistSSDOccupancyLadder[occupancyCounter] = new TH1D(gTitle.Data(),
306                                                              gTitle.Data(),
307                                                              AliITSgeomTGeo::GetNDetectors(iLayer),
308                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
309         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
310         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitle("Module number");
311         fHistSSDOccupancyLadder[occupancyCounter]->GetYaxis()->SetTitle("Occupancy [%]");
312         fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], 
313                                             fGenOffset+fSSDRawsOffset);
314         occupancyCounter += 1; fSSDRawsOffset += 1;
315         //N-side occupancy plots
316         gTitle = "fHistSSD_Occupancy_Layer"; gTitle += iLayer;
317         gTitle += "_Ladder"; 
318         if(iLayer == 5)
319           gTitle += 499+iLadder;
320         if(iLayer == 6)
321           gTitle += 599+iLadder;
322         gTitle += "_NSide";
323         fHistSSDOccupancyLadder[occupancyCounter] = new TH1D(gTitle.Data(),
324                                                              gTitle.Data(),
325                                                              AliITSgeomTGeo::GetNDetectors(iLayer),
326                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
327         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
328         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitle("Module number");
329         fHistSSDOccupancyLadder[occupancyCounter]->GetYaxis()->SetTitle("Occupancy [%]");
330         fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], 
331                                             fGenOffset+fSSDRawsOffset);
332         occupancyCounter += 1; fSSDRawsOffset += 1;
333       }//ladder loop
334     }//layer loop
335
336     //top level occupancy plots
337     TH2D *fHistSSDOccupancyLayer5 = new TH2D("fHistSSDOccupancyLayer5",
338                                              ";N_{modules};N_{Ladders}",
339                                              fgkSSDMODULESPERLADDERLAYER5,
340                                              0,fgkSSDMODULESPERLADDERLAYER5,
341                                              3*fgkSSDLADDERSLAYER5,
342                                              0,fgkSSDLADDERSLAYER5);  
343     Char_t fLabel[3];
344     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
345       sprintf(fLabel,"%d",iBin);
346       fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
347     }
348     fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer5, fGenOffset+fSSDRawsOffset);
349     fSSDRawsOffset += 1;
350     TH2D *fHistSSDOccupancyLayer6 = new TH2D("fHistSSDOccupancyLayer6",
351                                              ";N_{modules};N_{Ladders}",
352                                              fgkSSDMODULESPERLADDERLAYER6,
353                                              0,fgkSSDMODULESPERLADDERLAYER6,
354                                              3*fgkSSDLADDERSLAYER6,
355                                              0,fgkSSDLADDERSLAYER6);
356     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
357       sprintf(fLabel,"%d",iBin);
358       fHistSSDOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
359     }
360     fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer6, fGenOffset+fSSDRawsOffset);
361     fSSDRawsOffset += 1;
362   }//online flag
363   fSSDhTask = fSSDRawsOffset;
364   AliDebug(1,Form("%d SSD Raws histograms booked\n",fSSDhTask));
365   AliInfo(Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenOffset+fSSDhTask));  
366   AliDebug(1,Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenOffset+fSSDRawsOffset));
367 }
368
369 //____________________________________________________________________________
370 void AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) { 
371   // Fill QA for RAW - SSD -
372   Int_t gStripNumber;
373   Int_t gHistPosition;
374   Int_t gLayer = 0,gLadder = 0, gModule = 0;
375   
376   Double_t gSizePerDDL[fgkNumOfDDLs] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
377   Double_t gSizePerLDC[fgkNumOfLDCs] = {0.,0.,0.};
378   Double_t sumSSDDataSize = 0.0;
379   Double_t eventSize = -1.0;
380
381   if(fkOnline) {
382     //reset the signal vs strip number histograms
383     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
384       fHistSSDRawSignalModule[iModule]->Reset();
385   }//online flag
386
387   rawReader->Select("ITSSSD",-1,-1);  
388   rawReader->Reset(); //rawReader->NextEvent();   
389   (fAliITSQADataMakerRec->GetRawsData(fGenOffset))->Fill(rawReader->GetType());
390   if(rawReader->GetType() == 7) {
391     fSSDEvent += 1;
392     fSSDEventPerCycle += 1;
393   }
394
395   AliITSRawStreamSSD gSSDStream(rawReader);    
396   AliRawReaderRoot *rootReader = (AliRawReaderRoot *)rawReader;
397   if(rootReader) {
398     const AliRawEventHeaderBase *header = rootReader->GetEventHeader();
399     if(header)
400       eventSize = header->GetEventSize();
401   }
402   while (gSSDStream.Next()) {
403     if(gSSDStream.GetModuleID() < 0) continue;
404     gSizePerDDL[rawReader->GetDDLID()] = rawReader->GetDataSize();
405     gSizePerLDC[rawReader->GetLDCId()-6] = rawReader->GetDataSize();
406     AliITSgeomTGeo::GetModuleId(gSSDStream.GetModuleID(),gLayer,gLadder,gModule);
407     gStripNumber = (gSSDStream.GetSideFlag() == 0) ? gSSDStream.GetStrip() : gSSDStream.GetStrip() + fgkNumberOfPSideStrips;
408     gHistPosition = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
409     //AliInfo(Form("ModulePosition: %d - Layer: %d - Ladder: %d - Module: %d\n",gHistPosition,gLayer,gLadder,gModule));
410     if(fkOnline)
411       fHistSSDRawSignalModule[gHistPosition]->Fill(gStripNumber,gSSDStream.GetSignal());
412     //fAliITSQADataMakerRec->GetRawsData(fGenOffset+gHistPosition+fSSDRawsCommonLevelOffset)->Fill(gStripNumber,gSSDStream.GetSignal());
413   }//streamer loop   
414   
415   //event size calculation and filling info
416   for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
417     sumSSDDataSize += gSizePerDDL[i];
418     if(gSizePerDDL[i] > 0) {
419       (fAliITSQADataMakerRec->GetRawsData(fGenOffset+3))->Fill(i+512);
420       (fAliITSQADataMakerRec->GetRawsData(fGenOffset+5+i))->Fill(TMath::Log10(gSizePerDDL[i]));
421     }
422     (fAliITSQADataMakerRec->GetRawsData(fGenOffset+4))->Fill(i+512,gSizePerDDL[i]/1e+06);
423   }
424   for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
425     if(gSizePerLDC[i] > 0) {
426       (fAliITSQADataMakerRec->GetRawsData(fGenOffset+21))->Fill(i+6);
427       (fAliITSQADataMakerRec->GetRawsData(fGenOffset+23+i))->Fill(TMath::Log10(gSizePerLDC[i]));
428     }
429     (fAliITSQADataMakerRec->GetRawsData(fGenOffset+22))->Fill(i+6,gSizePerLDC[i]/1e+06);
430   }
431   if(sumSSDDataSize) 
432     (fAliITSQADataMakerRec->GetRawsData(fGenOffset+1))->Fill(TMath::Log10(sumSSDDataSize));
433   if(eventSize)
434     (fAliITSQADataMakerRec->GetRawsData(fGenOffset+2))->Fill(100.*sumSSDDataSize/eventSize);
435
436   //Occupancy calculation
437   if(fkOnline) {
438     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
439       GetOccupancyStrip(fHistSSDRawSignalModule[iModule],fOccupancyMatrix[iModule]);
440   }//online flag for SSD
441 }
442
443 //____________________________________________________________________________ //
444 Double_t AliITSQASSDDataMakerRec::GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix) { 
445   //Increments the entries in the occupancy matrix based 
446   //on whether the signal for each strip is larger than the cutoff
447   //Currently the cutoff is at 0 which means that if ZS
448   //works, whatever comes from the FEROM is considered as "signal"
449   Double_t cutoff = 0.0;
450   for(Int_t iBin = 1; iBin < lHisto->GetXaxis()->GetNbins(); iBin++) {
451     Double_t y = lHisto->GetBinContent(iBin);
452     if(y > cutoff) {
453       occupancyMatrix[iBin-1] += 1;
454       //cout<<"Event: "<<iEvent<<" - Strip: "<<i<<" - Signal: "<<fRawSignal->GetBinContent(i)<<                              
455       //" - Occupancy: "<<fOccupancy[i-1]<<endl;                                                                  
456     }
457   }
458 }
459
460 //____________________________________________________________________________ 
461 Double_t AliITSQASSDDataMakerRec::GetOccupancyModule(TH1 *lHisto, Int_t stripside) { 
462   // bo: TDC >0 or # of sigmas wrt noise ?
463   //stripside == 0 --> P-side
464   //stripside == 1 --> N-side
465   Int_t lNumFiredBins = 0;
466   for(Int_t iBin = 1 + stripside*fgkNumberOfPSideStrips; iBin < fgkNumberOfPSideStrips*(1 + stripside); iBin++){
467     if (lHisto->GetBinContent(iBin) > 0)
468       lNumFiredBins++; 
469   }
470   
471   Double_t lOccupancy = (100.*lNumFiredBins)/fgkNumberOfPSideStrips; // percentage
472   //AliInfo(Form("Fired strips: %d - Total strips: %d - Occupancy :%lf\n",lNumFiredBins,lHisto->GetNbinsX(),lOccupancy));
473   
474   return lOccupancy;
475 }
476
477 //____________________________________________________________________________ 
478 void AliITSQASSDDataMakerRec::InitRecPoints()
479 {
480   // Initialization for RECPOINTS - SSD -
481  
482   fGenOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries();
483   Int_t nModuleOffset = 500;
484   Int_t nITSTotalModules = AliITSgeomTGeo::GetNModules();
485
486   TH1F *fHistModuleIdLayer5 = new TH1F("fHistModuleIdLayer5",
487                                        "Module Id - Layer 5;Module Id;Entries",
488                                        fgkSSDMODULESLAYER5,
489                                        nModuleOffset - 0.5,
490                                        nITSTotalModules-fgkSSDMODULESLAYER6+0.5);
491   fAliITSQADataMakerRec->Add2RecPointsList(fHistModuleIdLayer5, 
492                                            fGenOffset + 0);
493   fSSDhTask += 1;
494   TH1F *fHistModuleIdLayer6 = new TH1F("fHistModuleIdLayer6",
495                                        "Module Id - Layer 6;Module Id;Entries",
496                                        fgkSSDMODULESLAYER6,
497                                        nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,
498                                        nITSTotalModules + 0.5);
499   fAliITSQADataMakerRec->Add2RecPointsList(fHistModuleIdLayer6, 
500                                            fGenOffset + 1);
501   fSSDhTask += 1;
502   TH1F *fHistClusterPerEventLayer5 = new TH1F("fHistClusterPerEventLayer5",
503                                               "N_{clusters} - Layer 5;N_{clusters};Entries;",
504                                               100,0.1,5000);
505   fAliITSQADataMakerRec->Add2RecPointsList(fHistClusterPerEventLayer5,
506                                            fGenOffset + 2);
507   fSSDhTask += 1;
508   TH1F *fHistClusterPerEventLayer6 = new TH1F("fHistClusterPerEventLayer6",
509                                               "N_{clusters} - Layer 6;N_{clusters};Entries;",
510                                               100,0.1,5000);
511   fAliITSQADataMakerRec->Add2RecPointsList(fHistClusterPerEventLayer6,
512                                            fGenOffset + 3);
513   fSSDhTask += 1;
514   TH1F *fHistLocalXLayer5 = new TH1F("fHistLocalXLayer5",
515                                      "Local x coord.- Layer 5;x [cm];Entries;",
516                                      100,-4.,4.);
517   fAliITSQADataMakerRec->Add2RecPointsList(fHistLocalXLayer5,
518                                            fGenOffset + 4);
519   fSSDhTask += 1;
520   TH1F *fHistLocalXLayer6 = new TH1F("fHistLocalXLayer6",
521                                      "Local x coord.- Layer 6;x [cm];Entries;",
522                                      100,-4.,4.);
523   fAliITSQADataMakerRec->Add2RecPointsList(fHistLocalXLayer6, 
524                                            fGenOffset + 5);
525   fSSDhTask += 1;
526   TH1F *fHistLocalZLayer5 = new TH1F("fHistLocalZLayer5",
527                                      "Local z coord.- Layer 5;z [cm];Entries;",
528                                      100,-4.,4.);
529   fAliITSQADataMakerRec->Add2RecPointsList(fHistLocalZLayer5, 
530                                            fGenOffset + 6);
531   fSSDhTask += 1;
532   TH1F *fHistLocalZLayer6 = new TH1F("fHistLocalZLayer6",
533                                      "Local z coord.- Layer 6;z [cm];Entries;",
534                                      100,-4.,4.);
535   fAliITSQADataMakerRec->Add2RecPointsList(fHistLocalZLayer6, 
536                                            fGenOffset + 7);
537   fSSDhTask += 1;
538   TH1F *fHistGlobalXLayer5 = new TH1F("fHistGlobalXLayer5",
539                                       "Global x - Layer 5;x [cm];Entries;",
540                                       100,-40.,40.);
541   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalXLayer5, 
542                                            fGenOffset + 8);
543   fSSDhTask += 1;
544   TH1F *fHistGlobalXLayer6 = new TH1F("fHistGlobalXLayer6",
545                                       "Global x - Layer 6;x [cm];Entries;",
546                                       100,-45.,45.);
547   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalXLayer6, 
548                                            fGenOffset + 9);
549   fSSDhTask += 1;
550   TH1F *fHistGlobalYLayer5 = new TH1F("fHistGlobalYLayer5",
551                                       "Global y - Layer 5;y [cm];Entries;",
552                                       100,-40.,40);
553   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalYLayer5, 
554                                            fGenOffset + 10);
555   fSSDhTask += 1;
556   TH1F *fHistGlobalYLayer6 = new TH1F("fHistGlobalYLayer6",
557                                       "Global y - Layer 6;y [cm];Entries;",
558                                       100,-45.,45.);
559   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalYLayer6, 
560                                            fGenOffset + 11);
561   fSSDhTask += 1;
562   TH1F *fHistGlobalZLayer5 = new TH1F("fHistGlobalZLayer5",
563                                       "Global z - Layer 5;z [cm];Entries;",
564                                       100,-45.,45);
565   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalZLayer5, 
566                                            fGenOffset + 12);
567   fSSDhTask += 1;
568   TH1F *fHistGlobalZLayer6 = new TH1F("fHistGlobalZLayer6",
569                                       "Global z - Layer 6;z [cm];Entries;",
570                                       100,-55.,55.);
571   fAliITSQADataMakerRec->Add2RecPointsList(fHistGlobalZLayer6, 
572                                            fGenOffset + 13);
573   fSSDhTask += 1;
574   TH1F *fHistPhiLayer5 = new TH1F("fHistPhiLayer5",
575                                   "#phi - Layer 5;#phi [rad];Entries;",
576                                   100,-TMath::Pi(),TMath::Pi());
577   fAliITSQADataMakerRec->Add2RecPointsList(fHistPhiLayer5, 
578                                            fGenOffset + 14);
579   fSSDhTask += 1;
580   TH1F *fHistPhiLayer6 = new TH1F("fHistPhiLayer6",
581                                   "#phi - Layer 6;#phi [rad];Entries;",
582                                   100,-TMath::Pi(),TMath::Pi());
583   fAliITSQADataMakerRec->Add2RecPointsList(fHistPhiLayer6, 
584                                            fGenOffset + 15);
585   fSSDhTask += 1;
586   TH1F *fHistThetaLayer5 = new TH1F("fHistThetaLayer5",
587                                     "#theta - Layer 5;#theta [rad];Entries;",
588                                     100,-TMath::Pi(),TMath::Pi());
589   fAliITSQADataMakerRec->Add2RecPointsList(fHistThetaLayer5, 
590                                            fGenOffset + 16);
591   fSSDhTask += 1;
592   TH1F *fHistThetaLayer6 = new TH1F("fHistThetaLayer6",
593                                     "#theta - Layer 6;#theta [rad];Entries;",
594                                     100,-TMath::Pi(),TMath::Pi());
595   fAliITSQADataMakerRec->Add2RecPointsList(fHistThetaLayer6, 
596                                            fGenOffset + 17);
597   fSSDhTask += 1;
598   TH1F *fHistRadiusLayer5 = new TH1F("fHistRadiusLayer5",
599                                      "r - Layer 5;r [cm];Entries;",
600                                      100,35.,50.);
601   fAliITSQADataMakerRec->Add2RecPointsList(fHistRadiusLayer5, 
602                                            fGenOffset + 18);
603   fSSDhTask += 1;
604   TH1F *fHistRadiusLayer6 = new TH1F("fHistRadiusLayer6",
605                                      "r - Layer 6;r [cm];Entries;",
606                                      100,35.,50.);
607   fAliITSQADataMakerRec->Add2RecPointsList(fHistRadiusLayer6, 
608                                            fGenOffset + 19);
609   fSSDhTask += 1;
610   TH1F *fHistClusterTypeLayer5 = new TH1F("fHistClusterTypeLayer5",
611                                           "CL type - Layer 5;Cluster type;Entries;",
612                                           150,0,150);
613   fAliITSQADataMakerRec->Add2RecPointsList(fHistClusterTypeLayer5, 
614                                            fGenOffset + 20);
615   fSSDhTask += 1;
616   TH1F *fHistClusterTypeLayer6 = new TH1F("fHistClusterTypeLayer6",
617                                           "CL type - Layer 6;Cluster type;Entries;",
618                                           150,0,150);
619   fAliITSQADataMakerRec->Add2RecPointsList(fHistClusterTypeLayer6, 
620                                            fGenOffset + 21);
621   fSSDhTask += 1;
622   TH1F *fHistChargeRatioLayer5 = new TH1F("fHistChargeRatioLayer5",
623                                           "Charge ratio - Layer 5;q_{ratio};Entries;",
624                                           100,-2.0,2.0);
625   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeRatioLayer5, 
626                                            fGenOffset + 22);
627   fSSDhTask += 1;
628   TH1F *fHistChargeRatioLayer6 = new TH1F("fHistChargeRatioLayer6",
629                                           "Charge ratio - Layer 6;q_{ratio};Entries;",
630                                           100,-2.0,2.0);
631   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeRatioLayer6, 
632                                            fGenOffset + 23);
633   fSSDhTask += 1;
634   TH1F *fHistChargekeVLayer5 = new TH1F("fHistChargekeVLayer5",
635                                         "Charge - Layer 5;q [keV];Entries;",
636                                         100,0.,300.);
637   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargekeVLayer5, 
638                                            fGenOffset + 24);
639   fSSDhTask += 1;
640   TH1F *fHistChargekeVLayer6 = new TH1F("fHistChargekeVLayer6",
641                                         "Charge - Layer 6;q [keV];Entries;",
642                                         100,0.,300.);
643   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargekeVLayer6, 
644                                            fGenOffset + 25);
645   fSSDhTask += 1;
646   TH1F *fHistChargePSideLayer5 = new TH1F("fHistChargePSideLayer5",
647                                           "Charge P- Layer 5;q_{P} [keV];Entries;",
648                                           100,0.,300.);
649   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargePSideLayer5,
650                                            fGenOffset + 26);
651   fSSDhTask += 1;
652   TH1F *fHistChargePSideLayer6 = new TH1F("fHistChargePSideLayer6",
653                                           "Charge P- Layer 6;q_{P} [keV];Entries;",
654                                           100,0.,300.);
655   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargePSideLayer6,
656                                            fGenOffset + 27);
657   fSSDhTask += 1;
658   TH1F *fHistChargeNSideLayer5 = new TH1F("fHistChargeNSideLayer5",
659                                           "Charge N- Layer 5;q_{N} [keV];Entries;",
660                                           100,0.,300.);
661   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeNSideLayer5,
662                                            fGenOffset + 28);
663   fSSDhTask += 1;
664   TH1F *fHistChargeNSideLayer6 = new TH1F("fHistChargeNSideLayer6",
665                                           "Charge N- Layer 6;q_{N} [keV];Entries;",
666                                           100,0.,300.);
667   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeNSideLayer6,
668                                            fGenOffset + 29);
669   fSSDhTask += 1;
670   TH1F *fHistChargeRatio2Layer5 = new TH1F("fHistChargeRatio2Layer5",
671                                           "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",
672                                           100,0,2);
673   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeRatio2Layer5,
674                                            fGenOffset + 30);
675   fSSDhTask += 1;
676   TH1F *fHistChargeRatio2Layer6 = new TH1F("fHistChargeRatio2Layer6",
677                                            "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",
678                                            100,0,2);
679   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeRatio2Layer6,
680                                            fGenOffset + 31);
681   fSSDhTask += 1;
682   TH2F *fHistChargePNSideLayer5 = new TH2F("fHistChargePNSideLayer5",
683                                            "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",
684                                            100,0.,300.,
685                                            100,0.,300.);
686   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargePNSideLayer5,
687                                            fGenOffset + 32);
688   fSSDhTask += 1;
689   TH2F *fHistChargePNSideLayer6 = new TH2F("fHistChargePNSideLayer6",
690                                            "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",
691                                            100,0.,300.,
692                                            100,0.,300.);
693   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargePNSideLayer6,
694                                            fGenOffset + 33);
695   fSSDhTask += 1;
696   TH2F *fHistChargeMapLayer5 = new TH2F("fHistChargeMapLayer5",
697                                         "Charge map;N_{modules};N_{Ladders}",
698                                         fgkSSDMODULESPERLADDERLAYER5,
699                                         -0.5,fgkSSDMODULESPERLADDERLAYER5+0.5,
700                                         3*fgkSSDLADDERSLAYER5,
701                                         -0.5,fgkSSDLADDERSLAYER5+0.5);
702   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeMapLayer5, 
703                                            fGenOffset + 34);
704   fSSDhTask += 1;
705   TH2F *fHistChargeMapLayer6 = new TH2F("fHistChargeMapLayer6",
706                                         "Charge map;N_{modules};N_{Ladders}",
707                                         fgkSSDMODULESPERLADDERLAYER6,
708                                         -0.5,fgkSSDMODULESPERLADDERLAYER6+0.5,
709                                         3*fgkSSDLADDERSLAYER6,
710                                         -0.5,fgkSSDLADDERSLAYER6+0.5);
711   fAliITSQADataMakerRec->Add2RecPointsList(fHistChargeMapLayer6, 
712                                            fGenOffset + 35);
713   fSSDhTask += 1;
714
715   AliDebug(1,Form("%d SSD Recs histograms booked\n",fSSDhTask));
716 }
717
718 //____________________________________________________________________________ 
719 void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
720 {
721   // Fill QA for recpoints - SSD -
722
723   Int_t gLayer = 0, gLadder = 0, gModule = 0;
724   Int_t lLadderLocationY = 0;
725   TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
726   if (!branchRecP) { 
727     AliError("can't get the branch with the ITS clusters !");
728     return;
729   }
730   static TClonesArray statRecpoints("AliITSRecPoint");
731   TClonesArray *recpoints = &statRecpoints;
732   branchRecP->SetAddress(&recpoints);
733   Int_t nClustersLayer5 = 0, nClustersLayer6 = 0;
734   Int_t npoints = 0;      
735   Float_t cluglo[3]={0.,0.,0.}; 
736   for(Int_t module = 0; module < clustersTree->GetEntries(); module++){
737     branchRecP->GetEvent(module);
738     npoints += recpoints->GetEntries();
739     AliITSgeomTGeo::GetModuleId(module,gLayer,gLadder,gModule);
740     lLadderLocationY = 3*gLadder;
741
742     for(Int_t j = 0;j < recpoints->GetEntries(); j++){
743       AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);    
744       Int_t layer = recp->GetLayer();
745       recp->GetGlobalXYZ(cluglo);
746       Float_t radius = TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); 
747       Float_t phi = TMath::ATan2(cluglo[1],cluglo[0]);
748       Float_t theta = TMath::ATan2(radius,cluglo[2]);
749       Double_t chargeRatio = recp->GetChargeRatio();
750       Double_t clusterCharge = recp->GetQ();
751       Double_t chargePSide = clusterCharge*(1. + chargeRatio);
752       Double_t chargeNSide = clusterCharge*(1. - chargeRatio);
753       if(layer == 4) {
754         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 0)->Fill(module);
755         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 4)->Fill(recp->GetDetLocalX());
756         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 6)->Fill(recp->GetDetLocalZ());
757         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 8)->Fill(cluglo[0]);
758         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 10)->Fill(cluglo[1]);
759         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 12)->Fill(cluglo[2]);
760         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 14)->Fill(phi);
761         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 16)->Fill(theta);
762         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 18)->Fill(radius);
763         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 20)->Fill(recp->GetType());
764         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 22)->Fill(recp->GetChargeRatio());
765         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 24)->Fill(recp->GetQ());
766         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 26)->Fill(chargePSide);
767         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 28)->Fill(chargeNSide);
768         if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 30)->Fill(chargeNSide/chargePSide);
769         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 32)->Fill(chargePSide,chargeNSide);
770         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 34)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
771         nClustersLayer5 += 1;
772       }//layer 5 histograms
773       if(layer == 5) {
774         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 1)->Fill(module);
775         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 5)->Fill(recp->GetDetLocalX());
776         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 7)->Fill(recp->GetDetLocalZ());
777         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 9)->Fill(cluglo[0]);
778         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 11)->Fill(cluglo[1]);
779         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 13)->Fill(cluglo[2]);
780         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 15)->Fill(phi);
781         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 17)->Fill(theta);
782         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 19)->Fill(radius);
783         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 21)->Fill(recp->GetType());
784         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 23)->Fill(recp->GetChargeRatio());
785         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 25)->Fill(recp->GetQ());
786         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 27)->Fill(chargePSide);
787         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 29)->Fill(chargeNSide);
788         if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 31)->Fill(chargeNSide/chargePSide);
789         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 33)->Fill(chargePSide,chargeNSide);
790         fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 35)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
791         nClustersLayer6 += 1;
792       }//layer 6 histograms
793     }//rec. points loop
794   }//module loop
795
796   fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 2)->Fill(nClustersLayer5);
797   fAliITSQADataMakerRec->GetRecPointsData(fGenOffset + 3)->Fill(nClustersLayer6);
798
799   statRecpoints.Clear();
800 }
801