Restored optimization
[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{
8c823e5a 164 // Initialization for RAW data
165 if(fSubDetector == 0 || fSubDetector == 1) {
5379c4a3 166 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n");
8c823e5a 167 fSPDDataMaker->InitRaws();
1aa7c4f5 168 }
8c823e5a 169 if(fSubDetector == 0 || fSubDetector == 2) {
5379c4a3 170 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRaws\n");
8c823e5a 171 fSDDDataMaker->InitRaws();
04236e67 172 }
8c823e5a 173 if(fSubDetector == 0 || fSubDetector == 3) {
5379c4a3 174 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRaws\n");
8c823e5a 175 fSSDDataMaker->InitRaws();
04236e67 176 }
1aa7c4f5 177}
178
04236e67 179//____________________________________________________________________________
180void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
181{
8c823e5a 182 // Fill QA for RAW
eca4fa66 183 return ;
184
185 if(fSubDetector == 0 || fSubDetector == 1) {
186 Int_t rv = fSPDDataMaker->MakeRaws(rawReader) ;
187 if ( rv != 0 )
188 fSDDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
189 }
190
191 if(fSubDetector == 0 || fSubDetector == 2) {
192 Int_t rv = fSPDDataMaker->MakeRaws(rawReader) ;
193 if ( rv != 0 )
194 fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
195 }
196
8c823e5a 197 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader);
1aa7c4f5 198}
04236e67 199
200//____________________________________________________________________________
44ed7a66 201void AliITSQADataMakerRec::InitDigits()
202{
203 // Initialization for DIGITS
204 if(fSubDetector == 0 || fSubDetector == 1) {
205 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigitss\n");
206 fSPDDataMaker->InitDigits();
207 }
208 if(fSubDetector == 0 || fSubDetector == 2) {
209 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitDigits\n");
210 fSDDDataMaker->InitDigits();
211 }
212 if(fSubDetector == 0 || fSubDetector == 3) {
213 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitDigits\n");
214 fSSDDataMaker->InitDigits();
215 }
216}
217
218//____________________________________________________________________________
219void AliITSQADataMakerRec::MakeDigits(TTree * digitsTree)
220{
221 // Fill QA for recpoints
eca4fa66 222 return ;
223 if(fSubDetector == 0 || fSubDetector == 1) {
224 Int_t rv = fSPDDataMaker->MakeDigits(digitsTree) ;
225 if ( rv != 0 )
226 fSDDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
227 }
228
229 if(fSubDetector == 0 || fSubDetector == 2) {
230 Int_t rv = fSPDDataMaker->MakeDigits(digitsTree) ;
231 if ( rv != 0 )
232 fSSDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
233 }
234
44ed7a66 235 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digitsTree);
236}
237
238//____________________________________________________________________________
04236e67 239void AliITSQADataMakerRec::InitRecPoints()
240{
1aa7c4f5 241 // Initialization for RECPOINTS
8c823e5a 242 if(fSubDetector == 0 || fSubDetector == 1) {
5379c4a3 243 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRecPoints\n");
8c823e5a 244 fSPDDataMaker->InitRecPoints();
04236e67 245 }
8c823e5a 246 if(fSubDetector == 0 || fSubDetector == 2) {
5379c4a3 247 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRecPoints\n");
8c823e5a 248 fSDDDataMaker->InitRecPoints();
1aa7c4f5 249 }
8c823e5a 250 if(fSubDetector == 0 || fSubDetector == 3) {
5379c4a3 251 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRecPoints\n");
8c823e5a 252 fSSDDataMaker->InitRecPoints();
1aa7c4f5 253 }
1aa7c4f5 254}
04236e67 255
256//____________________________________________________________________________
257void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
258{
eca4fa66 259 return ;
1aa7c4f5 260 // Fill QA for recpoints
eca4fa66 261 if(fSubDetector == 0 || fSubDetector == 1) {
262 Int_t rv = fSPDDataMaker->MakeRecPoints(clustersTree) ;
263 if ( rv != 0 )
264 fSDDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
265 }
266
267 if(fSubDetector == 0 || fSubDetector == 2) {
268 Int_t rv = fSPDDataMaker->MakeRecPoints(clustersTree) ;
269 if ( rv != 0 )
270 fSSDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
271 }
272
8c823e5a 273 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree);
04236e67 274}
275
d7d87ceb 276
a90a332e 277//____________________________________________________________________________
278void AliITSQADataMakerRec::InitESDs()
279{
280 // Create ESDs histograms in ESDs subdir
281
585a6e79 282 Bool_t expertHistogram = kTRUE;
283
a90a332e 284 TH1F *hESDClustersMI =
285 new TH1F("hESDClustersMI", "N ITS clusters per track (MI); N clusters; Counts",
286 7, -0.5, 6.5);
287 hESDClustersMI->Sumw2();
288 hESDClustersMI->SetMinimum(0);
289 Add2ESDsList(hESDClustersMI, 0);
290
291 TH1F *hESDClusterMapMI =
d7d87ceb 292 new TH1F("hESDClusterMapMI", "N tracks with point Layer (MI); Layer; N tracks",
a90a332e 293 6, -0.5, 5.5);
294 hESDClusterMapMI->Sumw2();
295 hESDClusterMapMI->SetMinimum(0);
585a6e79 296 Add2ESDsList(hESDClusterMapMI, 1, expertHistogram);
a90a332e 297
298 TH1F *hESDClustersSA =
299 new TH1F("hESDClustersSA", "N ITS clusters per track (SA); N clusters; Counts",
300 7, -0.5, 6.5);
301 hESDClustersSA->Sumw2();
302 hESDClustersSA->SetMinimum(0);
303 Add2ESDsList(hESDClustersSA, 2);
304
305 TH1F *hESDClusterMapSA =
d7d87ceb 306 new TH1F("hESDClusterMapSA", "N tracks with point Layer (SA); Layer; N tracks",
a90a332e 307 6, -0.5, 5.5);
308 hESDClusterMapSA->Sumw2();
309 hESDClusterMapSA->SetMinimum(0);
585a6e79 310 Add2ESDsList(hESDClusterMapSA, 3, expertHistogram);
a90a332e 311
312 TH1F *hSPDVertexX =
313 new TH1F("hSPDVertexX","SPD Vertex x; x [cm]; N events",
314 10000,-2,2);
315 hSPDVertexX->Sumw2();
316 Add2ESDsList(hSPDVertexX, 4);
317
318 TH1F *hSPDVertexY =
319 new TH1F("hSPDVertexY","SPD Vertex y; y [cm]; N events",
320 10000,-2,2);
321 hSPDVertexY->Sumw2();
322 Add2ESDsList(hSPDVertexY, 5);
323
324 TH1F *hSPDVertexZ =
d7d87ceb 325 new TH1F("hSPDVertexZ","SPD Vertex Z; z [cm]; N events",
a90a332e 326 10000,-20,20);
327 hSPDVertexZ->Sumw2();
328 Add2ESDsList(hSPDVertexZ, 6);
329
330 TH1F *hSPDVertexContrOverMult =
331 new TH1F("hSPDVertexContrOverMult","SPD Vertex: contributors / multiplicity; N contributors / SPD multiplicity; N events",
332 100,-4,20);
333 hSPDVertexContrOverMult->Sumw2();
585a6e79 334 Add2ESDsList(hSPDVertexContrOverMult, 7, expertHistogram);
a90a332e 335
336 TH1F *hTrkVertexX =
337 new TH1F("hTrkVertexX","ITS+TPC Trk Vertex x; x [cm]; N events",
338 10000,-2,2);
339 hTrkVertexX->Sumw2();
585a6e79 340 Add2ESDsList(hTrkVertexX, 8, expertHistogram);
a90a332e 341
342 TH1F *hTrkVertexY =
343 new TH1F("hTrkVertexY","ITS+TPC Trk Vertex y; y [cm]; N events",
344 10000,-2,2);
345 hTrkVertexY->Sumw2();
585a6e79 346 Add2ESDsList(hTrkVertexY, 9, expertHistogram);
a90a332e 347
348 TH1F *hTrkVertexZ =
d7d87ceb 349 new TH1F("hTrkVertexZ","ITS+TPC Trk Vertex Z; z [cm]; N events",
a90a332e 350 10000,-20,20);
351 hTrkVertexZ->Sumw2();
585a6e79 352 Add2ESDsList(hTrkVertexZ, 10, expertHistogram);
a90a332e 353
d7d87ceb 354 TH1F *hTrkVertexContrOverITSrefit5 =
355 new TH1F("hTrkVertexContrOverITSrefit5","ITS+TPC Trk Vertex: contributors / tracks; N contributors / N trks kITSrefit with 5 or 6 clusters; N events",
356 100,-4,2);
357 hTrkVertexContrOverITSrefit5->Sumw2();
585a6e79 358 Add2ESDsList(hTrkVertexContrOverITSrefit5, 11, expertHistogram);
a90a332e 359
360 TH1F *hSPDTrkVertexDeltaX =
361 new TH1F("hSPDTrkVertexDeltaX","Comparison of SPD and Trk vertices: x; xSPD-xTrk [cm]; N events",
362 1000,-1,1);
363 hSPDTrkVertexDeltaX->Sumw2();
585a6e79 364 Add2ESDsList(hSPDTrkVertexDeltaX, 12, expertHistogram);
a90a332e 365
366 TH1F *hSPDTrkVertexDeltaY =
367 new TH1F("hSPDTrkVertexDeltaY","Comparison of SPD and Trk vertices: y; ySPD-yTrk [cm]; N events",
368 1000,-1,1);
369 hSPDTrkVertexDeltaY->Sumw2();
585a6e79 370 Add2ESDsList(hSPDTrkVertexDeltaY, 13, expertHistogram);
a90a332e 371
372 TH1F *hSPDTrkVertexDeltaZ =
373 new TH1F("hSPDTrkVertexDeltaZ","Comparison of SPD and Trk vertices: z; zSPD-zTrk [cm]; N events",
374 1000,-1,1);
375 hSPDTrkVertexDeltaZ->Sumw2();
376 Add2ESDsList(hSPDTrkVertexDeltaZ, 14);
377
a8100152 378 // SPD Tracklets
379
380 TH1F* hSPDTracklets =
381 new TH1F("hSPDTracklets","N SPD Tracklets; N tracklets; Counts",300,0.,300.);
382 hSPDTracklets->Sumw2();
383 Add2ESDsList(hSPDTracklets, 15);
e23412ab 384
385 TH2F* hSPDTrackletsvsFiredChips0 =
386 new TH2F("hSPDTrackletsvsFiredChips0","N SPD Tracklets vs N FiredChips Layer0",
387 300,0.,300.,300,0.,300.);
388 hSPDTrackletsvsFiredChips0->GetXaxis()->SetTitle("N SPD Tracklets");
389 hSPDTrackletsvsFiredChips0->GetYaxis()->SetTitle("N FiredChips Layer0");
390 hSPDTrackletsvsFiredChips0->Sumw2();
391 Add2ESDsList(hSPDTrackletsvsFiredChips0, 16, expertHistogram );
392
393 TH2F* hSPDTrackletsvsFiredChips1 =
394 new TH2F("hSPDTrackletsvsFiredChips1","N SPD Tracklets vs N FiredChips Layer1",
395 300,0.,300.,300,0.,300.);
396 hSPDTrackletsvsFiredChips1->GetXaxis()->SetTitle("N SPD Tracklets");
397 hSPDTrackletsvsFiredChips1->GetYaxis()->SetTitle("N FiredChips Layer1");
398 hSPDTrackletsvsFiredChips1->Sumw2();
399 Add2ESDsList(hSPDTrackletsvsFiredChips1, 17, expertHistogram);
a8100152 400
401 TH1F* hSPDTrackletsDePhi =
402 new TH1F("hSPDTrackletsDePhi","DeltaPhi SPD Tracklets; DeltaPhi [rad]; N events",200,-0.2,0.2);
403 hSPDTrackletsDePhi->Sumw2();
e23412ab 404 Add2ESDsList(hSPDTrackletsDePhi, 18);
a8100152 405
406 TH1F* hSPDTrackletsPhi =
407 new TH1F("hSPDTrackletsPhi","Phi SPD Tracklets; Phi [rad]; N events",1000,0.,2*TMath::Pi());
408 hSPDTrackletsPhi->Sumw2();
e23412ab 409 Add2ESDsList(hSPDTrackletsPhi, 19);
a8100152 410
411 TH1F* hSPDTrackletsTheta =
412 new TH1F("hSPDTrackletsTheta","Theta SPD Tracklets; Theta [rad]; N events",500,0.,TMath::Pi());
413 hSPDTrackletsTheta->Sumw2();
e23412ab 414 Add2ESDsList(hSPDTrackletsTheta, 20);
a8100152 415
882ac7f1 416 // map of layers skipped by tracking (set in AliITSRecoParam)
417 TH1F *hESDSkippedLayers =
418 new TH1F("hESDSkippedLayers", "Map of layers skipped by tracking; Layer; Skipped",
419 6, -0.5, 5.5);
420 hESDSkippedLayers->Sumw2();
421 hESDSkippedLayers->SetMinimum(0);
e23412ab 422 Add2ESDsList(hESDSkippedLayers, 21, expertHistogram);
882ac7f1 423
424
a90a332e 425 return;
426}
427
428//____________________________________________________________________________
429void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd)
430{
431 // Make QA data from ESDs
eca4fa66 432
433 // Check id histograms already created for this Event Specie
434 if ( ! GetESDsData(0) )
435 InitESDs() ;
a90a332e 436
437 const Int_t nESDTracks = esd->GetNumberOfTracks();
d7d87ceb 438 Int_t nITSrefit5 = 0;
a90a332e 439
882ac7f1 440 Int_t idet,status;
441 Float_t xloc,zloc;
442
a90a332e 443 // loop on tracks
444 for(Int_t i = 0; i < nESDTracks; i++) {
445
446 AliESDtrack *track = esd->GetTrack(i);
447
448 Int_t nclsITS = track->GetNcls(0);
449
83ab496a 450 Bool_t itsrefit=kFALSE,tpcin=kFALSE,itsin=kFALSE;
a90a332e 451 if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE;
452 if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE;
83ab496a 453 if ((track->GetStatus() & AliESDtrack::kITSin)) itsin=kTRUE;
d7d87ceb 454 if(nclsITS>=5 && itsrefit) nITSrefit5++;
a90a332e 455
456 if(tpcin) {
457 GetESDsData(0)->Fill(nclsITS);
83ab496a 458 }
459 if(itsin && !tpcin){
a90a332e 460 GetESDsData(2)->Fill(nclsITS);
461 }
462
463 for(Int_t layer=0; layer<6; layer++) {
464
465 if(TESTBIT(track->GetITSClusterMap(),layer)) {
466 if(tpcin) {
467 GetESDsData(1)->Fill(layer);
468 } else {
469 GetESDsData(3)->Fill(layer);
470 }
471 }
882ac7f1 472 track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc);
e23412ab 473 if(status==3) GetESDsData(21)->SetBinContent(layer,1);
a90a332e 474 }
475
476 } // end loop on tracks
477
478 // vertices
479 const AliESDVertex *vtxSPD = esd->GetPrimaryVertexSPD();
3884ccc9 480 const AliESDVertex *vtxTrk = esd->GetPrimaryVertexTracks();
a90a332e 481
a90a332e 482 Int_t mult = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfTracklets();
483 if(mult>0)
484 GetESDsData(7)->Fill((Float_t)(vtxSPD->GetNContributors())/(Float_t)mult);
485
d7d87ceb 486 if(nITSrefit5>0)
487 GetESDsData(11)->Fill((Float_t)(vtxTrk->GetNIndices())/(Float_t)nITSrefit5);
a90a332e 488
d7d87ceb 489 if(vtxSPD->GetNContributors()>0) {
490 GetESDsData(4)->Fill(vtxSPD->GetXv());
491 GetESDsData(5)->Fill(vtxSPD->GetYv());
492 GetESDsData(6)->Fill(vtxSPD->GetZv());
493 }
a90a332e 494
d7d87ceb 495 if(vtxTrk->GetNContributors()>0) {
496 GetESDsData(8)->Fill(vtxTrk->GetXv());
497 GetESDsData(9)->Fill(vtxTrk->GetYv());
498 GetESDsData(10)->Fill(vtxTrk->GetZv());
499 }
500
501 if(vtxSPD->GetNContributors()>0 &&
502 vtxTrk->GetNContributors()>0) {
503 GetESDsData(12)->Fill(vtxSPD->GetXv()-vtxTrk->GetXv());
504 GetESDsData(13)->Fill(vtxSPD->GetYv()-vtxTrk->GetYv());
505 GetESDsData(14)->Fill(vtxSPD->GetZv()-vtxTrk->GetZv());
506 }
a90a332e 507
a8100152 508 // SPD Tracklets
e23412ab 509 GetESDsData(15)->Fill(mult);
510
511 Short_t nFiredChips0 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(0);
512 Short_t nFiredChips1 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(1);
513 GetESDsData(16)->Fill(nFiredChips0,mult);
514 GetESDsData(17)->Fill(nFiredChips1,mult);
a8100152 515
516 // Loop over tracklets
a8100152 517 for (Int_t itr=0; itr<mult; ++itr) {
518 Float_t dePhiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetDeltaPhi(itr);
519 Float_t phiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetPhi(itr);
520 Float_t thetaTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetTheta(itr);
e23412ab 521 GetESDsData(18)->Fill(dePhiTr);
522 GetESDsData(19)->Fill(phiTr);
523 GetESDsData(20)->Fill(thetaTr);
a8100152 524 } // end loop on tracklets
525
a90a332e 526 return;
527}
614c7e17 528
529//_________________________________________________________________
4e25ac79 530Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task)
614c7e17 531{
532 switch(subdet)
533 {
534
535 Int_t offset;
536 case 1:
537 offset=fSPDDataMaker->GetOffset(task);
538 return offset;
539 break;
540 case 2:
541 offset=fSDDDataMaker->GetOffset(task);
542 return offset;
543 break;
544 case 3:
545 offset=fSSDDataMaker->GetOffset(task);
546 return offset;
547 break;
548 default:
549 AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
550 offset=0;
551 return offset;
552 break;
553 }
554 //return offset;
555}