1mu overlap with SHIL corrected.
[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
11#include "AliGlobalQADataMaker.h"
12#include "AliGeomManager.h"
d7259b2e 13#include "AliESDEvent.h"
542c6c71 14#include "AliESDv0.h"
c0af1be2 15
16ClassImp(AliGlobalQADataMaker)
17
18void AliGlobalQADataMaker::InitRecPoints() {
19 //------------------------------------------------------
d7259b2e 20 // This function books the histograms of *track*residuals*
c0af1be2 21 // as a part of global QA
22 //------------------------------------------------------
23 Char_t *name[]={
24 "SPD1 residuals Y","SPD1 residuals Z",
25 "SPD2 residuals Y","SPD2 residuals Z",
26 "SDD1 residuals Y","SDD1 residuals Z",
27 "SDD2 residuals Y","SDD2 residuals Z",
28 "SSD1 residuals Y","SSD1 residuals Z",
29 "SSD2 residuals Y","SSD2 residuals Z",
30
31 "TPC1 residuals Y","TPC1 residuals Z",
32 "TPC2 residuals Y","TPC2 residuals Z",
33
34 "TRD1 residuals Y","TRD1 residuals Z",
35 "TRD2 residuals Y","TRD2 residuals Z",
36 "TRD3 residuals Y","TRD3 residuals Z",
37 "TRD4 residuals Y","TRD4 residuals Z",
38 "TRD5 residuals Y","TRD5 residuals Z",
39 "TRD6 residuals Y","TRD6 residuals Z",
40
41 "TOF residuals Y","TOF residuals Z",
42
43 "PHOS1 residuals Y","PHOS1 residuals Z",
44 "PHOS2 residuals Y","PHOS2 residuals Z",
45
46 "HMPID residuals Y","HMPID residuals Z",
47
48 "MUON residuals Y","MUON residuals Z",
49
50 "EMCAL residuals Y","EMCAL residuals Z"
51 };
52
53 for (Int_t m=1; m<AliGeomManager::kLastLayer; m++) {
54 Int_t i=2*m-2;
55 TH1F *h=new TH1F(name[i],name[i],100,-5.,5.);
56 Add2RecPointsList(h,i);
57 h=new TH1F(name[i+1],name[i+1],100,-5.,5.);
58 Add2RecPointsList(h,i+1);
59 }
a935c6c0 60
61 Add2RecPointsList(
62 new TH1F("SSD1 absolute residuals Z for Z<0 (cm)",
63 "SSD1 absolute residuals Z for Z<0 (cm)",100,-2.,2.),40);
64 Add2RecPointsList(
65 new TH1F("SSD1 absolute residuals Z for Z>0 (cm)",
66 "SSD1 absolute residuals Z for Z>0 (cm)",100,-2.,2.),41);
67 Add2RecPointsList(
68 new TH1F("SSD2 absolute residuals Z for Z<0 (cm)",
69 "SSD2 absolute residuals Z for Z<0 (cm)",100,-3.,3.),42);
70 Add2RecPointsList(
71 new TH1F("SSD2 absolute residuals Z for Z>0 (cm)",
72 "SSD2 absolute residuals Z for Z>0 (cm)",100,-3.,3.),43);
73
c0af1be2 74}
d7259b2e 75
76void AliGlobalQADataMaker::InitESDs() {
77 //------------------------------------------------------
78 // This function books the ESD QA histograms
79 // as a part of global QA
80 //------------------------------------------------------
542c6c71 81
82 {// Cluster related QA
d7259b2e 83 Char_t *name[]={
84 "Fraction of the assigned clusters in ITS",
85 "Fraction of the assigned clusters in TPC",
86 "Fraction of the assigned clusters in TRD"
87 };
542c6c71 88 Add2ESDsList(new TH1F(name[0],name[0],100,0.,2.),kClr0);
89 Add2ESDsList(new TH1F(name[1],name[1],100,0.,2.),kClr1);
90 Add2ESDsList(new TH1F(name[2],name[2],100,0.,2.),kClr2);
91 }
92
93 {// Track related QA
94 Char_t *name[]={
95 "Track azimuthal distribution (rad)", // kTrk0
96 "Track pseudo-rapidity distribution", // kTrk1
a0994cfd 97 "TPC: track momentum distribution (GeV)", // kTrk2
98 "TPC-ITS matched: track momentum distribution (GeV)", // kTrk3
99 "TPC-TOF matched: track momentum distribution (GeV)", // kTrk4
542c6c71 100 "TPC-ITS track-matching probability", // kTrk5
101 "TPC-TOF track-matching probability" // kTrk6
102 };
103 Add2ESDsList(new TH1F(name[0],name[0],100,-0.02,6.30),kTrk0);
104 Add2ESDsList(new TH1F(name[1],name[1],100,-2.00,2.00),kTrk1);
105 Add2ESDsList(new TH1F(name[2],name[2],50, 0.20,5.00),kTrk2);
106 Add2ESDsList(new TH1F(name[3],name[3],50, 0.20,5.00),kTrk3);
107 Add2ESDsList(new TH1F(name[4],name[4],50, 0.20,5.00),kTrk4);
108 Add2ESDsList(new TH1F(name[5],name[5],50, 0.20,5.00),kTrk5);
109 Add2ESDsList(new TH1F(name[6],name[6],50, 0.20,5.00),kTrk6);
110 }
111
112 {// V0 related QA
113 Char_t *name[]={
114 "K0s mass (GeV)",
115 "Lambda0 + Lambda0Bar mass (GeV)"
116 };
117 Add2ESDsList(new TH1F(name[0],name[0],50, 0.4477,0.5477),kV0s0);
118 Add2ESDsList(new TH1F(name[1],name[1],50, 1.0657,1.1657),kV0s1);
119 }
120
121 {// PID related QA
122 Char_t *name[]={
a0994cfd 123 "ITS: dEdx (ADC) for particles with momentum 0.4 - 0.5 (GeV)",
124 "TPC: dEdx (ADC) for particles with momentum 0.4 - 0.5 (GeV)",
542c6c71 125 "TOF: tracking - measured (ps)"
126 };
127 Add2ESDsList(new TH1F(name[0],name[0],50,0.00,200.),kPid0);
128 Add2ESDsList(new TH1F(name[1],name[1],50,0.00,100.),kPid1);
129 Add2ESDsList(new TH1F(name[2],name[2],50,-3500.,3500.),kPid2);
130 }
131
d7259b2e 132}
133
542c6c71 134void AliGlobalQADataMaker::MakeESDs(AliESDEvent * event) {
d7259b2e 135 //-----------------------------------------------------------
136 // This function fills the ESD QA histograms
137 // as a part of global QA
138 //-----------------------------------------------------------
542c6c71 139 const AliESDEvent *esd=event;
140
d7259b2e 141 Int_t ntrk=esd->GetNumberOfTracks() ;
142 for (Int_t i=0; i<ntrk; i++) {
542c6c71 143 const AliESDtrack *track=esd->GetTrack(i);
d7259b2e 144
542c6c71 145 // Cluster related QA
d7259b2e 146 if (track->IsOn(AliESDtrack::kITSrefit)) {
147 Int_t n=track->GetITSclusters(0);
542c6c71 148 GetESDsData(kClr0)->Fill(Float_t(n)/6.); //6 is the number of ITS layers
d7259b2e 149 }
150
151 if (track->IsOn(AliESDtrack::kTPCrefit)) {
152 Int_t n =track->GetTPCNcls();
153 Int_t nf=track->GetTPCNclsF(); // number of crossed TPC pad rows
542c6c71 154 GetESDsData(kClr1)->Fill(Float_t(n)/nf);
d7259b2e 155 }
156
157 if (track->IsOn(AliESDtrack::kTRDrefit)) {
158 Int_t n=track->GetTRDclusters(0);
e3bd5382 159 GetESDsData(kClr2)->Fill(Float_t(n)/(6*24));//(6*24) is the number of TRD time bins
542c6c71 160 }
161
162 Double_t p=track->GetP();
163
164 // Track related QA
165 if (track->IsOn(AliESDtrack::kTPCrefit)) {
166 Float_t dz[2];
167 track->GetDZ(0.,0.,0.,esd->GetMagneticField(),dz);
168 if ((TMath::Abs(dz[0])<3.) && (TMath::Abs(dz[1])<3.)) { // beam pipe
169 Double_t phi=track->Phi();
170 GetESDsData(kTrk0)->Fill(phi);
44f14df0 171 Double_t y=track->Eta();
542c6c71 172 GetESDsData(kTrk1)->Fill(y);
173
cecff4fc 174 if (TMath::Abs(y)<0.9) {
175 GetESDsData(kTrk2)->Fill(p);
176 if (track->IsOn(AliESDtrack::kITSrefit)) GetESDsData(kTrk3)->Fill(p);
177 if (track->IsOn(AliESDtrack::kTOFout)) GetESDsData(kTrk4)->Fill(p);
178 }
542c6c71 179 }
180 }
181
182 // PID related QA
183 if ((p>0.4) && (p<0.5)) {
184 if (track->IsOn(AliESDtrack::kITSpid)) {
185 Double_t dedx=track->GetITSsignal();
186 GetESDsData(kPid0)->Fill(dedx);
187 }
188 if (track->IsOn(AliESDtrack::kTPCpid)) {
189 Double_t dedx=track->GetTPCsignal();
190 GetESDsData(kPid1)->Fill(dedx);
191 }
d7259b2e 192 }
542c6c71 193 if (p>1.0) {
194 if (track->IsOn(AliESDtrack::kTOFpid)) {
195 Double_t times[10];
196 track->GetIntegratedTimes(times);
197 Double_t tof=track->GetTOFsignal();
198 GetESDsData(kPid2)->Fill(times[2]-tof);
199 }
200 }
201 }
d7259b2e 202
cecff4fc 203 TH1 *tpc=GetESDsData(kTrk2); tpc->Sumw2();
204 TH1 *its=GetESDsData(kTrk3); its->Sumw2();
205 TH1 *tof=GetESDsData(kTrk4); tof->Sumw2();
542c6c71 206 GetESDsData(kTrk5)->Divide(its,tpc,1,1.,"b");
207 GetESDsData(kTrk6)->Divide(tof,tpc,1,1.,"b");
208
209 // V0 related QA
210 Int_t nV0=esd->GetNumberOfV0s();
211 for (Int_t i=0; i<nV0; i++) {
212 Double_t mass;
213 AliESDv0 v0(*esd->GetV0(i));
214
215 v0.ChangeMassHypothesis(kK0Short);
216 mass=v0.GetEffMass();
217 GetESDsData(kV0s0)->Fill(mass);
218
219 v0.ChangeMassHypothesis(kLambda0);
220 mass=v0.GetEffMass();
221 GetESDsData(kV0s1)->Fill(mass);
222
223 v0.ChangeMassHypothesis(kLambda0Bar);
224 mass=v0.GetEffMass();
225 GetESDsData(kV0s1)->Fill(mass);
d7259b2e 226 }
542c6c71 227
d7259b2e 228}