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),
82 fGenRecPointsOffset(0),
90 //ctor used to discriminate OnLine-Offline analysis
91 if(fLDC < 0 || fLDC > 6) {
92 AliError("Error: LDC number out of range; return\n");
94 fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
95 fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
96 fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies];
97 for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {
98 fGenRawsOffset[i] = 0;
99 fGenRecPointsOffset[i] = 0;
100 fGenDigitsOffset[i]=0;
103 InitCalibrationArray();
106 //____________________________________________________________________________
107 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
109 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
110 fkOnline(qadm.fkOnline),
112 fSDDhRawsTask(qadm.fSDDhRawsTask),
113 fSDDhDigitsTask(qadm.fSDDhDigitsTask),
114 fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
115 fGenRawsOffset(qadm.fGenRawsOffset),
116 fGenDigitsOffset(qadm.fGenDigitsOffset),
117 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
118 fTimeBinSize(qadm.fTimeBinSize),
119 fNEvent(qadm.fNEvent),
120 fNEventRP(qadm.fNEventRP),
121 fDDLModuleMap(qadm.fDDLModuleMap),
122 fCalibration(qadm.fCalibration),
123 fHistoCalibration(qadm.fHistoCalibration)
126 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
127 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
128 //fDDLModuleMap=NULL;
131 //____________________________________________________________________________
132 AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
134 //if(fDDLModuleMap) delete fDDLModuleMap;
135 if(fHistoCalibration){delete fHistoCalibration; fHistoCalibration=NULL;}
137 //__________________________________________________________________
138 AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
141 this->~AliITSQASDDDataMakerRec();
142 new(this) AliITSQASDDDataMakerRec(qac);
146 //____________________________________________________________________________
147 void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
150 //Start of a QA cycle
152 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()));
153 if(!fCalibration) {CreateTheCalibration();}
155 if(fAliITSQADataMakerRec->GetEventSpecie()==0) return;//not the kDefault EventSpecie
156 //Detector specific actions at start of cycle
157 if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRAWS){
158 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
159 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return;
161 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
163 fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
164 fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
165 fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
168 if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRECPOINTS){
169 if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRECPOINTS)==kFALSE)return;
171 AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of RecPoints normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
173 fAliITSQADataMakerRec->GetRecPointsData(9+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
174 fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
175 fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
179 //____________________________________________________________________________
180 void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray* /*list*/)
183 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
184 if(task==AliQAv1::kRAWS){
185 // printf("fNevent %d \n",fNEvent);
187 ((TH1D*)fAliITSQADataMakerRec->GetRawsData(3 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRawsData(0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEvent);
189 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEvent);
191 ((TH2D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(2 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEvent);
195 if(task==AliQAv1::kRECPOINTS){
196 // printf("fNeventRP %d \n",fNEventRP);
198 ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(9 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(6 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEventRP);
200 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
202 ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(2))),1.,(Double_t)fNEventRP);
208 //____________________________________________________________________________
209 Int_t AliITSQASDDDataMakerRec::InitRaws()
212 // Initialization for RAW data - SDD -
213 const Bool_t expert = kTRUE ;
214 const Bool_t saveCorr = kTRUE ;
215 const Bool_t image = kTRUE ;
222 if(fkOnline){AliInfo("Book Online Histograms for SDD\n");}
223 else {AliInfo("Book Offline Histograms for SDD\n ");}
224 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
225 h0->GetXaxis()->SetTitle("Module Number");
226 h0->GetYaxis()->SetTitle("Counts");
227 rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
230 //zPhi distribution using ladder and modules numbers
231 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//1
232 hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]");
233 hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
234 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, saveCorr);
237 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //2
238 hphil4->GetXaxis()->SetTitle("z[Module Number L4]");
239 hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
240 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, saveCorr);
243 //normalized histograms
244 TH1D *h0norm = new TH1D("SDDModPatternNORM","NORM HW Modules pattern",fgknSDDmodules,239.5,499.5); //3
245 h0norm->GetXaxis()->SetTitle("Module Number");
246 h0norm->GetYaxis()->SetTitle("Counts");
247 rv = fAliITSQADataMakerRec->Add2RawsList(h0norm,3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
250 //zPhi distribution using ladder and modules numbers
251 TH2D *hphil3norm = new TH2D("SDDphizL3NORM","NORM SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//4
252 hphil3norm->GetXaxis()->SetTitle("z[Module Number L3 ]");
253 hphil3norm->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
254 rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
257 TH2D *hphil4norm = new TH2D("SDDphizL4NORM","NORM SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //5
258 hphil4norm->GetXaxis()->SetTitle("z[Module Number L4]");
259 hphil4norm->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
260 rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
265 TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); //6
266 hddl->GetXaxis()->SetTitle("Channel");
267 hddl->GetYaxis()->SetTitle("DDL Number");
268 rv = fAliITSQADataMakerRec->Add2RawsList(hddl,6+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
270 Int_t indexlast1 = 0;
275 indexlast1 = fSDDhRawsTask;
277 for(Int_t i=0; i<3; i++) hname[i]= new char[50];
278 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
279 for(Int_t iside=0;iside<fgknSide;iside++){
280 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
281 sprintf(hname[0],"SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside);
282 sprintf(hname[1],"SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside);
283 // sprintf(hname[2],"SDDhmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);
284 TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
285 fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
286 fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
287 rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
293 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
294 for(Int_t iside=0;iside<fgknSide;iside++){
295 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
296 sprintf(hname[0],"SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
297 sprintf(hname[1],"SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
298 TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
299 fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
300 fModuleChargeMap->GetYaxis()->SetTitle("Anode Number");
301 rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
308 TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",500,-0.5,199.5);
309 hsize->SetBit(TH1::kCanRebin);
310 hsize->GetXaxis()->SetTitle("Event Size [kB]");
311 hsize->GetYaxis()->SetTitle("Entries");
312 rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
316 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
321 //____________________________________________________________________________
322 Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
324 // Fill QA for RAW - SDD -
326 // Check id histograms already created for this Event Specie
328 if(!fDDLModuleMap){CreateTheMap();}
329 if(rawReader->GetType() != 7) return rv; // skips non physical triggers
330 AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");
332 rawReader->Select("ITSSDD");
333 AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
334 stream->SetDDLModuleMap(fDDLModuleMap);
340 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
341 for(Int_t iside=0;iside<fgknSide;iside++) {
342 if(fSDDhRawsTask > 7 + index) fAliITSQADataMakerRec->GetRawsData(7 + index +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
343 // 4 because the 2D histos for single events start after the fourth position
353 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
356 Int_t prevDDLID = -1;
358 int totalddl=static_cast<int>(fDDLModuleMap->GetNDDLs());
359 Bool_t *ddldata=new Bool_t[totalddl];
360 for(Int_t jddl=0;jddl<totalddl;jddl++){ddldata[jddl]=kFALSE;}
362 while(stream->Next()) {
363 ildcID = rawReader->GetLDCId();
364 iddl = rawReader->GetDDLID();// - fgkDDLIDshift;
365 //printf("----------------------iddl %i\n",iddl);
367 isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
369 AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
372 if(stream->IsCompletedModule()) {
373 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n"));
376 if(stream->IsCompletedDDL()) {
378 if ((rawReader->GetDDLID() != prevDDLID)&&(ddldata[iddl])==kFALSE){
379 size += rawReader->GetDataSize();//in bytes
380 prevDDLID = rawReader->GetDDLID();
384 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n"));
388 coord1 = stream->GetCoord1();
389 coord2 = stream->GetCoord2();
390 signal = stream->GetSignal();
392 moduleSDD = isddmod - fgkmodoffset;
394 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
395 AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
399 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
400 Short_t iside = stream->GetChannel();
402 //printf(" \n%i %i %i %i \n ",lay, lad, det,iside );
403 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod);
404 if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);
405 if(lay==4) {fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);}
409 fAliITSQADataMakerRec->GetRawsData(6+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill((stream->GetCarlosId())+0.5*iside -0.5,iddl);
410 // 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));
411 //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));
412 activeModule = moduleSDD;
413 index1 = activeModule * 2 + iside;
416 AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
420 if(fSDDhRawsTask > 7 + index1) {
421 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(7 + index1 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal);
422 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(7 + index1 + 260*2 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal);
426 if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt));
428 if(fkOnline){((TH1F*)(fAliITSQADataMakerRec->GetRawsData(7 + 260*4 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(size/1024.);//KB
430 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt));
435 // AnalyseBNG(); // Analyse Baseline, Noise, Gain
436 // AnalyseINJ(); // Analyse Injectors
444 //____________________________________________________________________________
445 Int_t AliITSQASDDDataMakerRec::InitDigits()
447 // if(!fHistoCalibration)InitCalibrationArray();
448 // Initialization for DIGIT data - SDD -
449 const Bool_t expert = kTRUE ;
450 const Bool_t image = kTRUE ;
452 // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
453 //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List
454 TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod
455 h0->GetXaxis()->SetTitle("SDD Module Number");
456 h0->GetYaxis()->SetTitle("# DIGITS");
457 rv = fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
459 // printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
460 TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc
461 h1->GetXaxis()->SetTitle("Anode Number");
462 h1->GetYaxis()->SetTitle("# DIGITS");
463 rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
465 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
466 TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc
467 h2->GetXaxis()->SetTitle("Tbin Number");
468 h2->GetYaxis()->SetTitle("# DIGITS");
469 rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
471 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
472 TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig
473 h3->GetXaxis()->SetTitle("ADC Value");
474 h3->GetYaxis()->SetTitle("# DIGITS");
475 rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
477 //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask );
478 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask));
482 //____________________________________________________________________________
483 Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
486 // Fill QA for DIGIT - SDD -
487 //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
488 //fITS->SetTreeAddress();
489 //TClonesArray *iITSdigits = fITS->DigitsAddress(1);
494 TBranch *branchD = digits->GetBranch("ITSDigitsSDD");
497 AliError("can't get the branch with the ITS SDD digits !");
500 // Check id histograms already created for this Event Specie
501 // if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
502 // rv = InitDigits() ;
504 static TClonesArray statDigits("AliITSdigitSDD");
505 TClonesArray *iITSdigits = &statDigits;
506 branchD->SetAddress(&iITSdigits);
508 for(Int_t i=0; i<260; i++){
510 digits->GetEvent(nmod);
511 Int_t ndigits = iITSdigits->GetEntries();
512 fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nmod,ndigits);
514 for (Int_t idig=0; idig<ndigits; idig++) {
515 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
516 Int_t iz=dig->GetCoord1(); // cell number z
517 Int_t ix=dig->GetCoord2(); // cell number x
518 Int_t sig=dig->GetSignal();
519 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iz);
520 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ix);
521 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(sig);
527 //____________________________________________________________________________
528 Int_t AliITSQASDDDataMakerRec::InitRecPoints()
530 //if(!fHistoCalibration)InitCalibrationArray();
531 //AliInfo("Initialize SDD recpoints histos\n");
532 // Initialization for RECPOINTS - SDD -
533 const Bool_t expert = kTRUE ;
534 const Bool_t image = kTRUE ;
536 // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
553 //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
554 //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
555 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
556 //h0->SetBit(TH1::kCanRebin);
557 h0->GetXaxis()->SetTitle("KeV");
558 h0->GetYaxis()->SetTitle("Entries");
559 rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
560 fSDDhRecPointsTask++;
562 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
563 //h1->SetBit(TH1::kCanRebin);
564 h1->GetXaxis()->SetTitle("Kev");
565 h1->GetYaxis()->SetTitle("Entries");
566 rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
567 fSDDhRecPointsTask++;
570 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
571 h2->GetYaxis()->SetTitle("Y[cm]");
572 h2->GetXaxis()->SetTitle("X[cm]");
573 rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
574 fSDDhRecPointsTask++;
576 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
577 h3->GetYaxis()->SetTitle("R[cm]");
578 h3->GetXaxis()->SetTitle("Z[cm]");
579 rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
580 fSDDhRecPointsTask++;
582 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",4600/nOnline3,-23,23,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
583 h4->GetYaxis()->SetTitle("#phi[rad]");
584 h4->GetXaxis()->SetTitle("Z[cm]");
585 rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
586 fSDDhRecPointsTask++;
588 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6200/nOnline6,-31,31,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
589 h5->GetYaxis()->SetTitle("#phi[rad]");
590 h5->GetXaxis()->SetTitle("Z[cm]");
591 rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
592 fSDDhRecPointsTask++;
594 TH1D *h6 = new TH1D("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
595 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
596 h6->GetYaxis()->SetTitle("Entries");
597 rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
598 fSDDhRecPointsTask++;
601 TH2D *h7 = new TH2D("SDDModPatternL3RP","Modules pattern L3 RP",12,0.5,6.5,14,0.5,14.5); //position number 7
602 h7->GetXaxis()->SetTitle("z[#Module L3 ]");
603 h7->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
604 rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
605 fSDDhRecPointsTask++;
607 TH2D *h8 = new TH2D("SDDModPatternL4RP","Modules pattern L4 RP",16,0.5,8.5,22,0.5,22.5); //position number 8
608 h8->GetXaxis()->SetTitle("[#Module L3 ]");
609 h8->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
610 rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
611 fSDDhRecPointsTask++;
613 //------------------------norm--------------------------//
616 TH1D *h9 = new TH1D("SDDModPatternRPNORM","Modules pattern RP NORM",fgknSDDmodules,239.5,499.5); //position number 9
617 h9->GetXaxis()->SetTitle("Module number"); //spd offset = 240
618 h9->GetYaxis()->SetTitle("Entries");
619 rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
620 fSDDhRecPointsTask++;
623 TH2D *h10 = new TH2D("SDDModPatternL3RPNORM","Modules pattern L3 RP NORM",12,0.5,6.5,14,0.5,14.5); //position number 10
624 h10->GetXaxis()->SetTitle("z[#Module L3 ]");
625 h10->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
626 rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
627 fSDDhRecPointsTask++;
629 TH2D *h11 = new TH2D("SDDModPatternL4RPNORM","Modules pattern L4 RP NORM",16,0.5,8.5,22,0.5,22.5); //position number 11
630 h11->GetXaxis()->SetTitle("[#Module L3 ]");
631 h10->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
632 rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
633 fSDDhRecPointsTask++;
635 //--------------------------------------------------------//
637 TH2F *h12 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 12
638 h12->GetXaxis()->SetTitle("X local coord, drift, cm");
639 h12->GetYaxis()->SetTitle("Z local coord, anode, cm");
640 rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
641 fSDDhRecPointsTask++;
643 //AliInfo("Create SDD recpoints histos\n");
645 TH1F *h13 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,16.5);//position number 13 (L3)
646 h13->SetBit(TH1::kCanRebin);
647 h13->GetXaxis()->SetTitle("r[cm]");
648 h13->GetXaxis()->CenterTitle();
649 h13->GetYaxis()->SetTitle("Entries");
650 rv = fAliITSQADataMakerRec->Add2RecPointsList(h13,13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
651 fSDDhRecPointsTask++;
653 TH1F *h14 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,23.,25.);// and position number 14 (L4)
654 h14->SetBit(TH1::kCanRebin);
655 h14->GetXaxis()->SetTitle("r[cm]");
656 h14->GetXaxis()->CenterTitle();
657 h14->GetYaxis()->SetTitle("Entries");
658 rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
659 fSDDhRecPointsTask++;
661 for(Int_t iLay=0; iLay<=1; iLay++){
662 sprintf(hisnam,"SDDphidistrib_Layer%d",iLay+3);
663 TH1F *h15 = new TH1F(hisnam,hisnam,180,-TMath::Pi(),TMath::Pi());//position number 15 (L3) and position number 16 (L4)
664 h15->GetXaxis()->SetTitle("#varphi[rad]");
665 h15->GetXaxis()->CenterTitle();
666 h15->GetYaxis()->SetTitle("Entries");
667 rv = fAliITSQADataMakerRec->Add2RecPointsList(h15,iLay+15+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
668 fSDDhRecPointsTask++;
671 for(Int_t iLay=0; iLay<=1; iLay++){
672 sprintf(hisnam,"SDDdrifttime_Layer%d",iLay+3);
673 TH1F *h17 = new TH1F(hisnam,hisnam,90/nOnline5,-0.5,4499.5);//position number 17 (L3) and position number 18 (L4)
674 h17->SetBit(TH1::kCanRebin);
675 h17->GetXaxis()->SetTitle("drift time[ns]");
676 h17->GetXaxis()->CenterTitle();
677 h17->GetYaxis()->SetTitle("Entries");
678 rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,iLay+17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
679 fSDDhRecPointsTask++;
683 TH2F *h19 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 19
684 h19->GetYaxis()->SetTitle("Y[cm]");
685 h19->GetXaxis()->SetTitle("X[cm]");
686 rv = fAliITSQADataMakerRec->Add2RecPointsList(h19,19+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
687 fSDDhRecPointsTask++;
689 TH2F *h20 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 20
690 h20->GetYaxis()->SetTitle("R[cm]");
691 h20->GetXaxis()->SetTitle("Z[cm]");
692 rv = fAliITSQADataMakerRec->Add2RecPointsList(h20,20+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
693 fSDDhRecPointsTask++;
696 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
701 //____________________________________________________________________________
702 Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
704 // Fill QA for RecPoints - SDD -
708 //AliInfo("get the branch with the ITS clusters !\n");
709 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
710 TClonesArray *recpoints=NULL;
711 if(fkOnline){recpoints = rpcont->FetchClusters(0,clustersTree,fAliITSQADataMakerRec->GetEventNumber());}
712 else{recpoints = rpcont->FetchClusters(0,clustersTree);}
713 if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){
714 AliError("can't get SDD clusters !");
719 Float_t cluglo[3]={0.,0.,0.};
721 for(Int_t i=19;i<21;i++){
722 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
725 Int_t firMod=AliITSgeomTGeo::GetModuleIndex(3,1,1);
726 Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1);
727 for(Int_t module=firMod; module<lasMod;module++){
728 //AliInfo(Form("Module %d\n",module));
729 recpoints = rpcont->UncheckedGetClusters(module);
730 npoints += recpoints->GetEntries();
731 //AliInfo(Form("modnumb %d, npoints %d, total points %d\n",module, recpoints->GetEntries(),npoints));
732 //AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
733 //AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det));
735 //AliInfo(Form("modnumb %d, entries %d\n",module, recpoints->GetEntries()));
736 for(Int_t j=0;j<recpoints->GetEntries();j++){
737 //AliInfo(Form("modnumb %d, entry %d \n",module, j));
738 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
739 Int_t index = recp->GetDetectorIndex();
740 lay=recp->GetLayer();
741 Int_t modnumb=index+AliITSgeomTGeo::GetModuleIndex(lay+1,1,1);
742 //printf("modnumb %i\n",modnumb);
743 AliITSgeomTGeo::GetModuleId(modnumb, lay, lad, det);
744 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(modnumb);//modpatternrp
745 recp->GetGlobalXYZ(cluglo);
746 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
747 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
748 Float_t drifttime=recp->GetDriftTime();
749 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
750 if(lay==3||lay==4)fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX
751 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz
753 fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
754 fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE
756 if(recp->GetLayer() == 2) {
757 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge of layer 3
758 //fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//lad pattern layer 3
759 Int_t iside=recp->GetDriftSide();
760 //printf("iside =%d\n",iside);
761 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);//mod pattern layer 3
762 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution layer 3
763 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);// phi distribution layer 3
764 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer
765 fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 3
766 } else if(recp->GetLayer() == 3) {
767 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge layer 4
768 //fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//ladpatternlayer4
769 Int_t iside=recp->GetDriftSide();
770 //printf("iside =%d\n",iside);
771 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);//mod pattern layer 4
772 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution
773 fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);//phi distribution
774 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer 4
775 fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 4
782 //_______________________________________________________________
784 Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie)const
786 // Returns offset number according to the specified task
788 if( task == AliQAv1::kRAWS ){offset=fGenRawsOffset[specie];}
789 else if(task == AliQAv1::kDIGITSR ){offset=fGenDigitsOffset[specie];}
790 else if( task == AliQAv1::kRECPOINTS ){offset=fGenRecPointsOffset[specie];}
794 //_______________________________________________________________
796 void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
797 // Set offset number according to the specified task
798 if( task == AliQAv1::kRAWS ) {fGenRawsOffset[specie]=offset;}
799 else if( task == AliQAv1::kDIGITSR ) {fGenDigitsOffset[specie]=offset;}
800 else if( task == AliQAv1::kRECPOINTS ) {fGenRecPointsOffset[specie]=offset;}
803 //_______________________________________________________________
805 Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
807 //return the number of histo booked for a given Task
809 if( task == AliQAv1::kRAWS ){ histotot=fSDDhRawsTask ;}
810 else if(task == AliQAv1::kDIGITSR) { histotot=fSDDhDigitsTask;}
811 else if( task == AliQAv1::kRECPOINTS ){ histotot=fSDDhRecPointsTask;}
812 else {AliInfo("No task has been selected. TaskHisto set to zero.\n");}
817 //_______________________________________________________________
820 void AliITSQASDDDataMakerRec::CreateTheMap()
822 //Create the SDD DDL Module Map
823 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
824 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
826 AliError("Calibration object retrieval failed! SDD will not be processed");
827 fDDLModuleMap = NULL;
830 fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
831 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
832 ddlMapSDD->SetOwner(kTRUE);
833 if(!cacheStatus){ delete ddlMapSDD;}
834 AliInfo("DDL Map Created\n ");
837 //_______________________________________________________________
840 void AliITSQASDDDataMakerRec::CreateTheCalibration()
842 //Take from the OCDB the calibration information for the SDD
843 AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
844 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
847 AliError("Calibration object retrieval failed! SDD will not be processed");
848 fCalibration = NULL;;
850 fCalibration = (TObjArray *)calibSDD->GetObject();
852 if(!cacheStatus)calibSDD->SetObject(NULL);
853 calibSDD->SetOwner(kTRUE);
854 if(!cacheStatus){delete calibSDD;}
856 AliITSCalibrationSDD * cal=NULL;
857 for(Int_t imod=0;imod<fgknSDDmodules;imod++)
860 Int_t fillmodhisto1=fgkTotalNumberSDDAnodes;
861 Int_t fillmodhisto2side0=fgkNumberOfSDDAnodesperSide;
862 Int_t fillmodhisto2side1=fgkNumberOfSDDAnodesperSide;
863 Int_t fillmodhisto3side0=fgkNumberOfSDDAnodesperSide;
864 Int_t fillmodhisto3side1=fgkNumberOfSDDAnodesperSide;
866 Int_t badmodhisto1=0;
867 Int_t badmodhisto2side0=0;
868 Int_t badmodhisto2side1=0;
869 Int_t badmodhisto3side0=0;
870 Int_t badmodhisto3side1=0;
871 //printf("imod %i\t ==== \t",imod);
872 Int_t module=imod + 240;
873 //printf("module %i\t ==== \t",module);
874 cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
876 AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
877 Int_t index=1+(det-1)*2;
878 if(cal==0){continue;}
879 if (cal->IsBad()){continue;}//bad module check
881 for(Int_t i=0;i<8;i++) //check on bad chips in good modules
884 if(cal->IsChipBad(i)){
885 if(i<4){badmodhisto2side0+=64;}
886 if(i>=4){badmodhisto2side1+=64;}
890 if(cal->IsChipBad(i)){
891 if(i<4){badmodhisto3side0+=64;}
892 if(i>=4){badmodhisto3side1+=64;}
896 for(Int_t iAn=0; iAn<512; iAn++){//anodes loop
897 Int_t ic=cal->GetChip(iAn);//chip with this anode number
898 if(!cal->IsChipBad(ic) && !cal->IsBad() && cal->IsBadChannel(iAn)){// good chip good module bad channel
900 if(ic<4) badmodhisto2side0++;
901 else if(ic>=4)badmodhisto2side1++;
904 if(ic<4) badmodhisto3side0++;
905 else if(ic>=4)badmodhisto3side1++;
907 }//end if chip module channel
910 badmodhisto1=badmodhisto2side0+badmodhisto2side1;
911 fillmodhisto1-=badmodhisto1;
912 fillmodhisto2side0-=badmodhisto2side0;
913 fillmodhisto2side1-=badmodhisto2side1;
914 ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
915 ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index,lad,fillmodhisto2side0);
916 ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index+1,lad,fillmodhisto2side1);
919 badmodhisto1=badmodhisto3side0+badmodhisto3side1;
920 fillmodhisto1-=badmodhisto1;
921 fillmodhisto3side0-=badmodhisto3side0;
922 fillmodhisto3side1-=badmodhisto3side1;
923 ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
924 ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index,lad,fillmodhisto3side0);
925 ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto2side1);
927 }//end else bad module
932 //____________________________________________________________________
934 void AliITSQASDDDataMakerRec::InitCalibrationArray()
936 //create the histograms with the calibration informations. The histograms are stored in a TObjArray
937 TH1D *pattern1 = new TH1D("CALSDDModPattern","Calibration HW Modules pattern",fgknSDDmodules,239.5,499.5);
938 TH2D *patternl3 = new TH2D("CALSDDphizL3","Calibration SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);
939 TH2D *patternl4 = new TH2D("CALSDDphizL4"," Calibration SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5);
941 fHistoCalibration = new TObjArray(3);
942 fHistoCalibration->AddAtAndExpand(pattern1,0);
943 fHistoCalibration->AddAtAndExpand(patternl3,1);
944 fHistoCalibration->AddAtAndExpand(patternl4,2);
946 // printf("Calibration Histograms created!\n");
949 //____________________________________________________________________
951 void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
953 //reset the SDD calibration histograms
954 AliInfo(Form("Reset detector in SDD called for task index %i", task));
955 if(task== AliQAv1::kRAWS ){
960 ((TH1D*)(fHistoCalibration->At(0)))->Reset();
961 ((TH2D*)(fHistoCalibration->At(1)))->Reset();
962 ((TH2D*)(fHistoCalibration->At(2)))->Reset();