1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // *************************************************************
19 // Checks the quality assurance
20 // by comparing with reference data
22 // -------------------------------------------------------------
23 // W. Ferrarese + P. Cerello Feb 2008
24 // M.Siciliano Aug 2008 QA RecPoints
27 // --- ROOT system ---
29 #include <TProfile2D.h>
35 //#include <TObjArray.h>
37 // --- Standard library ---
39 // --- AliRoot header files ---
40 #include "AliITSQASDDDataMakerRec.h"
42 #include "AliRawReader.h"
43 #include "AliITSRawStream.h"
44 #include "AliITSRawStreamSDD.h"
45 #include "AliITSdigit.h"
46 #include "AliITSRecPoint.h"
47 #include "AliITSRecPointContainer.h"
48 #include "AliITSgeomTGeo.h"
49 #include "AliCDBManager.h"
50 #include "AliCDBEntry.h"
51 #include "AliITSCalibrationSDD.h"
58 class AliITSRawStreamSDDCompressed;
65 class AliITSDetTypeRec;
69 ClassImp(AliITSQASDDDataMakerRec)
71 //____________________________________________________________________________
72 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :
74 fAliITSQADataMakerRec(aliITSQADataMakerRec),
79 fSDDhRecPointsTask(0),
81 fOnlineOffsetRecPoints(0),
84 fGenRecPointsOffset(0),
92 //ctor used to discriminate OnLine-Offline analysis
93 if(fLDC < 0 || fLDC > 6) {
94 AliError("Error: LDC number out of range; return\n");
96 fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
97 fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
98 fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies];
99 for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {
100 fGenRawsOffset[i] = 0;
101 fGenRecPointsOffset[i] = 0;
102 fGenDigitsOffset[i]=0;
105 InitCalibrationArray();
108 //____________________________________________________________________________
109 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
111 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
112 fkOnline(qadm.fkOnline),
114 fSDDhRawsTask(qadm.fSDDhRawsTask),
115 fSDDhDigitsTask(qadm.fSDDhDigitsTask),
116 fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
117 fOnlineOffsetRaws(qadm.fOnlineOffsetRaws),
118 fOnlineOffsetRecPoints(qadm.fOnlineOffsetRecPoints),
119 fGenRawsOffset(qadm.fGenRawsOffset),
120 fGenDigitsOffset(qadm.fGenDigitsOffset),
121 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
122 fTimeBinSize(qadm.fTimeBinSize),
123 fNEvent(qadm.fNEvent),
124 fNEventRP(qadm.fNEventRP),
125 fDDLModuleMap(qadm.fDDLModuleMap),
126 fCalibration(qadm.fCalibration),
127 fHistoCalibration(qadm.fHistoCalibration)
130 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
131 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
132 //fDDLModuleMap=NULL;
135 //____________________________________________________________________________
136 AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
138 //if(fDDLModuleMap) delete fDDLModuleMap;
139 if(fHistoCalibration){delete fHistoCalibration; fHistoCalibration=NULL;}
141 //__________________________________________________________________
142 AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
145 this->~AliITSQASDDDataMakerRec();
146 new(this) AliITSQASDDDataMakerRec(qac);
150 //____________________________________________________________________________
151 void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
154 //Start of a QA cycle
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()));
159 //fAliITSQADataMakerRec->GetRawsData(9+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
160 CreateTheCalibration();
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;
169 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
170 fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
171 fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
172 fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
173 fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
176 if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRECPOINTS){
177 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRECPOINTS)==kFALSE)return;
179 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of RecPoints normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
181 fAliITSQADataMakerRec->GetRecPointsData(9+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
182 fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
183 fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
184 fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
189 //____________________________________________________________________________
190 void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray* /*list*/)
193 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
195 Double_t entriescalibration1= 0.;
196 Double_t entriescalibrationL3=0.;
197 Double_t entriescalibrationL4=0.;
199 if(fHistoCalibration){
200 entriescalibration1= ((TH1D*)(fHistoCalibration->At(0)))->GetEntries();
201 entriescalibrationL3=((TH2D*)(fHistoCalibration->At(1)))->GetEntries();
202 entriescalibrationL4=((TH2D*)(fHistoCalibration->At(2)))->GetEntries();
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);
208 ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEvent);
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();
216 Double_t normentriesmodpattern=0.;
217 Double_t normentriesL3= 0.;
218 Double_t normentriesL4= 0.;
220 if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEvent);
221 if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*fNEvent);
222 if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*fNEvent);
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);
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);
231 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEvent);
233 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(2 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEvent);
236 Int_t xbin3 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
237 Int_t ybin3 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
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));
245 Int_t xbin4 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
246 Int_t ybin4 = ((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
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));
254 if(fHistoCalibration){
255 for(Int_t inumb=8;inumb<10;inumb++)
257 for(Int_t ii=1; ii<fAliITSQADataMakerRec->GetRawsData(inumb + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsX()+1;ii++)
259 for(Int_t jj=1; jj<fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsY()+1;jj++)
262 if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) != 0. )
264 fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,1);
266 else if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) == 0. )
268 fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,0);
270 //printf("%d \t %d \t %d \t %02f \n",inumb,ii,jj,fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetBinContent(ii,jj));
279 if(task==AliQAv1::kRECPOINTS){
282 Double_t chargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
283 Double_t errchargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
285 Double_t chargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
286 Double_t errchargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
289 Double_t radiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
290 Double_t errradiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
292 Double_t radiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
293 Double_t errradiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
297 // printf("fNeventRP %d \n",fNEventRP);
298 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEventRP);
300 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(31,chargeL3);
301 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(31,errchargeL3);
303 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(47,chargeL4);
304 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(47,errchargeL4);
306 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(32,radiusL3);
307 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(32,errradiusL3);
309 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(48,radiusL4);
310 ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(48,errradiusL4);
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();
317 //printf("entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",entriesmodpattern,entriesL3,entriesL4 );
323 Double_t normentriesmodpattern=0.;
324 Double_t normentriesL3= 0.;
325 Double_t normentriesL4= 0.;
327 if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEventRP);
328 if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*fNEventRP);
329 if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*fNEventRP);
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);
335 // printf("NORM entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",normentriesmodpattern,normentriesL3,normentriesL4 );
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);
340 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
342 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEventRP);
344 // ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(21+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
346 // ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(22+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEventRP);
349 Int_t xbin3 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
350 Int_t ybin3 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(10 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
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));
358 Int_t xbin4 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsX();
359 Int_t ybin4 = ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(11 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetNbinsY();
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));
367 // RecPoints 2 Raws Ratio
368 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kTRUE)
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));
382 AliWarning("Number of bins for Raws and RecPoints (Layer 3) do not match\n");
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));
397 AliWarning("Number of bins for Raws and RecPoints (Layer 4) do not match\n");
399 else{AliWarning("Ratio between RecPoints and Raws not executed because the raw list has not been created\n");}
404 //____________________________________________________________________________
405 Int_t AliITSQASDDDataMakerRec::InitRaws()
408 // Initialization for RAW data - SDD -
409 const Bool_t expert = kTRUE ;
410 const Bool_t saveCorr = kTRUE ;
411 const Bool_t image = kTRUE ;
419 if(fkOnline){AliInfo("Book Online Histograms for SDD\n");}
420 else {AliInfo("Book Offline Histograms for SDD\n ");}
421 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
422 h0->GetXaxis()->SetTitle("Module Number");
423 h0->GetYaxis()->SetTitle("Counts");
424 h0->SetOption("bar1");
425 h0->SetBarOffset(0.01);
426 h0->SetBarWidth(0.95);
427 h0->SetFillColor(45);
428 rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
431 //zPhi distribution using ladder and modules numbers
432 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//1
433 hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]");
434 hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
436 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
439 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //2
440 hphil4->GetXaxis()->SetTitle("z[Module Number L4]");
441 hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
443 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
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");
450 h0norm->SetOption("bar1");
451 h0norm->SetBarOffset(0.01);
452 h0norm->SetBarWidth(0.95);
453 h0norm->SetFillColor(46);
454 //h0norm->SetStats(0);
455 rv = fAliITSQADataMakerRec->Add2RawsList(h0norm,3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
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]");
462 hphil3norm->SetStats(0);
463 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
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]");
469 hphil4norm->SetStats(0);
470 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
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
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
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);
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);
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.);
514 hsummarydata->SetOption("textbar1");
515 hsummarydata->SetBarOffset(0.01);
516 hsummarydata->SetBarWidth(0.95);
517 hsummarydata->SetFillColor(8);
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");
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");
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");
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");
576 rv = fAliITSQADataMakerRec->Add2RawsList(hsummarydata,10+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
578 fOnlineOffsetRaws = fSDDhRawsTask;
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);
588 Int_t indexlast1 = 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);
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);
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);
628 cout << fSDDhRawsTask << " SDD Raws histograms booked" << endl;
630 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
635 //____________________________________________________________________________
636 Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
638 // Fill QA for RAW - SDD -
640 // Check id histograms already created for this Event Specie
642 if(!fDDLModuleMap){CreateTheMap();}
643 if(rawReader->GetType() != 7) return rv; // skips non physical triggers
644 AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");
646 rawReader->Select("ITSSDD");
647 AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
648 stream->SetDDLModuleMap(fDDLModuleMap);
654 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
655 for(Int_t iside=0;iside<fgknSide;iside++) {
656 if(fSDDhRawsTask > fOnlineOffsetRaws + 1 + index) fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws + 1 + index +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
657 // 4 because the 2D histos for single events start after the fourth position
667 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
670 Int_t prevDDLID = -1;
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;}
676 while(stream->Next()) {
677 ildcID = rawReader->GetLDCId();
678 iddl = rawReader->GetDDLID();// - fgkDDLIDshift;
679 if(iddl<0)isddmod=-1;
680 //printf("----------------------iddl %i\n",iddl);
681 else isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
684 AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
687 if(stream->IsCompletedModule()) {
688 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n"));
691 if(stream->IsCompletedDDL()) {
693 if ((rawReader->GetDDLID() != prevDDLID)&&(ddldata[iddl])==kFALSE){
694 size += rawReader->GetDataSize();//in bytes
695 prevDDLID = rawReader->GetDDLID();
699 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n"));
703 coord1 = stream->GetCoord1();
704 coord2 = stream->GetCoord2();
705 signal = stream->GetSignal();
707 moduleSDD = isddmod - fgkmodoffset;
709 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
710 AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
714 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
715 Short_t iside = stream->GetChannel();
717 //printf(" \n%i %i %i %i \n ",lay, lad, det,iside );
718 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod);
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
724 fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill((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+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));
727 activeModule = moduleSDD;
728 index1 = activeModule * 2 + iside;
731 AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
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);
741 if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt));
743 if(fkOnline){((TH1F*)(fAliITSQADataMakerRec->GetRawsData(fOnlineOffsetRaws +1 + 260*4 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(size/1024.);//KB
746 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt));
751 // AnalyseBNG(); // Analyse Baseline, Noise, Gain
752 // AnalyseINJ(); // Analyse Injectors
760 //____________________________________________________________________________
761 Int_t AliITSQASDDDataMakerRec::InitDigits()
763 // if(!fHistoCalibration)InitCalibrationArray();
764 // Initialization for DIGIT data - SDD -
765 const Bool_t expert = kTRUE ;
766 const Bool_t image = kTRUE ;
768 // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
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");
773 rv = fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
775 // printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
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");
779 rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
781 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
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");
785 rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
787 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
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");
791 rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
793 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
794 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask));
798 //____________________________________________________________________________
799 Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
802 // Fill QA for DIGIT - SDD -
803 //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
804 //fITS->SetTreeAddress();
805 //TClonesArray *iITSdigits = fITS->DigitsAddress(1);
810 TBranch *branchD = digits->GetBranch("ITSDigitsSDD");
813 AliError("can't get the branch with the ITS SDD digits !");
816 // Check id histograms already created for this Event Specie
817 // if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
818 // rv = InitDigits() ;
820 static TClonesArray statDigits("AliITSdigitSDD");
821 TClonesArray *iITSdigits = &statDigits;
822 branchD->SetAddress(&iITSdigits);
824 for(Int_t i=0; i<260; i++){
826 digits->GetEvent(nmod);
827 Int_t ndigits = iITSdigits->GetEntries();
828 fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nmod,ndigits);
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();
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);
843 //____________________________________________________________________________
844 Int_t AliITSQASDDDataMakerRec::InitRecPoints()
846 //if(!fHistoCalibration)InitCalibrationArray();
847 //AliInfo("Initialize SDD recpoints histos\n");
848 // Initialization for RECPOINTS - SDD -
849 const Bool_t expert = kTRUE ;
850 const Bool_t image = kTRUE ;
852 // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
854 //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
855 //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
856 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",250,-0.5, 499.5); //position number 0
857 //h0->SetBit(TH1::kCanRebin);
858 h0->GetXaxis()->SetTitle("KeV");
859 h0->GetYaxis()->SetTitle("Entries");
860 rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
861 fSDDhRecPointsTask++;
863 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",250,-0.5, 499.5);//position number 1
864 //h1->SetBit(TH1::kCanRebin);
865 h1->GetXaxis()->SetTitle("Kev");
866 h1->GetYaxis()->SetTitle("Entries");
867 rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
868 fSDDhRecPointsTask++;
870 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",56,-28,28,56,-28,28);//position number 2
871 h2->GetYaxis()->SetTitle("Y[cm]");
872 h2->GetXaxis()->SetTitle("X[cm]");
873 rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
874 fSDDhRecPointsTask++;
876 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",128,-32,32,56,12,26);//position number 3
877 h3->GetYaxis()->SetTitle("R[cm]");
878 h3->GetXaxis()->SetTitle("Z[cm]");
879 rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
880 fSDDhRecPointsTask++;
882 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",96,-23,23,112,-TMath::Pi(),TMath::Pi());//position number 4
883 h4->GetYaxis()->SetTitle("#phi[rad]");
884 h4->GetXaxis()->SetTitle("Z[cm]");
885 rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
886 fSDDhRecPointsTask++;
888 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",128,-31,31,176,-TMath::Pi(),TMath::Pi());//position number 5
889 h5->GetYaxis()->SetTitle("#phi[rad]");
890 h5->GetXaxis()->SetTitle("Z[cm]");
891 rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
892 fSDDhRecPointsTask++;
894 TH1D *h6 = new TH1D("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
895 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
896 h6->GetYaxis()->SetTitle("Entries");
897 h6->SetOption("bar1");
898 h6->SetBarOffset(0.01);
899 h6->SetBarWidth(0.95);
900 h6->SetFillColor(39);
901 rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
902 fSDDhRecPointsTask++;
905 TH2D *h7 = new TH2D("SDDModPatternL3RP","Modules pattern L3 RP",12,0.5,6.5,14,0.5,14.5); //position number 7
906 h7->GetXaxis()->SetTitle("z[#Module L3 ]");
907 h7->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
908 rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
909 fSDDhRecPointsTask++;
911 TH2D *h8 = new TH2D("SDDModPatternL4RP","Modules pattern L4 RP",16,0.5,8.5,22,0.5,22.5); //position number 8
912 h8->GetXaxis()->SetTitle("[#Module L3 ]");
913 h8->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
914 rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
915 fSDDhRecPointsTask++;
917 //------------------------norm--------------------------//
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");
923 h9->SetOption("bar1");
924 h9->SetBarOffset(0.01);
925 h9->SetBarWidth(0.95);
926 h9->SetFillColor(49);
927 rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
928 fSDDhRecPointsTask++;
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++;
937 TH2D *h11 = new TH2D("SDDModPatternL4RPNORM","Modules pattern L4 RP NORM",16,0.5,8.5,22,0.5,22.5); //position number 11
938 h11->GetXaxis()->SetTitle("[#Module L4 ]");
939 h10->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
940 rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
941 fSDDhRecPointsTask++;
943 //--------------------------------------------------------//
945 TH2F *h12 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",160,-4,4,160,-4,4);//position number 12
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
949 fSDDhRecPointsTask++;
951 //AliInfo("Create SDD recpoints histos\n");
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
959 fSDDhRecPointsTask++;
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
967 fSDDhRecPointsTask++;
969 for(Int_t iLay=0; iLay<=1; iLay++){
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)
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
975 fSDDhRecPointsTask++;
978 for(Int_t iLay=0; iLay<=1; iLay++){
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)
980 h17->SetBit(TH1::kCanRebin);
981 h17->GetXaxis()->SetTitle("drift time[ns]");
982 h17->GetXaxis()->CenterTitle();
983 h17->GetYaxis()->SetTitle("Entries");
984 rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,iLay+17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
985 fSDDhRecPointsTask++;
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++;
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++;
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++;
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++;
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++;
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++;
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++;
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++;
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);
1041 hsummarydatarp->SetOption("text bar1 hist");
1042 hsummarydatarp->SetBarOffset(0.05);
1043 hsummarydatarp->SetBarWidth(0.95);
1044 hsummarydatarp->SetFillColor(32);
1045 hsummarydatarp->SetMinimum(0.);
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");
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");
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");
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");
1107 hsummarydatarp->GetXaxis()->LabelsOption("v");
1109 rv = fAliITSQADataMakerRec->Add2RecPointsList(hsummarydatarp,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1113 fSDDhRecPointsTask++;
1115 fOnlineOffsetRecPoints = fSDDhRecPointsTask;
1117 TH2F *h19 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",112,-28,28,112,-28,28);//position number 27
1118 h19->GetYaxis()->SetTitle("Y[cm]");
1119 h19->GetXaxis()->SetTitle("X[cm]");
1120 rv = fAliITSQADataMakerRec->Add2RecPointsList(h19,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1121 fSDDhRecPointsTask++;
1123 TH2F *h20 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",128,-32,32,56,12,26);//position number 28
1124 h20->GetYaxis()->SetTitle("R[cm]");
1125 h20->GetXaxis()->SetTitle("Z[cm]");
1126 rv = fAliITSQADataMakerRec->Add2RecPointsList(h20,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
1127 fSDDhRecPointsTask++;
1130 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
1135 //____________________________________________________________________________
1136 Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
1138 // Fill QA for RecPoints - SDD -
1141 Int_t lay, lad, det;
1142 //AliInfo("get the branch with the ITS clusters !\n");
1143 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
1144 TClonesArray *recpoints=NULL;
1145 if(fkOnline){recpoints = rpcont->FetchClusters(0,clustersTree,fAliITSQADataMakerRec->GetEventNumber());}
1146 else{recpoints = rpcont->FetchClusters(0,clustersTree);}
1147 AliDebug(10,Form("Fetched RecPoints for %d SDD modules",recpoints->GetEntriesFast()));
1148 if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){
1149 AliError("can't get SDD clusters !");
1154 Float_t cluglo[3]={0.,0.,0.};
1156 for(Int_t i=28;i<30;i++){
1157 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
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));
1163 Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1);
1164 for(Int_t module=firMod; module<lasMod;module++){
1165 //AliInfo(Form("Module %d\n",module));
1166 recpoints = rpcont->UncheckedGetClusters(module);
1167 npoints += recpoints->GetEntries();
1168 for(Int_t j=0;j<recpoints->GetEntries();j++){
1169 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
1170 Int_t index = recp->GetDetectorIndex();
1171 lay=recp->GetLayer();
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));
1176 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(modnumb);//modpatternrp
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();
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
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
1188 Int_t iside=recp->GetDriftSide();
1189 lay=recp->GetLayer();
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
1212 //_______________________________________________________________
1214 Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie)const
1216 // Returns offset number according to the specified task
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];}
1224 //_______________________________________________________________
1226 void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
1227 // Set offset number according to the specified task
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;}
1233 //_______________________________________________________________
1235 Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
1237 //return the number of histo booked for a given Task
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");}
1247 //_______________________________________________________________
1250 void AliITSQASDDDataMakerRec::CreateTheMap()
1252 //Create the SDD DDL Module Map
1253 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
1254 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
1256 AliError("Calibration object retrieval failed! SDD will not be processed");
1257 fDDLModuleMap = NULL;
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 ");
1269 //_______________________________________________________________
1272 void AliITSQASDDDataMakerRec::CreateTheCalibration()
1274 //Take from the OCDB the calibration information for the SDD
1275 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
1276 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
1279 AliError("Calibration object retrieval failed! SDD will not be processed");
1280 fCalibration = NULL;
1283 fCalibration = (TObjArray *)calibSDD->GetObject();
1285 if(!cacheStatus)calibSDD->SetObject(NULL);
1286 calibSDD->SetOwner(kTRUE);
1287 if(!cacheStatus){delete calibSDD;}
1289 AliITSCalibrationSDD * cal=NULL;
1290 for(Int_t imod=0;imod<fgknSDDmodules;imod++)
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;
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);
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
1314 for(Int_t i=0;i<8;i++) //check on bad chips in good modules
1317 if(cal->IsChipBad(i)){
1318 if(i<4){badmodhisto2side0+=64;}
1319 if(i>=4){badmodhisto2side1+=64;}
1323 if(cal->IsChipBad(i)){
1324 if(i<4){badmodhisto3side0+=64;}
1325 if(i>=4){badmodhisto3side1+=64;}
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
1333 if(ic<4) badmodhisto2side0++;
1334 else if(ic>=4)badmodhisto2side1++;
1337 if(ic<4) badmodhisto3side0++;
1338 else if(ic>=4)badmodhisto3side1++;
1340 }//end if chip module channel
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);
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);
1358 ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto3side1);
1360 }//end else bad module
1366 //____________________________________________________________________
1368 void AliITSQASDDDataMakerRec::InitCalibrationArray()
1370 //create the histograms with the calibration informations. The histograms are stored in a TObjArray
1371 TH1D *pattern1 = new TH1D("CALSDDModPattern","Calibration HW Modules pattern",fgknSDDmodules,239.5,499.5);
1372 pattern1->SetDirectory(0) ;
1373 TH2D *patternl3 = new TH2D("CALSDDphizL3","Calibration SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);
1374 patternl3->SetDirectory(0) ;
1375 TH2D *patternl4 = new TH2D("CALSDDphizL4"," Calibration SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5);
1376 patternl4->SetDirectory(0) ;
1378 if(!fHistoCalibration)fHistoCalibration = new TObjArray(3);
1379 fHistoCalibration->AddAtAndExpand(pattern1,0);
1380 fHistoCalibration->AddAtAndExpand(patternl3,1);
1381 fHistoCalibration->AddAtAndExpand(patternl4,2);
1382 fHistoCalibration->SetOwner(kTRUE);
1383 // printf("Calibration Histograms created!\n");
1386 //____________________________________________________________________
1388 void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
1390 //reset the SDD calibration histograms
1391 AliInfo(Form("Reset detector in SDD called for task index %i", task));
1392 if(task== AliQAv1::kRAWS ){
1398 ((TH1D*)(fHistoCalibration->At(0)))->Reset();
1399 ((TH2D*)(fHistoCalibration->At(1)))->Reset();
1400 ((TH2D*)(fHistoCalibration->At(2)))->Reset();
1401 //delete fHistoCalibration;
1402 //fHistoCalibration=NULL;
1406 //____________________________________________________________________
1408 Int_t AliITSQASDDDataMakerRec::GetNumberOfEvents(AliQAv1::TASKINDEX_t task)
1410 //return the number of the processed events for a given task fod SDD only
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;}