1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // *************************************************************
19 // Checks the quality assurance
20 // by comparing with reference data
22 // -------------------------------------------------------------
23 // W. Ferrarese + P. Cerello Feb 2008
25 // Melinda Siciliano Aug 2008
28 // --- ROOT system ---
30 // --- Standard library ---
32 // --- AliRoot header files ---
33 #include "AliITSQADataMakerRec.h"
34 #include "AliITSQASPDDataMakerRec.h"
35 #include "AliITSQASDDDataMakerRec.h"
36 #include "AliITSQASSDDataMakerRec.h"
38 #include "AliQAChecker.h"
39 #include "AliITSQAChecker.h"
40 #include "AliITSRecPoint.h"
41 #include "AliITSRecPointContainer.h"
42 #include "AliRawReader.h"
43 #include "AliESDEvent.h"
44 #include "AliESDtrack.h"
45 #include "AliMultiplicity.h"
46 #include "AliITSgeomTGeo.h"
54 ClassImp(AliITSQADataMakerRec)
56 //____________________________________________________________________________
57 AliITSQADataMakerRec::AliITSQADataMakerRec(Bool_t kMode, Short_t subDet, Short_t ldc) :
58 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Data Maker"),
64 fSelectedTaskIndex(AliQAv1::kNULLTASKINDEX),
70 //ctor used to discriminate OnLine-Offline analysis
71 if(fSubDetector < 0 || fSubDetector > 3) {
72 AliError("Error: fSubDetector number out of range; return\n");
75 // Initialization for RAW data
76 if(fSubDetector == 0 || fSubDetector == 1) {
77 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SPD DataMakerRec\n");
78 fSPDDataMaker = new AliITSQASPDDataMakerRec(this,fkOnline);
80 if(fSubDetector == 0 || fSubDetector == 2) {
81 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SDD DataMakerRec\n");
82 fSDDDataMaker = new AliITSQASDDDataMakerRec(this,fkOnline);
84 if(fSubDetector == 0 || fSubDetector == 3) {
85 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SSD DataMakerRec\n");
86 fSSDDataMaker = new AliITSQASSDDataMakerRec(this,fkOnline);
90 //____________________________________________________________________________
91 AliITSQADataMakerRec::~AliITSQADataMakerRec(){
93 if(fSPDDataMaker)delete fSPDDataMaker;
94 if(fSDDDataMaker)delete fSDDDataMaker;
95 if(fSSDDataMaker)delete fSSDDataMaker;
98 //____________________________________________________________________________
99 AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) :
101 fkOnline(qadm.fkOnline),
102 fSubDetector(qadm.fSubDetector),
104 fRunNumber(qadm.fRunNumber),
105 fEventNumber(qadm.fEventNumber),
106 fSelectedTaskIndex(qadm.fSelectedTaskIndex),
113 SetName((const char*)qadm.GetName()) ;
114 SetTitle((const char*)qadm.GetTitle());
117 //__________________________________________________________________
118 AliITSQADataMakerRec& AliITSQADataMakerRec::operator = (const AliITSQADataMakerRec& qac )
121 this->~AliITSQADataMakerRec();
122 new(this) AliITSQADataMakerRec(qac);
126 //____________________________________________________________________________
127 void AliITSQADataMakerRec::StartOfDetectorCycle()
129 //Detector specific actions at start of cycle
130 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of ITS Cycle\n");
131 ResetEventTrigClasses(); // reset triggers list to select all histos
134 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle();
135 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle();
136 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle();
139 //____________________________________________________________________________
140 void AliITSQADataMakerRec::StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle)
142 // Start a cycle of QA data acquistion
143 fSelectedTaskIndex=task;
144 AliQADataMakerRec::StartOfCycle(task,run,sameCycle);
147 //____________________________________________________________________________
148 void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
150 // launch the QA checking
151 ResetEventTrigClasses();
153 AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() ));
155 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
157 if(!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;
158 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
159 Int_t idnumber=list[specie]->GetUniqueID();
160 //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber);
161 if(idnumber==40||idnumber==0){
162 //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() ))
164 } //skip kDigitsR and not filled TobjArray specie
166 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n");
167 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list);//[/*GetEventSpecie()*/specie]);
168 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list);//[/*GetEventSpecie()*/specie]);
169 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list);//[/*GetEventSpecie()*/specie]);
172 AliQAChecker *qac = AliQAChecker::Instance();
173 AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
174 Int_t subdet=GetSubDet();
175 qacb->SetSubDet(subdet);
178 qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task,specie), fSDDDataMaker->GetOffset(task,specie), fSSDDataMaker->GetOffset(task,specie)); //Setting the offset for the QAChecker list
179 qacb->SetHisto(fSPDDataMaker->GetTaskHisto(task), fSDDDataMaker->GetTaskHisto(task), fSSDDataMaker->GetTaskHisto(task));
183 Int_t offset=GetDetTaskOffset(subdet, task,specie);
184 qacb->SetDetTaskOffset(subdet,offset);
185 Int_t histo=GetDetTaskHisto(subdet, task);
186 qacb->SetDetHisto(subdet,histo);
189 qac->Run( AliQAv1::kITS , task, list);
191 }//end else unique id
196 //____________________________________________________________________________
197 //void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
199 //eventually used for different AliQAChecker::Instance()->Run
202 //____________________________________________________________________________
203 void AliITSQADataMakerRec::InitRaws() {
204 // Initialization of RAW data histograms
206 //if(fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
208 if(fSubDetector == 0 || fSubDetector == 1) {
209 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n");
210 fSPDDataMaker->InitRaws();
212 if(fSubDetector == 0 || fSubDetector == 2) {
213 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRaws\n");
215 fSDDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
216 fSDDDataMaker->InitRaws();
218 if(fSubDetector == 0 || fSubDetector == 3) {
219 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRaws\n");
221 fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
222 fSSDDataMaker->InitRaws();
224 fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(10);
226 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
229 //____________________________________________________________________________
230 void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
235 SetRunNumber(rawReader->GetRunNumber());
237 if(fSubDetector == 0 || fSubDetector == 1) {
238 fSPDDataMaker->MakeRaws(rawReader) ;
241 if(fSubDetector == 0 || fSubDetector == 2) {
242 fSDDDataMaker->MakeRaws(rawReader) ;
245 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader);
247 IncEvCountCycleRaws();
248 IncEvCountTotalRaws();
252 //____________________________________________________________________________
253 void AliITSQADataMakerRec::InitDigits()
256 // Initialization for DIGITS
257 if(fSubDetector == 0 || fSubDetector == 1) {
258 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n");
260 fSPDDataMaker->InitDigits();
262 if(fSubDetector == 0 || fSubDetector == 2) {
263 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitDigits\n");
264 fSDDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
266 fSDDDataMaker->InitDigits();
268 if(fSubDetector == 0 || fSubDetector == 3) {
269 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitDigits\n");
270 fSSDDataMaker->SetOffset(AliQAv1::kDIGITSR, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
272 fSSDDataMaker->InitDigits();
274 fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(40);
276 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
279 //____________________________________________________________________________
280 void AliITSQADataMakerRec::MakeDigits(TTree * digitsTree)
284 // Fill QA for recpoints
285 if(fSubDetector == 0 || fSubDetector == 1) {
286 fSPDDataMaker->MakeDigits(digitsTree) ;
289 if(fSubDetector == 0 || fSubDetector == 2) {
290 fSDDDataMaker->MakeDigits(digitsTree) ;
294 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digitsTree);
296 IncEvCountCycleDigits();
297 IncEvCountTotalDigits();
301 //____________________________________________________________________________
302 void AliITSQADataMakerRec::InitRecPoints()
305 // Initialization for RECPOINTS
308 //if(fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
309 if(fSubDetector == 0 || fSubDetector == 1) {
310 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRecPoints\n");
311 fSPDDataMaker->InitRecPoints();
313 if(fSubDetector == 0 || fSubDetector == 2) {
314 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRecPoints\n");
315 fSDDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(), AliRecoParam::AConvert(fEventSpecie));
316 fSDDDataMaker->InitRecPoints();
318 if(fSubDetector == 0 || fSubDetector == 3) {
319 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRecPoints\n");
320 fSSDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
321 fSSDDataMaker->InitRecPoints();
324 fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(20);
325 if(fSubDetector == 0){
326 Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
327 const Bool_t expert = kTRUE ;
328 const Bool_t image = kTRUE ;
330 for (Int_t iLay=0;iLay<6;iLay++) {
331 hPhiEta[iLay]=new TH2F(Form("Phi_vs_Eta_ITS_Layer%d",iLay+1),Form("Phi_vs_Eta_ITS_Layer%d",iLay+1),30,-1.5,1.5,200,0.,2*TMath::Pi());
332 hPhiEta[iLay]->GetXaxis()->SetTitle("Pseudorapidity");
333 hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
334 Add2RecPointsList(hPhiEta[iLay], iLay + offset, !expert, image);
335 //delete hPhiEta[iLay];
340 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
343 //____________________________________________________________________________
344 void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
346 // Fill QA for recpoints
348 if(fSubDetector == 0 || fSubDetector == 1) {
349 fSPDDataMaker->MakeRecPoints(clustersTree) ;
352 if(fSubDetector == 0 || fSubDetector == 2) {
353 fSDDDataMaker->MakeRecPoints(clustersTree) ;
356 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree);
360 if(fSubDetector == 0){
362 // Check id histograms already created for this Event Specie
363 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
364 TClonesArray *recpoints =NULL;
366 rpcont->FetchClusters(0,clustersTree,GetEventNumber());
369 rpcont->FetchClusters(0,clustersTree);
371 if(!rpcont->GetStatusOK()){
372 AliError("cannot access to ITS recpoints");
376 Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
377 Float_t cluGlo[3] = {0.,0.,0.};
379 // Fill QA for recpoints
380 for(Int_t module=0; module<rpcont->GetNumberOfModules();module++){
381 // AliInfo(Form("Module %d\n",module));
382 recpoints = rpcont->UncheckedGetClusters(module);
383 AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
384 for(Int_t j=0;j<recpoints->GetEntries();j++){
385 AliITSRecPoint *rcp = (AliITSRecPoint*)recpoints->At(j);
386 //Check id histograms already created for this Event Specie
387 rcp->GetGlobalXYZ(cluGlo);
388 Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]+cluGlo[2]*cluGlo[2]);
389 Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
390 Double_t theta = TMath::ACos(cluGlo[2]/rad);
392 if(AreEqual(rad,0.) == kFALSE) {
393 if(theta<=1.e-14){ eta=30.; }
394 else { eta = -TMath::Log(TMath::Tan(theta/2.));}
396 // printf("=========================>hlt rcp->GetLayer() = %d \n",rcp->GetLayer());
397 FillRecPointsData(rcp->GetLayer() + offset - 6,eta,phi);
402 IncEvCountCycleRecPoints();
403 IncEvCountTotalRecPoints();
407 //____________________________________________________________________________
408 void AliITSQADataMakerRec::FillRecPoint(AliITSRecPoint rcp)
411 // Fill QA for recpoints
412 Float_t cluGlo[3] = {0.,0.,0.};
413 Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
414 // Check id histograms already created for this Event Specie
415 rcp.GetGlobalXYZ(cluGlo);
416 Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]+cluGlo[2]*cluGlo[2]);
417 Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
418 Double_t theta = TMath::ACos(cluGlo[2]/rad);
420 if(AreEqual(rad,0.)==kFALSE) {
421 if(theta<=1.e-14){eta=30.;}
422 else {eta = -TMath::Log(TMath::Tan(theta/2.));}
424 FillRecPointsData( rcp.GetLayer() + offset - 6, eta,phi);
428 //____________________________________________________________________________
429 TH2F *AliITSQADataMakerRec::GetITSGlobalHisto(Int_t layer)
432 Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
433 return ((TH2F *) GetRecPointsData( layer + offset - 6));//local distribution
436 //____________________________________________________________________________
437 void AliITSQADataMakerRec::InitESDs()
440 // Create ESDs histograms in ESDs subdir
442 Bool_t expertHistogram = kTRUE;
444 TH1F *hESDClustersMI =
445 new TH1F("hESDClustersMI", "N ITS clusters per track (MI); N clusters; Counts",
447 hESDClustersMI->Sumw2();
448 hESDClustersMI->SetMinimum(0);
449 Add2ESDsList(hESDClustersMI, 0);
451 TH1F *hESDClusterMapMI =
452 new TH1F("hESDClusterMapMI", "N tracks with point Layer (MI); Layer; N tracks",
454 hESDClusterMapMI->Sumw2();
455 hESDClusterMapMI->SetMinimum(0);
456 Add2ESDsList(hESDClusterMapMI, 1, expertHistogram);
458 TH1F *hESDClustersSA =
459 new TH1F("hESDClustersSA", "N ITS clusters per track (SA); N clusters; Counts",
461 hESDClustersSA->Sumw2();
462 hESDClustersSA->SetMinimum(0);
463 Add2ESDsList(hESDClustersSA, 2);
465 TH1F *hESDClusterMapSA =
466 new TH1F("hESDClusterMapSA", "N tracks with point Layer (SA); Layer; N tracks",
468 hESDClusterMapSA->Sumw2();
469 hESDClusterMapSA->SetMinimum(0);
470 Add2ESDsList(hESDClusterMapSA, 3, expertHistogram);
473 new TH1F("hSPDVertexX","SPD Vertex x; x [cm]; N events",
475 hSPDVertexX->Sumw2();
476 Add2ESDsList(hSPDVertexX, 4);
479 new TH1F("hSPDVertexY","SPD Vertex y; y [cm]; N events",
481 hSPDVertexY->Sumw2();
482 Add2ESDsList(hSPDVertexY, 5);
485 new TH1F("hSPDVertexZ","SPD Vertex Z; z [cm]; N events",
487 hSPDVertexZ->Sumw2();
488 Add2ESDsList(hSPDVertexZ, 6);
490 TH1F *hSPDVertexContrOverMult =
491 new TH1F("hSPDVertexContrOverMult","SPD Vertex: contributors / multiplicity; N contributors / SPD multiplicity; N events",
493 hSPDVertexContrOverMult->Sumw2();
494 Add2ESDsList(hSPDVertexContrOverMult, 7, expertHistogram);
497 new TH1F("hTrkVertexX","ITS+TPC Trk Vertex x; x [cm]; N events",
499 hTrkVertexX->Sumw2();
500 Add2ESDsList(hTrkVertexX, 8, expertHistogram);
503 new TH1F("hTrkVertexY","ITS+TPC Trk Vertex y; y [cm]; N events",
505 hTrkVertexY->Sumw2();
506 Add2ESDsList(hTrkVertexY, 9, expertHistogram);
509 new TH1F("hTrkVertexZ","ITS+TPC Trk Vertex Z; z [cm]; N events",
511 hTrkVertexZ->Sumw2();
512 Add2ESDsList(hTrkVertexZ, 10, expertHistogram);
514 TH1F *hTrkVertexContrOverITSrefit5 =
515 new TH1F("hTrkVertexContrOverITSrefit5","ITS+TPC Trk Vertex: contributors / tracks; N contributors / N trks kITSrefit with 5 or 6 clusters; N events",
517 hTrkVertexContrOverITSrefit5->Sumw2();
518 Add2ESDsList(hTrkVertexContrOverITSrefit5, 11, expertHistogram);
520 TH1F *hSPDTrkVertexDeltaX =
521 new TH1F("hSPDTrkVertexDeltaX","Comparison of SPD and Trk vertices: x; xSPD-xTrk [cm]; N events",
523 hSPDTrkVertexDeltaX->Sumw2();
524 Add2ESDsList(hSPDTrkVertexDeltaX, 12, expertHistogram);
526 TH1F *hSPDTrkVertexDeltaY =
527 new TH1F("hSPDTrkVertexDeltaY","Comparison of SPD and Trk vertices: y; ySPD-yTrk [cm]; N events",
529 hSPDTrkVertexDeltaY->Sumw2();
530 Add2ESDsList(hSPDTrkVertexDeltaY, 13, expertHistogram);
532 TH1F *hSPDTrkVertexDeltaZ =
533 new TH1F("hSPDTrkVertexDeltaZ","Comparison of SPD and Trk vertices: z; zSPD-zTrk [cm]; N events",
535 hSPDTrkVertexDeltaZ->Sumw2();
536 Add2ESDsList(hSPDTrkVertexDeltaZ, 14);
540 TH1F* hSPDTracklets =
541 new TH1F("hSPDTracklets","N SPD Tracklets; N tracklets; Counts",300,0.,300.);
542 hSPDTracklets->Sumw2();
543 Add2ESDsList(hSPDTracklets, 15);
545 TH2F* hSPDTrackletsvsFiredChips0 =
546 new TH2F("hSPDTrackletsvsFiredChips0","N SPD Tracklets vs N FiredChips Layer0",
547 300,0.,300.,300,0.,300.);
548 hSPDTrackletsvsFiredChips0->GetXaxis()->SetTitle("N FiredChips Layer0");
549 hSPDTrackletsvsFiredChips0->GetYaxis()->SetTitle("N SPD Tracklets");
550 hSPDTrackletsvsFiredChips0->Sumw2();
551 Add2ESDsList(hSPDTrackletsvsFiredChips0, 16, expertHistogram );
553 TH2F* hSPDTrackletsvsFiredChips1 =
554 new TH2F("hSPDTrackletsvsFiredChips1","N SPD Tracklets vs N FiredChips Layer1",
555 300,0.,300.,300,0.,300.);
556 hSPDTrackletsvsFiredChips1->GetXaxis()->SetTitle("N FiredChips Layer1");
557 hSPDTrackletsvsFiredChips1->GetYaxis()->SetTitle("N SPD Tracklets");
558 hSPDTrackletsvsFiredChips1->Sumw2();
559 Add2ESDsList(hSPDTrackletsvsFiredChips1, 17, expertHistogram);
561 TH2F* hSPDFiredChips1vsFiredChips0 =
562 new TH2F("hSPDFiredChips1vsFiredChips0","N FiredChips Layer1 vs N FiredChips Layer0",
563 300,0.,300.,300,0.,300.);
564 hSPDFiredChips1vsFiredChips0->GetXaxis()->SetTitle("N FiredChips Layer0");
565 hSPDFiredChips1vsFiredChips0->GetYaxis()->SetTitle("N FiredChips Layer1");
566 hSPDFiredChips1vsFiredChips0->Sumw2();
567 Add2ESDsList(hSPDFiredChips1vsFiredChips0, 18, expertHistogram );
569 TH1F* hSPDTrackletsDePhi =
570 new TH1F("hSPDTrackletsDePhi","DeltaPhi SPD Tracklets; DeltaPhi [rad]; N events",200,-0.2,0.2);
571 hSPDTrackletsDePhi->Sumw2();
572 Add2ESDsList(hSPDTrackletsDePhi, 19);
574 TH1F* hSPDTrackletsPhi =
575 new TH1F("hSPDTrackletsPhi","Phi SPD Tracklets; Phi [rad]; N events",1000,0.,2*TMath::Pi());
576 hSPDTrackletsPhi->Sumw2();
577 Add2ESDsList(hSPDTrackletsPhi, 20);
579 TH1F* hSPDTrackletsDeTheta =
580 new TH1F("hSPDTrackletsDeTheta","DeltaTheta SPD Tracklets; DeltaTheta [rad]; N events",200,-0.2,0.2);
581 hSPDTrackletsDeTheta->Sumw2();
582 Add2ESDsList(hSPDTrackletsDeTheta, 21);
584 TH1F* hSPDTrackletsTheta =
585 new TH1F("hSPDTrackletsTheta","Theta SPD Tracklets; Theta [rad]; N events",500,0.,TMath::Pi());
586 hSPDTrackletsTheta->Sumw2();
587 Add2ESDsList(hSPDTrackletsTheta, 22);
589 // map of layers skipped by tracking (set in AliITSRecoParam)
590 TH1F *hESDSkippedLayers =
591 new TH1F("hESDSkippedLayers", "Map of layers skipped by tracking; Layer; Skipped",
593 hESDSkippedLayers->Sumw2();
594 hESDSkippedLayers->SetMinimum(0);
595 Add2ESDsList(hESDSkippedLayers, 23, expertHistogram);
597 fESDsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(30);
599 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
602 //____________________________________________________________________________
603 void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd)
605 // Make QA data from ESDs
607 // Check id histograms already created for this Event Specie
608 // if ( ! GetESDsData(0) )
611 const Int_t nESDTracks = esd->GetNumberOfTracks();
612 Int_t nITSrefit5 = 0;
618 AliInfo(Form("Filling histograms for ESD. Number of tracks %d",nESDTracks));
619 for(Int_t i = 0; i < nESDTracks; i++) {
621 AliESDtrack *track = esd->GetTrack(i);
623 Int_t nclsITS = track->GetNcls(0);
625 Bool_t itsrefit=kFALSE,tpcin=kFALSE,itsin=kFALSE;
626 if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE;
627 if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE;
628 if ((track->GetStatus() & AliESDtrack::kITSin)) itsin=kTRUE;
629 if(nclsITS>=5 && itsrefit) nITSrefit5++;
632 FillESDsData(0,nclsITS);
635 FillESDsData(2,nclsITS);
638 for(Int_t layer=0; layer<6; layer++) {
640 if(TESTBIT(track->GetITSClusterMap(),layer)) {
642 FillESDsData(1,layer);
644 FillESDsData(3,layer);
647 track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc);
648 if(status==3) SetESDsDataBinContent(23,layer,1);
651 } // end loop on tracks
654 const AliESDVertex *vtxSPD = esd->GetPrimaryVertexSPD();
655 const AliESDVertex *vtxTrk = esd->GetPrimaryVertexTracks();
657 Int_t mult = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfTracklets();
658 AliInfo(Form("Multiplicity %d ; Number of SPD vert contributors %d",mult,vtxSPD->GetNContributors()));
660 FillESDsData(7,(Float_t)(vtxSPD->GetNContributors())/(Float_t)mult);
663 FillESDsData(11,(Float_t)(vtxTrk->GetNIndices())/(Float_t)nITSrefit5);
665 if(vtxSPD->GetNContributors()>0) {
666 FillESDsData(4,vtxSPD->GetXv());
667 FillESDsData(5,vtxSPD->GetYv());
668 FillESDsData(6,vtxSPD->GetZv());
671 if(vtxTrk->GetNContributors()>0) {
672 FillESDsData(8,vtxTrk->GetXv());
673 FillESDsData(9,vtxTrk->GetYv());
674 FillESDsData(10,vtxTrk->GetZv());
677 if(vtxSPD->GetNContributors()>0 &&
678 vtxTrk->GetNContributors()>0) {
679 FillESDsData(12,vtxSPD->GetXv()-vtxTrk->GetXv());
680 FillESDsData(13,vtxSPD->GetYv()-vtxTrk->GetYv());
681 FillESDsData(14,vtxSPD->GetZv()-vtxTrk->GetZv());
685 FillESDsData(15,mult);
687 Short_t nFiredChips0 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(0);
688 Short_t nFiredChips1 = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfFiredChips(1);
689 FillESDsData(16,nFiredChips0,mult);
690 FillESDsData(17,nFiredChips1,mult);
691 FillESDsData(18,nFiredChips0,nFiredChips1);
693 // Loop over tracklets
694 for (Int_t itr=0; itr<mult; ++itr) {
695 Float_t dePhiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetDeltaPhi(itr);
696 Float_t deThetaTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetDeltaTheta(itr);
697 Float_t phiTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetPhi(itr);
698 Float_t thetaTr = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetTheta(itr);
699 FillESDsData(19,dePhiTr);
700 FillESDsData(20,phiTr);
701 FillESDsData(21,deThetaTr);
702 FillESDsData(22,thetaTr);
703 } // end loop on tracklets
705 IncEvCountCycleESDs();
706 IncEvCountTotalESDs();
710 //_________________________________________________________________
711 Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task, Int_t specie)
713 //number of booked histos for the QAchecking Raws offset
718 offset=fSPDDataMaker->GetOffset(task,specie);
722 offset=fSDDDataMaker->GetOffset(task,specie);
726 offset=fSSDDataMaker->GetOffset(task,specie);
730 AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
738 //____________________________________________________________________
740 Bool_t AliITSQADataMakerRec::AreEqual(Double_t a1,Double_t a2)
742 const Double_t kEpsilon= 1.e-14;
743 return TMath::Abs(a1-a2)<=kEpsilon*TMath::Abs(a1);
746 //_________________________________________________________________
747 Int_t AliITSQADataMakerRec::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task)
749 //return the number of histo booked for each the Raws Task
755 histo=fSPDDataMaker->GetTaskHisto(task);
759 histo=fSDDDataMaker->GetTaskHisto(task);
763 histo=fSSDDataMaker->GetTaskHisto(task);
767 AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
777 //____________________________________________________________________
779 void AliITSQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
781 //reset the detector histograms for a given task
782 AliQADataMakerRec::ResetDetector(task);
784 if(fSubDetector==0||fSubDetector==1)fSPDDataMaker->ResetDetector(task);
786 if(fSubDetector==0||fSubDetector==2)fSDDDataMaker->ResetDetector(task);
788 if(fSubDetector==0||fSubDetector==3)fSSDDataMaker->ResetDetector(task);
793 //____________________________________________________________________
795 AliITSDDLModuleMapSDD *AliITSQADataMakerRec::GetDDLSDDModuleMap()
797 //return the SDD module map
798 if(fSubDetector==2){return fSDDDataMaker->GetDDLSDDModuleMap();}
802 //____________________________________________________________________
803 Bool_t AliITSQADataMakerRec::ListExists(AliQAv1::TASKINDEX_t task) const
805 //Check the existence of a list for a given task
806 Bool_t havethelist=kFALSE;
807 if( ( task == AliQAv1::kRAWS && fRawsQAList ) ||
808 ( task == AliQAv1::kRECPOINTS && fRecPointsQAList ) ||
809 ( task == AliQAv1::kDIGITSR && fDigitsQAList ) ||
810 ( task == AliQAv1::kESDS && fESDsQAList ) ) havethelist=kTRUE;