Another histos for lumi
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDDataMakerRec.cxx
1 /**************************************************************************\r
2  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *\r
3  *                                                                        *\r
4  * Author: The ALICE Off-line Project.                                    *\r
5  * Contributors are mentioned in the code where appropriate.              *\r
6  *                                                                        *\r
7  * Permission to use, copy, modify and distribute this software and its   *\r
8  * documentation strictly for non-commercial purposes is hereby granted   *\r
9  * without fee, provided that the above copyright notice appears in all   *\r
10  * copies and that both the copyright notice and this permission notice   *\r
11  * appear in the supporting documentation. The authors make no claims     *\r
12  * about the suitability of this software for any purpose. It is          *\r
13  * provided "as is" without express or implied warranty.                  *\r
14  **************************************************************************/\r
15 /* $Id$    */\r
16 //  *************************************************************\r
17 //  Checks the quality assurance \r
18 //  by comparing with reference data\r
19 //  contained in a DB\r
20 //  -------------------------------------------------------------\r
21 //  W. Ferrarese + P. Cerello Feb 2008\r
22 //  INFN Torino\r
23 \r
24 // --- ROOT system ---\r
25 #include <TH2F.h>\r
26 #include <TTree.h>\r
27 #include <TMath.h>\r
28 #include <TString.h>\r
29 #include <TSystem.h>\r
30 \r
31 // --- Standard library ---\r
32 \r
33 // --- AliRoot header files ---\r
34 #include "AliITSQADataMakerRec.h"\r
35 #include "AliITSQASSDDataMakerRec.h"\r
36 #include "AliQADataMakerRec.h"\r
37 #include "AliLog.h"\r
38 #include "AliQAv1.h"\r
39 #include "AliQAChecker.h"\r
40 #include "AliRawReader.h"\r
41 #include "AliRawReaderRoot.h"\r
42 #include "AliITSRawStreamSSD.h"\r
43 #include "AliITSgeomTGeo.h"\r
44 #include "AliRawEventHeaderBase.h"\r
45 #include "AliITSRecPoint.h"\r
46 #include "AliITSRecPointContainer.h"\r
47 #include "AliITSdigitSSD.h"\r
48 #include "AliITSBadChannelsSSDv2.h"\r
49 \r
50 #include "AliCDBManager.h"\r
51 #include "AliCDBEntry.h"\r
52 \r
53 ClassImp(AliITSQASSDDataMakerRec)\r
54 \r
55 AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Int_t ldc) :\r
56 TObject(),\r
57   fAliITSQADataMakerRec(aliITSQADataMakerRec),\r
58   fkOnline(kMode),\r
59   fLDC(ldc),\r
60   fSSDRawsOffset(0), fSSDRawsDAOffset(0),\r
61   fSSDRawsCommonLevelOffset(0),\r
62   fSSDhRawsTask(0),\r
63   fSSDhDigitsTask(0),\r
64   fSSDhRecPointsTask(0),\r
65   fGenRawsOffset(0),\r
66   fGenDigitsOffset(0),\r
67   fGenRecPointsOffset(0),\r
68   fCDBManager(0) {\r
69   // Default constructor   \r
70   //initilize the raw signal vs strip number histograms\r
71   fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];\r
72   fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];\r
73   fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies];\r
74   for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {\r
75     fGenRawsOffset[i] = 0;\r
76     fGenRecPointsOffset[i] = 0;\r
77     fGenDigitsOffset[i]=0;\r
78   }\r
79   if(fkOnline) {\r
80     fCDBManager = AliCDBManager::Instance();\r
81     //fCDBManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");\r
82     fCDBManager->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));\r
83 \r
84     Int_t runNumber = 1;\r
85     if(!gSystem->Getenv("DATE_RUN_NUMBER")) {\r
86       AliWarning("DATE_RUN_NUMBER not defined!!!\n"); }\r
87     else {\r
88       runNumber = atoi(gSystem->Getenv("DATE_RUN_NUMBER"));}\r
89     fCDBManager->SetRun(runNumber);\r
90     AliCDBEntry *geomGRP = fCDBManager->Get("GRP/Geometry/Data");\r
91     if(!geomGRP) AliWarning("GRP geometry not found!!!\n");\r
92     \r
93     Int_t gLayer = 0,gLadder = 0, gModule = 0;\r
94     Int_t gHistCounterRawSignal = 0, gHistCounterCM = 0;\r
95     TString gTitle; \r
96 \r
97     for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {\r
98       AliITSgeomTGeo::GetModuleId(iModule,gLayer,gLadder,gModule);\r
99       gTitle = "SSD_RawSignal_Layer"; gTitle += gLayer;\r
100       gTitle += "_Ladder"; gTitle += gLadder;\r
101       gTitle += "_Module"; gTitle += gModule;\r
102       fHistSSDRawSignalModule[gHistCounterRawSignal] = new TH1F(gTitle.Data(),gTitle.Data(),\r
103                                                                 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);\r
104       gHistCounterRawSignal += 1;\r
105       \r
106       for(Int_t iStrip = 0; iStrip < 2*fgkNumberOfPSideStrips; iStrip++)\r
107         fOccupancyMatrix[iModule-500][iStrip] = 0; \r
108 \r
109       //CM histograms\r
110       gTitle = "SSD_CM_PSide_Layer"; gTitle += gLayer;\r
111       gTitle += "_Ladder"; gTitle += gLadder;\r
112       gTitle += "_Module"; gTitle += gModule;\r
113       fHistSSDCMModule[gHistCounterCM] = new TH1F(gTitle.Data(),gTitle.Data(),\r
114                                                   100,-50.,50.);\r
115       fHistSSDCMModule[gHistCounterCM]->GetXaxis()->SetTitle("CM");\r
116       gHistCounterCM += 1;\r
117     }//module loop\r
118 \r
119     for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {\r
120       AliITSgeomTGeo::GetModuleId(iModule,gLayer,gLadder,gModule);\r
121       gTitle = "SSD_CM_NSide_Layer"; gTitle += gLayer;\r
122       gTitle += "_Ladder"; gTitle += gLadder;\r
123       gTitle += "_Module"; gTitle += gModule;\r
124       fHistSSDCMModule[gHistCounterCM] = new TH1F(gTitle.Data(),gTitle.Data(),\r
125                                                   100,-50.,50.);\r
126       fHistSSDCMModule[gHistCounterCM]->GetXaxis()->SetTitle("CM");\r
127       gHistCounterCM += 1;\r
128 \r
129     }\r
130   }//online flag\r
131   else {\r
132     fCDBManager = NULL;\r
133     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
134       fHistSSDCMModule[iModule] = NULL;\r
135       fHistSSDCMModule[fgkSSDMODULES+iModule] = NULL;\r
136       fHistSSDRawSignalModule[iModule] = NULL;\r
137     }\r
138   }\r
139 }\r
140 /*\r
141 //____________________________________________________________________________ \r
142 AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm) :\r
143 TObject(),\r
144 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),\r
145 fkOnline(qadm.fkOnline),\r
146 fLDC(qadm.fLDC),\r
147 fSSDRawsOffset(qadm.fSSDRawsOffset), fSSDRawsDAOffset(qadm.fSSDRawsDAOffset),\r
148 fSSDRawsCommonLevelOffset(qadm.fSSDRawsCommonLevelOffset),\r
149 fSSDhRawsTask(qadm.fSSDhRawsTask),\r
150 fSSDhDigitsTask(qadm.fSSDhDigitsTask),\r
151 fSSDhRecPointsTask(qadm.fSSDhRecPointsTask),\r
152 fGenRawsOffset(qadm.fGenRawsOffset),\r
153 fGenDigitsOffset(qadm.fGenDigitsOffset),\r
154 fGenRecPointsOffset(qadm.fGenRecPointsOffset),\r
155 fCDBManager(qadm.fCDBManager) {\r
156 //copy ctor \r
157 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; \r
158 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());\r
159 }\r
160 \r
161 //__________________________________________________________________\r
162 AliITSQASSDDataMakerRec& AliITSQASSDDataMakerRec::operator = (const AliITSQASSDDataMakerRec& qac )\r
163 {\r
164 // Equal operator.\r
165 this->~AliITSQASSDDataMakerRec();\r
166 new(this) AliITSQASSDDataMakerRec(qac);\r
167 return *this;\r
168 }\r
169 */\r
170 //__________________________________________________________________\r
171 AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {\r
172   // destructor\r
173   if(fkOnline) {\r
174     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
175       if(fHistSSDRawSignalModule[iModule]) delete fHistSSDRawSignalModule[iModule];\r
176       if(fHistSSDCMModule[iModule]) delete fHistSSDCMModule[iModule];\r
177       if(fHistSSDCMModule[fgkSSDMODULES+iModule]) delete fHistSSDCMModule[fgkSSDMODULES+iModule];\r
178     }\r
179     \r
180     if(fCDBManager) delete fCDBManager;\r
181   }\r
182 }\r
183 \r
184 //____________________________________________________________________________ \r
185 void AliITSQASSDDataMakerRec::StartOfDetectorCycle()\r
186 {\r
187   // start of detector cycle\r
188 \r
189   if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return;\r
190 \r
191   //if ( fAliITSQADataMakerRec->GetRawsData(0) == NULL ) // Raws not defined\r
192   //return ;\r
193  \r
194   //for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
195   //if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
196   //cout << "StartOfDetectorCycle: Event specie " << specie << " is set" << endl;\r
197 \r
198   //Detector specific actions at start of cycle\r
199   AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SSD Cycle\n");\r
200   //Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
201 \r
202   //}//event specie loop\r
203 \r
204 }\r
205 \r
206 //____________________________________________________________________________ \r
207 void AliITSQASSDDataMakerRec::ResetRawsMonitoredObjects() \r
208 {\r
209   //Resetting the raw data monitored objects\r
210   //Data size per DDL\r
211   //for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
212   //if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
213   /*((TH1F *)(fAliITSQADataMakerRec->ResetRawsData(fGenRawsOffset[specie]+4)));\r
214   //Data size per LDC\r
215   ((TH1F *)(fAliITSQADataMakerRec->ResetRawsData(fGenRawsOffset[specie]+22)));*/\r
216   Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
217   //cout << "(AliITSQASSDDataMakerRec::ResetRawsMonitoredObjects): Event specie " << specie << " is set" << endl;\r
218   //online part\r
219   if(fkOnline) {\r
220     for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {\r
221       for(Int_t iStrip = 0; iStrip < 2*fgkNumberOfPSideStrips; iStrip++)\r
222         fOccupancyMatrix[iModule-500][iStrip] = 0;\r
223     }//module loop\r
224     \r
225     //for(Int_t iSSDOffset = 0; iSSDOffset < fSSDRawsCommonLevelOffset; iSSDOffset++)\r
226     //(fAliITSQADataMakerRec->ResetRawsData(fGenRawsOffset[specie]+iSSDOffset));\r
227     //for(Int_t iSSDOffset = fSSDRawsCommonLevelOffset; iSSDOffset < fSSDRawsOffset; iSSDOffset++)\r
228     //(fAliITSQADataMakerRec->ResetRawsData(fGenRawsOffset[specie]+iSSDOffset));\r
229 \r
230     Int_t gHistPositionOccupancyPerLadder = 0;\r
231     Int_t gLayer = 0, gLadder = 0, gModule = 0;\r
232     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
233       AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);\r
234       \r
235       gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);\r
236       \r
237       //P-SIDE OCCUPANCY\r
238       int offs = fGenRawsOffset[specie]+fSSDRawsCommonLevelOffset+fgkSSDMODULES;\r
239       fAliITSQADataMakerRec->ResetRawsData(offs+gHistPositionOccupancyPerLadder);\r
240       //N-SIDE OCCUPANCY\r
241       fAliITSQADataMakerRec->ResetRawsData(offs+gHistPositionOccupancyPerLadder+1);\r
242       //\r
243       fAliITSQADataMakerRec->ResetRawsData(offs+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6);\r
244       fAliITSQADataMakerRec->ResetRawsData(offs+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1);\r
245     }//module loop\r
246   }//online flag\r
247   //\r
248 }\r
249 \r
250 //____________________________________________________________________________ \r
251 void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** /*list*/)\r
252 {\r
253   // finalize ssd cycle\r
254   //\r
255   Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
256   //cout << "(AliITSQASSDDataMakerRec::EndOfDetectorCycle): Event specie " << specie << " is set" << endl;\r
257   \r
258   // launch the QA checking\r
259   AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); \r
260   AliDebug(AliQAv1::GetQADebugLevel(), Form("Offset: %d\n",fGenRawsOffset[specie]));\r
261   //Printf("Offset: %d\n",fGenRawsOffset[specie]);\r
262 \r
263   if(task == AliQAv1::kRAWS) {\r
264     //\r
265     for (int trCl=-1;trCl<fAliITSQADataMakerRec->GetNTrigClasses();trCl++) { // RS Loop over all trigger classes (+ global counter, -1)\r
266       //\r
267       TObjArray &harr = *fAliITSQADataMakerRec->GetRawsDataOfTrigClass(trCl);\r
268       int offs = fGenRawsOffset[specie];\r
269       int nSSDEventPerCycle = fAliITSQADataMakerRec->GetEvCountCycleRaws(trCl);\r
270       //    \r
271       //Data size per DDL\r
272       for(Int_t i = 0; i < fgkNumOfDDLs; i++) {\r
273         if (!(harr[offs+5+i] && harr[offs+4+i])) continue;\r
274         Double_t gSizePerDDL = ((TH1*)harr[offs+5+i])->GetMean();\r
275         //cout<<"DDL: "<<i+512<<" - Size: "<<gSizePerDDL<<" - Mean: "<<gSizePerDDL<<endl;\r
276         //cout<<"Entries: "<<((TH1*)harr[offs+5+i])->GetEntries()<<endl;\r
277         ((TH1*)harr[offs+4])->SetBinContent(i+1,gSizePerDDL);\r
278         //cout<<"After filling DDL: "<<i+512<<" - Size: "<< ((TH1F*)harr[offs+4+i])->GetBinContent(i+1)<<endl;\r
279       }\r
280       //\r
281       //Data size per LDC\r
282       for(Int_t i = 0; i < fgkNumOfLDCs; i++) {\r
283         if ( !(harr[offs+23+i]&&harr[offs+22+i])) continue;\r
284         Double_t gSizePerLDC = ((TH1*)harr[offs+23+i])->GetMean();\r
285         ((TH1*)harr[offs+22])->SetBinContent(i+1,gSizePerLDC);\r
286         //cout<<"LDC: "<<i+170<<" - Size: "<<gSizePerLDC<<" - Mean: "<<" - Size: "<<((TH1*)harr[offs+23+i])->GetMean()<<endl;\r
287       }\r
288       //\r
289       //if (harr[offs+4])  cout<<"Data size/ DDL entries: "<<((TH1*)harr[offs+4 ])->GetEntries()<< " mean: " << ((TH1*)harr[offs+4])->GetMean()<<endl;   \r
290       //if (harr[offs+22]) cout<<"Data size/ LDC entries: "<<((TH1*)harr[offs+22])->GetEntries()<< " mean: " << ((TH1*)harr[offs+22])->GetMean()<<endl;\r
291       //\r
292       //online part\r
293       if(fkOnline) {\r
294         //Output of the DA\r
295         MonitorOCDBObjects(trCl);\r
296         //Monitor common mode values\r
297         MonitorCMValues(trCl);\r
298         //\r
299         Int_t gHistPositionOccupancyPerModule = 0;\r
300         Int_t gLayer = 0, gLadder = 0, gModule = 0;\r
301         //occupancy per module\r
302         for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
303           AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);        \r
304           gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);\r
305           TH1* htmp = (TH1*)harr[offs+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule];\r
306           if (htmp) {\r
307             for(Int_t iBins = 1; iBins < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBins++) htmp->SetBinContent(iBins,fOccupancyMatrix[iModule][iBins-1]);\r
308             if(nSSDEventPerCycle != 0) htmp->Scale(100./nSSDEventPerCycle);\r
309           }//module loop\r
310         }\r
311         //\r
312         //occupancy per ladder\r
313         Int_t gHistPositionOccupancyPerLadder = 0;\r
314         Int_t lLadderLocationY = 0;\r
315         Double_t occupancy = 0.0, occupancyThreshold = 0.0, occupancyAverage = 0.0;\r
316         for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
317           AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);\r
318           //\r
319           gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);\r
320           gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);\r
321           //\r
322           TH1* htmpo = (TH1*)harr[offs+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule];\r
323           TH1* h1t = 0;\r
324           TH2* h2t = 0;\r
325           if (htmpo) {\r
326             //P-SIDE OCCUPANCY\r
327             occupancy          = GetOccupancyModule(htmpo,0,0,0);\r
328             occupancyThreshold = GetOccupancyModule(htmpo,0,1,3);\r
329             occupancyAverage   = GetOccupancyModule(htmpo,0,2,0);\r
330             if ( (h1t=(TH1*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder]) ) h1t->SetBinContent(gModule,occupancy);\r
331             lLadderLocationY = 3*gLadder; // sideP=1 sideN=0 \r
332             if(gLayer == 5) {\r
333               //occupancy per module - no threshold\r
334               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6])   ) h2t->SetBinContent(gModule,lLadderLocationY,occupancy);\r
335               //occupancy per module - threshold @ 3%\r
336               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2]) ) h2t->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);\r
337               //average occupancy per module\r
338               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4]) ) h2t->SetBinContent(gModule,lLadderLocationY,occupancyAverage);\r
339             }\r
340             else if(gLayer == 6) {\r
341               //occupancy per module - no threshold\r
342               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1]) ) h2t->SetBinContent(gModule,lLadderLocationY,occupancy);\r
343               //occupancy per module - threshold @ 3%\r
344               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3]) ) h2t->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);\r
345               //average occupancy per module\r
346               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5]) ) h2t->SetBinContent(gModule,lLadderLocationY,occupancyAverage);\r
347             }\r
348             //\r
349             //N-SIDE OCCUPANCY\r
350             //\r
351             occupancy          = GetOccupancyModule(htmpo,1,0,0);   \r
352             occupancyThreshold = GetOccupancyModule(htmpo,1,1,3);   \r
353             occupancyAverage   = GetOccupancyModule(htmpo,1,2,0);   \r
354             if ( (h1t=(TH1*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1]) ) h1t->SetBinContent(gModule,occupancy);\r
355             if(gLayer == 5) {\r
356               //occupancy per module - no threshold\r
357               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6])   ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancy);\r
358               //occupancy per module - threshold @ 3%\r
359               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2]) ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);\r
360               //average occupancy per module\r
361               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4]) ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);\r
362             }\r
363             else if(gLayer == 6) {\r
364               //occupancy per module - no threshold\r
365               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1]) ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancy);\r
366               //occupancy per module - threshold @ 3%\r
367   if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3]) ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);\r
368               //average occupancy per module\r
369               if ( (h2t=(TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5]) ) h2t->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);\r
370             }\r
371           } // htmpo\r
372         }//module loop\r
373       }//online flag for SSD\r
374       //\r
375       //TH2* h2tmp = (TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6];\r
376       //if (h2tmp) AliInfo(Form("Entries 2d occupancy no thres- lay 5: %d"),h2tmp->GetEntries());\r
377       //h2tmp = (TH2*)harr[offs+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3];\r
378       //cout<<"entries 2d occupancy thres- lay 6: "<<h2tmp->GetEntries()<< " mean: " << h2tmp->GetMean() << endl; //Somehow the other occupancy maps do give nonzero values for GetMean() here\r
379       //\r
380       // TH1* h1tmp = (TH1*)harr[fGenRawsOffset[1]+4];\r
381       // if (h1tmp) cout<<"Data size/ DDL entries: "<<h1tmp->GetEntries()<< " mean: " << h1tmp->GetMean()<<endl;   \r
382       //Reset of the raws\r
383     } //  RS Loop over all trigger classes (+ global counter, -1)\r
384     //AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);\r
385     //\r
386     ResetRawsMonitoredObjects();\r
387   }//raw data end of cycle\r
388   //\r
389       \r
390   // \r
391 }\r
392 \r
393 //____________________________________________________________________________ \r
394 Int_t AliITSQASSDDataMakerRec::InitRaws() {  \r
395   // Initialization for RAW data - SSD -\r
396   const Bool_t expert   = kTRUE ; \r
397   const Bool_t saveCorr = kTRUE ; \r
398   const Bool_t image    = kTRUE ; \r
399   Int_t rv = 0 ; \r
400   fSSDRawsOffset = 0;\r
401 \r
402   //for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
403   //if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
404   Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
405   //cout << "(AliITSQASSDDataMakerRec::InitRaws): Event specie " << specie << " is set" << endl;\r
406   //cout << "(AliITSQASSDDataMakerRec::InitRaws): Offset " << offsRw << endl;\r
407   int offsRw = fGenRawsOffset[specie];\r
408     \r
409     \r
410   if(fkOnline) {\r
411     AliDebug(AliQAv1::GetQADebugLevel(), "Book Online Histograms for SSD\n");\r
412   }\r
413   else {\r
414     AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SSD\n ");\r
415   }\r
416   AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD): %d\n",offsRw));\r
417   \r
418   TString gTitle;\r
419   TString gName;\r
420   //book online-offline QA histos\r
421   TH1F *fHistSSDEventType = new TH1F("fHistSSDEventType",\r
422                                      "SSD Event Type;Event type;Events",\r
423                                      31,-1,30);\r
424   fHistSSDEventType->SetStats(kFALSE);\r
425   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDEventType, \r
426                                            offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
427   fSSDRawsOffset += 1;\r
428   //cout<<"(AliITSQASSDDataMakerRec::InitRaws): "<<offsRw+fSSDRawsOffset-1<<" - Name: "<<(fAliITSQADataMakerRec->GetRawsData(offsRw))->GetName()<<endl;\r
429   TH1F *fHistSSDDataSize = new TH1F("fHistSSDDataSize",\r
430                                     "SSD Data Size;(SSD data size) [KB];Events",\r
431                                     1000,0,500);\r
432   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize, \r
433                                            offsRw+fSSDRawsOffset, !expert, image, !saveCorr);\r
434   fSSDRawsOffset += 1;\r
435   TH1F *fHistSSDDataSizePercentage = new TH1F("fHistSSDDataSizePercentage",\r
436                                               "SSD Data Size Percentage;SSD data size [%];Events",\r
437                                               1000,0,100);\r
438   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage, \r
439                                            offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
440   fSSDRawsOffset += 1;\r
441   TH1F *fHistSSDDDLId = new TH1F("fHistSSDDDLId",\r
442                                  "SSD DDL Id;DDL id;Events",16,511.5,527.5);\r
443   fHistSSDDDLId->SetStats(kFALSE);\r
444   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDDLId, \r
445                                            offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
446   fSSDRawsOffset += 1;\r
447   TH1F *fHistSSDDataSizePerDDL = new TH1F("fHistSSDDataSizePerDDL",\r
448                                           "SSD Data Size Per DDL;DDL id;<SSD data size> [KB]",\r
449                                           16,511.5,527.5);\r
450   fHistSSDDataSizePerDDL->SetStats(kFALSE);\r
451   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL, \r
452                                            offsRw+fSSDRawsOffset, !expert, image, !saveCorr);\r
453 \r
454   fSSDRawsOffset += 1;\r
455   TH1F *fHistSSDDataSizeDDL[fgkNumOfDDLs];\r
456   for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {\r
457     gName = Form("fHistSSDDataSizeDDL%d", i+511) ;\r
458     gTitle = Form("SSD Data Size DDL %d", i+511) ;\r
459     fHistSSDDataSizeDDL[i-1] = new TH1F(gName.Data(),\r
460                                         Form("%s;(SSD data size) [KB];Events", gTitle.Data()),\r
461                                         100,0,50);\r
462     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeDDL[i-1], \r
463                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
464     fSSDRawsOffset += 1;\r
465   }\r
466   \r
467   TH1F *fHistSSDLDCId = new TH1F("fHistSSDLDCId","SSD LDC Id;LDC id;Events",8,169.5,177.5);\r
468   fHistSSDLDCId->SetStats(kFALSE);\r
469   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDLDCId, \r
470                                            offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
471   fSSDRawsOffset += 1;\r
472   TH1F *fHistSSDDataSizePerLDC = new TH1F("fHistSSDDataSizePerLDC",\r
473                                           "SSD Data Size Per LDC;LDC id;<SSD data size> [KB]",\r
474                                           8,169.5,177.5);\r
475   fHistSSDDataSizePerLDC->SetStats(kFALSE);\r
476   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC, \r
477                                            offsRw+fSSDRawsOffset, expert, !image, !saveCorr);  fSSDRawsOffset += 1;\r
478   TH1F *fHistSSDDataSizeLDC[fgkNumOfLDCs];\r
479   for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {\r
480     gName = "fHistSSDDataSizeLDC"; \r
481     if(i == 1) gName += "170";\r
482     if(i == 2) gName += "171";\r
483     if(i == 3) gName += "172";\r
484     if(i == 4) gName += "173";\r
485     if(i == 5) gName += "174";\r
486     if(i == 6) gName += "175";\r
487     if(i == 7) gName += "176";\r
488     if(i == 8) gName += "177";\r
489     \r
490     gTitle = "SSD Data Size LDC "; gTitle += gName.Data();\r
491     fHistSSDDataSizeLDC[i-1] = new TH1F(gName.Data(),\r
492                                         Form("%s;SSD data size [KB];Events", gTitle.Data()),\r
493                                         1000,0,100);\r
494     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeLDC[i-1], \r
495                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
496     fSSDRawsOffset += 1;\r
497   }\r
498   fSSDRawsCommonLevelOffset = fSSDRawsOffset;\r
499   \r
500   if(fkOnline) {\r
501     Int_t gLayer = 0, gLadder = 0, gModule = 0;\r
502     //occupancy per SSD module\r
503     TH1F *fHistSSDOccupancyModule[fgkSSDMODULES]; \r
504     for(Int_t i = 500; i < fgkSSDMODULES + 500; i++) {\r
505       AliITSgeomTGeo::GetModuleId(i,gLayer,gLadder,gModule);\r
506       gName = "fHistSSD_Occupancy_Layer";\r
507       gTitle = "SSD Occupancy Layer";\r
508       if(gLayer == 5) {\r
509         gName += gLayer; gName += "_Ladder"; \r
510         gName += 499+gLadder;\r
511         gTitle += gLayer; gTitle += "_Ladder"; \r
512         gTitle += 499+gLadder;\r
513       }\r
514       if(gLayer == 6) {\r
515         gName += gLayer; gName += "_Ladder"; \r
516         gName += 599+gLadder;\r
517         gTitle += gLayer; gTitle += "_Ladder"; \r
518         gTitle += 599+gLadder;\r
519       }\r
520       gName += "_Module"; gName += gModule; \r
521       gTitle += "_Module"; gTitle += gModule; \r
522       \r
523       fHistSSDOccupancyModule[i-500] = new TH1F(gName.Data(),Form("%s;N_{strip};Occupancy [%%]", gTitle.Data()),\r
524                                                 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);\r
525       fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitleColor(1);\r
526       rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyModule[i-500], \r
527                                                offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
528       fSSDRawsOffset += 1;\r
529     }\r
530     \r
531     //Occupancy per SSD ladder\r
532     Int_t occupancyCounter = 0;\r
533     TH1F *fHistSSDOccupancyLadder[2*(fgkSSDLADDERSLAYER5 + fgkSSDLADDERSLAYER6)];\r
534     for(Int_t iLayer = 5; iLayer < 7; iLayer++) {\r
535       for(Int_t iLadder = 1; iLadder < AliITSgeomTGeo::GetNLadders(iLayer) + 1; iLadder++) {\r
536         //P-side occupancy plots\r
537         gName  = "fHistSSD_Occupancy_Layer"; \r
538         gTitle = "SSD Occupancy Layer"; \r
539         if(iLayer == 5) {\r
540           gName += iLayer; gName += "_Ladder"; \r
541           gName += 499+iLadder;\r
542           gTitle += iLayer; gTitle += "_Ladder"; \r
543           gTitle += 499+iLadder;\r
544         }\r
545         if(iLayer == 6) {\r
546           gName += iLayer; gName += "_Ladder"; \r
547           gName += 599+iLadder;\r
548           gTitle += iLayer; gTitle += "_Ladder"; \r
549           gTitle += 599+iLadder;\r
550         }\r
551         gName += "_PSide";\r
552         gTitle += "_PSide";\r
553         fHistSSDOccupancyLadder[occupancyCounter] = new TH1F(gName.Data(),\r
554                                                              Form("%s;Module number;Occupancy [%%]", gTitle.Data()),\r
555                                                              AliITSgeomTGeo::GetNDetectors(iLayer),\r
556                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);\r
557         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);\r
558         rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], \r
559                                                  offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
560         occupancyCounter += 1; fSSDRawsOffset += 1;\r
561         //N-side occupancy plots\r
562         gName = "fHistSSD_Occupancy_Layer"; \r
563         gTitle = "SSD Occupancy Layer"; \r
564         if(iLayer == 5) {\r
565           gName += iLayer; gName += "_Ladder"; \r
566           gName += 499+iLadder;\r
567           gTitle += iLayer; gTitle += "_Ladder"; \r
568           gTitle += 499+iLadder;\r
569         }\r
570         if(iLayer == 6) {\r
571           gName += iLayer; gName += "_Ladder"; \r
572           gName += 599+iLadder;\r
573           gTitle += iLayer; gTitle += "_Ladder"; \r
574           gTitle += 599+iLadder;\r
575         }\r
576         gName += "_NSide";\r
577         gTitle += "_NSide";\r
578         fHistSSDOccupancyLadder[occupancyCounter] = new TH1F(gName.Data(),\r
579                                                              Form("%s;Module number;Occupancy [%%]", gTitle.Data()),\r
580                                                              AliITSgeomTGeo::GetNDetectors(iLayer),\r
581                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);\r
582         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);\r
583         rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], \r
584                                                  offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
585         occupancyCounter += 1; fSSDRawsOffset += 1;\r
586       }//ladder loop\r
587     }//layer loop\r
588 \r
589     //top level occupancy plots\r
590     //occupancy per module - no threshold\r
591     TH2F *fHistSSDOccupancyLayer5 = new TH2F("fHistSSDOccupancyLayer5",\r
592                                              "SSD Occupancy (Layer 5) - No threshold;N_{modules};N_{Ladders}",\r
593                                              fgkSSDMODULESPERLADDERLAYER5,\r
594                                              0,fgkSSDMODULESPERLADDERLAYER5,\r
595                                              3*fgkSSDLADDERSLAYER5,\r
596                                              500,500+fgkSSDLADDERSLAYER5);  \r
597     fHistSSDOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,100.0);\r
598     Char_t fLabel[3];\r
599     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){\r
600       snprintf(fLabel,2,"%d",iBin);\r
601       fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);\r
602     }\r
603     fHistSSDOccupancyLayer5->SetStats(kFALSE);\r
604     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer5, \r
605                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
606     fSSDRawsOffset += 1;\r
607     TH2F *fHistSSDOccupancyLayer6 = new TH2F("fHistSSDOccupancyLayer6",\r
608                                              "Occupancy per module (Layer 6) - No threshold;N_{modules};N_{Ladders}",\r
609                                              fgkSSDMODULESPERLADDERLAYER6,\r
610                                              0,fgkSSDMODULESPERLADDERLAYER6,\r
611                                              3*fgkSSDLADDERSLAYER6,\r
612                                              600,600+fgkSSDLADDERSLAYER6);\r
613     fHistSSDOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,100.0);\r
614     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){\r
615       snprintf(fLabel,2,"%d",iBin);\r
616       fHistSSDOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);\r
617     }\r
618     fHistSSDOccupancyLayer6->SetStats(kFALSE);\r
619     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer6, \r
620                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
621     fSSDRawsOffset += 1;\r
622 \r
623     //occupancy per module - threshold @ 3%\r
624     TH2F *fHistSSDOccupancyThresholdLayer5 = new TH2F("fHistSSDOccupancyThresholdLayer5",\r
625                                                       "Occupancy per module (Layer 5) - Threshold 3%;N_{modules};N_{Ladders};Entries",\r
626                                                       fgkSSDMODULESPERLADDERLAYER5,\r
627                                                       0,fgkSSDMODULESPERLADDERLAYER5,\r
628                                                       3*fgkSSDLADDERSLAYER5,\r
629                                                       500,500+fgkSSDLADDERSLAYER5);  \r
630     fHistSSDOccupancyThresholdLayer5->GetZaxis()->SetRangeUser(3.0,10.0);\r
631     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){\r
632       snprintf(fLabel,2,"%d",iBin);\r
633       fHistSSDOccupancyThresholdLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);\r
634     }\r
635     fHistSSDOccupancyThresholdLayer5->SetStats(kFALSE);\r
636     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer5, \r
637                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
638     fSSDRawsOffset += 1;\r
639     TH2F *fHistSSDOccupancyThresholdLayer6 = new TH2F("fHistSSDOccupancyThresholdLayer6",\r
640                                                       "Occupancy per module (Layer 6) - Threshold 3%;N_{modules};N_{Ladders}",\r
641                                                       fgkSSDMODULESPERLADDERLAYER6,\r
642                                                       0,fgkSSDMODULESPERLADDERLAYER6,\r
643                                                       3*fgkSSDLADDERSLAYER6,\r
644                                                       600,600+fgkSSDLADDERSLAYER6);\r
645     fHistSSDOccupancyThresholdLayer6->GetZaxis()->SetRangeUser(3.0,10.0);\r
646     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){\r
647       snprintf(fLabel,2,"%d",iBin);\r
648       fHistSSDOccupancyThresholdLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);\r
649     }\r
650     fHistSSDOccupancyThresholdLayer6->SetStats(kFALSE);\r
651     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer6, \r
652                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
653     fSSDRawsOffset += 1;\r
654 \r
655     //Average occupancy per module\r
656     TH2F *fHistSSDAverageOccupancyLayer5 = new TH2F("fHistSSDAverageOccupancyLayer5",\r
657                                                     "Average occupancy per module (Layer 5);N_{modules};N_{Ladders}",\r
658                                                     fgkSSDMODULESPERLADDERLAYER5,\r
659                                                     0,fgkSSDMODULESPERLADDERLAYER5,\r
660                                                     3*fgkSSDLADDERSLAYER5,\r
661                                                     500,500+fgkSSDLADDERSLAYER5);  \r
662     fHistSSDAverageOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,5.0);\r
663     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){\r
664       snprintf(fLabel,2,"%d",iBin);\r
665       fHistSSDAverageOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);\r
666     }\r
667     fHistSSDAverageOccupancyLayer5->SetStats(kFALSE);\r
668     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer5, \r
669                                              offsRw+fSSDRawsOffset, !expert, image, !saveCorr);\r
670     fSSDRawsOffset += 1;\r
671     TH2F *fHistSSDAverageOccupancyLayer6 = new TH2F("fHistSSDAverageOccupancyLayer6",\r
672                                                     "Average occupancy per module (Layer 6);N_{modules};N_{Ladders}",\r
673                                                     fgkSSDMODULESPERLADDERLAYER6,\r
674                                                     0,fgkSSDMODULESPERLADDERLAYER6,\r
675                                                     3*fgkSSDLADDERSLAYER6,\r
676                                                     600,600+fgkSSDLADDERSLAYER6);\r
677     fHistSSDAverageOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,5.0);\r
678     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){\r
679       snprintf(fLabel,2,"%d",iBin);\r
680       fHistSSDAverageOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);\r
681     }\r
682     fHistSSDAverageOccupancyLayer6->SetStats(kFALSE);\r
683     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer6, \r
684                                              offsRw+fSSDRawsOffset, !expert, image, !saveCorr);\r
685     fSSDRawsOffset += 1;\r
686 \r
687     //Output of the DA\r
688     TH2F *fHistSSDPSideBadChannelMapLayer5 = new TH2F("fHistSSDPSideBadChannelMapLayer5",\r
689                                                       "Layer 5;N_{module};N_{ladder}",\r
690                                                       22,1,23,\r
691                                                       34,500,534);\r
692     fHistSSDPSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);\r
693     fHistSSDPSideBadChannelMapLayer5->SetStats(kFALSE);\r
694     fHistSSDPSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);\r
695     fHistSSDPSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);\r
696     fHistSSDPSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);\r
697     fHistSSDPSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);\r
698     fHistSSDPSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);\r
699     fHistSSDPSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);\r
700     fHistSSDPSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (p-side)[%]");\r
701     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDPSideBadChannelMapLayer5, \r
702                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
703     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
704     \r
705     TH2F *fHistSSDNSideBadChannelMapLayer5 = new TH2F("fHistSSDNSideBadChannelMapLayer5",\r
706                                                       "Layer 5;N_{module};N_{ladder}",\r
707                                                       22,1,23,\r
708                                                       34,500,534);\r
709     fHistSSDNSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);\r
710     fHistSSDNSideBadChannelMapLayer5->SetStats(kFALSE);\r
711     fHistSSDNSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);\r
712     fHistSSDNSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);\r
713     fHistSSDNSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);\r
714     fHistSSDNSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);\r
715     fHistSSDNSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);\r
716     fHistSSDNSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);\r
717     fHistSSDNSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (n-side)[%]");\r
718     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDNSideBadChannelMapLayer5, \r
719                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
720     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
721     \r
722     TH2F *fHistSSDPSideBadChannelMapLayer6 = new TH2F("fHistSSDPSideBadChannelMapLayer6",\r
723                                                       "Layer 6;N_{module};N_{ladder}",\r
724                                                       25,1,26,\r
725                                                       38,600,638);\r
726     fHistSSDPSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);\r
727     fHistSSDPSideBadChannelMapLayer6->SetStats(kFALSE);\r
728     fHistSSDPSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);\r
729     fHistSSDPSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);\r
730     fHistSSDPSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);\r
731     fHistSSDPSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);\r
732     fHistSSDPSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);\r
733     fHistSSDPSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);\r
734     fHistSSDPSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (p-side)[%]");\r
735     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDPSideBadChannelMapLayer6, \r
736                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
737     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
738     \r
739     TH2F *fHistSSDNSideBadChannelMapLayer6 = new TH2F("fHistSSDNSideBadChannelMapLayer6",\r
740                                                       "Layer 6;N_{module};N_{ladder}",\r
741                                                       25,1,26,\r
742                                                       38,600,638);\r
743     fHistSSDNSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);\r
744     fHistSSDNSideBadChannelMapLayer6->SetStats(kFALSE);\r
745     fHistSSDNSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);\r
746     fHistSSDNSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);\r
747     fHistSSDNSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);\r
748     fHistSSDNSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);\r
749     fHistSSDNSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);\r
750     fHistSSDNSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);\r
751     fHistSSDNSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (n-side)[%]");\r
752     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDNSideBadChannelMapLayer6, \r
753                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
754     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
755 \r
756     //Common mode values\r
757     TH2F *fHistSSDPSideCommonModeMapLayer5 = new TH2F("fHistSSDPSideCommonModeMapLayer5",\r
758                                                       "Layer 5 - CM (P-side);N_{module};N_{ladder}",\r
759                                                       22,1,23,\r
760                                                       34,500,534);\r
761     fHistSSDPSideCommonModeMapLayer5->GetXaxis()->SetTitleColor(1);\r
762     fHistSSDPSideCommonModeMapLayer5->SetStats(kFALSE);\r
763     fHistSSDPSideCommonModeMapLayer5->GetYaxis()->SetTitleOffset(1.8);\r
764     fHistSSDPSideCommonModeMapLayer5->GetXaxis()->SetNdivisions(22);\r
765     fHistSSDPSideCommonModeMapLayer5->GetYaxis()->SetNdivisions(34);\r
766     fHistSSDPSideCommonModeMapLayer5->GetXaxis()->SetLabelSize(0.03);\r
767     fHistSSDPSideCommonModeMapLayer5->GetYaxis()->SetLabelSize(0.03);\r
768     fHistSSDPSideCommonModeMapLayer5->GetZaxis()->SetTitleOffset(1.6);\r
769     fHistSSDPSideCommonModeMapLayer5->GetZaxis()->SetTitle("RMS(CM) (P-side)");\r
770     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDPSideCommonModeMapLayer5, \r
771                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
772     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
773     \r
774     TH2F *fHistSSDNSideCommonModeMapLayer5 = new TH2F("fHistSSDNSideCommonModeMapLayer5",\r
775                                                       "Layer 5 - CM (N-side);N_{module};N_{ladder}",\r
776                                                       22,1,23,\r
777                                                       34,500,534);\r
778     fHistSSDNSideCommonModeMapLayer5->GetXaxis()->SetTitleColor(1);\r
779     fHistSSDNSideCommonModeMapLayer5->SetStats(kFALSE);\r
780     fHistSSDNSideCommonModeMapLayer5->GetYaxis()->SetTitleOffset(1.8);\r
781     fHistSSDNSideCommonModeMapLayer5->GetXaxis()->SetNdivisions(22);\r
782     fHistSSDNSideCommonModeMapLayer5->GetYaxis()->SetNdivisions(34);\r
783     fHistSSDNSideCommonModeMapLayer5->GetXaxis()->SetLabelSize(0.03);\r
784     fHistSSDNSideCommonModeMapLayer5->GetYaxis()->SetLabelSize(0.03);\r
785     fHistSSDNSideCommonModeMapLayer5->GetZaxis()->SetTitleOffset(1.6);\r
786     fHistSSDNSideCommonModeMapLayer5->GetZaxis()->SetTitle("RMS(CM) (N-side)");\r
787     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDNSideCommonModeMapLayer5, \r
788                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
789     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
790     \r
791     TH2F *fHistSSDPSideCommonModeMapLayer6 = new TH2F("fHistSSDPSideCommonModeMapLayer6",\r
792                                                       "Layer 6 - CM (P-side);N_{module};N_{ladder}",\r
793                                                       25,1,26,\r
794                                                       38,600,638);\r
795     fHistSSDPSideCommonModeMapLayer6->GetXaxis()->SetTitleColor(1);\r
796     fHistSSDPSideCommonModeMapLayer6->SetStats(kFALSE);\r
797     fHistSSDPSideCommonModeMapLayer6->GetYaxis()->SetTitleOffset(1.8);\r
798     fHistSSDPSideCommonModeMapLayer6->GetXaxis()->SetNdivisions(25);\r
799     fHistSSDPSideCommonModeMapLayer6->GetYaxis()->SetNdivisions(38);\r
800     fHistSSDPSideCommonModeMapLayer6->GetXaxis()->SetLabelSize(0.03);\r
801     fHistSSDPSideCommonModeMapLayer6->GetYaxis()->SetLabelSize(0.03);\r
802     fHistSSDPSideCommonModeMapLayer6->GetZaxis()->SetTitleOffset(1.6);\r
803     fHistSSDPSideCommonModeMapLayer6->GetZaxis()->SetTitle("RMS(CM) (P-side)");\r
804     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDPSideCommonModeMapLayer6, \r
805                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
806     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
807     \r
808     TH2F *fHistSSDNSideCommonModeMapLayer6 = new TH2F("fHistSSDNSideCommonModeMapLayer6",\r
809                                                       "Layer 6 - CM (N-side);N_{module};N_{ladder}",\r
810                                                       25,1,26,\r
811                                                       38,600,638);\r
812     fHistSSDNSideCommonModeMapLayer6->GetXaxis()->SetTitleColor(1);\r
813     fHistSSDNSideCommonModeMapLayer6->SetStats(kFALSE);\r
814     fHistSSDNSideCommonModeMapLayer6->GetYaxis()->SetTitleOffset(1.8);\r
815     fHistSSDNSideCommonModeMapLayer6->GetXaxis()->SetNdivisions(25);\r
816     fHistSSDNSideCommonModeMapLayer6->GetYaxis()->SetNdivisions(38);\r
817     fHistSSDNSideCommonModeMapLayer6->GetXaxis()->SetLabelSize(0.03);\r
818     fHistSSDNSideCommonModeMapLayer6->GetYaxis()->SetLabelSize(0.03);\r
819     fHistSSDNSideCommonModeMapLayer6->GetZaxis()->SetTitleOffset(1.6);\r
820     fHistSSDNSideCommonModeMapLayer6->GetZaxis()->SetTitle("RMS(CM) (N-side)");\r
821     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDNSideCommonModeMapLayer6, \r
822                                              offsRw+fSSDRawsOffset, expert, !image, !saveCorr);\r
823     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;\r
824   }//online flag\r
825   \r
826   fSSDhRawsTask = fSSDRawsOffset;\r
827   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhRawsTask));\r
828   AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",offsRw+fSSDhRawsTask));  \r
829   AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",offsRw+fSSDRawsOffset));\r
830   \r
831   /*\r
832     fSSDhTask = fSSDRawsOffset;\r
833     AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhTask));\r
834     AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",offsRw+fSSDhTask));  \r
835     AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",offsRw+fSSDRawsOffset));\r
836   */\r
837 \r
838 \r
839   //} //event species loop\r
840 \r
841   return rv ; \r
842 \r
843 \r
844 }\r
845 \r
846 //____________________________________________________________________________\r
847 Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) \r
848\r
849   // Fill QA for RAW - SSD -\r
850   Int_t rv = 0 ; \r
851   Int_t gStripNumber;\r
852   Int_t gHistPosition;\r
853   Int_t gLayer = 0,gLadder = 0, gModule = 0;\r
854 \r
855   Double_t gSizePerDDL[fgkNumOfDDLs] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};\r
856   Double_t gSizePerLDC[fgkNumOfLDCs] = {0.,0.,0.,0.,0.,0.,0.,0.};\r
857   Double_t sumSSDDataSize = 0.0;\r
858   Double_t eventSize = -1.0;\r
859 \r
860   // RS: I've commented this loop over species: makes no sense in the event loop\r
861   //  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
862   //    if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
863   int specie = fAliITSQADataMakerRec->GetEventSpecie(); \r
864   //cout << "MakeRaws: Event specie " << specie << " is set" << endl;\r
865   //\r
866   int offsRw = fGenRawsOffset[specie];\r
867   //\r
868   //AliInfo(Form("offsRw %d\n",offsRw));\r
869   if(fkOnline) {\r
870     //reset the signal vs strip number histograms\r
871     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)\r
872       fHistSSDRawSignalModule[iModule]->Reset();\r
873   }//online flag\r
874   \r
875   rawReader->Select("ITSSSD",-1,-1);  \r
876   rawReader->Reset(); //rawReader->NextEvent();   \r
877   //AliInfo(Form("offsRw %d\n",offsRw));\r
878   fAliITSQADataMakerRec->FillRawsData(offsRw,rawReader->GetType());\r
879   \r
880   AliITSRawStreamSSD gSSDStream(rawReader);    \r
881   AliRawReaderRoot *rootReader = (AliRawReaderRoot *)rawReader;\r
882   if(rootReader) {\r
883     const AliRawEventHeaderBase *header = rootReader->GetEventHeader();\r
884     if(header)\r
885       eventSize = header->GetEventSize();\r
886   }\r
887   while (gSSDStream.Next()) {\r
888     if(gSSDStream.GetModuleID() < 0) continue;\r
889     /*cout<<"DDL: "<<rawReader->GetDDLID()<<\r
890       " - LDC: "<<rawReader->GetLDCId()<<\r
891       " - Size: "<<rawReader->GetDataSize()<<\r
892       " - Equipment size: "<<rawReader->GetEquipmentSize()<<endl;*/\r
893     Int_t ddlid = rawReader->GetDDLID();\r
894     if(ddlid<0){\r
895       AliError("GetDDLID returns a negative value");\r
896       continue;\r
897     }\r
898     gSizePerDDL[ddlid] = rawReader->GetDataSize();\r
899     //gSizePerLDC[rawReader->GetLDCId()-8] = rawReader->GetDataSize();\r
900     AliITSgeomTGeo::GetModuleId(gSSDStream.GetModuleID(),gLayer,gLadder,gModule);\r
901     gHistPosition = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);\r
902     if(fkOnline) {\r
903       if(gSSDStream.GetStrip() < 0) {\r
904         //Printf("Layer: %d - Ladder: %d - Module: %d - Strip: %d - Signal: %lf",gLayer,gLadder,gModule,gSSDStream.GetStrip(),gSSDStream.GetSignal());\r
905         if(TMath::Abs(gSSDStream.GetStrip()) < 7)\r
906           fHistSSDCMModule[gHistPosition]->Fill(gSSDStream.GetSignal());\r
907         if(TMath::Abs(gSSDStream.GetStrip()) > 6)\r
908           fHistSSDCMModule[fgkSSDMODULES+gHistPosition]->Fill(gSSDStream.GetSignal());\r
909       }//CM values\r
910       else {\r
911         gStripNumber = (gSSDStream.GetSideFlag() == 0) ? gSSDStream.GetStrip() : -gSSDStream.GetStrip() + 2*fgkNumberOfPSideStrips;\r
912         //AliDebug(AliQAv1::GetQADebugLevel(), Form("ModulePosition: %d - Layer: %d - Ladder: %d - Module: %d\n",gHistPosition,gLayer,gLadder,gModule));\r
913         fHistSSDRawSignalModule[gHistPosition]->Fill(gStripNumber,gSSDStream.GetSignal());\r
914         //fAliITSQADataMakerRec->FillRawsData(offsRw+gHistPosition+fSSDRawsCommonLevelOffset,gStripNumber,gSSDStream.GetSignal());\r
915       }//normal strip signal\r
916     }//online flag\r
917   }//streamer loop   \r
918   \r
919   //event size calculation and filling info\r
920   for(Int_t i = 0; i < fgkNumOfDDLs; i++) {\r
921     sumSSDDataSize += gSizePerDDL[i];\r
922     if(gSizePerDDL[i] > 0) {\r
923       fAliITSQADataMakerRec->FillRawsData(offsRw+3,i+512);\r
924       fAliITSQADataMakerRec->FillRawsData(offsRw+5+i,gSizePerDDL[i]/1e+03);\r
925       //if(i == 5)\r
926       //cout<<gSizePerDDL[i]/1e+03<<endl;\r
927       //cout<<"Event: "<<nSSDEventPerCycle<<" - DDL: "<<i+512<<\r
928       //" - Data size: "<<gSizePerDDL[i]/1e+03<<endl;\r
929     }\r
930     //(fAliITSQADataMakerRec->FillRawsData(offsRw+4),i+512,gSizePerDDL[i]/1e+06);\r
931   }\r
932   for(Int_t i = 0; i < fgkNumOfLDCs; i++) {\r
933     //LDC 170\r
934     if(i == 0)\r
935       gSizePerLDC[i] = gSizePerDDL[8] + gSizePerDDL[9];\r
936     //LDC 171\r
937     if(i == 1)\r
938       gSizePerLDC[i] = gSizePerDDL[10] + gSizePerDDL[11];\r
939     //LDC 172\r
940     if(i == 2)\r
941       gSizePerLDC[i] = gSizePerDDL[12] + gSizePerDDL[13];\r
942     //LDC 173\r
943     if(i == 3)\r
944       gSizePerLDC[i] = gSizePerDDL[14] + gSizePerDDL[15];\r
945     //LDC 174\r
946     if(i == 4)\r
947       gSizePerLDC[i] = gSizePerDDL[0] + gSizePerDDL[1];\r
948     //LDC 175\r
949     if(i == 5)\r
950       gSizePerLDC[i] = gSizePerDDL[2] + gSizePerDDL[3];\r
951       //LDC 176\r
952     if(i == 6)\r
953       gSizePerLDC[i] = gSizePerDDL[4] + gSizePerDDL[5];\r
954     //LDC 177\r
955     if(i == 7)\r
956       gSizePerLDC[i] = gSizePerDDL[6] + gSizePerDDL[7];\r
957     \r
958     if(gSizePerLDC[i] > 0) fAliITSQADataMakerRec->FillRawsData(offsRw+21,i+170);\r
959     fAliITSQADataMakerRec->FillRawsData(offsRw+23+i,gSizePerLDC[i]/1e+03);\r
960     //cout<<"Event: "<<nSSDEventPerCycle<<" - LDC: "<<i+170<<\r
961     //" - Data size: "<<gSizePerLDC[i]<<endl;\r
962     \r
963     //(fAliITSQADataMakerRec->FillRawsData(offsRw+22),i+6,gSizePerLDC[i]/1e+06);\r
964   }\r
965   \r
966   // RS Invalid\r
967   //    for(Int_t i = 0; i < fgkNumOfDDLs; i++) {\r
968   //      Double_t gSizePerDDL = ((TH1F *)fAliITSQADataMakerRec->GetRawsData(offsRw+5+i))->GetMean();\r
969   //if(i == 5)\r
970   //cout<<"DDL: "<<i+512<<" - Size: "<<gSizePerDDL<<\r
971   //" - Mean: "<<((TH1F *)fAliITSQADataMakerRec->GetRawsData(offsRw+5+i))->GetMean()<<endl;\r
972   //    }\r
973   \r
974   if(sumSSDDataSize) fAliITSQADataMakerRec->FillRawsData(offsRw+1,sumSSDDataSize/1e+03);\r
975   if(eventSize) fAliITSQADataMakerRec->FillRawsData(offsRw+2,100.*sumSSDDataSize/eventSize);\r
976   \r
977   //Occupancy calculation\r
978   if(fkOnline) {\r
979     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {\r
980       GetOccupancyStrip(fHistSSDRawSignalModule[iModule],fOccupancyMatrix[iModule]);\r
981       //if(iModule == 156) {    \r
982       //cout<<"========================================"<<endl;\r
983       //AliITSgeomTGeo::GetModuleId(656,gLayer,gLadder,gModule);\r
984       /*for(Int_t iBin = 1; iBin < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBin++) {\r
985         if((iBin >= 750)&&(iBin <= 780))\r
986         cout<<"Event: "<<nSSDEventPerCycle<<" - Ladder: "<<gLadder+499<<\r
987         " - Module: "<<gModule<<" - Strip: "<<iBin<<\r
988         " - Signal: "<<fHistSSDRawSignalModule[iModule]->GetBinContent(iBin)<<endl;\r
989         }*///strip loop --> to be removed\r
990       //}//module cut --> to be removed\r
991     }//module loop\r
992   }//online flag for SSD\r
993   \r
994   // RS Invalid\r
995   //cout<<"Event type entries: "<<((TH1*)fAliITSQADataMakerRec->GetRawsData(offsRw))->GetEntries()<<endl;\r
996   //cout<<"DDL id entries at MR: "<<((TH1F *)fAliITSQADataMakerRec->GetRawsData(offsRw+3))->GetEntries()<< endl;    \r
997   //cout<<"LDC id entries at MR: "<<((TH1F *)fAliITSQADataMakerRec->GetRawsData(offsRw+21))->GetEntries()<< endl; \r
998   \r
999   //  } //event species loop // commented by RS\r
1000   //\r
1001   return rv ; \r
1002 }\r
1003 \r
1004 //____________________________________________________________________________ //\r
1005 void AliITSQASSDDataMakerRec::GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix) { \r
1006   //Increments the entries in the occupancy matrix based \r
1007   //on whether the signal for each strip is larger than the cutoff\r
1008   //Currently the cutoff is at 0 which means that if ZS\r
1009   //works, whatever comes from the FEROM is considered as "signal"\r
1010   //Double_t cutoff = 0.0;\r
1011   TString histname = lHisto->GetName();\r
1012   //cout<<histname.Data()<<endl;\r
1013   //if(histname.Contains("Layer5_Ladder8_Module3")) {\r
1014   for(Int_t iBin = 1; iBin < lHisto->GetXaxis()->GetNbins(); iBin++) {\r
1015     Double_t y = lHisto->GetBinContent(iBin);\r
1016     if(y) {\r
1017       occupancyMatrix[iBin-1] += 1;\r
1018     }\r
1019     //if((iBin >= 750)&&(iBin <= 780))\r
1020     //cout<<"Strip: "<<iBin<<\r
1021     //" - Signal: "<<y<<\r
1022     //" - Occupancy: "<<occupancyMatrix[iBin-1]<<endl;\r
1023     \r
1024   }\r
1025   //}\r
1026 }\r
1027 \r
1028 //____________________________________________________________________________ \r
1029 Double_t AliITSQASSDDataMakerRec::GetOccupancyModule(TH1 *lHisto, \r
1030                                                      Int_t stripside,\r
1031                                                      Int_t mode,\r
1032                                                      Double_t threshold) {\r
1033   //Mode 0: calculates the occupancy of a module \r
1034   //        without a threshold in the strip occupancy\r
1035   //Mode 1: calculates the occupancy of a module \r
1036   //        with the set threshold in the strip occupancy\r
1037   //Mode 2: calculates the average occupancy of a module \r
1038 \r
1039   // bo: TDC >0 or # of sigmas wrt noise ?\r
1040   //stripside == 0 --> P-side\r
1041   //stripside == 1 --> N-side\r
1042   Int_t lNumFiredBins = 0;\r
1043   Double_t sumOccupancy = 0.0;\r
1044   TString histname = lHisto->GetName();\r
1045   for(Int_t iBin = 1 + stripside*fgkNumberOfPSideStrips; iBin < fgkNumberOfPSideStrips*(1 + stripside); iBin++){\r
1046     /*if(histname.Contains("Layer5_Ladder507_Module3")) {\r
1047       cout<<lHisto->GetName()<<\r
1048       " - Strip: "<<iBin<<\r
1049       " - Bin content: "<<lHisto->GetBinContent(iBin)<<endl;\r
1050       }*/\r
1051     if (lHisto->GetBinContent(iBin) > threshold) {\r
1052       lNumFiredBins++; \r
1053       sumOccupancy = lHisto->GetBinContent(iBin);\r
1054     }\r
1055   }\r
1056   \r
1057   Double_t lOccupancy = 0.0;\r
1058   if((mode == 0)||(mode == 1))\r
1059     lOccupancy = (100.*lNumFiredBins)/fgkNumberOfPSideStrips; // percentage  \r
1060   else if(mode == 2)\r
1061     lOccupancy = 100.*sumOccupancy/fgkNumberOfPSideStrips;\r
1062 \r
1063   /* if(histname.Contains("Layer5_Ladder507_Module3"))\r
1064      cout<<"Fired strips: "<<lNumFiredBins<<\r
1065      " - Occupancy: "<<lOccupancy<<endl;*/\r
1066   ;\r
1067   //AliDebug(AliQAv1::GetQADebugLevel(), Form("Fired strips: %d - Total strips: %d - Occupancy :%lf\n",lNumFiredBins,lHisto->GetNbinsX(),lOccupancy));\r
1068   \r
1069   return lOccupancy;\r
1070 }\r
1071 \r
1072 //____________________________________________________________________________\r
1073 void AliITSQASSDDataMakerRec::MonitorCMValues(Int_t trCl) \r
1074 {\r
1075   //Monitor in AMORE the CM values\r
1076   //for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
1077   //if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
1078   //cout << "MonitorCMValues: Event specie " << specie << " is set" << endl;\r
1079   Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
1080   int offsRw = fGenRawsOffset[specie];\r
1081    \r
1082   //compute the rms of the CM values\r
1083   Int_t gLayer = 0, gLadder = 0, gModule = 0;\r
1084   Double_t rmsPsideCM = 0.0, rmsNsideCM = 0.0;\r
1085   for(Int_t i = 0; i < fgkSSDMODULES; i++) {\r
1086     rmsPsideCM = 0.0; rmsNsideCM = 0.0;\r
1087     AliITSgeomTGeo::GetModuleId(i+500,gLayer,gLadder,gModule);\r
1088     //Printf("%s - %s",((TH1*)list->At(i))->GetName(),\r
1089     //((TH1*)list->At(1698+i))->GetName());\r
1090     rmsPsideCM = fHistSSDCMModule[i]->GetRMS();\r
1091     rmsNsideCM = fHistSSDCMModule[fgkSSDMODULES+i]->GetRMS();\r
1092     //Printf("rmsPside: %lf - rmsNside: %lf",rmsPsideCM,rmsNsideCM);\r
1093     if(gLayer == 5) {\r
1094       TH2* h4 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+4,trCl);\r
1095       if (h4) h4->SetBinContent(gModule,gLadder,rmsPsideCM);\r
1096       TH2* h5 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+5,trCl);\r
1097       if (h5) h5->SetBinContent(gModule,gLadder,rmsNsideCM);\r
1098     }\r
1099     if(gLayer == 6) {\r
1100       TH2* h6 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+6,trCl);\r
1101       if (h6) h6->SetBinContent(gModule,gLadder,rmsPsideCM);\r
1102       TH2* h7 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+7,trCl);\r
1103       if (h7) h7->SetBinContent(gModule,gLadder,rmsNsideCM);\r
1104     }\r
1105   }//module loopcdcd\r
1106    //}//event species loop\r
1107 }\r
1108 \r
1109 //____________________________________________________________________________\r
1110 void AliITSQASSDDataMakerRec::MonitorOCDBObjects(Int_t trCl) \r
1111\r
1112   //Monitor in AMORE the output of the DA\r
1113   //Currently only the bad channel list is monitored\r
1114   //Todo: Noise - Pedestal\r
1115 \r
1116 \r
1117   //for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {\r
1118   //if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;\r
1119   //cout << "MonitorOCDBObjects: Event specie " << specie << " is set" << endl;\r
1120   Int_t specie = fAliITSQADataMakerRec->GetEventSpecie();\r
1121   int offsRw = fGenRawsOffset[specie];\r
1122   fAliITSQADataMakerRec->SetEventSpecie(AliRecoParam::ConvertIndex(specie));\r
1123   \r
1124   //((TH2F *)fAliITSQADataMakerRec->ResetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset));\r
1125   //((TH2F *)fAliITSQADataMakerRec->ResetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+1));\r
1126   //((TH2F *)fAliITSQADataMakerRec->ResetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+2));\r
1127   //((TH2F *)fAliITSQADataMakerRec->ResetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+3));\r
1128   \r
1129   AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD");\r
1130   if(!entryBadChannelsSSD)AliError("OCDB entry for the bad channel list is not valid!"); \r
1131   AliITSBadChannelsSSDv2 *badchannelsSSD = NULL;\r
1132   if(entryBadChannelsSSD)badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();\r
1133   if(!badchannelsSSD)\r
1134     AliError("Bad channel list object is not a valid AliITSBadChannelsSSD object!");\r
1135 \r
1136   //_____________________________________________________________________________//                       \r
1137   Int_t nBadPSideChannels = 0, nBadNSideChannels = 0;\r
1138   Int_t layer = 0, ladder = 0, module = 0;\r
1139   Int_t nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;\r
1140   Int_t nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;\r
1141   //_____________________________________________________________________________//                      \r
1142 \r
1143   for(Int_t i = 0; i < fgkSSDMODULES; i++) {\r
1144     AliITSgeomTGeo::GetModuleId(i+500,layer,ladder,module);\r
1145     nBadPSideChannels = 0, nBadNSideChannels = 0;\r
1146     nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;\r
1147     nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;\r
1148 \r
1149     Int_t badChannel = 0;\r
1150     if(badchannelsSSD){\r
1151       for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) {\r
1152         badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j));\r
1153         if(badChannel != 0) {\r
1154           if(layer == 5)\r
1155             nPSideChannelsLayer5 += 1;\r
1156           if(layer == 6)\r
1157             nPSideChannelsLayer6 += 1;\r
1158           nBadPSideChannels += 1;\r
1159         }//badchannel flag != 0\r
1160         badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j));\r
1161         if(badChannel != 0) {\r
1162           if(layer == 5)\r
1163             nNSideChannelsLayer5 += 1;\r
1164           if(layer == 6)\r
1165             nNSideChannelsLayer6 += 1;\r
1166           nBadNSideChannels += 1;\r
1167         }//badchannel flag != 0\r
1168       }//loop over strips\r
1169     }\r
1170 \r
1171     //cout << "Bad channels P side module " << module << ": " << nBadPSideChannels << endl;\r
1172     //cout << "Bad channels N side module " << module << ": " << nBadNSideChannels << endl;\r
1173     \r
1174     if(layer == 5) {\r
1175       /*if((module == 10)&&(ladder == 10)) {\r
1176         cout<<"Npside bad: "<<nPSideChannelsLayer5<<" - Total: "<<fgkNumberOfPSideStrips<<" - Percentage: "<<(100.*nPSideChannelsLayer5/fgkNumberOfPSideStrips)<<endl;\r
1177         }*/\r
1178       TH2* h0 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset,trCl);\r
1179       if (h0) {\r
1180         if(nPSideChannelsLayer5 > 0) h0->SetBinContent(module,ladder,100.*nPSideChannelsLayer5/fgkNumberOfPSideStrips);\r
1181         else                         h0->SetBinContent(module,ladder,0.0001);\r
1182       }\r
1183       TH2* h1 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+1,trCl);\r
1184       if (h1) {\r
1185         if(nNSideChannelsLayer5 > 0) h1->SetBinContent(module,ladder,100.*nNSideChannelsLayer5/fgkNumberOfPSideStrips);\r
1186         else                         h1->SetBinContent(module,ladder,0.0001);\r
1187       }\r
1188     }//layer 5                                                                    \r
1189     if(layer == 6) {\r
1190       TH2* h2 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+2,trCl);\r
1191       if (h2) {\r
1192         if(nPSideChannelsLayer6 > 0) h2->SetBinContent(module,ladder,100.*nPSideChannelsLayer6/fgkNumberOfPSideStrips);\r
1193         else                         h2->SetBinContent(module,ladder,0.0001);\r
1194       }\r
1195       TH2* h3 = (TH2*)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+3,trCl);      \r
1196       if (h3) {\r
1197         if(nNSideChannelsLayer6 > 0) h3->SetBinContent(module,ladder,100.*nNSideChannelsLayer6/fgkNumberOfPSideStrips);\r
1198         else                         h3->SetBinContent(module,ladder,0.0001);\r
1199       }\r
1200     }//layer 6                                                              \r
1201   }//module loop\r
1202   \r
1203   //cout << "entries bad channel layer 5 n side " << ((TH2F *)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset+1))->GetEntries() << " - Bad channels P side layer 5 module 10 ladder 10: " << ((TH2F *)fAliITSQADataMakerRec->GetRawsData(offsRw+fSSDRawsOffset-fSSDRawsDAOffset))->GetBinContent(10,10)<<endl;\r
1204 \r
1205 \r
1206   //} //event species loop\r
1207 \r
1208 \r
1209 }\r
1210 \r
1211 //____________________________________________________________________________ \r
1212 Int_t AliITSQASSDDataMakerRec::InitDigits() { \r
1213   // Initialization for DIGIT data - SSD -\r
1214   const Bool_t expert   = kTRUE ; \r
1215   const Bool_t image    = kTRUE ; \r
1216   Int_t rv = 0 ; \r
1217   //  fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();\r
1218   \r
1219   // custom code here\r
1220   TH1F *fHistSSDModule = new TH1F("fHistSSDDigitsModule",\r
1221                                   ";SSD Module Number;N_{DIGITS}",\r
1222                                   1698,499.5,2197.5);  \r
1223   rv =  fAliITSQADataMakerRec->Add2DigitsList(fHistSSDModule,\r
1224                                               fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0, !expert, image);\r
1225   fSSDhDigitsTask += 1;\r
1226   TH2F *fHistSSDModuleStrip = new TH2F("fHistSSDDigitsModuleStrip",\r
1227                                        ";N_{Strip};N_{Module}",\r
1228                                        1540,0,1540,1698,499.5,2197.5);  \r
1229   rv = fAliITSQADataMakerRec->Add2DigitsList(fHistSSDModuleStrip,\r
1230                                              fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1, !expert, image);\r
1231   fSSDhDigitsTask += 1;\r
1232   \r
1233   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Digits histograms booked\n",fSSDhDigitsTask));\r
1234   return rv ; \r
1235 }\r
1236 \r
1237 //____________________________________________________________________________\r
1238 Int_t AliITSQASSDDataMakerRec::MakeDigits(TTree *digits) \r
1239\r
1240   // Fill QA for DIGIT - SSD -\r
1241   //  AliITS *fITS  = (AliITS*)gAlice->GetModule("ITS");\r
1242   //  fITS->SetTreeAddress();\r
1243   //  TClonesArray *iSSDdigits  = fITS->DigitsAddress(2);\r
1244   //  \r
1245   Int_t rv = 0 ; \r
1246   TBranch *branchD = digits->GetBranch("ITSDigitsSSD");\r
1247   if (!branchD) { \r
1248     AliError("can't get the branch with the SSD ITS digits !");\r
1249     return rv;\r
1250   }\r
1251   \r
1252   static TClonesArray statDigits("AliITSdigitSSD");\r
1253   TClonesArray *iSSDdigits = &statDigits;\r
1254   branchD->SetAddress(&iSSDdigits);  \r
1255   for(Int_t iModule = 500; iModule < 2198; iModule++) {\r
1256     iSSDdigits->Clear();\r
1257     digits->GetEvent(iModule);    \r
1258     Int_t ndigits = iSSDdigits->GetEntries();\r
1259     //printf("Module = %i \t ndigits = %i\t offset = %i \n",iModule,ndigits,fAliITSQADataMakerRec->GetEventSpecie() );\r
1260     fAliITSQADataMakerRec->FillDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0,iModule,ndigits);\r
1261     if(ndigits != 0)\r
1262       AliDebug(AliQAv1::GetQADebugLevel(),Form("Module: %d - Digits: %d",iModule,ndigits));\r
1263     \r
1264     for (Int_t iDigit = 0; iDigit < ndigits; iDigit++) {\r
1265       AliITSdigit *dig = (AliITSdigit*)iSSDdigits->UncheckedAt(iDigit);\r
1266       Int_t fStripNumber = (dig->GetCoord1() == 0) ? dig->GetCoord2() : dig->GetCoord2() + fgkNumberOfPSideStrips;\r
1267       fAliITSQADataMakerRec->FillDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1,fStripNumber,iModule,dig->GetSignal());\r
1268     }//digit loop\r
1269   }//module loop\r
1270   //\r
1271   return rv ; \r
1272 }\r
1273 \r
1274 //____________________________________________________________________________ \r
1275 Int_t AliITSQASSDDataMakerRec::InitRecPoints()\r
1276 {\r
1277   // Initialization for RECPOINTS - SSD -\r
1278   const Bool_t expert   = kTRUE ; \r
1279   const Bool_t image    = kTRUE ; \r
1280   Int_t rv = 0 ; \r
1281   //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));\r
1282   //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));\r
1283   //  fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();\r
1284   //AliDebug(AliQAv1::GetQADebugLevel(), Form("**-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints offset %d \t %d \n",fGenOffset,fGenRecPointsOffset));\r
1285   Int_t nModuleOffset = 500;\r
1286   Int_t nITSTotalModules = AliITSgeomTGeo::GetNModules();\r
1287 \r
1288   TH1F *fHistSSDModuleIdLayer5 = new TH1F("fHistSSDModuleIdLayer5",\r
1289                                           "Module Id - Layer 5;Module Id;Entries",\r
1290                                           fgkSSDMODULESLAYER5,\r
1291                                           nModuleOffset - 0.5,\r
1292                                           nITSTotalModules-fgkSSDMODULESLAYER6+0.5);\r
1293   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer5, \r
1294                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0, expert, !image);\r
1295   fSSDhRecPointsTask += 1;\r
1296   TH1F *fHistSSDModuleIdLayer6 = new TH1F("fHistSSDModuleIdLayer6",\r
1297                                           "Module Id - Layer 6;Module Id;Entries",\r
1298                                           fgkSSDMODULESLAYER6,\r
1299                                           nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,\r
1300                                           nITSTotalModules + 0.5);\r
1301   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer6, \r
1302                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1, expert, !image);\r
1303   fSSDhRecPointsTask += 1;\r
1304   TH1F *fHistSSDClusterPerEventLayer5 = new TH1F("fHistSSDClusterPerEventLayer5",\r
1305                                                  "N_{clusters} - Layer 5;N_{clusters};Entries;",\r
1306                                                  100,0.1,5000);\r
1307   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer5,\r
1308                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 2, expert, !image);\r
1309   fSSDhRecPointsTask += 1;\r
1310   TH1F *fHistSSDClusterPerEventLayer6 = new TH1F("fHistSSDClusterPerEventLayer6",\r
1311                                                  "N_{clusters} - Layer 6;N_{clusters};Entries;",\r
1312                                                  100,0.1,5000);\r
1313   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer6,\r
1314                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 3, expert, !image);\r
1315   fSSDhRecPointsTask += 1;\r
1316   TH1F *fHistSSDLocalXLayer5 = new TH1F("fHistSSDLocalXLayer5",\r
1317                                         "Local x coord.- Layer 5;x [cm];Entries;",\r
1318                                         100,-4.,4.);\r
1319   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer5,\r
1320                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 4, expert, !image);\r
1321   fSSDhRecPointsTask += 1;\r
1322   TH1F *fHistSSDLocalXLayer6 = new TH1F("fHistSSDLocalXLayer6",\r
1323                                         "Local x coord.- Layer 6;x [cm];Entries;",\r
1324                                         100,-4.,4.);\r
1325   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer6, \r
1326                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 5, expert, !image);\r
1327   fSSDhRecPointsTask += 1;\r
1328   TH1F *fHistSSDLocalZLayer5 = new TH1F("fHistSSDLocalZLayer5",\r
1329                                         "Local z coord.- Layer 5;z [cm];Entries;",\r
1330                                         100,-4.,4.);\r
1331   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer5, \r
1332                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 6, expert, !image);\r
1333   fSSDhRecPointsTask += 1;\r
1334   TH1F *fHistSSDLocalZLayer6 = new TH1F("fHistSSDLocalZLayer6",\r
1335                                         "Local z coord.- Layer 6;z [cm];Entries;",\r
1336                                         100,-4.,4.);\r
1337   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer6, \r
1338                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 7, expert, !image);\r
1339   fSSDhRecPointsTask += 1;\r
1340   TH1F *fHistSSDGlobalXLayer5 = new TH1F("fHistSSDGlobalXLayer5",\r
1341                                          "Global x - Layer 5;x [cm];Entries;",\r
1342                                          100,-40.,40.);\r
1343   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer5, \r
1344                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 8, expert, !image);\r
1345   fSSDhRecPointsTask += 1;\r
1346   TH1F *fHistSSDGlobalXLayer6 = new TH1F("fHistSSDGlobalXLayer6",\r
1347                                          "Global x - Layer 6;x [cm];Entries;",\r
1348                                          100,-45.,45.);\r
1349   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer6, \r
1350                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 9, expert, !image);\r
1351   fSSDhRecPointsTask += 1;\r
1352   TH1F *fHistSSDGlobalYLayer5 = new TH1F("fHistSSDGlobalYLayer5",\r
1353                                          "Global y - Layer 5;y [cm];Entries;",\r
1354                                          100,-40.,40);\r
1355   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer5, \r
1356                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 10, expert, !image);\r
1357   fSSDhRecPointsTask += 1;\r
1358   TH1F *fHistSSDGlobalYLayer6 = new TH1F("fHistSSDGlobalYLayer6",\r
1359                                          "Global y - Layer 6;y [cm];Entries;",\r
1360                                          100,-45.,45.);\r
1361   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer6, \r
1362                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 11, expert, !image);\r
1363   fSSDhRecPointsTask += 1;\r
1364   TH1F *fHistSSDGlobalZLayer5 = new TH1F("fHistSSDGlobalZLayer5",\r
1365                                          "Global z - Layer 5;z [cm];Entries;",\r
1366                                          100,-45.,45);\r
1367   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer5, \r
1368                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 12, expert, !image);\r
1369   fSSDhRecPointsTask += 1;\r
1370   TH1F *fHistSSDGlobalZLayer6 = new TH1F("fHistSSDGlobalZLayer6",\r
1371                                          "Global z - Layer 6;z [cm];Entries;",\r
1372                                          100,-55.,55.);\r
1373   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer6, \r
1374                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 13, expert, !image);\r
1375   fSSDhRecPointsTask += 1;\r
1376   TH1F *fHistSSDPhiLayer5 = new TH1F("fHistSSDPhiLayer5",\r
1377                                      "#phi - Layer 5;#phi [rad];Entries;",\r
1378                                      100,-TMath::Pi(),TMath::Pi());\r
1379   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer5, \r
1380                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 14, expert, !image);\r
1381   fSSDhRecPointsTask += 1;\r
1382   TH1F *fHistSSDPhiLayer6 = new TH1F("fHistSSDPhiLayer6",\r
1383                                      "#phi - Layer 6;#phi [rad];Entries;",\r
1384                                      100,-TMath::Pi(),TMath::Pi());\r
1385   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer6, \r
1386                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 15, expert, !image);\r
1387   fSSDhRecPointsTask += 1;\r
1388   TH1F *fHistSSDThetaLayer5 = new TH1F("fHistSSDThetaLayer5",\r
1389                                        "#theta - Layer 5;#theta [rad];Entries;",\r
1390                                        100,-TMath::Pi(),TMath::Pi());\r
1391   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer5, \r
1392                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 16, expert, !image);\r
1393   fSSDhRecPointsTask += 1;\r
1394   TH1F *fHistSSDThetaLayer6 = new TH1F("fHistSSDThetaLayer6",\r
1395                                        "#theta - Layer 6;#theta [rad];Entries;",\r
1396                                        100,-TMath::Pi(),TMath::Pi());\r
1397   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer6, \r
1398                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 17, expert, !image);\r
1399   fSSDhRecPointsTask += 1;\r
1400   TH1F *fHistSSDRadiusLayer5 = new TH1F("fHistSSDRadiusLayer5",\r
1401                                         "r - Layer 5;r [cm];Entries;",\r
1402                                         100,35.,50.);\r
1403   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer5, \r
1404                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 18, expert, !image);\r
1405   fSSDhRecPointsTask += 1;\r
1406   TH1F *fHistSSDRadiusLayer6 = new TH1F("fHistSSDRadiusLayer6",\r
1407                                         "r - Layer 6;r [cm];Entries;",\r
1408                                         100,35.,50.);\r
1409   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer6, \r
1410                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 19, expert, !image);\r
1411   fSSDhRecPointsTask += 1;\r
1412   TH1F *fHistSSDClusterTypeLayer5 = new TH1F("fHistSSDClusterTypeLayer5",\r
1413                                              "CL type - Layer 5;Cluster type;Entries;",\r
1414                                              150,0,150);\r
1415   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer5, \r
1416                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 20, expert, !image);\r
1417   fSSDhRecPointsTask += 1;\r
1418   TH1F *fHistSSDClusterTypeLayer6 = new TH1F("fHistSSDClusterTypeLayer6",\r
1419                                              "CL type - Layer 6;Cluster type;Entries;",\r
1420                                              150,0,150);\r
1421   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer6, \r
1422                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 21, expert, !image);\r
1423   fSSDhRecPointsTask += 1;\r
1424   TH1F *fHistSSDChargeRatioLayer5 = new TH1F("fHistSSDChargeRatioLayer5",\r
1425                                              "Charge ratio - Layer 5;q_{ratio};Entries;",\r
1426                                              100,-2.0,2.0);\r
1427   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer5, \r
1428                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 22, expert, !image);\r
1429   fSSDhRecPointsTask += 1;\r
1430   TH1F *fHistSSDChargeRatioLayer6 = new TH1F("fHistSSDChargeRatioLayer6",\r
1431                                              "Charge ratio - Layer 6;q_{ratio};Entries;",\r
1432                                              100,-2.0,2.0);\r
1433   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer6, \r
1434                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 23, expert, !image);\r
1435   fSSDhRecPointsTask += 1;\r
1436   TH1F *fHistSSDChargekeVLayer5 = new TH1F("fHistSSDChargekeVLayer5",\r
1437                                            "Charge - Layer 5;q [keV];Entries;",\r
1438                                            100,0.,300.);\r
1439   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer5, \r
1440                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 24, !expert, image);\r
1441   fSSDhRecPointsTask += 1;\r
1442   TH1F *fHistSSDChargekeVLayer6 = new TH1F("fHistSSDChargekeVLayer6",\r
1443                                            "Charge - Layer 6;q [keV];Entries;",\r
1444                                            100,0.,300.);\r
1445   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer6, \r
1446                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 25, !expert, image);\r
1447   fSSDhRecPointsTask += 1;\r
1448   TH1F *fHistSSDChargePSideLayer5 = new TH1F("fHistSSDChargePSideLayer5",\r
1449                                              "Charge P- Layer 5;q_{P} [keV];Entries;",\r
1450                                              100,0.,300.);\r
1451   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer5,\r
1452                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 26, expert, !image);\r
1453   fSSDhRecPointsTask += 1;\r
1454   TH1F *fHistSSDChargePSideLayer6 = new TH1F("fHistSSDChargePSideLayer6",\r
1455                                              "Charge P- Layer 6;q_{P} [keV];Entries;",\r
1456                                              100,0.,300.);\r
1457   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer6,\r
1458                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 27, expert, !image);\r
1459   fSSDhRecPointsTask += 1;\r
1460   TH1F *fHistSSDChargeNSideLayer5 = new TH1F("fHistSSDChargeNSideLayer5",\r
1461                                              "Charge N- Layer 5;q_{N} [keV];Entries;",\r
1462                                              100,0.,300.);\r
1463   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer5,\r
1464                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 28, expert, !image);\r
1465   fSSDhRecPointsTask += 1;\r
1466   TH1F *fHistSSDChargeNSideLayer6 = new TH1F("fHistSSDChargeNSideLayer6",\r
1467                                              "Charge N- Layer 6;q_{N} [keV];Entries;",\r
1468                                              100,0.,300.);\r
1469   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer6,\r
1470                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 29, expert, !image);\r
1471   fSSDhRecPointsTask += 1;\r
1472   TH1F *fHistSSDChargeRatio2Layer5 = new TH1F("fHistSSDChargeRatio2Layer5",\r
1473                                               "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",\r
1474                                               100,0,2);\r
1475   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer5,\r
1476                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 30, expert, !image);\r
1477   fSSDhRecPointsTask += 1;\r
1478   TH1F *fHistSSDChargeRatio2Layer6 = new TH1F("fHistSSDChargeRatio2Layer6",\r
1479                                               "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",\r
1480                                               100,0,2);\r
1481   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer6,\r
1482                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 31, expert, !image);\r
1483   fSSDhRecPointsTask += 1;\r
1484   TH2F *fHistSSDChargePNSideLayer5 = new TH2F("fHistSSDChargePNSideLayer5",\r
1485                                               "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",\r
1486                                               100,0.,300.,\r
1487                                               100,0.,300.);\r
1488   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer5,\r
1489                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 32, expert, !image);\r
1490   fSSDhRecPointsTask += 1;\r
1491   TH2F *fHistSSDChargePNSideLayer6 = new TH2F("fHistSSDChargePNSideLayer6",\r
1492                                               "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",\r
1493                                               100,0.,300.,\r
1494                                               100,0.,300.);\r
1495   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer6,\r
1496                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 33, expert, !image);\r
1497   fSSDhRecPointsTask += 1;\r
1498   TH2F *fHistSSDChargeMapLayer5 = new TH2F("fHistSSDChargeMapLayer5",\r
1499                                            "Charge map;N_{modules};N_{Ladders}",\r
1500                                            fgkSSDMODULESPERLADDERLAYER5,\r
1501                                            -0.5,fgkSSDMODULESPERLADDERLAYER5+0.5,\r
1502                                            3*fgkSSDLADDERSLAYER5,\r
1503                                            -0.5,fgkSSDLADDERSLAYER5+0.5);\r
1504   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer5, \r
1505                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 34, expert, !image);\r
1506   fSSDhRecPointsTask += 1;\r
1507   TH2F *fHistSSDChargeMapLayer6 = new TH2F("fHistSSDChargeMapLayer6",\r
1508                                            "Charge map;N_{modules};N_{Ladders}",\r
1509                                            fgkSSDMODULESPERLADDERLAYER6,\r
1510                                            -0.5,fgkSSDMODULESPERLADDERLAYER6+0.5,\r
1511                                            3*fgkSSDLADDERSLAYER6,\r
1512                                            -0.5,fgkSSDLADDERSLAYER6+0.5);\r
1513   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer6, \r
1514                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 35, expert, !image);\r
1515   fSSDhRecPointsTask += 1;\r
1516   TH2F *fHistSSDClusterMapLayer5 = new TH2F("fHistSSDClusterMapLayer5",\r
1517                                             "Layer 5;N_{module};N_{ladder}",\r
1518                                             22,1,23,\r
1519                                             34,500,534);\r
1520   fHistSSDClusterMapLayer5->GetXaxis()->SetTitleColor(1);\r
1521   fHistSSDClusterMapLayer5->SetStats(kFALSE);\r
1522   fHistSSDClusterMapLayer5->GetYaxis()->SetTitleOffset(1.8);\r
1523   fHistSSDClusterMapLayer5->GetXaxis()->SetNdivisions(22);\r
1524   fHistSSDClusterMapLayer5->GetYaxis()->SetNdivisions(34);\r
1525   fHistSSDClusterMapLayer5->GetXaxis()->SetLabelSize(0.03);\r
1526   fHistSSDClusterMapLayer5->GetYaxis()->SetLabelSize(0.03);\r
1527   fHistSSDClusterMapLayer5->GetZaxis()->SetTitleOffset(1.4);\r
1528   fHistSSDClusterMapLayer5->GetZaxis()->SetTitle("N_{clusters}");\r
1529   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer5,\r
1530                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 36, !expert, image);\r
1531   fSSDhRecPointsTask += 1;\r
1532   TH2F *fHistSSDClusterMapLayer6 = new TH2F("fHistSSDClusterMapLayer6",\r
1533                                             "Layer 6;N_{module};N_{ladder}",\r
1534                                             25,1,26,\r
1535                                             38,600,638);\r
1536   fHistSSDClusterMapLayer6->GetXaxis()->SetTitleColor(1);\r
1537   fHistSSDClusterMapLayer6->SetStats(kFALSE);\r
1538   fHistSSDClusterMapLayer6->GetYaxis()->SetTitleOffset(1.8);\r
1539   fHistSSDClusterMapLayer6->GetXaxis()->SetNdivisions(25);\r
1540   fHistSSDClusterMapLayer6->GetYaxis()->SetNdivisions(38);\r
1541   fHistSSDClusterMapLayer6->GetXaxis()->SetLabelSize(0.03);\r
1542   fHistSSDClusterMapLayer6->GetYaxis()->SetLabelSize(0.03);\r
1543   fHistSSDClusterMapLayer6->GetZaxis()->SetTitleOffset(1.4);\r
1544   fHistSSDClusterMapLayer6->GetZaxis()->SetTitle("N_{clusters}");\r
1545   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer6,\r
1546                                                 fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 37, !expert, image);\r
1547   fSSDhRecPointsTask += 1;\r
1548   //printf ("%d SSD Recs histograms booked\n",fSSDhRecPointsTask);\r
1549   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Recs histograms booked\n",fSSDhRecPointsTask));\r
1550   return rv ; \r
1551 }\r
1552 \r
1553 //____________________________________________________________________________ \r
1554 Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)\r
1555 {\r
1556   // Fill QA for recpoints - SSD -\r
1557   //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints called \n");\r
1558   //\r
1559   Int_t rv = 0 ; \r
1560   Int_t gLayer = 0, gLadder = 0, gModule = 0;\r
1561   Int_t lLadderLocationY = 0;\r
1562   TClonesArray *recpoints = NULL;\r
1563   AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();\r
1564   rpcont->FetchClusters(0,clustersTree); \r
1565   if(!rpcont->GetStatusOK() || !rpcont->IsSSDActive()){\r
1566     AliError("can't get SSD clusters !");\r
1567     return rv;\r
1568   }\r
1569  \r
1570   //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));\r
1571   //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));\r
1572   Int_t nClustersLayer5 = 0, nClustersLayer6 = 0;\r
1573   Int_t npoints = 0;      \r
1574   Float_t cluglo[3]={0.,0.,0.}; \r
1575   //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints STEP1 \n");\r
1576   // AliITSgeomTGeo::GetModuleIndex() issues an error in case the arguments\r
1577   // are illegal and returns -1\r
1578   Int_t firMod = TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(5,1,1));\r
1579   Int_t lasMod =  AliITSgeomTGeo::GetNModules();\r
1580   for(Int_t module = firMod; module < lasMod; module++){\r
1581     recpoints = rpcont->UncheckedGetClusters(module);\r
1582     npoints += recpoints->GetEntries();\r
1583     AliITSgeomTGeo::GetModuleId(module,gLayer,gLadder,gModule);\r
1584     //printf("SSDDataMAkerRec:::::::::::::::::::::::gLayer ========== %d \n\n",gLayer);\r
1585     lLadderLocationY = 3*gLadder;\r
1586     ////printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints inside loop \n");\r
1587     for(Int_t j = 0;j < recpoints->GetEntries(); j++){\r
1588       ////printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints inside loop 2\n");\r
1589       AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);    \r
1590       Int_t layer = recp->GetLayer();\r
1591       //printf("SSDDataMAkerRec:::::::::::::::::::::::layer ========== %d \n\n",layer);\r
1592       recp->GetGlobalXYZ(cluglo);\r
1593       Float_t radius = TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); \r
1594       Float_t phi = TMath::ATan2(cluglo[1],cluglo[0]);\r
1595       Float_t theta = TMath::ATan2(radius,cluglo[2]);\r
1596       Double_t chargeRatio = recp->GetChargeRatio();\r
1597       Double_t clusterCharge = recp->GetQ();\r
1598       Double_t chargePSide = clusterCharge*(1. + chargeRatio);\r
1599       Double_t chargeNSide = clusterCharge*(1. - chargeRatio);\r
1600       if(layer == 4) {\r
1601         //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 4 called \n");\r
1602         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 20,recp->GetType());\r
1603 \r
1604         if(recp->GetType() != 1) continue;\r
1605         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0,module);\r
1606         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 4,recp->GetDetLocalX());\r
1607         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 6,recp->GetDetLocalZ());\r
1608         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 8,cluglo[0]);\r
1609         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 10,cluglo[1]);\r
1610         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 12,cluglo[2]);\r
1611         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 14,phi);\r
1612         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 16,theta);\r
1613         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 18,radius);\r
1614         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 22,recp->GetChargeRatio());\r
1615         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 24,recp->GetQ());\r
1616         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 26,chargePSide);\r
1617         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 28,chargeNSide);\r
1618         if(chargePSide != 0.) fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 30,chargeNSide/chargePSide);\r
1619         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 32,chargePSide,chargeNSide);\r
1620         fAliITSQADataMakerRec->SetRecPointsDataBinContent(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 34,gModule,lLadderLocationY,recp->GetQ());\r
1621         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 36,gModule,499+gLadder,1);\r
1622         nClustersLayer5 += 1;\r
1623       }//layer 5 histograms\r
1624       if(layer == 5) {\r
1625         //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 5 called \n");\r
1626         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 21,recp->GetType());\r
1627 \r
1628         if(recp->GetType() != 1) continue;\r
1629         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1,module);\r
1630         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 5,recp->GetDetLocalX());\r
1631         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 7,recp->GetDetLocalZ());\r
1632         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 9,cluglo[0]);\r
1633         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 11,cluglo[1]);\r
1634         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 13,cluglo[2]);\r
1635         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 15,phi);\r
1636         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 17,theta);\r
1637         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 19,radius);\r
1638         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 23,recp->GetChargeRatio());\r
1639         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 25,recp->GetQ());\r
1640         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 27,chargePSide);\r
1641         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 29,chargeNSide);\r
1642         if(chargePSide != 0.) fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 31,chargeNSide/chargePSide);\r
1643         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 33,chargePSide,chargeNSide);\r
1644         fAliITSQADataMakerRec->SetRecPointsDataBinContent(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 35,gModule,lLadderLocationY,recp->GetQ());\r
1645         fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 37,gModule,599+gLadder,1);\r
1646         nClustersLayer6 += 1;\r
1647       }//layer 6 histograms\r
1648     }//rec. points loop\r
1649   }//module loop\r
1650   \r
1651   //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling called \n");\r
1652   fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 2,nClustersLayer5);\r
1653   fAliITSQADataMakerRec->FillRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 3,nClustersLayer6);\r
1654   //\r
1655   return rv ; \r
1656 }\r
1657 \r
1658 //____________________________________________________________________________ \r
1659 Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie) const {\r
1660   // Returns offset number according to the specified task \r
1661   Int_t offset=0;\r
1662   if( task == AliQAv1::kRAWS ) {\r
1663     offset=fGenRawsOffset[specie];  \r
1664   }\r
1665   else if( task == AliQAv1::kDIGITSR ) {\r
1666     offset=fGenDigitsOffset[specie];   \r
1667   }\r
1668   else if( task == AliQAv1::kRECPOINTS ) {\r
1669     offset=fGenRecPointsOffset[specie];   \r
1670   }\r
1671 \r
1672   return offset;\r
1673 }\r
1674 \r
1675 //_______________________________________________________________\r
1676 \r
1677 void AliITSQASSDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {\r
1678   // Returns offset number according to the specified task\r
1679   if( task == AliQAv1::kRAWS ) {\r
1680     fGenRawsOffset[specie]=offset;\r
1681   }\r
1682   else if( task == AliQAv1::kDIGITSR ) {\r
1683     fGenDigitsOffset[specie]=offset;\r
1684   }\r
1685   else if( task == AliQAv1::kRECPOINTS ) {\r
1686     fGenRecPointsOffset[specie]=offset;\r
1687   }\r
1688 }\r
1689 \r
1690 //____________________________________________________________________________ \r
1691 Int_t AliITSQASSDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {\r
1692   // Returns the number of histograms associated to the specified task\r
1693   Int_t histotot=0;\r
1694 \r
1695   if( task == AliQAv1::kRAWS ) {\r
1696     histotot=fSSDhRawsTask;  \r
1697   }\r
1698   else if( task == AliQAv1::kDIGITSR ) {\r
1699     histotot=fSSDhDigitsTask;\r
1700   }\r
1701   else if( task == AliQAv1::kRECPOINTS ){\r
1702     histotot=fSSDhRecPointsTask;   \r
1703   }\r
1704   else { \r
1705     AliWarning("No task has been selected. TaskHisto set to zero.\n");\r
1706   }\r
1707 \r
1708   return histotot;\r
1709 }\r
1710 \r
1711 //____________________________________________________________________________ \r
1712 void AliITSQASSDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)\r
1713 {\r
1714   if(task==AliQAv1::kRAWS) {\r
1715     ResetRawsMonitoredObjects();\r
1716   }\r
1717 \r
1718 }\r