Implementing base class methods for easy component configuration:
[u/mrichter/AliRoot.git] / ITS / AliITSQADataMakerRec.cxx
CommitLineData
04236e67 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// -------------------------------------------------------------
8c823e5a 23// W. Ferrarese + P. Cerello Feb 2008
04236e67 24// INFN Torino
25
26// --- ROOT system ---
e23412ab 27#include <TH2.h>
04236e67 28#include <TTree.h>
04236e67 29// --- Standard library ---
30
31// --- AliRoot header files ---
32#include "AliITSQADataMakerRec.h"
8c823e5a 33#include "AliITSQASPDDataMakerRec.h"
34#include "AliITSQASDDDataMakerRec.h"
35#include "AliITSQASSDDataMakerRec.h"
04236e67 36#include "AliLog.h"
4e25ac79 37#include "AliQAv1.h"
04236e67 38#include "AliQAChecker.h"
c71529b0 39#include "AliITSQAChecker.h"
04236e67 40#include "AliRawReader.h"
a90a332e 41#include "AliESDEvent.h"
42#include "AliESDtrack.h"
43#include "AliESDVertex.h"
44#include "AliMultiplicity.h"
04236e67 45
46ClassImp(AliITSQADataMakerRec)
47
48//____________________________________________________________________________
8c823e5a 49AliITSQADataMakerRec::AliITSQADataMakerRec(Bool_t kMode, Short_t subDet, Short_t ldc) :
4e25ac79 50AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Data Maker"),
1aa7c4f5 51fkOnline(kMode),
e41192d7 52fHLTMode(0),
8c823e5a 53fSubDetector(subDet),
1aa7c4f5 54fLDC(ldc),
8c823e5a 55fSPDDataMaker(NULL),
56fSDDDataMaker(NULL),
57fSSDDataMaker(NULL)
1aa7c4f5 58{
1aa7c4f5 59 //ctor used to discriminate OnLine-Offline analysis
8c823e5a 60 if(fSubDetector < 0 || fSubDetector > 3) {
61 AliError("Error: fSubDetector number out of range; return\n");
62 }
63
64 // Initialization for RAW data
65 if(fSubDetector == 0 || fSubDetector == 1) {
5379c4a3 66 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SPD DataMakerRec\n");
8c823e5a 67 fSPDDataMaker = new AliITSQASPDDataMakerRec(this,fkOnline);
68 }
69 if(fSubDetector == 0 || fSubDetector == 2) {
5379c4a3 70 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SDD DataMakerRec\n");
8c823e5a 71 fSDDDataMaker = new AliITSQASDDDataMakerRec(this,fkOnline);
e41192d7 72 if(fkOnline){SetHLTMode(fSDDDataMaker->GetHLTMode()); }
8c823e5a 73 }
74 if(fSubDetector == 0 || fSubDetector == 3) {
5379c4a3 75 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SSD DataMakerRec\n");
8c823e5a 76 fSSDDataMaker = new AliITSQASSDDataMakerRec(this,fkOnline);
77 }
1aa7c4f5 78}
79
80//____________________________________________________________________________
8c823e5a 81AliITSQADataMakerRec::~AliITSQADataMakerRec(){
82 // destructor
83 if(fSPDDataMaker)delete fSPDDataMaker;
84 if(fSDDDataMaker)delete fSDDDataMaker;
85 if(fSSDDataMaker)delete fSSDDataMaker;
04236e67 86}
87
88//____________________________________________________________________________
89AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) :
8c823e5a 90AliQADataMakerRec(),
9db10425 91fkOnline(qadm.fkOnline),
e41192d7 92fHLTMode(qadm.fHLTMode),
8c823e5a 93fSubDetector(qadm.fSubDetector),
9db10425 94fLDC(qadm.fLDC),
8c823e5a 95fSPDDataMaker(NULL),
96fSDDDataMaker(NULL),
97fSSDDataMaker(NULL)
04236e67 98{
99 //copy ctor
100 SetName((const char*)qadm.GetName()) ;
8c823e5a 101 SetTitle((const char*)qadm.GetTitle());
04236e67 102}
103
104//__________________________________________________________________
105AliITSQADataMakerRec& AliITSQADataMakerRec::operator = (const AliITSQADataMakerRec& qac )
106{
107 // Equal operator.
108 this->~AliITSQADataMakerRec();
109 new(this) AliITSQADataMakerRec(qac);
110 return *this;
111}
112
113//____________________________________________________________________________
8c823e5a 114void AliITSQADataMakerRec::StartOfDetectorCycle()
04236e67 115{
116 //Detector specific actions at start of cycle
5379c4a3 117 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of ITS Cycle\n");
8c823e5a 118 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle();
119 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle();
120 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle();
04236e67 121}
122
123//____________________________________________________________________________
4e25ac79 124void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
04236e67 125{
126 // launch the QA checking
57acd2d2 127
128 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
129 SetEventSpecie(specie) ;
5379c4a3 130 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n");
57acd2d2 131 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[specie]);
132 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[specie]);
133 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[specie]);
04236e67 134
8bb2fdfd 135
136 AliQAChecker *qac = AliQAChecker::Instance();
137 AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
138 Int_t subdet=GetSubDet();
139 qacb->SetSubDet(subdet);
614c7e17 140
8bb2fdfd 141 if(subdet== 0 ){
142 qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task), fSDDDataMaker->GetOffset(task), fSSDDataMaker->GetOffset(task)); //Setting the offset for the QAChecker list
614c7e17 143 }
8bb2fdfd 144 else
145 if(subdet!=0){
146 Int_t offset=GetDetTaskOffset(subdet, task);
147 qacb->SetDetTaskOffset(subdet,offset);
148 }
614c7e17 149
4e25ac79 150 qac->Run( AliQAv1::kITS , task, list);
8bb2fdfd 151
152 }
04236e67 153}
154
155//____________________________________________________________________________
8c823e5a 156void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
04236e67 157{
8c823e5a 158 //eventually used for different AliQAChecker::Instance()->Run
04236e67 159}
160
161//____________________________________________________________________________
162void AliITSQADataMakerRec::InitRaws()
163{
7555afef 164
8c823e5a 165 // Initialization for RAW data
166 if(fSubDetector == 0 || fSubDetector == 1) {
5379c4a3 167 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n");
8c823e5a 168 fSPDDataMaker->InitRaws();
1aa7c4f5 169 }
8c823e5a 170 if(fSubDetector == 0 || fSubDetector == 2) {
5379c4a3 171 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRaws\n");
8c823e5a 172 fSDDDataMaker->InitRaws();
04236e67 173 }
8c823e5a 174 if(fSubDetector == 0 || fSubDetector == 3) {
5379c4a3 175 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRaws\n");
8c823e5a 176 fSSDDataMaker->InitRaws();
04236e67 177 }
1aa7c4f5 178}
179
04236e67 180//____________________________________________________________________________
181void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
182{
8c823e5a 183 // Fill QA for RAW
7555afef 184 //return ;
eca4fa66 185
186 if(fSubDetector == 0 || fSubDetector == 1) {
187 Int_t rv = fSPDDataMaker->MakeRaws(rawReader) ;
188 if ( rv != 0 )
7555afef 189 fSDDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
eca4fa66 190 }
191
192 if(fSubDetector == 0 || fSubDetector == 2) {
7555afef 193 Int_t rv = fSDDDataMaker->MakeRaws(rawReader) ;
eca4fa66 194 if ( rv != 0 )
7555afef 195 fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
eca4fa66 196 }
197
8c823e5a 198 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader);
1aa7c4f5 199}
04236e67 200
201//____________________________________________________________________________
44ed7a66 202void AliITSQADataMakerRec::InitDigits()
203{
7555afef 204
44ed7a66 205 // Initialization for DIGITS
206 if(fSubDetector == 0 || fSubDetector == 1) {
207 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigitss\n");
208 fSPDDataMaker->InitDigits();
209 }
210 if(fSubDetector == 0 || fSubDetector == 2) {
211 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitDigits\n");
212 fSDDDataMaker->InitDigits();
213 }
214 if(fSubDetector == 0 || fSubDetector == 3) {
215 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitDigits\n");
216 fSSDDataMaker->InitDigits();
217 }
218}
219
220//____________________________________________________________________________
221void AliITSQADataMakerRec::MakeDigits(TTree * digitsTree)
222{
7555afef 223
44ed7a66 224 // Fill QA for recpoints
eca4fa66 225 if(fSubDetector == 0 || fSubDetector == 1) {
226 Int_t rv = fSPDDataMaker->MakeDigits(digitsTree) ;
227 if ( rv != 0 )
228 fSDDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
229 }
230
231 if(fSubDetector == 0 || fSubDetector == 2) {
7555afef 232 Int_t rv = fSDDDataMaker->MakeDigits(digitsTree) ;
eca4fa66 233 if ( rv != 0 )
234 fSSDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
235 }
236
44ed7a66 237 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digitsTree);
238}
239
240//____________________________________________________________________________
04236e67 241void AliITSQADataMakerRec::InitRecPoints()
242{
7555afef 243
1aa7c4f5 244 // Initialization for RECPOINTS
8c823e5a 245 if(fSubDetector == 0 || fSubDetector == 1) {
5379c4a3 246 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRecPoints\n");
8c823e5a 247 fSPDDataMaker->InitRecPoints();
04236e67 248 }
8c823e5a 249 if(fSubDetector == 0 || fSubDetector == 2) {
5379c4a3 250 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRecPoints\n");
8c823e5a 251 fSDDDataMaker->InitRecPoints();
1aa7c4f5 252 }
8c823e5a 253 if(fSubDetector == 0 || fSubDetector == 3) {
5379c4a3 254 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRecPoints\n");
8c823e5a 255 fSSDDataMaker->InitRecPoints();
1aa7c4f5 256 }
1aa7c4f5 257}
04236e67 258
259//____________________________________________________________________________
260void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
261{
7555afef 262
1aa7c4f5 263 // Fill QA for recpoints
eca4fa66 264 if(fSubDetector == 0 || fSubDetector == 1) {
265 Int_t rv = fSPDDataMaker->MakeRecPoints(clustersTree) ;
266 if ( rv != 0 )
7555afef 267 fSDDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
eca4fa66 268 }
269
270 if(fSubDetector == 0 || fSubDetector == 2) {
7555afef 271 Int_t rv = fSDDDataMaker->MakeRecPoints(clustersTree) ;
eca4fa66 272 if ( rv != 0 )
7555afef 273 fSSDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
eca4fa66 274 }
275
8c823e5a 276 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree);
04236e67 277}
278
d7d87ceb 279
a90a332e 280//____________________________________________________________________________
281void AliITSQADataMakerRec::InitESDs()
282{
7555afef 283
a90a332e 284 // Create ESDs histograms in ESDs subdir
285
585a6e79 286 Bool_t expertHistogram = kTRUE;
287
a90a332e 288 TH1F *hESDClustersMI =
289 new TH1F("hESDClustersMI", "N ITS clusters per track (MI); N clusters; Counts",
290 7, -0.5, 6.5);
291 hESDClustersMI->Sumw2();
292 hESDClustersMI->SetMinimum(0);
293 Add2ESDsList(hESDClustersMI, 0);
294
295 TH1F *hESDClusterMapMI =
d7d87ceb 296 new TH1F("hESDClusterMapMI", "N tracks with point Layer (MI); Layer; N tracks",
a90a332e 297 6, -0.5, 5.5);
298 hESDClusterMapMI->Sumw2();
299 hESDClusterMapMI->SetMinimum(0);
585a6e79 300 Add2ESDsList(hESDClusterMapMI, 1, expertHistogram);
a90a332e 301
302 TH1F *hESDClustersSA =
303 new TH1F("hESDClustersSA", "N ITS clusters per track (SA); N clusters; Counts",
304 7, -0.5, 6.5);
305 hESDClustersSA->Sumw2();
306 hESDClustersSA->SetMinimum(0);
307 Add2ESDsList(hESDClustersSA, 2);
308
309 TH1F *hESDClusterMapSA =
d7d87ceb 310 new TH1F("hESDClusterMapSA", "N tracks with point Layer (SA); Layer; N tracks",
a90a332e 311 6, -0.5, 5.5);
312 hESDClusterMapSA->Sumw2();
313 hESDClusterMapSA->SetMinimum(0);
585a6e79 314 Add2ESDsList(hESDClusterMapSA, 3, expertHistogram);
a90a332e 315
316 TH1F *hSPDVertexX =
317 new TH1F("hSPDVertexX","SPD Vertex x; x [cm]; N events",
318 10000,-2,2);
319 hSPDVertexX->Sumw2();
320 Add2ESDsList(hSPDVertexX, 4);
321
322 TH1F *hSPDVertexY =
323 new TH1F("hSPDVertexY","SPD Vertex y; y [cm]; N events",
324 10000,-2,2);
325 hSPDVertexY->Sumw2();
326 Add2ESDsList(hSPDVertexY, 5);
327
328 TH1F *hSPDVertexZ =
d7d87ceb 329 new TH1F("hSPDVertexZ","SPD Vertex Z; z [cm]; N events",
a90a332e 330 10000,-20,20);
331 hSPDVertexZ->Sumw2();
332 Add2ESDsList(hSPDVertexZ, 6);
333
334 TH1F *hSPDVertexContrOverMult =
335 new TH1F("hSPDVertexContrOverMult","SPD Vertex: contributors / multiplicity; N contributors / SPD multiplicity; N events",
336 100,-4,20);
337 hSPDVertexContrOverMult->Sumw2();
585a6e79 338 Add2ESDsList(hSPDVertexContrOverMult, 7, expertHistogram);
a90a332e 339
340 TH1F *hTrkVertexX =
341 new TH1F("hTrkVertexX","ITS+TPC Trk Vertex x; x [cm]; N events",
342 10000,-2,2);
343 hTrkVertexX->Sumw2();
585a6e79 344 Add2ESDsList(hTrkVertexX, 8, expertHistogram);
a90a332e 345
346 TH1F *hTrkVertexY =
347 new TH1F("hTrkVertexY","ITS+TPC Trk Vertex y; y [cm]; N events",
348 10000,-2,2);
349 hTrkVertexY->Sumw2();
585a6e79 350 Add2ESDsList(hTrkVertexY, 9, expertHistogram);
a90a332e 351
352 TH1F *hTrkVertexZ =
d7d87ceb 353 new TH1F("hTrkVertexZ","ITS+TPC Trk Vertex Z; z [cm]; N events",
a90a332e 354 10000,-20,20);
355 hTrkVertexZ->Sumw2();
585a6e79 356 Add2ESDsList(hTrkVertexZ, 10, expertHistogram);
a90a332e 357
d7d87ceb 358 TH1F *hTrkVertexContrOverITSrefit5 =
359 new TH1F("hTrkVertexContrOverITSrefit5","ITS+TPC Trk Vertex: contributors / tracks; N contributors / N trks kITSrefit with 5 or 6 clusters; N events",
360 100,-4,2);
361 hTrkVertexContrOverITSrefit5->Sumw2();
585a6e79 362 Add2ESDsList(hTrkVertexContrOverITSrefit5, 11, expertHistogram);
a90a332e 363
364 TH1F *hSPDTrkVertexDeltaX =
365 new TH1F("hSPDTrkVertexDeltaX","Comparison of SPD and Trk vertices: x; xSPD-xTrk [cm]; N events",
366 1000,-1,1);
367 hSPDTrkVertexDeltaX->Sumw2();
585a6e79 368 Add2ESDsList(hSPDTrkVertexDeltaX, 12, expertHistogram);
a90a332e 369
370 TH1F *hSPDTrkVertexDeltaY =
371 new TH1F("hSPDTrkVertexDeltaY","Comparison of SPD and Trk vertices: y; ySPD-yTrk [cm]; N events",
372 1000,-1,1);
373 hSPDTrkVertexDeltaY->Sumw2();
585a6e79 374 Add2ESDsList(hSPDTrkVertexDeltaY, 13, expertHistogram);
a90a332e 375
376 TH1F *hSPDTrkVertexDeltaZ =
377 new TH1F("hSPDTrkVertexDeltaZ","Comparison of SPD and Trk vertices: z; zSPD-zTrk [cm]; N events",
378 1000,-1,1);
379 hSPDTrkVertexDeltaZ->Sumw2();
380 Add2ESDsList(hSPDTrkVertexDeltaZ, 14);
381
a8100152 382 // SPD Tracklets
383
384 TH1F* hSPDTracklets =
385 new TH1F("hSPDTracklets","N SPD Tracklets; N tracklets; Counts",300,0.,300.);
386 hSPDTracklets->Sumw2();
387 Add2ESDsList(hSPDTracklets, 15);
e23412ab 388
389 TH2F* hSPDTrackletsvsFiredChips0 =
390 new TH2F("hSPDTrackletsvsFiredChips0","N SPD Tracklets vs N FiredChips Layer0",
391 300,0.,300.,300,0.,300.);
392 hSPDTrackletsvsFiredChips0->GetXaxis()->SetTitle("N SPD Tracklets");
393 hSPDTrackletsvsFiredChips0->GetYaxis()->SetTitle("N FiredChips Layer0");
394 hSPDTrackletsvsFiredChips0->Sumw2();
395 Add2ESDsList(hSPDTrackletsvsFiredChips0, 16, expertHistogram );
396
397 TH2F* hSPDTrackletsvsFiredChips1 =
398 new TH2F("hSPDTrackletsvsFiredChips1","N SPD Tracklets vs N FiredChips Layer1",
399 300,0.,300.,300,0.,300.);
400 hSPDTrackletsvsFiredChips1->GetXaxis()->SetTitle("N SPD Tracklets");
401 hSPDTrackletsvsFiredChips1->GetYaxis()->SetTitle("N FiredChips Layer1");
402 hSPDTrackletsvsFiredChips1->Sumw2();
403 Add2ESDsList(hSPDTrackletsvsFiredChips1, 17, expertHistogram);
a8100152 404
405 TH1F* hSPDTrackletsDePhi =
406 new TH1F("hSPDTrackletsDePhi","DeltaPhi SPD Tracklets; DeltaPhi [rad]; N events",200,-0.2,0.2);
407 hSPDTrackletsDePhi->Sumw2();
e23412ab 408 Add2ESDsList(hSPDTrackletsDePhi, 18);
a8100152 409
410 TH1F* hSPDTrackletsPhi =
411 new TH1F("hSPDTrackletsPhi","Phi SPD Tracklets; Phi [rad]; N events",1000,0.,2*TMath::Pi());
412 hSPDTrackletsPhi->Sumw2();
e23412ab 413 Add2ESDsList(hSPDTrackletsPhi, 19);
a8100152 414
415 TH1F* hSPDTrackletsTheta =
416 new TH1F("hSPDTrackletsTheta","Theta SPD Tracklets; Theta [rad]; N events",500,0.,TMath::Pi());
417 hSPDTrackletsTheta->Sumw2();
e23412ab 418 Add2ESDsList(hSPDTrackletsTheta, 20);
a8100152 419
882ac7f1 420 // map of layers skipped by tracking (set in AliITSRecoParam)
421 TH1F *hESDSkippedLayers =
422 new TH1F("hESDSkippedLayers", "Map of layers skipped by tracking; Layer; Skipped",
423 6, -0.5, 5.5);
424 hESDSkippedLayers->Sumw2();
425 hESDSkippedLayers->SetMinimum(0);
e23412ab 426 Add2ESDsList(hESDSkippedLayers, 21, expertHistogram);
882ac7f1 427
428
a90a332e 429 return;
430}
431
432//____________________________________________________________________________
433void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd)
434{
435 // Make QA data from ESDs
eca4fa66 436
437 // Check id histograms already created for this Event Specie
438 if ( ! GetESDsData(0) )
439 InitESDs() ;
a90a332e 440
441 const Int_t nESDTracks = esd->GetNumberOfTracks();
d7d87ceb 442 Int_t nITSrefit5 = 0;
a90a332e 443
882ac7f1 444 Int_t idet,status;
445 Float_t xloc,zloc;
446
a90a332e 447 // loop on tracks
448 for(Int_t i = 0; i < nESDTracks; i++) {
449
450 AliESDtrack *track = esd->GetTrack(i);
451
452 Int_t nclsITS = track->GetNcls(0);
453
83ab496a 454 Bool_t itsrefit=kFALSE,tpcin=kFALSE,itsin=kFALSE;
a90a332e 455 if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE;
456 if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE;
83ab496a 457 if ((track->GetStatus() & AliESDtrack::kITSin)) itsin=kTRUE;
d7d87ceb 458 if(nclsITS>=5 && itsrefit) nITSrefit5++;
a90a332e 459
460 if(tpcin) {
461 GetESDsData(0)->Fill(nclsITS);
83ab496a 462 }
463 if(itsin && !tpcin){
a90a332e 464 GetESDsData(2)->Fill(nclsITS);
465 }
466
467 for(Int_t layer=0; layer<6; layer++) {
468
469 if(TESTBIT(track->GetITSClusterMap(),layer)) {
470 if(tpcin) {
471 GetESDsData(1)->Fill(layer);
472 } else {
473 GetESDsData(3)->Fill(layer);
474 }
475 }
882ac7f1 476 track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc);
e23412ab 477 if(status==3) GetESDsData(21)->SetBinContent(layer,1);
a90a332e 478 }
479
480 } // end loop on tracks
481
482 // vertices
483 const AliESDVertex *vtxSPD = esd->GetPrimaryVertexSPD();
3884ccc9 484 const AliESDVertex *vtxTrk = esd->GetPrimaryVertexTracks();
a90a332e 485
a90a332e 486 Int_t mult = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfTracklets();
487 if(mult>0)
488 GetESDsData(7)->Fill((Float_t)(vtxSPD->GetNContributors())/(Float_t)mult);
489
d7d87ceb 490 if(nITSrefit5>0)
491 GetESDsData(11)->Fill((Float_t)(vtxTrk->GetNIndices())/(Float_t)nITSrefit5);
a90a332e 492
d7d87ceb 493 if(vtxSPD->GetNContributors()>0) {
494 GetESDsData(4)->Fill(vtxSPD->GetXv());
495 GetESDsData(5)->Fill(vtxSPD->GetYv());
496 GetESDsData(6)->Fill(vtxSPD->GetZv());
497 }
a90a332e 498
d7d87ceb 499 if(vtxTrk->GetNContributors()>0) {
500 GetESDsData(8)->Fill(vtxTrk->GetXv());
501 GetESDsData(9)->Fill(vtxTrk->GetYv());
502 GetESDsData(10)->Fill(vtxTrk->GetZv());
503 }
504
505 if(vtxSPD->GetNContributors()>0 &&
506 vtxTrk->GetNContributors()>0) {
507 GetESDsData(12)->Fill(vtxSPD->GetXv()-vtxTrk->GetXv());
508 GetESDsData(13)->Fill(vtxSPD->GetYv()-vtxTrk->GetYv());
509 GetESDsData(14)->Fill(vtxSPD->GetZv()-vtxTrk->GetZv());
510 }
a90a332e 511
a8100152 512 // SPD Tracklets
e23412ab 513 GetESDsData(15)->Fill(mult);
514
515 Short_t nFiredChips0 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(0);
516 Short_t nFiredChips1 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(1);
517 GetESDsData(16)->Fill(nFiredChips0,mult);
518 GetESDsData(17)->Fill(nFiredChips1,mult);
a8100152 519
520 // Loop over tracklets
a8100152 521 for (Int_t itr=0; itr<mult; ++itr) {
522 Float_t dePhiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetDeltaPhi(itr);
523 Float_t phiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetPhi(itr);
524 Float_t thetaTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetTheta(itr);
e23412ab 525 GetESDsData(18)->Fill(dePhiTr);
526 GetESDsData(19)->Fill(phiTr);
527 GetESDsData(20)->Fill(thetaTr);
a8100152 528 } // end loop on tracklets
529
a90a332e 530 return;
531}
614c7e17 532
533//_________________________________________________________________
4e25ac79 534Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task)
614c7e17 535{
536 switch(subdet)
537 {
538
539 Int_t offset;
540 case 1:
541 offset=fSPDDataMaker->GetOffset(task);
542 return offset;
543 break;
544 case 2:
545 offset=fSDDDataMaker->GetOffset(task);
546 return offset;
547 break;
548 case 3:
549 offset=fSSDDataMaker->GetOffset(task);
550 return offset;
551 break;
552 default:
553 AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
554 offset=0;
555 return offset;
556 break;
557 }
558 //return offset;
559}