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