]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASDDDataMakerRec.cxx
Updates needed for full jet reconstruction (charged + emcal) [Magali Estienne]
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDDataMakerRec.cxx
CommitLineData
ebdd0606 1/**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18// *************************************************************
19// Checks the quality assurance
20// by comparing with reference data
21// contained in a DB
22// -------------------------------------------------------------
23// W. Ferrarese + P. Cerello Feb 2008
e41192d7 24// M.Siciliano Aug 2008 QA RecPoints and HLT mode
ebdd0606 25// INFN Torino
26
27// --- ROOT system ---
ad300de9 28
ebdd0606 29#include <TProfile2D.h>
30#include <TH2D.h>
31#include <TBranch.h>
32#include <TTree.h>
33#include <TGaxis.h>
34#include <TMath.h>
35#include <TDirectory.h>
e41192d7 36#include <TSystem.h>
ebdd0606 37// --- Standard library ---
38
39// --- AliRoot header files ---
40#include "AliITSQASDDDataMakerRec.h"
41#include "AliLog.h"
4e25ac79 42#include "AliQAv1.h"
ebdd0606 43#include "AliQAChecker.h"
44#include "AliRawReader.h"
e41192d7 45#include "AliITSRawStream.h"
ebdd0606 46#include "AliITSRawStreamSDD.h"
e41192d7 47#include "AliITSRawStreamSDDCompressed.h"
48#include "AliITSDetTypeRec.h"
ebdd0606 49#include "AliITSRecPoint.h"
50#include "AliITSgeomTGeo.h"
e41192d7 51#include "AliITSHLTforSDD.h"
ebdd0606 52#include "AliCDBManager.h"
53#include "AliCDBStorage.h"
54#include "AliCDBEntry.h"
ad300de9 55#include "Riostream.h"
ebdd0606 56
57ClassImp(AliITSQASDDDataMakerRec)
58
59//____________________________________________________________________________
60AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :
61TObject(),
62fAliITSQADataMakerRec(aliITSQADataMakerRec),
63fkOnline(kMode),
64fLDC(ldc),
ad300de9 65fSDDhRawsTask(0),
66fSDDhRecPointsTask(0),
ad300de9 67fGenRawsOffset(0),
68fGenRecPointsOffset(0),
ebdd0606 69fTimeBinSize(1),
e41192d7 70fDDLModuleMap(0),
71fHLTMode(0),
72fHLTSDD(0)
ebdd0606 73{
74 //ctor used to discriminate OnLine-Offline analysis
75 if(fLDC < 0 || fLDC > 4) {
76 AliError("Error: LDC number out of range; return\n");
77 }
e41192d7 78 if(!fkOnline){AliInfo("Offline mode: HLT set from AliITSDetTypeRec for SDD\n");}
79 else
80 if(fkOnline){
81 AliInfo("Online mode: HLT set from environment for SDD\n");
82 SetHLTModeFromEnvironment();
83 }
ebdd0606 84 //fDDLModuleMap=NULL;
85}
86
87//____________________________________________________________________________
88AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
89TObject(),
90fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
91fkOnline(qadm.fkOnline),
92fLDC(qadm.fLDC),
ad300de9 93fSDDhRawsTask(qadm.fSDDhRawsTask),
94fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
ad300de9 95fGenRawsOffset(qadm.fGenRawsOffset),
96fGenRecPointsOffset(qadm.fGenRecPointsOffset),
ebdd0606 97fTimeBinSize(1),
e41192d7 98fDDLModuleMap(0),
99fHLTMode(qadm.fHLTMode),
100fHLTSDD( qadm.fHLTSDD)
ebdd0606 101{
102 //copy ctor
103 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
104 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
105 fDDLModuleMap=NULL;
106}
107
108//____________________________________________________________________________
109AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
110 // destructor
111 // if(fDDLModuleMap) delete fDDLModuleMap;
112}
113//__________________________________________________________________
114AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
115{
7a0e5776 116 // Equal operator.
ebdd0606 117 this->~AliITSQASDDDataMakerRec();
118 new(this) AliITSQASDDDataMakerRec(qac);
119 return *this;
120}
121
122//____________________________________________________________________________
123void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
124{
125 //Detector specific actions at start of cycle
126 AliDebug(1,"AliITSQADM::Start of SDD Cycle\n");
127}
128
129//____________________________________________________________________________
4e25ac79 130void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
ebdd0606 131{
132 // launch the QA checking
4e25ac79 133 AliDebug(1,"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
ebdd0606 134}
135
136//____________________________________________________________________________
137void AliITSQASDDDataMakerRec::InitRaws()
138{
139 // Initialization for RAW data - SDD -
7d297381 140 const Bool_t expert = kTRUE ;
141 const Bool_t saveCorr = kTRUE ;
142 const Bool_t image = kTRUE ;
143
57acd2d2 144 fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
ebdd0606 145 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
146 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
e41192d7 147 if(!ddlMapSDD)
148 {
149 AliError("Calibration object retrieval failed! SDD will not be processed");
150 fDDLModuleMap = NULL;
151 return;
152 }
ebdd0606 153 fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
154 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
155 ddlMapSDD->SetOwner(kTRUE);
e41192d7 156 if(!cacheStatus)
157 {
158 delete ddlMapSDD;
159 }
7a0e5776 160
e41192d7 161 if(fkOnline==kFALSE){
162 AliInfo("Offline mode: HLTforSDDobject used \n");
163 AliCDBEntry *hltforSDD = AliCDBManager::Instance()->Get("ITS/Calib/HLTforSDD");
164 if(!hltforSDD){
165 AliError("Calibration object retrieval failed! SDD will not be processed");
166 fHLTSDD=NULL;
167 return;
168 }
169 fHLTSDD = (AliITSHLTforSDD*)hltforSDD->GetObject();
170 if(!cacheStatus)hltforSDD->SetObject(NULL);
171 hltforSDD->SetOwner(kTRUE);
172 if(!cacheStatus)
173 {
174 delete hltforSDD;
175 }
176 }
ebdd0606 177 Int_t lay, lad, det;
ebdd0606 178 Int_t indexlast = 0;
179 Int_t index1 = 0;
180
7a0e5776 181 if(fkOnline)
182 {
183 AliInfo("Book Online Histograms for SDD\n");
184 }
185 else
186 {
187 AliInfo("Book Offline Histograms for SDD\n ");
188 }
189 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
ebdd0606 190 h0->GetXaxis()->SetTitle("Module Number");
191 h0->GetYaxis()->SetTitle("Counts");
7d297381 192 fAliITSQADataMakerRec->Add2RawsList((new TH1D(*h0)),0+fGenRawsOffset, expert, !image, !saveCorr);
ebdd0606 193 delete h0;
ad300de9 194 fSDDhRawsTask++;
7a0e5776 195
196 //zPhi distribution using ladder and modules numbers
197 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",6,0.5,6.5,14,0.5,14.5);
198 hphil3->GetXaxis()->SetTitle("z[#Module L3 ]");
199 hphil3->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
7d297381 200 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil3)),1+fGenRawsOffset, !expert, image, saveCorr);
7a0e5776 201 delete hphil3;
202 fSDDhRawsTask++;
203
204 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",8,0.5,8.5,22,0.5,22.5);
205 hphil4->GetXaxis()->SetTitle("z[#Module L4]");
206 hphil4->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
7d297381 207 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil4)),2+fGenRawsOffset, !expert, image, saveCorr);
7a0e5776 208 delete hphil4;
209 fSDDhRawsTask++;
210
ebdd0606 211
7a0e5776 212 if(fkOnline)
213 {
214
215 //DDL Pattern
216 TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,23.5,24,-0.5,23.5);
ad300de9 217 hddl->GetXaxis()->SetTitle("Channel");
218 hddl->GetYaxis()->SetTitle("#DDL");
7d297381 219 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hddl)),3+fGenRawsOffset, expert, !image, !saveCorr);
ad300de9 220 delete hddl;
221 fSDDhRawsTask++;
7a0e5776 222 Int_t indexlast1 = 0;
223
224 fTimeBinSize = 4;
225 indexlast = 0;
226 index1 = 0;
227 indexlast1 = fSDDhRawsTask;
228 char *hname[3];
229 for(Int_t i=0; i<3; i++) hname[i]= new char[50];
230 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
231 for(Int_t iside=0;iside<fgknSide;iside++){
232 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
233 sprintf(hname[0],"SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside);
234 sprintf(hname[1],"SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside);
235 sprintf(hname[2],"SDDhmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);
236 TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
237 fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
238 fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
7d297381 239 fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 240 delete fModuleChargeMapFSE;
241
242 fSDDhRawsTask++;
243 index1++;
ebdd0606 244 }
7a0e5776 245 }
246
247 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
248 for(Int_t iside=0;iside<fgknSide;iside++){
249 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
250 sprintf(hname[0],"SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
251 sprintf(hname[1],"SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
252 TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
253 fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
254 fModuleChargeMap->GetYaxis()->SetTitle("Anode");
7d297381 255 fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
7a0e5776 256 delete fModuleChargeMap;
257
258 fSDDhRawsTask++;
259 index1++;
ebdd0606 260 }
7a0e5776 261 }
262
263 } // kONLINE
ebdd0606 264
ad300de9 265 AliDebug(1,Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
ebdd0606 266}
267
268
269//____________________________________________________________________________
270void AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
271{
272 // Fill QA for RAW - SDD -
7a0e5776 273
ebdd0606 274 if(!fDDLModuleMap){
275 AliError("SDD DDL module map not available - skipping SDD QA");
276 return;
277 }
278 if(rawReader->GetType() != 7) return; // skips non physical triggers
279 AliDebug(1,"entering MakeRaws\n");
7a0e5776 280
e41192d7 281 rawReader->Reset();
282 AliITSRawStream *stream;
283
284 if(fkOnline==kTRUE)
285 {
286 if(GetHLTMode()==kTRUE)
287 {
ad300de9 288 //AliInfo("Online mode: HLT C compressed mode used for SDD\n");
e41192d7 289 stream = new AliITSRawStreamSDDCompressed(rawReader); }
290 else{
ad300de9 291 //AliInfo("Online mode: HLT A mode used for SDD\n");
e41192d7 292 stream = new AliITSRawStreamSDD(rawReader);}
293 }
294 else
295 {
296 if(fHLTSDD->IsHLTmodeC()==kTRUE){
ad300de9 297 //AliInfo("Offline mode: HLT C compressed mode used for SDD\n");
e41192d7 298 stream = new AliITSRawStreamSDDCompressed(rawReader);
299 }else
300 {
ad300de9 301 //AliInfo("Offline mode: HLT A mode used for SDD\n");
7a0e5776 302 stream = new AliITSRawStreamSDD(rawReader);
303 }
e41192d7 304 }
305
306 //ckeck on HLT mode
7a0e5776 307
e41192d7 308 // AliITSRawStreamSDD s(rawReader);
309 stream->SetDDLModuleMap(fDDLModuleMap);
310
ebdd0606 311 Int_t lay, lad, det;
7a0e5776 312
ebdd0606 313 Int_t index=0;
314 if(fkOnline) {
315 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
7a0e5776 316 for(Int_t iside=0;iside<fgknSide;iside++) {
317 if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset)->Reset();
318 // 4 because the 2D histos for single events start after the fourth position
319 index++;
320 }
ebdd0606 321 }
322 }
e41192d7 323
ebdd0606 324 Int_t cnt = 0;
325 Int_t ildcID = -1;
326 Int_t iddl = -1;
327 Int_t isddmod = -1;
7a0e5776 328 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
e41192d7 329
330 while(stream->Next()) {
ebdd0606 331 ildcID = rawReader->GetLDCId();
332 iddl = rawReader->GetDDLID() - fgkDDLIDshift;
7a0e5776 333
e41192d7 334 isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
ebdd0606 335 if(isddmod==-1){
ad300de9 336 AliDebug(1,Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
ebdd0606 337 continue;
338 }
e41192d7 339 if(stream->IsCompletedModule()) {
ebdd0606 340 AliDebug(1,Form("IsCompletedModule == KTRUE\n"));
341 continue;
342 }
de075dae 343 if(stream->IsCompletedDDL()) {
344 AliDebug(1,Form("IsCompletedDDL == KTRUE\n"));
345 continue;
346 }
ebdd0606 347
e41192d7 348 coord1 = stream->GetCoord1();
349 coord2 = stream->GetCoord2();
350 signal = stream->GetSignal();
ebdd0606 351
7a0e5776 352 moduleSDD = isddmod - fgkmodoffset;
353
b62d7123 354 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
e41192d7 355 AliDebug(1,Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
b62d7123 356 isddmod = 1;
ebdd0606 357 }
7a0e5776 358
ebdd0606 359 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
ad300de9 360
7a0e5776 361
ad300de9 362 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset )->Fill(isddmod);
7a0e5776 363
364 if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(det,lad);
ebdd0606 365 if(lay==4) {
7a0e5776 366 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(det,lad);}
367
e41192d7 368 Short_t iside = stream->GetChannel();
ebdd0606 369
7a0e5776 370 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
371
ad300de9 372
ebdd0606 373 if(fkOnline) {
7a0e5776 374
375 activeModule = moduleSDD;
376 index1 = activeModule * 2 + iside;
377
378 if(index1<0){
379 AliDebug(1,Form("Wrong index number %d - patched to 0\n",index1));
380 index1 = 0;
381 }
382 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
383 if(fSDDhRawsTask > 4 + index1) {
384 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
385 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
ebdd0606 386 }
387 }
7a0e5776 388 cnt++;
389 if(!(cnt%10000)) AliDebug(1,Form(" %d raw digits read",cnt));
ebdd0606 390 }
391 AliDebug(1,Form("Event completed, %d raw digits read",cnt));
e41192d7 392 delete stream;
393 stream = NULL;
7a0e5776 394}
ebdd0606 395
396//____________________________________________________________________________
397void AliITSQASDDDataMakerRec::InitRecPoints()
398{
399 // Initialization for RECPOINTS - SDD -
7d297381 400 const Bool_t expert = kTRUE ;
401 const Bool_t image = kTRUE ;
402
57acd2d2 403 fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
ad300de9 404
ebdd0606 405 Int_t nOnline=1;
406 Int_t nOnline2=1;
407 Int_t nOnline3=1;
408 Int_t nOnline4=1;
409 if(fkOnline)
410 {
ebdd0606 411 nOnline=4;
412 nOnline2=28;
413 nOnline3=64;
414 nOnline4=14;
415 }
416
417
418 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
419 h0->GetXaxis()->SetTitle("ADC value");
420 h0->GetYaxis()->SetTitle("Entries");
7d297381 421 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h0)), 0 +fGenRecPointsOffset, !expert, image);
ebdd0606 422 delete h0;
ad300de9 423 fSDDhRecPointsTask++;
ebdd0606 424
425 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
426 h1->GetXaxis()->SetTitle("ADC value");
427 h1->GetYaxis()->SetTitle("Entries");
7d297381 428 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h1)), 1 +fGenRecPointsOffset, !expert, image);
ebdd0606 429 delete h1;
ad300de9 430 fSDDhRecPointsTask++;
ebdd0606 431
432 char hisnam[50];
433 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
434 h2->GetYaxis()->SetTitle("Y[cm]");
435 h2->GetXaxis()->SetTitle("X[cm]");
7d297381 436 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h2)),2+fGenRecPointsOffset, expert, !image);
ebdd0606 437 delete h2;
ad300de9 438 fSDDhRecPointsTask++;
ebdd0606 439
440 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
441 h3->GetYaxis()->SetTitle("R[cm]");
442 h3->GetXaxis()->SetTitle("Z[cm]");
7d297381 443 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h3)),3+fGenRecPointsOffset, expert, !image);
ebdd0606 444 delete h3;
ad300de9 445 fSDDhRecPointsTask++;
ebdd0606 446
447 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
448 h4->GetYaxis()->SetTitle("#phi[rad]");
449 h4->GetXaxis()->SetTitle("Z[cm]");
7d297381 450 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h4)),4+fGenRecPointsOffset, !expert, image);
ebdd0606 451 delete h4;
ad300de9 452 fSDDhRecPointsTask++;
ebdd0606 453
454 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
455 h5->GetYaxis()->SetTitle("#phi[rad]");
456 h5->GetXaxis()->SetTitle("Z[cm]");
7d297381 457 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h5)),5+fGenRecPointsOffset, !expert, image);
ebdd0606 458 delete h5;
ad300de9 459 fSDDhRecPointsTask++;
ebdd0606 460
461 TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
462 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
463 h6->GetYaxis()->SetTitle("Entries");
7d297381 464 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h6)),6 +fGenRecPointsOffset, expert, !image);
ebdd0606 465 delete h6;
ad300de9 466 fSDDhRecPointsTask++;
ebdd0606 467 TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5); //position number 7
468 h7->GetXaxis()->SetTitle("Ladder #, Layer 3");
469 h7->GetYaxis()->SetTitle("Entries");
7d297381 470 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h7)),7 +fGenRecPointsOffset, expert, !image);
ebdd0606 471 delete h7;
ad300de9 472 fSDDhRecPointsTask++;
ebdd0606 473 TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8
474 h8->GetXaxis()->SetTitle("Ladder #, Layer 4");
475 h8->GetYaxis()->SetTitle("Entries");
7d297381 476 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h8)),8 +fGenRecPointsOffset, expert, !image);
ebdd0606 477 delete h8;
ad300de9 478 fSDDhRecPointsTask++;
ebdd0606 479 TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9
480 h9->GetXaxis()->SetTitle("X local coord, drift, cm");
481 h9->GetYaxis()->SetTitle("Z local coord, anode, cm");
7d297381 482 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h9)),9 +fGenRecPointsOffset, expert, !image);
ebdd0606 483 delete h9;
ad300de9 484 fSDDhRecPointsTask++;
ebdd0606 485
486
487 TH1F *h10 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,18.);//position number 10 (L3)
488 h10->GetXaxis()->SetTitle("r[cm]");
489 h10->GetXaxis()->CenterTitle();
490 h10->GetYaxis()->SetTitle("Entries");
7d297381 491 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h10)),10 +fGenRecPointsOffset, expert, !image);
ebdd0606 492 delete h10;
ad300de9 493 fSDDhRecPointsTask++;
ebdd0606 494
495 TH1F *h11 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,22.,26.);// and position number 11 (L4)
496 h11->GetXaxis()->SetTitle("r[cm]");
497 h11->GetXaxis()->CenterTitle();
498 h11->GetYaxis()->SetTitle("Entries");
7d297381 499 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h11)),11 +fGenRecPointsOffset, expert, !image);
ebdd0606 500 delete h11;
ad300de9 501 fSDDhRecPointsTask++;
ebdd0606 502
503 for(Int_t iLay=0; iLay<=1; iLay++){
504 sprintf(hisnam,"SDDphidistrib_Layer%d",iLay+3);
505 TH1F *h12 = new TH1F(hisnam,hisnam,180,-TMath::Pi(),TMath::Pi());//position number 12 (L3) and position number 13 (L4)
506 h12->GetXaxis()->SetTitle("#varphi[rad]");
507 h12->GetXaxis()->CenterTitle();
508 h12->GetYaxis()->SetTitle("Entries");
7d297381 509 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h12)),iLay+12+fGenRecPointsOffset, expert, !image);
ebdd0606 510 delete h12;
ad300de9 511 fSDDhRecPointsTask++;
ebdd0606 512 }
513
514 if(fkOnline)
515 {
516 TH2F *h14 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 14
517 h14->GetYaxis()->SetTitle("Y[cm]");
518 h14->GetXaxis()->SetTitle("X[cm]");
7d297381 519 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h14)),14+fGenRecPointsOffset, expert, !image);
ebdd0606 520 delete h14;
ad300de9 521 fSDDhRecPointsTask++;
ebdd0606 522
523 TH2F *h15 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 15
524 h15->GetYaxis()->SetTitle("R[cm]");
525 h15->GetXaxis()->SetTitle("Z[cm]");
7d297381 526 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h15)),15+fGenRecPointsOffset, expert, !image);
ebdd0606 527 delete h15;
ad300de9 528 fSDDhRecPointsTask++;
ebdd0606 529
ebdd0606 530 }//online
531
ad300de9 532 //printf("%d SDD Recs histograms booked\n",fSDDhRecPointsTask);
ebdd0606 533
534
ad300de9 535 AliDebug(1,Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
ebdd0606 536
537
538}
539
540//____________________________________________________________________________
7a0e5776 541void AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
542{
543
544
ebdd0606 545 // Fill QA for RecPoints - SDD -
546 Int_t lay, lad, det;
547 TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
548 if (!branchRecP) {
549 AliError("can't get the branch with the ITS clusters !");
550 return;
551 }
552
553 static TClonesArray statRecpoints("AliITSRecPoint") ;
554 TClonesArray *recpoints = &statRecpoints;
555 branchRecP->SetAddress(&recpoints);
556 Int_t npoints = 0;
557 Float_t cluglo[3]={0.,0.,0.};
558 if(fkOnline)
559 {
560 for(Int_t i=14;i<16;i++)
561 {
ad300de9 562 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset)->Reset();
ebdd0606 563 }
564 }
565 for(Int_t module=0; module<clustersTree->GetEntries();module++){
566 branchRecP->GetEvent(module);
567 npoints += recpoints->GetEntries();
568 AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
569 //printf("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det);
570 for(Int_t j=0;j<recpoints->GetEntries();j++){
571 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
ad300de9 572 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(module);//modpatternrp
ebdd0606 573 recp->GetGlobalXYZ(cluglo);
574 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
575 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
ad300de9 576 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
577 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX
578 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz
ebdd0606 579 if(fkOnline)
580 {
ad300de9 581 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
582 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz FSE
ebdd0606 583 }
584 if(recp->GetLayer() ==2) {
ad300de9 585 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge of layer 3
586 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(lad);//lad pattern layer 3
587 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(rad);//r distribution layer 3
588 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(phi);// phi distribution layer 3
589 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 3
ebdd0606 590 }
591 else if(recp->GetLayer() ==3) {
ad300de9 592 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge layer 4
593 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(lad);//ladpatternlayer4
594 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(rad);//r distribution
595 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(phi);//phi distribution
596 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 4
ebdd0606 597 }
598 }
599 }
600 statRecpoints.Clear();
601
602}
603
e41192d7 604//_______________________________________________________________
605
7a0e5776 606void AliITSQASDDDataMakerRec::SetHLTModeFromEnvironment()
607{
e41192d7 608
609 Int_t hltmode= ::atoi(gSystem->Getenv("HLT_MODE"));
610
7a0e5776 611 if(hltmode==1)
612 {
613 AliInfo("Online mode: HLT mode A selected from environment for SDD\n");
614 SetHLTMode(kFALSE);
615 }
616 else
617 if(hltmode==2)
618 {
619 AliInfo("Online mode: HLT mode C compressed selected from environment for SDD\n");
620 SetHLTMode(kTRUE);
621 }
ad300de9 622}
623
624
625//_______________________________________________________________
626
4e25ac79 627Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
7a0e5776 628{
ad300de9 629 Int_t offset=0;
4e25ac79 630 if( task == AliQAv1::kRAWS )
7a0e5776 631 {
632 offset=fGenRawsOffset;
633 }
634 else
4e25ac79 635 if( task == AliQAv1::kRECPOINTS )
7a0e5776 636 {
637 offset=fGenRecPointsOffset;
638 }
639 else AliInfo("No task has been selected. Offset set to zero.\n");
ad300de9 640 return offset;
641}
642
643//_______________________________________________________________
644
4e25ac79 645Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
7a0e5776 646{
ad300de9 647
7a0e5776 648 Int_t histotot=0;
ad300de9 649
4e25ac79 650 if( task == AliQAv1::kRAWS )
7a0e5776 651 {
652 histotot=fSDDhRawsTask ;
653 }
654 else
4e25ac79 655 if( task == AliQAv1::kRECPOINTS )
7a0e5776 656 {
657 histotot=fSDDhRecPointsTask;
658 }
659 else AliInfo("No task has been selected. TaskHisto set to zero.\n");
ad300de9 660 return histotot;
e41192d7 661}