]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASDDDataMakerRec.cxx
fixed typo for setting fraction of shared clusters
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDDataMakerRec.cxx
CommitLineData
ebdd0606 1/**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18// *************************************************************
19// Checks the quality assurance
20// by comparing with reference data
21// contained in a DB
22// -------------------------------------------------------------
23// W. Ferrarese + P. Cerello Feb 2008
8b7e858c 24// M.Siciliano Aug 2008 QA RecPoints
ebdd0606 25// INFN Torino
26
27// --- ROOT system ---
ad300de9 28
ebdd0606 29#include <TProfile2D.h>
30#include <TH2D.h>
58ceb8ca 31#include <TH1F.h>
ebdd0606 32#include <TBranch.h>
33#include <TTree.h>
ebdd0606 34#include <TMath.h>
ed340566 35//#include <TObjArray.h>
3f90b3dc 36
ebdd0606 37// --- Standard library ---
38
39// --- AliRoot header files ---
40#include "AliITSQASDDDataMakerRec.h"
4e25ac79 41#include "AliQAv1.h"
ebdd0606 42#include "AliRawReader.h"
e41192d7 43#include "AliITSRawStream.h"
ebdd0606 44#include "AliITSRawStreamSDD.h"
5192f264 45#include "AliITSdigit.h"
ebdd0606 46#include "AliITSRecPoint.h"
e62fe478 47#include "AliITSRecPointContainer.h"
ebdd0606 48#include "AliITSgeomTGeo.h"
ebdd0606 49#include "AliCDBManager.h"
ebdd0606 50#include "AliCDBEntry.h"
3f90b3dc 51#include "AliITSCalibrationSDD.h"
fc89f88c 52
cfb59c70 53class TGaxis;
54class TF1;
55class TSystem;
56class AliLog;
57class AliQAChecker;
58class AliITSRawStreamSDDCompressed;
59class AliCDBStorage;
60class Riostream;
61class AliITSdigitSDD;
62class AliITS;
63class AliRunLoader;
64class AliITSLoader;
65class AliITSDetTypeRec;
66
67
ebdd0606 68
69ClassImp(AliITSQASDDDataMakerRec)
70
71//____________________________________________________________________________
72AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :
73TObject(),
74fAliITSQADataMakerRec(aliITSQADataMakerRec),
75fkOnline(kMode),
76fLDC(ldc),
ad300de9 77fSDDhRawsTask(0),
44ed7a66 78fSDDhDigitsTask(0),
ad300de9 79fSDDhRecPointsTask(0),
78fb0b3d 80fOnlineOffsetRaws(0),
81fOnlineOffsetRecPoints(0),
ad300de9 82fGenRawsOffset(0),
44ed7a66 83fGenDigitsOffset(0),
ad300de9 84fGenRecPointsOffset(0),
ebdd0606 85fTimeBinSize(1),
3f90b3dc 86fNEvent(0),
87fNEventRP(0),
88fDDLModuleMap(0),
89fCalibration(0),
90fHistoCalibration(0)
ebdd0606 91{
92 //ctor used to discriminate OnLine-Offline analysis
8b7e858c 93 if(fLDC < 0 || fLDC > 6) {
ebdd0606 94 AliError("Error: LDC number out of range; return\n");
95 }
8b7e858c 96 fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
97 fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
4a903927 98 fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies];
8b7e858c 99 for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {
100 fGenRawsOffset[i] = 0;
101 fGenRecPointsOffset[i] = 0;
4a903927 102 fGenDigitsOffset[i]=0;
8b7e858c 103 }
3d0c40f9 104
105 InitCalibrationArray();
ebdd0606 106}
107
108//____________________________________________________________________________
109AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
110TObject(),
111fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
112fkOnline(qadm.fkOnline),
113fLDC(qadm.fLDC),
ad300de9 114fSDDhRawsTask(qadm.fSDDhRawsTask),
44ed7a66 115fSDDhDigitsTask(qadm.fSDDhDigitsTask),
ad300de9 116fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
78fb0b3d 117fOnlineOffsetRaws(qadm.fOnlineOffsetRaws),
118fOnlineOffsetRecPoints(qadm.fOnlineOffsetRecPoints),
ad300de9 119fGenRawsOffset(qadm.fGenRawsOffset),
44ed7a66 120fGenDigitsOffset(qadm.fGenDigitsOffset),
ad300de9 121fGenRecPointsOffset(qadm.fGenRecPointsOffset),
3f90b3dc 122fTimeBinSize(qadm.fTimeBinSize),
123fNEvent(qadm.fNEvent),
124fNEventRP(qadm.fNEventRP),
125fDDLModuleMap(qadm.fDDLModuleMap),
126fCalibration(qadm.fCalibration),
127fHistoCalibration(qadm.fHistoCalibration)
58ceb8ca 128{
ebdd0606 129 //copy ctor
130 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
131 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
3d0c40f9 132 //fDDLModuleMap=NULL;
ebdd0606 133}
134
135//____________________________________________________________________________
136AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
137 // destructor
58ceb8ca 138 //if(fDDLModuleMap) delete fDDLModuleMap;
3f90b3dc 139 if(fHistoCalibration){delete fHistoCalibration; fHistoCalibration=NULL;}
ebdd0606 140}
141//__________________________________________________________________
142AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
143{
7a0e5776 144 // Equal operator.
ebdd0606 145 this->~AliITSQASDDDataMakerRec();
146 new(this) AliITSQASDDDataMakerRec(qac);
147 return *this;
148}
149
150//____________________________________________________________________________
151void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
152{
cfb59c70 153
154 //Start of a QA cycle
155
1e7991d8 156 AliDebug(AliQAv1::GetQADebugLevel(),Form("Start of SDD Cycle with event specie %s for task %s\n",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()),AliQAv1::GetTaskName(fAliITSQADataMakerRec->GetTaskIndexSelected()).Data()));
8a55554e 157 if(!fCalibration)
158 {
159 //fAliITSQADataMakerRec->GetRawsData(9+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
160 CreateTheCalibration();
161 }
3d0c40f9 162
1e7991d8 163 if(fAliITSQADataMakerRec->GetEventSpecie()==0) return;//not the kDefault EventSpecie
164 //Detector specific actions at start of cycle
165 if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRAWS){
166 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
167 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return;
3f90b3dc 168
1e7991d8 169 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
8a55554e 170 fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
1e7991d8 171 fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
172 fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
173 fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
174
175 }
176 if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRECPOINTS){
177 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRECPOINTS)==kFALSE)return;
178
179 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of RecPoints normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
180
181 fAliITSQADataMakerRec->GetRecPointsData(9+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
182 fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
183 fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
8a55554e 184 fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
185
1e7991d8 186 }
ebdd0606 187}
188
189//____________________________________________________________________________
3f90b3dc 190void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray* /*list*/)
ebdd0606 191{
cfb59c70 192 //end of a QA cycle
6649909b 193 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
194
195 Double_t entriescalibration1= 0.;
196 Double_t entriescalibrationL3=0.;
197 Double_t entriescalibrationL4=0.;
198
199 if(fHistoCalibration){
200 entriescalibration1= ((TH1D*)(fHistoCalibration->At(0)))->GetEntries();
201 entriescalibrationL3=((TH2D*)(fHistoCalibration->At(1)))->GetEntries();
202 entriescalibrationL4=((TH2D*)(fHistoCalibration->At(2)))->GetEntries();
203 }
204 else{ AliWarning("Calibration TObjArray is NULL! No Normalization and calibtaion plot will be filled\n");}
205 if(task==AliQAv1::kRAWS){
206 // printf("fNevent %d \n",fNEvent);
207
208 ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEvent);
209
210 if(fNEvent!=0){
211
212 Double_t entriesmodpattern=((TH1D*)fAliITSQADataMakerRec->GetRawsData(0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
213 Double_t entriesL3=((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
214 Double_t entriesL4=((TH2D*)fAliITSQADataMakerRec->GetRawsData(2 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
215
216 Double_t normentriesmodpattern=0.;
217 Double_t normentriesL3= 0.;
218 Double_t normentriesL4= 0.;
219
220 if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEvent);
221 if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*fNEvent);
222 if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*fNEvent);
223
224 ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(2,normentriesmodpattern);
225 ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(3,normentriesL3);
226 ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(4,normentriesL4);
227
228 if(fHistoCalibration){
229 ((TH1D*)fAliITSQADataMakerRec->GetRawsData(3 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRawsData(0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEvent);
3f90b3dc 230
6649909b 231 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEvent);
232
233 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(2 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEvent);
234 }
235 }
236 Int_t xbin3 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
237 Int_t ybin3 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
238
239 for(Int_t i=0; i<xbin3; i++) {
240 for(Int_t j=0; j<ybin3; j++) {
241 ((TH1D*)fAliITSQADataMakerRec->GetRawsData(6 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
242 }
243 }
244
245 Int_t xbin4 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
246 Int_t ybin4 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
247
248 for(Int_t i=0; i<xbin4; i++) {
249 for(Int_t j=0; j<ybin4; j++) {
250 ((TH1D*)fAliITSQADataMakerRec->GetRawsData(7 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
251 }
252 }
253
254 if(fHistoCalibration){
255 for(Int_t inumb=8;inumb<10;inumb++)
256 {
257 for(Int_t ii=1; ii<fAliITSQADataMakerRec->GetRawsData(inumb + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsX()+1;ii++)
258 {
259 for(Int_t jj=1; jj<fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsY()+1;jj++)
260 {
78fb0b3d 261
6649909b 262 if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) != 0. )
263 {
264 fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,1);
265 }
266 else if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) == 0. )
267 {
268 fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,0);
269 }
270 //printf("%d \t %d \t %d \t %02f \n",inumb,ii,jj,fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetBinContent(ii,jj));
271 }//end x axis
272 }//end y axis
273 }//end for inumb
274 }
275
276
277 }//end raws
278
279 if(task==AliQAv1::kRECPOINTS){
280
281
282 Double_t chargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
283 Double_t errchargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
284
285 Double_t chargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
286 Double_t errchargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
287
288
289 Double_t radiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
290 Double_t errradiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
291
292 Double_t radiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
293 Double_t errradiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
294
295
296
297 // printf("fNeventRP %d \n",fNEventRP);
298 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEventRP);
299
300 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(31,chargeL3);
301 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(31,errchargeL3);
302
303 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(47,chargeL4);
304 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(47,errchargeL4);
305
306 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(32,radiusL3);
307 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(32,errradiusL3);
308
309 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(48,radiusL4);
310 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(48,errradiusL4);
311
312
313 Double_t entriesmodpattern=((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(6 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
314 Double_t entriesL3=((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
315 Double_t entriesL4=((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
316
317 //printf("entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",entriesmodpattern,entriesL3,entriesL4 );
318
319 if(fNEventRP!=0){
320
321
322
323 Double_t normentriesmodpattern=0.;
324 Double_t normentriesL3= 0.;
325 Double_t normentriesL4= 0.;
326
327 if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEventRP);
328 if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*fNEventRP);
329 if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*fNEventRP);
330
331 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(2,normentriesmodpattern);
332 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(3,normentriesL3);
333 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(4,normentriesL4);
334
335 // printf("NORM entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",normentriesmodpattern,normentriesL3,normentriesL4 );
336
337 if(fHistoCalibration){
338 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(9 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(6 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEventRP);
339
340 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
341
342 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEventRP);
343
344 // ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(21+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
345
346 // ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(22+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEventRP);
347 }
348 }
349 Int_t xbin3 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
350 Int_t ybin3 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
351
352 for(Int_t i=0; i<xbin3; i++) {
353 for(Int_t j=0; j<ybin3; j++) {
354 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(19 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
355 }
356 }
357
358 Int_t xbin4 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
359 Int_t ybin4 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
360
361 for(Int_t i=0; i<xbin4; i++) {
362 for(Int_t j=0; j<ybin4; j++) {
363 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(20 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
364 }
365 }
366
367 // RecPoints 2 Raws Ratio
368 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kTRUE)
369 {
370 Int_t xbin3RP = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(21 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
371 Int_t ybin3RP = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(21 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
372 Int_t xbin3R = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
373 Int_t ybin3R = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
374 if((xbin3RP == xbin3R) && (ybin3RP == ybin3R)) {
375 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(21 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide(((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])),((TH2D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])));
376 for(Int_t i=0; i<xbin3R; i++) {
377 for(Int_t j=0; j<ybin3R; j++) {
378 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(23 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(21 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
379 }
3f90b3dc 380 }
6649909b 381 } else
382 AliWarning("Number of bins for Raws and RecPoints (Layer 3) do not match\n");
3f90b3dc 383
6649909b 384 Int_t xbin4RP = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(22 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
385 Int_t ybin4RP = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(22 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
386 Int_t xbin4R = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
387 Int_t ybin4R = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
388 if((xbin4RP == xbin4R) && (ybin4RP == ybin4R)) {
389 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(22 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide(((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])),((TH2D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])));
390 // ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(22 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide(((TH2D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])));
391 for(Int_t i=0; i<xbin4R; i++) {
392 for(Int_t j=0; j<ybin4R; j++) {
393 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(24 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(22 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
394 }
395 }
396 } else
397 AliWarning("Number of bins for Raws and RecPoints (Layer 4) do not match\n");
398 }
399 else{AliWarning("Ratio between RecPoints and Raws not executed because the raw list has not been created\n");}
400 }//end recpoints
401
ebdd0606 402}
403
404//____________________________________________________________________________
eca4fa66 405Int_t AliITSQASDDDataMakerRec::InitRaws()
ebdd0606 406{
3d0c40f9 407
ebdd0606 408 // Initialization for RAW data - SDD -
7d297381 409 const Bool_t expert = kTRUE ;
410 const Bool_t saveCorr = kTRUE ;
411 const Bool_t image = kTRUE ;
58ceb8ca 412
eca4fa66 413 Int_t rv = 0 ;
ebdd0606 414 Int_t lay, lad, det;
ebdd0606 415 Int_t indexlast = 0;
416 Int_t index1 = 0;
417
78fb0b3d 418 fSDDhRawsTask = 0;
419 if(fkOnline){AliInfo("Book Online Histograms for SDD\n");}
3f90b3dc 420 else {AliInfo("Book Offline Histograms for SDD\n ");}
7a0e5776 421 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
ebdd0606 422 h0->GetXaxis()->SetTitle("Module Number");
423 h0->GetYaxis()->SetTitle("Counts");
8a55554e 424 h0->SetOption("bar1");
425 h0->SetBarOffset(0.01);
426 h0->SetBarWidth(0.95);
427 h0->SetFillColor(45);
ce8c37f2 428 rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
ad300de9 429 fSDDhRawsTask++;
7a0e5776 430
431 //zPhi distribution using ladder and modules numbers
3f90b3dc 432 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//1
5af1d436 433 hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]");
434 hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
8a55554e 435 hphil3->SetStats(0);
436 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
7a0e5776 437 fSDDhRawsTask++;
438
3f90b3dc 439 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //2
5af1d436 440 hphil4->GetXaxis()->SetTitle("z[Module Number L4]");
441 hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
8a55554e 442 hphil4->SetStats(0);
443 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
7a0e5776 444 fSDDhRawsTask++;
445
3f90b3dc 446 //normalized histograms
447 TH1D *h0norm = new TH1D("SDDModPatternNORM","NORM HW Modules pattern",fgknSDDmodules,239.5,499.5); //3
448 h0norm->GetXaxis()->SetTitle("Module Number");
449 h0norm->GetYaxis()->SetTitle("Counts");
8a55554e 450 h0norm->SetOption("bar1");
451 h0norm->SetBarOffset(0.01);
452 h0norm->SetBarWidth(0.95);
453 h0norm->SetFillColor(46);
454 //h0norm->SetStats(0);
3f90b3dc 455 rv = fAliITSQADataMakerRec->Add2RawsList(h0norm,3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
456 fSDDhRawsTask++;
457
458 //zPhi distribution using ladder and modules numbers
459 TH2D *hphil3norm = new TH2D("SDDphizL3NORM","NORM SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//4
460 hphil3norm->GetXaxis()->SetTitle("z[Module Number L3 ]");
461 hphil3norm->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
8a55554e 462 hphil3norm->SetStats(0);
463 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
3f90b3dc 464 fSDDhRawsTask++;
465
466 TH2D *hphil4norm = new TH2D("SDDphizL4NORM","NORM SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //5
467 hphil4norm->GetXaxis()->SetTitle("z[Module Number L4]");
468 hphil4norm->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
8a55554e 469 hphil4norm->SetStats(0);
470 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
3f90b3dc 471 fSDDhRawsTask++;
ebdd0606 472
78fb0b3d 473
8a55554e 474 Float_t hMax = 0.2;
7a0e5776 475
8a55554e 476 TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy",200,0.,hMax);
477 rv = fAliITSQADataMakerRec->Add2RawsList(oL3,6+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //6
478 fSDDhRawsTask++;
479
480 TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy",200,0.,hMax);
481 rv = fAliITSQADataMakerRec->Add2RawsList(oL4,7+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //7
482 fSDDhRawsTask++;
483
484 //zPhi distribution using ladder and modules numbers
485 TH2D *hcalibl3 = new TH2D("SDDphizCalibL3","SDDCalibL3 ",12,0.5,6.5,14,0.5,14.5);//8
486 hcalibl3->GetXaxis()->SetTitle("z[Module Number L3]");
487 hcalibl3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
488 hcalibl3->SetStats(0);
489 hcalibl3->SetMaximum(2);
490 rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl3,8+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
491 fSDDhRawsTask++;
492
493 TH2D *hcalibl4 = new TH2D("SDDphizCalibL4","SDDCalibL4 ",16,0.5,8.5,22,0.5,22.5); //9
494 hcalibl4->GetXaxis()->SetTitle("z[Module Number L4]");
495 hcalibl4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
496 hcalibl4->SetStats(0);
497 hcalibl4->SetMaximum(2);
498 rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl4,9+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
499 fSDDhRawsTask++;
500
501 TH1F *hsummarydata = new TH1F("SDDRawDataCheck","SDDRawDataCheck",46,-0.5,45.5);//10 summary of raw data checks
502 hsummarydata->GetXaxis()->SetLabelSize(0.02);
503 hsummarydata->GetXaxis()->SetTickLength(0.01);
504 hsummarydata->GetXaxis()->SetNdivisions(110);
505 hsummarydata->GetXaxis()->SetTicks("-");
506 hsummarydata->GetYaxis()->SetLabelSize(0.02);
507 hsummarydata->GetYaxis()->SetTitleSize(0.02);
508 hsummarydata->GetYaxis()->SetTitleOffset(1.5);
509 hsummarydata->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)");
510 hsummarydata->SetStats(0);
511 hsummarydata->SetMaximum(272);
512 hsummarydata->SetMinimum(0.);
513
514 hsummarydata->SetOption("textbar1");
515 hsummarydata->SetBarOffset(0.01);
516 hsummarydata->SetBarWidth(0.95);
517 hsummarydata->SetFillColor(8);
518
519 //information about the events
520 hsummarydata->GetXaxis()->SetBinLabel(1,"Events");
521 hsummarydata->GetXaxis()->SetBinLabel(2,"Ent_NORM");
522 hsummarydata->GetXaxis()->SetBinLabel(3,"Ent_NORML3");
523 hsummarydata->GetXaxis()->SetBinLabel(4,"Ent_NORML4");
524 //all
525
526 hsummarydata->GetXaxis()->SetBinLabel(5,"m_act");
527 hsummarydata->GetXaxis()->SetBinLabel(6,"m_fil");
528 hsummarydata->GetXaxis()->SetBinLabel(7,"dr_act");
529 hsummarydata->GetXaxis()->SetBinLabel(8,"dr_fil");
530 hsummarydata->GetXaxis()->SetBinLabel(9,"m_exc");
531 hsummarydata->GetXaxis()->SetBinLabel(10,"m_emp");
532 hsummarydata->GetXaxis()->SetBinLabel(11,"dr_exc");
533 hsummarydata->GetXaxis()->SetBinLabel(12,"dr_emp");
534 hsummarydata->GetXaxis()->SetBinLabel(13,"m_exc-act");
535 hsummarydata->GetXaxis()->SetBinLabel(14,"m_act-emp");
536 hsummarydata->GetXaxis()->SetBinLabel(15,"dr_exc-act");
537 hsummarydata->GetXaxis()->SetBinLabel(16,"dr_act-emp");
538 hsummarydata->GetXaxis()->SetBinLabel(17,"m_overth");
539 hsummarydata->GetXaxis()->SetBinLabel(18,"dr_overth");
540
541 //l3
542
543 hsummarydata->GetXaxis()->SetBinLabel(19,"m_actl3");
544 hsummarydata->GetXaxis()->SetBinLabel(20,"m_fill3");
545 hsummarydata->GetXaxis()->SetBinLabel(21,"dr_actl3");
546 hsummarydata->GetXaxis()->SetBinLabel(22,"dr_fill3");
547 hsummarydata->GetXaxis()->SetBinLabel(23,"m_excl3");
548 hsummarydata->GetXaxis()->SetBinLabel(24,"m_empl3");
549 hsummarydata->GetXaxis()->SetBinLabel(25,"dr_excl3");
550 hsummarydata->GetXaxis()->SetBinLabel(26,"dr_empl3");
551 hsummarydata->GetXaxis()->SetBinLabel(27,"m_exc-actl3");
552 hsummarydata->GetXaxis()->SetBinLabel(28,"m_act-empl3");
553 hsummarydata->GetXaxis()->SetBinLabel(29,"dr_exc-actl3");
554 hsummarydata->GetXaxis()->SetBinLabel(30,"dr_act-empl3");
555 hsummarydata->GetXaxis()->SetBinLabel(31,"m_overthl3");
556 hsummarydata->GetXaxis()->SetBinLabel(32,"dr_overthl3");
557
558 //l4
559
560 hsummarydata->GetXaxis()->SetBinLabel(33,"m_actl4");
561 hsummarydata->GetXaxis()->SetBinLabel(34,"m_fill4");
562 hsummarydata->GetXaxis()->SetBinLabel(35,"dr_actl4");
563 hsummarydata->GetXaxis()->SetBinLabel(36,"dr_fill4");
564 hsummarydata->GetXaxis()->SetBinLabel(37,"m_excl4");
565 hsummarydata->GetXaxis()->SetBinLabel(38,"m_empl4");
566 hsummarydata->GetXaxis()->SetBinLabel(39,"dr_excl4");
567 hsummarydata->GetXaxis()->SetBinLabel(40,"dr_empl4");
568 hsummarydata->GetXaxis()->SetBinLabel(41,"m_exc-actl4");
569 hsummarydata->GetXaxis()->SetBinLabel(42,"m_act-empl4");
570 hsummarydata->GetXaxis()->SetBinLabel(43,"dr_exc-actl4");
571 hsummarydata->GetXaxis()->SetBinLabel(44,"dr_act-empl4");
572 hsummarydata->GetXaxis()->SetBinLabel(45,"m_overthl4");
573 hsummarydata->GetXaxis()->SetBinLabel(46,"dr_overthl4");
574 hsummarydata->GetXaxis()->LabelsOption("v");
575
576 rv = fAliITSQADataMakerRec->Add2RawsList(hsummarydata,10+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
577 fSDDhRawsTask++;
578 fOnlineOffsetRaws = fSDDhRawsTask;
579
580 //online part
581 if(fkOnline){
582 //DDL Pattern
583 TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); //11
584 hddl->GetXaxis()->SetTitle("Channel");
585 hddl->GetYaxis()->SetTitle("DDL Number");
586 rv = fAliITSQADataMakerRec->Add2RawsList(hddl,fOnlineOffsetRaws+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
587 fSDDhRawsTask++;
588 Int_t indexlast1 = 0;
589
590 fTimeBinSize = 4;
591 indexlast = 0;
592 index1 = 0;
593 indexlast1 = fSDDhRawsTask;
594 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
595 for(Int_t iside=0;iside<fgknSide;iside++){
596 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
597 TProfile2D *fModuleChargeMapFSE = new TProfile2D(Form("SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside) ,256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
598 fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
599 fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
600 rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
601 fSDDhRawsTask++;
602 index1++;
7a0e5776 603 }
8a55554e 604 }
7a0e5776 605
8a55554e 606 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
607 for(Int_t iside=0;iside<fgknSide;iside++){
608 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
609 TProfile2D *fModuleChargeMap = new TProfile2D(Form("SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside),256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
610 fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
611 fModuleChargeMap->GetYaxis()->SetTitle("Anode Number");
612 rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
613 fSDDhRawsTask++;
614 index1++;
7a0e5776 615 }
8a55554e 616 }
617
618 //Event Size
619 TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",500,-0.5,199.5);
620 hsize->SetBit(TH1::kCanRebin);
621 hsize->GetXaxis()->SetTitle("Event Size [kB]");
622 hsize->GetYaxis()->SetTitle("Entries");
623 rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
624 fSDDhRawsTask++;
625
626 } // kONLINE
627
628 cout << fSDDhRawsTask << " SDD Raws histograms booked" << endl;
629
630 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
631 return rv ;
ebdd0606 632}
633
634
635//____________________________________________________________________________
eca4fa66 636Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
ebdd0606 637{
638 // Fill QA for RAW - SDD -
3f90b3dc 639 Int_t rv = 0;
7555afef 640 // Check id histograms already created for this Event Specie
3f90b3dc 641 fNEvent++;
642 if(!fDDLModuleMap){CreateTheMap();}
eca4fa66 643 if(rawReader->GetType() != 7) return rv; // skips non physical triggers
5379c4a3 644 AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");
e41192d7 645 rawReader->Reset();
58ceb8ca 646 rawReader->Select("ITSSDD");
8b7e858c 647 AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
648 stream->SetDDLModuleMap(fDDLModuleMap);
e41192d7 649
ebdd0606 650 Int_t lay, lad, det;
7a0e5776 651
ebdd0606 652 Int_t index=0;
653 if(fkOnline) {
654 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
7a0e5776 655 for(Int_t iside=0;iside<fgknSide;iside++) {
78fb0b3d 656 if(fSDDhRawsTask > fOnlineOffsetRaws + 1 + index) fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws + 1 + index +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
7a0e5776 657 // 4 because the 2D histos for single events start after the fourth position
658 index++;
659 }
ebdd0606 660 }
661 }
e41192d7 662
ebdd0606 663 Int_t cnt = 0;
664 Int_t ildcID = -1;
665 Int_t iddl = -1;
666 Int_t isddmod = -1;
7a0e5776 667 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
58ceb8ca 668 //if(fkOnline)
669 //{
670 Int_t prevDDLID = -1;
671 UInt_t size = 0;
672 int totalddl=static_cast<int>(fDDLModuleMap->GetNDDLs());
673 Bool_t *ddldata=new Bool_t[totalddl];
674 for(Int_t jddl=0;jddl<totalddl;jddl++){ddldata[jddl]=kFALSE;}
675 //}
e41192d7 676 while(stream->Next()) {
ebdd0606 677 ildcID = rawReader->GetLDCId();
58ceb8ca 678 iddl = rawReader->GetDDLID();// - fgkDDLIDshift;
d2f99642 679 if(iddl<0)isddmod=-1;
3f90b3dc 680 //printf("----------------------iddl %i\n",iddl);
d2f99642 681 else isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
58ceb8ca 682
ebdd0606 683 if(isddmod==-1){
5379c4a3 684 AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
ebdd0606 685 continue;
686 }
e41192d7 687 if(stream->IsCompletedModule()) {
5379c4a3 688 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n"));
ebdd0606 689 continue;
690 }
de075dae 691 if(stream->IsCompletedDDL()) {
58ceb8ca 692 if(fkOnline){
693 if ((rawReader->GetDDLID() != prevDDLID)&&(ddldata[iddl])==kFALSE){
694 size += rawReader->GetDataSize();//in bytes
695 prevDDLID = rawReader->GetDDLID();
696 ddldata[iddl]=kTRUE;
697 }
698 }
5379c4a3 699 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n"));
de075dae 700 continue;
701 }
ebdd0606 702
e41192d7 703 coord1 = stream->GetCoord1();
704 coord2 = stream->GetCoord2();
705 signal = stream->GetSignal();
ebdd0606 706
7a0e5776 707 moduleSDD = isddmod - fgkmodoffset;
708
b62d7123 709 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
5379c4a3 710 AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
b62d7123 711 isddmod = 1;
ebdd0606 712 }
7a0e5776 713
ebdd0606 714 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
e41192d7 715 Short_t iside = stream->GetChannel();
ad300de9 716
58ceb8ca 717 //printf(" \n%i %i %i %i \n ",lay, lad, det,iside );
718 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod);
8a55554e 719 if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad); //phiz l3 not norm
720 if(lay==4) fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad); //phiz l4 not norm
58ceb8ca 721
ebdd0606 722 if(fkOnline) {
fc89f88c 723
78fb0b3d 724 fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill((stream->GetCarlosId())+0.5*iside -0.5,iddl);
3f90b3dc 725 // printf("content ddlmap %d, %d = %f \n",(stream->GetCarlosId()+0.5*iside -0.5),iddl,fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetBinContent(1+(det-1)*2;lad));
726 //printf("content ddlmap %d, %d = %f \n",(stream->GetCarlosId())+0.5*iside -0.5,iddl,fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetBinContent(1+(stream->GetCarlosId()-1)*2,iddl));
7a0e5776 727 activeModule = moduleSDD;
728 index1 = activeModule * 2 + iside;
729
730 if(index1<0){
5379c4a3 731 AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
78fb0b3d 732 index1 = 0;
7a0e5776 733 }
78f8430c 734
78fb0b3d 735 if(fSDDhRawsTask > fOnlineOffsetRaws +1 + index1) {
736 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws +1 + index1 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal);
737 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws +1 + index1 + 260*2 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal);
ebdd0606 738 }
58ceb8ca 739 }//online
7a0e5776 740 cnt++;
5379c4a3 741 if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt));
58ceb8ca 742 }//end next()
78fb0b3d 743 if(fkOnline){((TH1F*)(fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws +1 + 260*4 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(size/1024.);//KB
3f90b3dc 744 }
78fb0b3d 745
5379c4a3 746 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt));
e41192d7 747 delete stream;
748 stream = NULL;
8b7e858c 749
750// if(fkOnline) {
751// AnalyseBNG(); // Analyse Baseline, Noise, Gain
752// AnalyseINJ(); // Analyse Injectors
753// }
754
58ceb8ca 755 delete []ddldata;
756 ddldata=NULL;
eca4fa66 757 return rv ;
7a0e5776 758}
ebdd0606 759
44ed7a66 760//____________________________________________________________________________
eca4fa66 761Int_t AliITSQASDDDataMakerRec::InitDigits()
44ed7a66 762{
3d0c40f9 763 // if(!fHistoCalibration)InitCalibrationArray();
44ed7a66 764 // Initialization for DIGIT data - SDD -
765 const Bool_t expert = kTRUE ;
766 const Bool_t image = kTRUE ;
eca4fa66 767 Int_t rv = 0 ;
768// fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
44ed7a66 769 //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List
770 TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod
771 h0->GetXaxis()->SetTitle("SDD Module Number");
772 h0->GetYaxis()->SetTitle("# DIGITS");
4a903927 773 rv = fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 774 fSDDhDigitsTask ++;
4a903927 775 // printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
44ed7a66 776 TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc
777 h1->GetXaxis()->SetTitle("Anode Number");
778 h1->GetYaxis()->SetTitle("# DIGITS");
4a903927 779 rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 780 fSDDhDigitsTask ++;
4a903927 781 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
44ed7a66 782 TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc
783 h2->GetXaxis()->SetTitle("Tbin Number");
784 h2->GetYaxis()->SetTitle("# DIGITS");
4a903927 785 rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 786 fSDDhDigitsTask ++;
4a903927 787 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
44ed7a66 788 TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig
789 h3->GetXaxis()->SetTitle("ADC Value");
790 h3->GetYaxis()->SetTitle("# DIGITS");
4a903927 791 rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 792 fSDDhDigitsTask ++;
4a903927 793 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
44ed7a66 794 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask));
eca4fa66 795 return rv ;
44ed7a66 796}
797
798//____________________________________________________________________________
eca4fa66 799Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
44ed7a66 800{
7555afef 801
44ed7a66 802 // Fill QA for DIGIT - SDD -
fc89f88c 803 //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
804 //fITS->SetTreeAddress();
805 //TClonesArray *iITSdigits = fITS->DigitsAddress(1);
806
807
eca4fa66 808 Int_t rv = 0 ;
809
fc89f88c 810 TBranch *branchD = digits->GetBranch("ITSDigitsSDD");
811
812 if (!branchD) {
813 AliError("can't get the branch with the ITS SDD digits !");
eca4fa66 814 return rv ;
44ed7a66 815 }
eca4fa66 816 // Check id histograms already created for this Event Specie
8b7e858c 817// if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
818// rv = InitDigits() ;
eca4fa66 819
fc89f88c 820 static TClonesArray statDigits("AliITSdigitSDD");
44ed7a66 821 TClonesArray *iITSdigits = &statDigits;
822 branchD->SetAddress(&iITSdigits);
fc89f88c 823
44ed7a66 824 for(Int_t i=0; i<260; i++){
825 Int_t nmod=i+240;
826 digits->GetEvent(nmod);
827 Int_t ndigits = iITSdigits->GetEntries();
4a903927 828 fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nmod,ndigits);
7555afef 829
44ed7a66 830 for (Int_t idig=0; idig<ndigits; idig++) {
831 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
832 Int_t iz=dig->GetCoord1(); // cell number z
833 Int_t ix=dig->GetCoord2(); // cell number x
834 Int_t sig=dig->GetSignal();
4a903927 835 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iz);
836 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ix);
837 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(sig);
44ed7a66 838 }
839 }
eca4fa66 840 return rv ;
44ed7a66 841}
842
ebdd0606 843//____________________________________________________________________________
eca4fa66 844Int_t AliITSQASDDDataMakerRec::InitRecPoints()
ebdd0606 845{
3d0c40f9 846 //if(!fHistoCalibration)InitCalibrationArray();
8b7e858c 847 //AliInfo("Initialize SDD recpoints histos\n");
ebdd0606 848 // Initialization for RECPOINTS - SDD -
7d297381 849 const Bool_t expert = kTRUE ;
850 const Bool_t image = kTRUE ;
eca4fa66 851 Int_t rv = 0 ;
852// fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
ad300de9 853
8b7e858c 854 //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
855 //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
be2d913a 856 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",250,-0.5, 499.5); //position number 0
3f90b3dc 857 //h0->SetBit(TH1::kCanRebin);
cfb59c70 858 h0->GetXaxis()->SetTitle("KeV");
ebdd0606 859 h0->GetYaxis()->SetTitle("Entries");
80b9610c 860 rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
ad300de9 861 fSDDhRecPointsTask++;
ebdd0606 862
be2d913a 863 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",250,-0.5, 499.5);//position number 1
3f90b3dc 864 //h1->SetBit(TH1::kCanRebin);
cfb59c70 865 h1->GetXaxis()->SetTitle("Kev");
ebdd0606 866 h1->GetYaxis()->SetTitle("Entries");
80b9610c 867 rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
ad300de9 868 fSDDhRecPointsTask++;
ebdd0606 869
be2d913a 870 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",56,-28,28,56,-28,28);//position number 2
ebdd0606 871 h2->GetYaxis()->SetTitle("Y[cm]");
872 h2->GetXaxis()->SetTitle("X[cm]");
80b9610c 873 rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
ad300de9 874 fSDDhRecPointsTask++;
ebdd0606 875
be2d913a 876 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",128,-32,32,56,12,26);//position number 3
ebdd0606 877 h3->GetYaxis()->SetTitle("R[cm]");
878 h3->GetXaxis()->SetTitle("Z[cm]");
80b9610c 879 rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
ad300de9 880 fSDDhRecPointsTask++;
ebdd0606 881
78fb0b3d 882 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",96,-23,23,112,-TMath::Pi(),TMath::Pi());//position number 4
ebdd0606 883 h4->GetYaxis()->SetTitle("#phi[rad]");
884 h4->GetXaxis()->SetTitle("Z[cm]");
80b9610c 885 rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
ad300de9 886 fSDDhRecPointsTask++;
ebdd0606 887
78fb0b3d 888 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",128,-31,31,176,-TMath::Pi(),TMath::Pi());//position number 5
ebdd0606 889 h5->GetYaxis()->SetTitle("#phi[rad]");
890 h5->GetXaxis()->SetTitle("Z[cm]");
80b9610c 891 rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
ad300de9 892 fSDDhRecPointsTask++;
ebdd0606 893
3f90b3dc 894 TH1D *h6 = new TH1D("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
ebdd0606 895 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
896 h6->GetYaxis()->SetTitle("Entries");
8a55554e 897 h6->SetOption("bar1");
898 h6->SetBarOffset(0.01);
899 h6->SetBarWidth(0.95);
900 h6->SetFillColor(39);
80b9610c 901 rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 902 fSDDhRecPointsTask++;
58ceb8ca 903
3f90b3dc 904
905 TH2D *h7 = new TH2D("SDDModPatternL3RP","Modules pattern L3 RP",12,0.5,6.5,14,0.5,14.5); //position number 7
5af1d436 906 h7->GetXaxis()->SetTitle("z[#Module L3 ]");
907 h7->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
3f90b3dc 908 rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 909 fSDDhRecPointsTask++;
58ceb8ca 910
3f90b3dc 911 TH2D *h8 = new TH2D("SDDModPatternL4RP","Modules pattern L4 RP",16,0.5,8.5,22,0.5,22.5); //position number 8
5af1d436 912 h8->GetXaxis()->SetTitle("[#Module L3 ]");
913 h8->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
3f90b3dc 914 rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
915 fSDDhRecPointsTask++;
916
917 //------------------------norm--------------------------//
918
919
920 TH1D *h9 = new TH1D("SDDModPatternRPNORM","Modules pattern RP NORM",fgknSDDmodules,239.5,499.5); //position number 9
921 h9->GetXaxis()->SetTitle("Module number"); //spd offset = 240
922 h9->GetYaxis()->SetTitle("Entries");
8a55554e 923 h9->SetOption("bar1");
924 h9->SetBarOffset(0.01);
925 h9->SetBarWidth(0.95);
926 h9->SetFillColor(49);
3f90b3dc 927 rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 928 fSDDhRecPointsTask++;
58ceb8ca 929
3f90b3dc 930
931 TH2D *h10 = new TH2D("SDDModPatternL3RPNORM","Modules pattern L3 RP NORM",12,0.5,6.5,14,0.5,14.5); //position number 10
932 h10->GetXaxis()->SetTitle("z[#Module L3 ]");
933 h10->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
934 rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
935 fSDDhRecPointsTask++;
936
937 TH2D *h11 = new TH2D("SDDModPatternL4RPNORM","Modules pattern L4 RP NORM",16,0.5,8.5,22,0.5,22.5); //position number 11
78fb0b3d 938 h11->GetXaxis()->SetTitle("[#Module L4 ]");
3f90b3dc 939 h10->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
940 rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
941 fSDDhRecPointsTask++;
942
943 //--------------------------------------------------------//
944
be2d913a 945 TH2F *h12 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",160,-4,4,160,-4,4);//position number 12
3f90b3dc 946 h12->GetXaxis()->SetTitle("X local coord, drift, cm");
947 h12->GetYaxis()->SetTitle("Z local coord, anode, cm");
948 rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 949 fSDDhRecPointsTask++;
58ceb8ca 950
951 //AliInfo("Create SDD recpoints histos\n");
952
3f90b3dc 953 TH1F *h13 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,16.5);//position number 13 (L3)
954 h13->SetBit(TH1::kCanRebin);
955 h13->GetXaxis()->SetTitle("r[cm]");
956 h13->GetXaxis()->CenterTitle();
957 h13->GetYaxis()->SetTitle("Entries");
958 rv = fAliITSQADataMakerRec->Add2RecPointsList(h13,13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
58ceb8ca 959 fSDDhRecPointsTask++;
960
3f90b3dc 961 TH1F *h14 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,23.,25.);// and position number 14 (L4)
962 h14->SetBit(TH1::kCanRebin);
963 h14->GetXaxis()->SetTitle("r[cm]");
964 h14->GetXaxis()->CenterTitle();
965 h14->GetYaxis()->SetTitle("Entries");
966 rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
58ceb8ca 967 fSDDhRecPointsTask++;
968
ebdd0606 969 for(Int_t iLay=0; iLay<=1; iLay++){
d2f99642 970 TH1F *h15 = new TH1F(Form("SDDphidistrib_Layer%d",iLay+3),Form("SDDphidistrib_Layer%d",iLay+3) ,180,-TMath::Pi(),TMath::Pi());//position number 15 (L3) and position number 16 (L4)
3f90b3dc 971 h15->GetXaxis()->SetTitle("#varphi[rad]");
972 h15->GetXaxis()->CenterTitle();
973 h15->GetYaxis()->SetTitle("Entries");
974 rv = fAliITSQADataMakerRec->Add2RecPointsList(h15,iLay+15+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 975 fSDDhRecPointsTask++;
ebdd0606 976 }
58ceb8ca 977
978 for(Int_t iLay=0; iLay<=1; iLay++){
d2f99642 979 TH1F *h17 = new TH1F(Form("SDDdrifttime_Layer%d",iLay+3),Form("SDDdrifttime_Layer%d",iLay+3),45,-0.5,4499.5);//position number 17 (L3) and position number 18 (L4)
3f90b3dc 980 h17->SetBit(TH1::kCanRebin);
1e7991d8 981 h17->GetXaxis()->SetTitle("drift time[ns]");
3f90b3dc 982 h17->GetXaxis()->CenterTitle();
983 h17->GetYaxis()->SetTitle("Entries");
984 rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,iLay+17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
58ceb8ca 985 fSDDhRecPointsTask++;
986 }
987
78fb0b3d 988 Float_t hMax = 0.2;
989
990 TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy (RecPoints)",200,0.,hMax);
991 rv = fAliITSQADataMakerRec->Add2RecPointsList(oL3,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 19
992 fSDDhRecPointsTask++;
993
994 TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy (RecPoints)",200,0.,hMax);
995 rv = fAliITSQADataMakerRec->Add2RecPointsList(oL4,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 20
996 fSDDhRecPointsTask++;
997
998
999 TH2D *h21 = new TH2D("SDDL3_Rec2Raw_2D","L3 RecPoints to Raws 2D",12,0.5,6.5,14,0.5,14.5); //position number 21
1000 h21->GetXaxis()->SetTitle("z[#Module L3 ]");
1001 h21->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
1002 rv = fAliITSQADataMakerRec->Add2RecPointsList(h21,21 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1003 fSDDhRecPointsTask++;
1004
1005 TH2D *h22 = new TH2D("SDDL4_Rec2Raw_2D","L4 RecPoints to Raws 2D",16,0.5,8.5,22,0.5,22.5); //position number 22
1006 h22->GetXaxis()->SetTitle("[#Module L4 ]");
1007 h22->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
1008 rv = fAliITSQADataMakerRec->Add2RecPointsList(h22,22 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1009 fSDDhRecPointsTask++;
1010
1011 hMax = 0.3;
1012 TH1F *R2RL3 = new TH1F("SDDL3_Rec2Raw","L3 RecPoints to Raws ratio",150,0.,hMax);
1013 rv = fAliITSQADataMakerRec->Add2RecPointsList(R2RL3,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 23
1014 fSDDhRecPointsTask++;
1015
1016 TH1F *R2RL4 = new TH1F("SDDL4_Rec2Raw","L4 RecPoints to Raws ratio",150,0.,hMax);
1017 rv = fAliITSQADataMakerRec->Add2RecPointsList(R2RL4,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 24
1018 fSDDhRecPointsTask++;
1019
1020 TH1F *dedxL3 = new TH1F("SDDL3_dedx","L3 dE/dX",100,0.,1.);
1021 rv = fAliITSQADataMakerRec->Add2RecPointsList(dedxL3,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 25
1022 fSDDhRecPointsTask++;
1023
1024 TH1F *dedxL4 = new TH1F("SDDL4_dedx","L4 dE/dX",100,0.,1.);
1025 rv = fAliITSQADataMakerRec->Add2RecPointsList(dedxL4,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 26
1026 fSDDhRecPointsTask++;
1027
8a55554e 1028
1029 TH1F *hsummarydatarp = new TH1F("SDDRecPointCheck","SDDRecPointCheck",50,-0.5,49.5);//27 summary of recpoint checks
1030 hsummarydatarp->GetXaxis()->SetLabelSize(0.02);
1031 hsummarydatarp->GetXaxis()->SetTickLength(0.01);
1032 hsummarydatarp->GetXaxis()->SetNdivisions(110);
1033 hsummarydatarp->GetXaxis()->SetTicks("-");
1034 hsummarydatarp->GetYaxis()->SetLabelSize(0.02);
1035 hsummarydatarp->GetYaxis()->SetTitleSize(0.02);
1036 hsummarydatarp->GetYaxis()->SetTitleOffset(1.5);
1037 hsummarydatarp->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)");
1038 hsummarydatarp->SetStats(0);
1039 hsummarydatarp->SetMaximum(272);
1040
1041 hsummarydatarp->SetOption("text bar1 hist");
1042 hsummarydatarp->SetBarOffset(0.05);
1043 hsummarydatarp->SetBarWidth(0.95);
1044 hsummarydatarp->SetFillColor(32);
1045 hsummarydatarp->SetMinimum(0.);
1046
1047 //information about the events
1048 hsummarydatarp->GetXaxis()->SetBinLabel(1,"Events");
1049 hsummarydatarp->GetXaxis()->SetBinLabel(2,"Ent_NORM");
1050 hsummarydatarp->GetXaxis()->SetBinLabel(3,"Ent_NORML3");
1051 hsummarydatarp->GetXaxis()->SetBinLabel(4,"Ent_NORML4");
1052 //all
1053
1054 hsummarydatarp->GetXaxis()->SetBinLabel(5, "m_act");
1055 hsummarydatarp->GetXaxis()->SetBinLabel(6, "m_fil");
1056 hsummarydatarp->GetXaxis()->SetBinLabel(7, "dr_act");
1057 hsummarydatarp->GetXaxis()->SetBinLabel(8, "dr_fil");
1058 hsummarydatarp->GetXaxis()->SetBinLabel(9, "m_exc");
1059 hsummarydatarp->GetXaxis()->SetBinLabel(10,"m_emp");
1060 hsummarydatarp->GetXaxis()->SetBinLabel(11,"dr_exc");
1061 hsummarydatarp->GetXaxis()->SetBinLabel(12,"dr_emp");
1062 hsummarydatarp->GetXaxis()->SetBinLabel(13,"m_exc-act");
1063 hsummarydatarp->GetXaxis()->SetBinLabel(14,"m_act-emp");
1064 hsummarydatarp->GetXaxis()->SetBinLabel(15,"dr_exc-act");
1065 hsummarydatarp->GetXaxis()->SetBinLabel(16,"dr_act-emp");
1066 hsummarydatarp->GetXaxis()->SetBinLabel(17,"m_overth");
1067 hsummarydatarp->GetXaxis()->SetBinLabel(18,"dr_overth");
1068
1069 //l3
1070
1071 hsummarydatarp->GetXaxis()->SetBinLabel(19,"m_actl3");
1072 hsummarydatarp->GetXaxis()->SetBinLabel(20,"m_fill3");
1073 hsummarydatarp->GetXaxis()->SetBinLabel(21,"dr_actl3");
1074 hsummarydatarp->GetXaxis()->SetBinLabel(22,"dr_fill3");
1075 hsummarydatarp->GetXaxis()->SetBinLabel(23,"m_excl3");
1076 hsummarydatarp->GetXaxis()->SetBinLabel(24,"m_empl3");
1077 hsummarydatarp->GetXaxis()->SetBinLabel(25,"dr_excl3");
1078 hsummarydatarp->GetXaxis()->SetBinLabel(26,"dr_empl3");
1079 hsummarydatarp->GetXaxis()->SetBinLabel(27,"m_exc-actl3");
1080 hsummarydatarp->GetXaxis()->SetBinLabel(28,"m_act-empl3");
1081 hsummarydatarp->GetXaxis()->SetBinLabel(29,"dr_exc-actl3");
1082 hsummarydatarp->GetXaxis()->SetBinLabel(30,"dr_act-empl3");
1083 hsummarydatarp->GetXaxis()->SetBinLabel(31,"meanch_l3");
1084 hsummarydatarp->GetXaxis()->SetBinLabel(32,"meanrad_l3");
1085 hsummarydatarp->GetXaxis()->SetBinLabel(33,"m_overthl3");
1086 hsummarydatarp->GetXaxis()->SetBinLabel(34,"dr_overthl3");
1087
1088 //l4
1089
1090 hsummarydatarp->GetXaxis()->SetBinLabel(35,"m_actl4");
1091 hsummarydatarp->GetXaxis()->SetBinLabel(36,"m_fill4");
1092 hsummarydatarp->GetXaxis()->SetBinLabel(37,"dr_actl4");
1093 hsummarydatarp->GetXaxis()->SetBinLabel(38,"dr_fill4");
1094 hsummarydatarp->GetXaxis()->SetBinLabel(39,"m_excl4");
1095 hsummarydatarp->GetXaxis()->SetBinLabel(40,"m_empl4");
1096 hsummarydatarp->GetXaxis()->SetBinLabel(41,"dr_excl4");
1097 hsummarydatarp->GetXaxis()->SetBinLabel(42,"dr_empl4");
1098 hsummarydatarp->GetXaxis()->SetBinLabel(43,"m_exc-actl4");
1099 hsummarydatarp->GetXaxis()->SetBinLabel(44,"m_act-empl4");
1100 hsummarydatarp->GetXaxis()->SetBinLabel(45,"dr_exc-actl4");
1101 hsummarydatarp->GetXaxis()->SetBinLabel(46,"dr_act-empl4");
1102 hsummarydatarp->GetXaxis()->SetBinLabel(47,"meanch_l4");
1103 hsummarydatarp->GetXaxis()->SetBinLabel(48,"meanrad_l4");
1104 hsummarydatarp->GetXaxis()->SetBinLabel(49,"m_overthl4");
1105 hsummarydatarp->GetXaxis()->SetBinLabel(50,"dr_overthl4");
1106
1107 hsummarydatarp->GetXaxis()->LabelsOption("v");
1108
1109 rv = fAliITSQADataMakerRec->Add2RecPointsList(hsummarydatarp,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1110
1111
1112
1113 fSDDhRecPointsTask++;
1114
78fb0b3d 1115 fOnlineOffsetRecPoints = fSDDhRecPointsTask;
1116 if(fkOnline){
1117 TH2F *h19 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",112,-28,28,112,-28,28);//position number 27
3f90b3dc 1118 h19->GetYaxis()->SetTitle("Y[cm]");
1119 h19->GetXaxis()->SetTitle("X[cm]");
78fb0b3d 1120 rv = fAliITSQADataMakerRec->Add2RecPointsList(h19,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
ad300de9 1121 fSDDhRecPointsTask++;
ebdd0606 1122
78fb0b3d 1123 TH2F *h20 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",128,-32,32,56,12,26);//position number 28
3f90b3dc 1124 h20->GetYaxis()->SetTitle("R[cm]");
1125 h20->GetXaxis()->SetTitle("Z[cm]");
78fb0b3d 1126 rv = fAliITSQADataMakerRec->Add2RecPointsList(h20,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
3f90b3dc 1127 fSDDhRecPointsTask++;
ebdd0606 1128 }//online
58ceb8ca 1129
5379c4a3 1130 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
58ceb8ca 1131
eca4fa66 1132 return rv ;
ebdd0606 1133}
1134
1135//____________________________________________________________________________
eca4fa66 1136Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
7a0e5776 1137{
ebdd0606 1138 // Fill QA for RecPoints - SDD -
3f90b3dc 1139 Int_t rv = 0 ;
1140 fNEventRP++;
ebdd0606 1141 Int_t lay, lad, det;
8b7e858c 1142 //AliInfo("get the branch with the ITS clusters !\n");
e62fe478 1143 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
aa444532 1144 TClonesArray *recpoints=NULL;
3f90b3dc 1145 if(fkOnline){recpoints = rpcont->FetchClusters(0,clustersTree,fAliITSQADataMakerRec->GetEventNumber());}
1146 else{recpoints = rpcont->FetchClusters(0,clustersTree);}
7fa9b948 1147 AliDebug(10,Form("Fetched RecPoints for %d SDD modules",recpoints->GetEntriesFast()));
e62fe478 1148 if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){
1149 AliError("can't get SDD clusters !");
1150 return rv;
ebdd0606 1151 }
1152
ebdd0606 1153 Int_t npoints = 0;
1154 Float_t cluglo[3]={0.,0.,0.};
3f90b3dc 1155 if(fkOnline){
8a55554e 1156 for(Int_t i=28;i<30;i++){
8b7e858c 1157 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
ebdd0606 1158 }
1159 }
e917bef4 1160 // AliITSgeomTGeo::GetModuleIndex() issues an error in case the arguments
1161 // are illegal and returns -1
1162 Int_t firMod=TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(3,1,1));
e62fe478 1163 Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1);
1164 for(Int_t module=firMod; module<lasMod;module++){
58ceb8ca 1165 //AliInfo(Form("Module %d\n",module));
e62fe478 1166 recpoints = rpcont->UncheckedGetClusters(module);
58ceb8ca 1167 npoints += recpoints->GetEntries();
58ceb8ca 1168 for(Int_t j=0;j<recpoints->GetEntries();j++){
80b9610c 1169 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
1170 Int_t index = recp->GetDetectorIndex();
1171 lay=recp->GetLayer();
78fb0b3d 1172 if(lay < 2 || lay > 3) continue;
1173 Int_t modnumb=index+AliITSgeomTGeo::GetModuleIndex(lay+1,1,1);
1174 AliITSgeomTGeo::GetModuleId(modnumb, lay, lad, det);
1175// AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det));
80b9610c 1176 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(modnumb);//modpatternrp
58ceb8ca 1177 recp->GetGlobalXYZ(cluglo);
1178 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
1179 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
1180 Float_t drifttime=recp->GetDriftTime();
78fb0b3d 1181 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
1182 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX
1183 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz
1184 if(fkOnline) {
8a55554e 1185 fAliITSQADataMakerRec->GetRecPointsData(28 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
1186 fAliITSQADataMakerRec->GetRecPointsData(29 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE
78fb0b3d 1187 }
1188 Int_t iside=recp->GetDriftSide();
1189 lay=recp->GetLayer();
1190 if(lay == 2) {
1191 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge of layer 3
1192 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);//mod pattern layer 3
1193 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution layer 3
1194 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);// phi distribution layer 3
1195 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer
1196 fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 3
1197 fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetdEdX());// charge distribution layer 3
1198 } else if(lay == 3) {
1199 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge layer 4
1200 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);//mod pattern layer 4
1201 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution
1202 fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);//phi distribution
1203 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer 4
1204 fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 4
1205 fAliITSQADataMakerRec->GetRecPointsData(26 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetdEdX());// charge distribution layer 4
58ceb8ca 1206 }
1207 }
1208 }
58ceb8ca 1209 return rv ;
ebdd0606 1210}
1211
ad300de9 1212//_______________________________________________________________
1213
cfb59c70 1214Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie)const
7a0e5776 1215{
cfb59c70 1216 // Returns offset number according to the specified task
ad300de9 1217 Int_t offset=0;
3f90b3dc 1218 if( task == AliQAv1::kRAWS ){offset=fGenRawsOffset[specie];}
1219 else if(task == AliQAv1::kDIGITSR ){offset=fGenDigitsOffset[specie];}
1220 else if( task == AliQAv1::kRECPOINTS ){offset=fGenRecPointsOffset[specie];}
ad300de9 1221 return offset;
1222}
1223
1224//_______________________________________________________________
1225
8b7e858c 1226void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
cfb59c70 1227 // Set offset number according to the specified task
3f90b3dc 1228 if( task == AliQAv1::kRAWS ) {fGenRawsOffset[specie]=offset;}
1229 else if( task == AliQAv1::kDIGITSR ) {fGenDigitsOffset[specie]=offset;}
1230 else if( task == AliQAv1::kRECPOINTS ) {fGenRecPointsOffset[specie]=offset;}
eca4fa66 1231}
1232
1233//_______________________________________________________________
1234
4e25ac79 1235Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
7a0e5776 1236{
cfb59c70 1237 //return the number of histo booked for a given Task
7a0e5776 1238 Int_t histotot=0;
3f90b3dc 1239 if( task == AliQAv1::kRAWS ){ histotot=fSDDhRawsTask ;}
1240 else if(task == AliQAv1::kDIGITSR) { histotot=fSDDhDigitsTask;}
1241 else if( task == AliQAv1::kRECPOINTS ){ histotot=fSDDhRecPointsTask;}
1242 else {AliInfo("No task has been selected. TaskHisto set to zero.\n");}
ad300de9 1243 return histotot;
e41192d7 1244}
8b7e858c 1245
58ceb8ca 1246
1247//_______________________________________________________________
1248
1249
1250void AliITSQASDDDataMakerRec::CreateTheMap()
1251{
cfb59c70 1252 //Create the SDD DDL Module Map
58ceb8ca 1253 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
1254 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
3f90b3dc 1255 if(!ddlMapSDD){
58ceb8ca 1256 AliError("Calibration object retrieval failed! SDD will not be processed");
1257 fDDLModuleMap = NULL;
1258 //return rv;
1259 }
d2f99642 1260 else{
1261 fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
1262 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
1263 ddlMapSDD->SetOwner(kTRUE);
1264 if(!cacheStatus){ delete ddlMapSDD;}
1265 AliInfo("DDL Map Created\n ");
1266 }
58ceb8ca 1267}
5af1d436 1268
3f90b3dc 1269//_______________________________________________________________
1270
1271
1272void AliITSQASDDDataMakerRec::CreateTheCalibration()
1273{
cfb59c70 1274 //Take from the OCDB the calibration information for the SDD
3f90b3dc 1275 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
1276 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
1277 if(!calibSDD)
1278 {
1279 AliError("Calibration object retrieval failed! SDD will not be processed");
d2f99642 1280 fCalibration = NULL;
3f90b3dc 1281 }
d2f99642 1282 else{
1283 fCalibration = (TObjArray *)calibSDD->GetObject();
1284
1285 if(!cacheStatus)calibSDD->SetObject(NULL);
1286 calibSDD->SetOwner(kTRUE);
1287 if(!cacheStatus){delete calibSDD;}
1288
1289 AliITSCalibrationSDD * cal=NULL;
1290 for(Int_t imod=0;imod<fgknSDDmodules;imod++)
1291 {
1292 //cal=NULL;
1293 Int_t fillmodhisto1=fgkTotalNumberSDDAnodes;
1294 Int_t fillmodhisto2side0=fgkNumberOfSDDAnodesperSide;
1295 Int_t fillmodhisto2side1=fgkNumberOfSDDAnodesperSide;
1296 Int_t fillmodhisto3side0=fgkNumberOfSDDAnodesperSide;
1297 Int_t fillmodhisto3side1=fgkNumberOfSDDAnodesperSide;
1298
1299 Int_t badmodhisto1=0;
1300 Int_t badmodhisto2side0=0;
1301 Int_t badmodhisto2side1=0;
1302 Int_t badmodhisto3side0=0;
1303 Int_t badmodhisto3side1=0;
1304 //printf("imod %i\t ==== \t",imod);
1305 Int_t module=imod + 240;
1306 //printf("module %i\t ==== \t",module);
1307 cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
1308 Int_t lay,lad,det;
1309 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
1310 Int_t index=1+(det-1)*2;
1311 if(cal==0){continue;}
1312 if (cal->IsBad()){continue;}//bad module check
1313 else{
1314 for(Int_t i=0;i<8;i++) //check on bad chips in good modules
1315 {
1316 if(lay==3){
1317 if(cal->IsChipBad(i)){
1318 if(i<4){badmodhisto2side0+=64;}
1319 if(i>=4){badmodhisto2side1+=64;}
1320 }//end if chip
1321 }//end if layer3
1322 else if(lay==4){
1323 if(cal->IsChipBad(i)){
1324 if(i<4){badmodhisto3side0+=64;}
1325 if(i>=4){badmodhisto3side1+=64;}
1326 }//end if chip
1327 }//ens if layer4
1328 }//end for chip
1329 for(Int_t iAn=0; iAn<512; iAn++){//anodes loop
1330 Int_t ic=cal->GetChip(iAn);//chip with this anode number
1331 if(!cal->IsChipBad(ic) && !cal->IsBad() && cal->IsBadChannel(iAn)){// good chip good module bad channel
1332 if(lay==3){
3f90b3dc 1333 if(ic<4) badmodhisto2side0++;
1334 else if(ic>=4)badmodhisto2side1++;
1335 }//end if layer 3
d2f99642 1336 else if(lay==4){
3f90b3dc 1337 if(ic<4) badmodhisto3side0++;
1338 else if(ic>=4)badmodhisto3side1++;
1339 }//end if layer 4
d2f99642 1340 }//end if chip module channel
1341 }//end for anodes
1342 if(lay==3){
1343 badmodhisto1=badmodhisto2side0+badmodhisto2side1;
1344 fillmodhisto1-=badmodhisto1;
1345 fillmodhisto2side0-=badmodhisto2side0;
1346 fillmodhisto2side1-=badmodhisto2side1;
1347 ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
1348 ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index,lad,fillmodhisto2side0);
1349 ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index+1,lad,fillmodhisto2side1);
1350 }//end layer 3
1351 else if(lay==4){
1352 badmodhisto1=badmodhisto3side0+badmodhisto3side1;
1353 fillmodhisto1-=badmodhisto1;
1354 fillmodhisto3side0-=badmodhisto3side0;
1355 fillmodhisto3side1-=badmodhisto3side1;
1356 ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
1357 ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index,lad,fillmodhisto3side0);
8a55554e 1358 ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto3side1);
d2f99642 1359 }//end layer 4
1360 }//end else bad module
1361 }//end module for
1362 }
8a55554e 1363
3f90b3dc 1364}
1365
1366//____________________________________________________________________
1367
1368void AliITSQASDDDataMakerRec::InitCalibrationArray()
1369{
cfb59c70 1370 //create the histograms with the calibration informations. The histograms are stored in a TObjArray
3f90b3dc 1371 TH1D *pattern1 = new TH1D("CALSDDModPattern","Calibration HW Modules pattern",fgknSDDmodules,239.5,499.5);
f2fafc64 1372 pattern1->SetDirectory(0) ;
3f90b3dc 1373 TH2D *patternl3 = new TH2D("CALSDDphizL3","Calibration SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);
f2fafc64 1374 patternl3->SetDirectory(0) ;
3f90b3dc 1375 TH2D *patternl4 = new TH2D("CALSDDphizL4"," Calibration SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5);
f2fafc64 1376 patternl4->SetDirectory(0) ;
3f90b3dc 1377
f2fafc64 1378 if(!fHistoCalibration)fHistoCalibration = new TObjArray(3);
3f90b3dc 1379 fHistoCalibration->AddAtAndExpand(pattern1,0);
1380 fHistoCalibration->AddAtAndExpand(patternl3,1);
1381 fHistoCalibration->AddAtAndExpand(patternl4,2);
f2fafc64 1382 fHistoCalibration->SetOwner(kTRUE);
fad6e2fc 1383 // printf("Calibration Histograms created!\n");
3f90b3dc 1384}
5af1d436 1385
1386//____________________________________________________________________
1387
1388void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
1389{
cfb59c70 1390 //reset the SDD calibration histograms
5af1d436 1391 AliInfo(Form("Reset detector in SDD called for task index %i", task));
1392 if(task== AliQAv1::kRAWS ){
d2f99642 1393 fDDLModuleMap=NULL;
3d0c40f9 1394 }
d2f99642 1395
3f90b3dc 1396 fCalibration=NULL;
3d0c40f9 1397
3f90b3dc 1398 ((TH1D*)(fHistoCalibration->At(0)))->Reset();
1399 ((TH2D*)(fHistoCalibration->At(1)))->Reset();
1400 ((TH2D*)(fHistoCalibration->At(2)))->Reset();
f2fafc64 1401 //delete fHistoCalibration;
1402 //fHistoCalibration=NULL;
3d0c40f9 1403
5af1d436 1404}
be2d913a 1405
8a55554e 1406//____________________________________________________________________
1407
1408Int_t AliITSQASDDDataMakerRec::GetNumberOfEvents(AliQAv1::TASKINDEX_t task)
1409{
1410 //return the number of the processed events for a given task fod SDD only
1411
1412 if(task==AliQAv1::kRAWS){return fNEvent;}
1413 else if(task==AliQAv1::kRECPOINTS){return fNEventRP;}
1414 else{ AliWarning("The selected TASKINDEX is not valid!! return 0\n"); return 0;}
1415
1416
1417}