- Three classes by MinJung Kweon AliHFEpriVtx, AliHFEsecVtx and AliHFEmcQA for primar...
[u/mrichter/AliRoot.git] / STEER / AliGlobalQADataMaker.cxx
CommitLineData
c0af1be2 1/*
2 The class for calculating the global (not detector specific) quality assurance.
3 It reuses the following TLists from its base class
4 AliQADataMaker::fRecPointsQAList (for keeping the track residuals)
5 AliQADataMaker::fESDsQAList (for keeping global ESD QA data)
6*/
7
542c6c71 8#include <TPDGCode.h>
c0af1be2 9#include <TH1F.h>
10
fb774831 11#include "AliQAChecker.h"
c0af1be2 12#include "AliGlobalQADataMaker.h"
13#include "AliGeomManager.h"
d7259b2e 14#include "AliESDEvent.h"
542c6c71 15#include "AliESDv0.h"
fb774831 16#include "AliRawReader.h"
c0af1be2 17
18ClassImp(AliGlobalQADataMaker)
19
fb774831 20//____________________________________________________________________________
4e25ac79 21void AliGlobalQADataMaker::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
fb774831 22{
23 //Detector specific actions at end of cycle
24 // do the QA checking
4e25ac79 25 AliQAChecker::Instance()->Run(AliQAv1::kGLOBAL, task, list) ;
fb774831 26}
27
28//____________________________________________________________________________
29void AliGlobalQADataMaker::InitRaws()
30{
31 // create Raws histograms in Raws subdir
32}
33
34//____________________________________________________________________________
c0af1be2 35void AliGlobalQADataMaker::InitRecPoints() {
36 //------------------------------------------------------
d7259b2e 37 // This function books the histograms of *track*residuals*
c0af1be2 38 // as a part of global QA
39 //------------------------------------------------------
a6e0ebfe 40 const Char_t *name[]={
c0af1be2 41 "SPD1 residuals Y","SPD1 residuals Z",
42 "SPD2 residuals Y","SPD2 residuals Z",
43 "SDD1 residuals Y","SDD1 residuals Z",
44 "SDD2 residuals Y","SDD2 residuals Z",
45 "SSD1 residuals Y","SSD1 residuals Z",
46 "SSD2 residuals Y","SSD2 residuals Z",
47
48 "TPC1 residuals Y","TPC1 residuals Z",
49 "TPC2 residuals Y","TPC2 residuals Z",
50
51 "TRD1 residuals Y","TRD1 residuals Z",
52 "TRD2 residuals Y","TRD2 residuals Z",
53 "TRD3 residuals Y","TRD3 residuals Z",
54 "TRD4 residuals Y","TRD4 residuals Z",
55 "TRD5 residuals Y","TRD5 residuals Z",
56 "TRD6 residuals Y","TRD6 residuals Z",
57
58 "TOF residuals Y","TOF residuals Z",
59
60 "PHOS1 residuals Y","PHOS1 residuals Z",
61 "PHOS2 residuals Y","PHOS2 residuals Z",
62
63 "HMPID residuals Y","HMPID residuals Z",
64
65 "MUON residuals Y","MUON residuals Z",
66
67 "EMCAL residuals Y","EMCAL residuals Z"
68 };
69
70 for (Int_t m=1; m<AliGeomManager::kLastLayer; m++) {
71 Int_t i=2*m-2;
72 TH1F *h=new TH1F(name[i],name[i],100,-5.,5.);
73 Add2RecPointsList(h,i);
74 h=new TH1F(name[i+1],name[i+1],100,-5.,5.);
75 Add2RecPointsList(h,i+1);
76 }
a935c6c0 77
78 Add2RecPointsList(
49ab451d 79 new TH1F("SSD1 absolute residuals Y for Z<0 (cm)",
80 "SSD1 absolute residuals Y for Z<0 (cm)",100,-2.,2.),40);
81 Add2RecPointsList(
a935c6c0 82 new TH1F("SSD1 absolute residuals Z for Z<0 (cm)",
49ab451d 83 "SSD1 absolute residuals Z for Z<0 (cm)",100,-2.,2.),41);
84 Add2RecPointsList(
85 new TH1F("SSD1 absolute residuals Y for Z>0 (cm)",
86 "SSD1 absolute residuals Y for Z>0 (cm)",100,-2.,2.),42);
a935c6c0 87 Add2RecPointsList(
88 new TH1F("SSD1 absolute residuals Z for Z>0 (cm)",
49ab451d 89 "SSD1 absolute residuals Z for Z>0 (cm)",100,-2.,2.),43);
90
91
92 Add2RecPointsList(
93 new TH1F("SSD2 absolute residuals Y for Z<0 (cm)",
94 "SSD2 absolute residuals Y for Z<0 (cm)",100,-3.,3.),44);
a935c6c0 95 Add2RecPointsList(
96 new TH1F("SSD2 absolute residuals Z for Z<0 (cm)",
49ab451d 97 "SSD2 absolute residuals Z for Z<0 (cm)",100,-3.,3.),45);
98 Add2RecPointsList(
99 new TH1F("SSD2 absolute residuals Y for Z>0 (cm)",
100 "SSD2 absolute residuals Y for Z>0 (cm)",100,-3.,3.),46);
a935c6c0 101 Add2RecPointsList(
102 new TH1F("SSD2 absolute residuals Z for Z>0 (cm)",
49ab451d 103 "SSD2 absolute residuals Z for Z>0 (cm)",100,-3.,3.),47);
a935c6c0 104
c0af1be2 105}
d7259b2e 106
fb774831 107//____________________________________________________________________________
d7259b2e 108void AliGlobalQADataMaker::InitESDs() {
109 //------------------------------------------------------
110 // This function books the ESD QA histograms
111 // as a part of global QA
112 //------------------------------------------------------
542c6c71 113
114 {// Cluster related QA
a6e0ebfe 115 const Char_t *name[]={
d7259b2e 116 "Fraction of the assigned clusters in ITS",
117 "Fraction of the assigned clusters in TPC",
118 "Fraction of the assigned clusters in TRD"
119 };
542c6c71 120 Add2ESDsList(new TH1F(name[0],name[0],100,0.,2.),kClr0);
121 Add2ESDsList(new TH1F(name[1],name[1],100,0.,2.),kClr1);
122 Add2ESDsList(new TH1F(name[2],name[2],100,0.,2.),kClr2);
123 }
124
125 {// Track related QA
a6e0ebfe 126 const Char_t *name[]={
542c6c71 127 "Track azimuthal distribution (rad)", // kTrk0
128 "Track pseudo-rapidity distribution", // kTrk1
a0994cfd 129 "TPC: track momentum distribution (GeV)", // kTrk2
130 "TPC-ITS matched: track momentum distribution (GeV)", // kTrk3
131 "TPC-TOF matched: track momentum distribution (GeV)", // kTrk4
542c6c71 132 "TPC-ITS track-matching probability", // kTrk5
133 "TPC-TOF track-matching probability" // kTrk6
134 };
923347d4 135 Add2ESDsList(new TH1F(name[0],name[0],100, 0.,TMath::TwoPi()),kTrk0);
542c6c71 136 Add2ESDsList(new TH1F(name[1],name[1],100,-2.00,2.00),kTrk1);
137 Add2ESDsList(new TH1F(name[2],name[2],50, 0.20,5.00),kTrk2);
138 Add2ESDsList(new TH1F(name[3],name[3],50, 0.20,5.00),kTrk3);
139 Add2ESDsList(new TH1F(name[4],name[4],50, 0.20,5.00),kTrk4);
140 Add2ESDsList(new TH1F(name[5],name[5],50, 0.20,5.00),kTrk5);
141 Add2ESDsList(new TH1F(name[6],name[6],50, 0.20,5.00),kTrk6);
142 }
143
144 {// V0 related QA
a6e0ebfe 145 const Char_t *name[]={
b72280b3 146 "On-the-fly K0s mass (GeV)",
147 "Offline K0s mass (GeV)",
148 "On-the-fly Lambda0 + Lambda0Bar mass (GeV)",
149 "Offline Lambda0 + Lambda0Bar mass (GeV)"
542c6c71 150 };
b72280b3 151 Add2ESDsList(new TH1F(name[0],name[0],50, 0.4477,0.5477),kK0on);
152 Add2ESDsList(new TH1F(name[1],name[1],50, 0.4477,0.5477),kK0off);
153 Add2ESDsList(new TH1F(name[2],name[2],50, 1.0657,1.1657),kL0on);
154 Add2ESDsList(new TH1F(name[3],name[3],50, 1.0657,1.1657),kL0off);
542c6c71 155 }
156
157 {// PID related QA
a6e0ebfe 158 const Char_t *name[]={
a0994cfd 159 "ITS: dEdx (ADC) for particles with momentum 0.4 - 0.5 (GeV)",
160 "TPC: dEdx (ADC) for particles with momentum 0.4 - 0.5 (GeV)",
542c6c71 161 "TOF: tracking - measured (ps)"
162 };
163 Add2ESDsList(new TH1F(name[0],name[0],50,0.00,200.),kPid0);
164 Add2ESDsList(new TH1F(name[1],name[1],50,0.00,100.),kPid1);
165 Add2ESDsList(new TH1F(name[2],name[2],50,-3500.,3500.),kPid2);
166 }
167
d7259b2e 168}
169
fb774831 170//____________________________________________________________________________
171void AliGlobalQADataMaker::MakeRaws(AliRawReader* rawReader)
172{
173 //Fill prepared histograms with Raw digit properties
174 rawReader->Reset() ;
175
176}
177
178//____________________________________________________________________________
542c6c71 179void AliGlobalQADataMaker::MakeESDs(AliESDEvent * event) {
d7259b2e 180 //-----------------------------------------------------------
181 // This function fills the ESD QA histograms
182 // as a part of global QA
183 //-----------------------------------------------------------
eca4fa66 184 // Check id histograms already created for this Event Specie
185 if ( ! GetESDsData(kClr0) )
186 InitESDs() ;
187
542c6c71 188 const AliESDEvent *esd=event;
189
d7259b2e 190 Int_t ntrk=esd->GetNumberOfTracks() ;
191 for (Int_t i=0; i<ntrk; i++) {
542c6c71 192 const AliESDtrack *track=esd->GetTrack(i);
d7259b2e 193
542c6c71 194 // Cluster related QA
d7259b2e 195 if (track->IsOn(AliESDtrack::kITSrefit)) {
196 Int_t n=track->GetITSclusters(0);
542c6c71 197 GetESDsData(kClr0)->Fill(Float_t(n)/6.); //6 is the number of ITS layers
d7259b2e 198 }
199
200 if (track->IsOn(AliESDtrack::kTPCrefit)) {
201 Int_t n =track->GetTPCNcls();
202 Int_t nf=track->GetTPCNclsF(); // number of crossed TPC pad rows
1aaf4118 203 if (nf>0) {
204 Double_t val = n*1.0/nf;
205 GetESDsData(kClr1)->Fill(val);
206 }
d7259b2e 207 }
208
209 if (track->IsOn(AliESDtrack::kTRDrefit)) {
210 Int_t n=track->GetTRDclusters(0);
e3bd5382 211 GetESDsData(kClr2)->Fill(Float_t(n)/(6*24));//(6*24) is the number of TRD time bins
542c6c71 212 }
213
214 Double_t p=track->GetP();
215
216 // Track related QA
217 if (track->IsOn(AliESDtrack::kTPCrefit)) {
218 Float_t dz[2];
219 track->GetDZ(0.,0.,0.,esd->GetMagneticField(),dz);
220 if ((TMath::Abs(dz[0])<3.) && (TMath::Abs(dz[1])<3.)) { // beam pipe
221 Double_t phi=track->Phi();
222 GetESDsData(kTrk0)->Fill(phi);
44f14df0 223 Double_t y=track->Eta();
542c6c71 224 GetESDsData(kTrk1)->Fill(y);
225
cecff4fc 226 if (TMath::Abs(y)<0.9) {
227 GetESDsData(kTrk2)->Fill(p);
228 if (track->IsOn(AliESDtrack::kITSrefit)) GetESDsData(kTrk3)->Fill(p);
4d9ba05c 229 //if (track->IsOn(AliESDtrack::kTOFout)) GetESDsData(kTrk4)->Fill(p);
230 if (track->GetTOFsignal()>0) GetESDsData(kTrk4)->Fill(p);
cecff4fc 231 }
542c6c71 232 }
233 }
234
235 // PID related QA
236 if ((p>0.4) && (p<0.5)) {
237 if (track->IsOn(AliESDtrack::kITSpid)) {
238 Double_t dedx=track->GetITSsignal();
239 GetESDsData(kPid0)->Fill(dedx);
240 }
241 if (track->IsOn(AliESDtrack::kTPCpid)) {
242 Double_t dedx=track->GetTPCsignal();
243 GetESDsData(kPid1)->Fill(dedx);
244 }
d7259b2e 245 }
542c6c71 246 if (p>1.0) {
247 if (track->IsOn(AliESDtrack::kTOFpid)) {
248 Double_t times[10];
249 track->GetIntegratedTimes(times);
250 Double_t tof=track->GetTOFsignal();
251 GetESDsData(kPid2)->Fill(times[2]-tof);
252 }
253 }
254 }
d7259b2e 255
cecff4fc 256 TH1 *tpc=GetESDsData(kTrk2); tpc->Sumw2();
257 TH1 *its=GetESDsData(kTrk3); its->Sumw2();
258 TH1 *tof=GetESDsData(kTrk4); tof->Sumw2();
542c6c71 259 GetESDsData(kTrk5)->Divide(its,tpc,1,1.,"b");
260 GetESDsData(kTrk6)->Divide(tof,tpc,1,1.,"b");
261
262 // V0 related QA
263 Int_t nV0=esd->GetNumberOfV0s();
264 for (Int_t i=0; i<nV0; i++) {
265 Double_t mass;
266 AliESDv0 v0(*esd->GetV0(i));
267
268 v0.ChangeMassHypothesis(kK0Short);
269 mass=v0.GetEffMass();
b72280b3 270 if (v0.GetOnFlyStatus())
271 GetESDsData(kK0on)->Fill(mass);
272 else
273 GetESDsData(kK0off)->Fill(mass);
542c6c71 274
275 v0.ChangeMassHypothesis(kLambda0);
276 mass=v0.GetEffMass();
b72280b3 277 if (v0.GetOnFlyStatus())
278 GetESDsData(kL0on)->Fill(mass);
279 else
280 GetESDsData(kL0off)->Fill(mass);
542c6c71 281
282 v0.ChangeMassHypothesis(kLambda0Bar);
283 mass=v0.GetEffMass();
b72280b3 284 if (v0.GetOnFlyStatus())
285 GetESDsData(kL0on)->Fill(mass);
286 else
287 GetESDsData(kL0off)->Fill(mass);
d7259b2e 288 }
542c6c71 289
f92b626a 290}