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