Project
Loading...
Searching...
No Matches
MatchITSTPCQC.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include <algorithm>
13
14#include "GLOQC/MatchITSTPCQC.h"
21#include <TEfficiency.h>
27#include "GPUO2InterfaceUtils.h"
30#include "GPUO2InterfaceRefit.h"
31
32using namespace o2::gloqc;
33using namespace o2::mcutils;
36
41
42//_______________________________________________________
43
45{
46
47 LOG(debug) << "Deleting histos...";
48 for (int i = 0; i < matchType::SIZE; ++i) {
49 // Pt
50 delete mPtNum[i];
51 delete mPtDen[i];
52 delete mFractionITSTPCmatch[i];
53 delete mPtNum_noEta0[i];
54 delete mPtDen_noEta0[i];
55 delete mFractionITSTPCmatch_noEta0[i];
56 delete mPtPhysPrimNum[i];
57 delete mPtPhysPrimDen[i];
58 delete mFractionITSTPCmatchPhysPrim[i];
59
60 // Phi
61 delete mPhiNum[i];
62 delete mPhiDen[i];
63 delete mFractionITSTPCmatchPhi[i];
64 delete mPhiPhysPrimNum[i];
65 delete mPhiPhysPrimDen[i];
66 delete mFractionITSTPCmatchPhiPhysPrim[i];
67 delete mPhiVsPtNum[i];
68 delete mPhiVsPtDen[i];
69 delete mFractionITSTPCmatchPhiVsPt[i];
70
71 // Eta
72 delete mEtaNum[i];
73 delete mEtaDen[i];
74 delete mFractionITSTPCmatchEta[i];
75 delete mEtaPhysPrimNum[i];
76 delete mEtaPhysPrimDen[i];
77 delete mFractionITSTPCmatchEtaPhysPrim[i];
78 delete mEtaVsPtNum[i];
79 delete mEtaVsPtDen[i];
80 delete mFractionITSTPCmatchEtaVsPt[i];
81
82 // Clusters
83 delete mClsVsPtNum[i];
84 delete mClsVsPtDen[i];
85 delete mFractionITSTPCmatchClsVsPt[i];
86
87 // Chi2
88 delete mChi2VsPtNum[i];
89 delete mChi2VsPtDen[i];
90 delete mFractionITSTPCmatchChi2VsPt[i];
91
92 for (int j = 0; j < o2::track::PID::NIDs; ++j) {
93 // Pt
94 delete mPtNumVsTrkPID[i][j];
95 delete mPtDenVsTrkPID[i][j];
96 delete mFractionITSTPCmatchPtVsTrkPID[i][j];
97 // Phi
98 delete mPhiNumVsTrkPID[i][j];
99 delete mPhiDenVsTrkPID[i][j];
100 delete mFractionITSTPCmatchPhiVsTrkPID[i][j];
101 // Eta
102 delete mEtaNumVsTrkPID[i][j];
103 delete mEtaDenVsTrkPID[i][j];
104 delete mFractionITSTPCmatchEtaVsTrkPID[i][j];
105 }
106
107 // 1/Pt
108 delete m1OverPtNum[i];
109 delete m1OverPtDen[i];
110 delete mFractionITSTPCmatch1OverPt[i];
111 delete m1OverPtPhysPrimNum[i];
112 delete m1OverPtPhysPrimDen[i];
113 delete mFractionITSTPCmatchPhysPrim1OverPt[i];
114
115 // 3D eta/phi/pt
116 delete mEtaPhiPtNum[i];
117 delete mEtaPhiPtDen[i];
118 }
119
120 // Residuals
121 delete mResidualPt;
122 delete mResidualPhi;
123 delete mResidualEta;
124 // Others
125 delete mChi2Matching;
126 delete mChi2Refit;
127 delete mTimeResVsPt;
128 delete mDCAr;
129 delete mDCArVsPtNum;
130 delete mDCArVsPtDen;
131 delete mFractionITSTPCmatchDCArVsPt;
132
133 // K0
134 delete mK0MassVsPtVsOccpp;
135 delete mK0MassVsPtVsOccPbPb;
136}
137
138//__________________________________________________________
139
141{
142 for (int i = 0; i < matchType::SIZE; ++i) {
143 // Pt
144 mPtNum[i]->Reset();
145 mPtDen[i]->Reset();
146 mPtNum_noEta0[i]->Reset();
147 mPtDen_noEta0[i]->Reset();
148
149 // Phi
150 mPhiNum[i]->Reset();
151 mPhiDen[i]->Reset();
152 mPhiVsPtNum[i]->Reset();
153 mPhiVsPtDen[i]->Reset();
154
155 // Eta
156 mEtaNum[i]->Reset();
157 mEtaDen[i]->Reset();
158 mEtaVsPtNum[i]->Reset();
159 mEtaVsPtDen[i]->Reset();
160
161 // Clusters
162 mClsVsPtNum[i]->Reset();
163 mClsVsPtDen[i]->Reset();
164
165 // Chi2
166 mChi2VsPtNum[i]->Reset();
167 mChi2VsPtDen[i]->Reset();
168
169 // 1/Pt
170 m1OverPtNum[i]->Reset();
171 m1OverPtDen[i]->Reset();
172
173 // 3D eta/phi/pt
174 mEtaPhiPtNum[i]->Reset();
175 mEtaPhiPtDen[i]->Reset();
176
177 if (mUseTrkPID) { // Vs Tracking PID hypothesis
178 for (int j = 0; j < o2::track::PID::NIDs; ++j) {
179 // Pt
180 mPtNumVsTrkPID[i][j]->Reset();
181 mPtDenVsTrkPID[i][j]->Reset();
182 // Phi
183 mPhiNumVsTrkPID[i][j]->Reset();
184 mPhiDenVsTrkPID[i][j]->Reset();
185 // Eta
186 mEtaNumVsTrkPID[i][j]->Reset();
187 mEtaDenVsTrkPID[i][j]->Reset();
188 }
189 }
190
191 if (mUseMC) {
192 mPtPhysPrimNum[i]->Reset();
193 mPtPhysPrimDen[i]->Reset();
194
195 mPhiPhysPrimNum[i]->Reset();
196 mPhiPhysPrimDen[i]->Reset();
197
198 mEtaPhysPrimNum[i]->Reset();
199 mEtaPhysPrimDen[i]->Reset();
200
201 m1OverPtPhysPrimNum[i]->Reset();
202 m1OverPtPhysPrimDen[i]->Reset();
203 }
204 }
205
206 // Residuals
207 mResidualPt->Reset();
208 mResidualPhi->Reset();
209 mResidualEta->Reset();
210 // Others
211 mChi2Matching->Reset();
212 mChi2Refit->Reset();
213 mTimeResVsPt->Reset();
214 mDCAr->Reset();
215 mDCArVsPtNum->Reset();
216 mDCArVsPtDen->Reset();
217
218 // K0
219 if (mDoK0QC) {
220 mK0MassVsPtVsOccpp->Reset();
221 mK0MassVsPtVsOccPbPb->Reset();
222 }
223}
224
225//__________________________________________________________
227{
228 LOGP(debug, "Creating Variable Binning");
229 std::array<std::string, 2> title{"TPC", "ITS"};
230 std::array<std::string, 2> etaSel{Form(", |#eta| < %.1f", mEtaTPCCut), Form(", |#eta| < %.1f", mEtaCut)};
231 std::array<int, 2> maxNCls{156, 7};
232 // log binning for pT
233 const Int_t nbinsPt = mPtBins;
234 const Double_t xminPt = (mPtCut > 0) ? mPtCut : 0.01;
235 const Double_t xmaxPt = mPtMaxCut;
236 Double_t* xbinsPt = new Double_t[nbinsPt + 1];
237 Double_t xlogminPt = TMath::Log10(xminPt);
238 Double_t xlogmaxPt = TMath::Log10(xmaxPt);
239 Double_t dlogxPt = (xlogmaxPt - xlogminPt) / nbinsPt;
240 for (int i = 0; i <= nbinsPt; i++) {
241 Double_t xlogPt = xlogminPt + i * dlogxPt;
242 xbinsPt[i] = TMath::Exp(TMath::Log(10) * xlogPt);
243 }
244
245 LOGP(debug, "Creating Histograms");
246 // Data and MC
247 for (int i = 0; i < matchType::SIZE; ++i) {
248 // Pt
249 mPtNum[i] = new TH1D(Form("mPtNum_%s", title[i].c_str()), Form("Pt distribution of ITSTPC matched tracks, wrt %s tracks %s; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
250 mPtNum[i]->Sumw2();
251 mPtNum[i]->SetOption("logy");
252 mPtNum[i]->GetYaxis()->SetTitleOffset(1.4);
253 mPtDen[i] = new TH1D(Form("mPtDen_%s", title[i].c_str()), Form("Pt distribution of %s tracks %s; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
254 mPtDen[i]->Sumw2();
255 mPtDen[i]->SetOption("logy");
256 mPtDen[i]->GetYaxis()->SetTitleOffset(1.4);
257 mFractionITSTPCmatch[i] = new TEfficiency(Form("mFractionITSTPCmatch_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks wrt %s tracks vs Pt %s; Pt [GeV/c]; Eff", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
258 mPtNum_noEta0[i] = new TH1D(Form("mPtNum_noEta0_%s", title[i].c_str()), Form("Pt distribution of ITSTPC matched tracks without |eta| < %.2f, wrt %s tracks %s; Pt [GeV/c]; dNdPt", mEtaNo0Cut, title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
259 mPtNum_noEta0[i]->Sumw2();
260 mPtNum_noEta0[i]->SetOption("logy");
261 mPtNum_noEta0[i]->GetYaxis()->SetTitleOffset(1.4);
262 mPtDen_noEta0[i] = new TH1D(Form("mPtDen_noEta0_%s", title[i].c_str()), Form("Pt distribution of %s tracks without |eta| < %.2f %s; Pt [GeV/c]; dNdPt", title[i].c_str(), mEtaNo0Cut, etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
263 mPtDen_noEta0[i]->Sumw2();
264 mPtDen_noEta0[i]->SetOption("logy");
265 mPtDen_noEta0[i]->GetYaxis()->SetTitleOffset(1.4);
266 mFractionITSTPCmatch_noEta0[i] = new TEfficiency(Form("mFractionITSTPCmatch_noEta0_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks wrt %s tracks vs Pt without |eta| < %.2f %s; Pt [GeV/c]; Eff", title[i].c_str(), mEtaNo0Cut, etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut);
267
268 // Phi
269 mPhiNum[i] = new TH1F(Form("mPhiNum_%s", title[i].c_str()), Form("Phi distribution of ITSTPC matched tracks, wrt %s tracks %s; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
270 mPhiNum[i]->Sumw2();
271 mPhiDen[i] = new TH1F(Form("mPhiDen_%s", title[i].c_str()), Form("Phi distribution of %s tracks %s; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
272 mPhiDen[i]->Sumw2();
273 mFractionITSTPCmatchPhi[i] = new TEfficiency(Form("mFractionITSTPCmatchPhi_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Phi wrt %s tracks %s; Phi [rad]; Eff", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
274 mPhiVsPtNum[i] = new TH2F(Form("mPhiVsPtNum_%s", title[i].c_str()), Form("Phi vs Pt distribution of ITSTPC matched tracks wrt %s %s; #it{p}_{T} [GeV#it{c}]; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, 0.f, 2 * TMath::Pi());
275 mPhiVsPtNum[i]->Sumw2();
276 mPhiVsPtDen[i] = new TH2F(Form("mPhiVsPtDen_%s", title[i].c_str()), Form("Phi vs Pt distribution of %s tracks %s; #it{p}_{T} [GeV#it{c}]; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, 0.f, 2 * TMath::Pi());
277 mPhiVsPtDen[i]->Sumw2();
278 mFractionITSTPCmatchPhiVsPt[i] = new TEfficiency(Form("mFractionITSTPCmatchPhiVsPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks wrt %s tracks %s, Phi vs Pt; #it{p}_{T} [GeV#it{c}]; Phi [rad]; Eff", title[i].c_str(), etaSel[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, 0.f, 2 * TMath::Pi());
279
280 // Eta
281 mEtaNum[i] = new TH1F(Form("mEtaNum_%s", title[i].c_str()), Form("Eta distribution of ITSTPC matched tracks, wrt %s tracks; Eta; dNdEta", title[i].c_str()), 100, -2.f, 2.f);
282 mEtaNum[i]->Sumw2();
283 mEtaNum[i]->GetYaxis()->SetTitleOffset(1.4);
284 mEtaDen[i] = new TH1F(Form("mEtaDen_%s", title[i].c_str()), Form("Eta distribution of %s tracks; Eta; dNdEta", title[i].c_str()), 100, -2.f, 2.f);
285 mEtaDen[i]->Sumw2();
286 mEtaDen[i]->GetYaxis()->SetTitleOffset(1.4);
287 mFractionITSTPCmatchEta[i] = new TEfficiency(Form("mFractionITSTPCmatchEta_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks , wrt %s tracks, vs Eta; Eta; Eff", title[i].c_str()), 100, -2.f, 2.f);
288 mEtaVsPtNum[i] = new TH2F(Form("mEtaVsPtNum_%s", title[i].c_str()), Form("Eta vs Pt distribution of ITSTPC matched tracks, wrt %s tracks; #it{p}_{T} [GeV#it{c}]; Eta", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, -2.f, 2.f);
289 mEtaVsPtNum[i]->Sumw2();
290 mEtaVsPtDen[i] = new TH2F(Form("mEtaVsPtDen_%s", title[i].c_str()), Form("Eta vs Pt distribution of %s tracks; #it{p}_{T} [GeV#it{c}]; Eta", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, -2.f, 2.f);
291 mEtaVsPtDen[i]->Sumw2();
292 mFractionITSTPCmatchEtaVsPt[i] = new TEfficiency(Form("mFractionITSTPCmatchEtaVsPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks, wrt %s tracks, Eta vs Pt; #it{p}_{T} [GeV#it{c}]; Eta; Eff", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 100, -2.f, 2.f);
293
294 // Clusters
295 mClsVsPtNum[i] = new TH2F(Form("mClsVsPtNum_%s", title[i].c_str()), Form("#Clusters vs Pt distribution of ITSTPC matched tracks, wrt %s tracks; #it{p}_{T} [GeV#it{c}]; #Clusters", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, maxNCls[i], 0, maxNCls[i]);
296 mClsVsPtNum[i]->Sumw2();
297 mClsVsPtDen[i] = new TH2F(Form("mClsVsPtDen_%s", title[i].c_str()), Form("#Clusters vs Pt distribution of %s tracks; #it{p}_{T} [GeV#it{c}]; #Clusters", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, maxNCls[i], 0, maxNCls[i]);
298 mClsVsPtDen[i]->Sumw2();
299 mFractionITSTPCmatchClsVsPt[i] = new TEfficiency(Form("mFractionITSTPCmatchClsVsPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks, wrt %s tracks, #Clusters vs Pt; #it{p}_{T} [GeV#it{c}]; #Clusters; Eff", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, maxNCls[i], 0, maxNCls[i]);
300
301 // Chi2
302 mChi2VsPtNum[i] = new TH2F(Form("mChi2VsPtNum_%s", title[i].c_str()), Form("Chi2 vs Pt distribution of ITSTPC matched tracks, wrt %s tracks; #it{p}_{T} [GeV#it{c}]; Chi2", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 200, 0, 300);
303 mChi2VsPtNum[i]->Sumw2();
304 mChi2VsPtDen[i] = new TH2F(Form("mChi2VsPtDen_%s", title[i].c_str()), Form("Chi2 vs Pt distribution of %s tracks; #it{p}_{T} [GeV#it{c}]; Chi2", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 200, 0, 300);
305 mChi2VsPtDen[i]->Sumw2();
306 mFractionITSTPCmatchChi2VsPt[i] = new TEfficiency(Form("mFractionITSTPCmatchChi2VsPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks, wrt %s tracks, Chi2 vs Pt; #it{p}_{T} [GeV#it{c}]; Chi2; Eff", title[i].c_str()), mPtBins, mPtCut, mPtMaxCut, 200, 0, 300);
307
308 // 1/pt
309 m1OverPtNum[i] = new TH1D(Form("m1OverPtNum_%s", title[i].c_str()), Form("1/Pt distribution of matched tracks, wrt %s tracks %s; 1/Pt [c/GeV]; dNdPt", title[i].c_str(), etaSel[i].c_str()), 100, -20.f, 20.f);
310 m1OverPtNum[i]->Sumw2();
311 m1OverPtDen[i] = new TH1D(Form("m1OverPtDen_%s", title[i].c_str()), Form("1/Pt distribution of %s tracks %s; 1/Pt [c/GeV]; dNdPt", title[i].c_str(), etaSel[i].c_str()), 100, -20.f, 20.f);
312 m1OverPtDen[i]->Sumw2();
313 mFractionITSTPCmatch1OverPt[i] = new TEfficiency(Form("mFractionITSTPCmatch1OverPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs 1/Pt, wrt %s tracks %s; 1/Pt [c/GeV]; Eff", title[i].c_str(), etaSel[i].c_str()), 100, -20.f, 20.f);
314
315 // 3d eta/phi/pt
316 mEtaPhiPtNum[i] = new TH3F(Form("mEtaPhiPtNum_%s", title[i].c_str()), Form("Numerator #eta vs #varphi vs #it{p}_{T}, wrt %s;#eta %s;#varphi;#it{p}_{T} [GeV#it{c}];Entries", title[i].c_str(), etaSel[i].c_str()), 100, -2., 2., 100, 0., 2 * TMath::Pi(), 100, 0.01, 20.);
317 mEtaPhiPtNum[i]->Sumw2();
318 mEtaPhiPtDen[i] = new TH3F(Form("mEtaPhiPtDen_%s", title[i].c_str()), Form("Denominator #eta vs #varphi vs #it{p}_{T}, wrt %s;#eta %s;#varphi;#it{p}_{T} [GeV#it{c}];Entries", title[i].c_str(), etaSel[i].c_str()), 100, -2., 2., 100, 0., 2 * TMath::Pi(), 100, 0.01, 20.);
319 mEtaPhiPtDen[i]->Sumw2();
320
321 if (mUseTrkPID) { // Vs Tracking PID hypothesis
322 for (int j = 0; j < o2::track::PID::NIDs; ++j) {
323 // Pt
324 mPtNumVsTrkPID[i][j] = new TH1D(Form("mPtNumVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Pt distribution of ITSTPC matched tracks, wrt %s tracks %s, TrkPID %i; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str(), j), mPtBins, mPtCut, mPtMaxCut);
325 mPtNumVsTrkPID[i][j]->Sumw2();
326 mPtDenVsTrkPID[i][j] = new TH1D(Form("mPtDenVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Pt distribution of %s tracks %s, TrkPID %i; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str(), j), mPtBins, mPtCut, mPtMaxCut);
327 mPtDenVsTrkPID[i][j]->Sumw2();
328 mFractionITSTPCmatchPtVsTrkPID[i][j] = new TEfficiency(Form("mFractionITSTPCmatchPtVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Fraction of ITSTPC matched tracks wrt %s tracks vs Pt %s, TrkPID %i; Pt [GeV/c]; Eff", title[i].c_str(), etaSel[i].c_str(), j), mPtBins, mPtCut, mPtMaxCut);
329
330 // Phi
331 mPhiNumVsTrkPID[i][j] = new TH1D(Form("mPhiNumVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Phi distribution of ITSTPC matched tracks, wrt %s tracks %s, TrkPID %i; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str(), j), 100, 0.f, 2 * TMath::Pi());
332 mPhiNumVsTrkPID[i][j]->Sumw2();
333 mPhiDenVsTrkPID[i][j] = new TH1D(Form("mPhiDenVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Phi distribution of %s tracks %s, TrkPID %i; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str(), j), 100, 0.f, 2 * TMath::Pi());
334 mPhiDenVsTrkPID[i][j]->Sumw2();
335 mFractionITSTPCmatchPhiVsTrkPID[i][j] = new TEfficiency(Form("mFractionITSTPCmatchPhiVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Fraction of ITSTPC matched tracks wrt %s tracks vs Phi %s, TrkPID %i; Phi [rad]; Eff", title[i].c_str(), etaSel[i].c_str(), j), 100, 0.f, 2 * TMath::Pi());
336
337 // Eta
338 mEtaNumVsTrkPID[i][j] = new TH1D(Form("mEtaNumVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Eta distribution of ITSTPC matched tracks, wrt %s tracks %s, TrkPID %i; Eta; dNdEta", title[i].c_str(), etaSel[i].c_str(), j), 100, -2.f, 2.f);
339 mEtaNumVsTrkPID[i][j]->Sumw2();
340 mEtaDenVsTrkPID[i][j] = new TH1D(Form("mEtaDenVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Eta distribution of %s tracks %s, TrkPID %i; Eta; dNdEta", title[i].c_str(), etaSel[i].c_str(), j), 100, -2.f, 2.f);
341 mEtaDenVsTrkPID[i][j]->Sumw2();
342 mFractionITSTPCmatchEtaVsTrkPID[i][j] = new TEfficiency(Form("mFractionITSTPCmatchEtaVsTrkPID_%s_PID%i", title[i].c_str(), j), Form("Fraction of ITSTPC matched tracks wrt %s tracks vs Eta %s, TrkPID %i; Eta; Eff", title[i].c_str(), etaSel[i].c_str(), j), 100, -2.f, 2.f);
343 }
344 }
345 }
346
347 mResidualPt = new TH2F("mResidualPt", "Residuals of ITS-TPC matching in #it{p}_{T}; #it{p}_{T}^{ITS-TPC} [GeV/c]; #it{p}_{T}^{ITS-TPC} - #it{p}_{T}^{TPC} [GeV/c]", mPtBins, mPtCut, mPtMaxCut, 100, -1.f, 1.f);
348 mResidualPhi = new TH2F("mResidualPhi", "Residuals of ITS-TPC matching in #it{#phi}; #it{#phi}^{ITS-TPC} [rad]; #it{#phi}^{ITS-TPC} - #it{#phi}^{TPC} [rad]", 100, 0.f, 2 * TMath::Pi(), 100, -1.f, 1.f);
349 mResidualEta = new TH2F("mResidualEta", "Residuals of ITS-TPC matching in #it{#eta}; #it{#eta}^{ITS-TPC}; #it{#eta}^{ITS-TPC} - #it{#eta}^{TPC}", 100, -2.f, 2.f, 100, -1.f, 1.f);
350 mChi2Matching = new TH1F("mChi2Matching", "Chi2 of matching; chi2", 200, 0, 300);
351 mChi2Matching->SetOption("logy");
352 mChi2Matching->GetYaxis()->SetTitleOffset(1.4);
353 mChi2Refit = new TH1F("mChi2Refit", "Chi2 of refit; chi2", 200, 0, 300);
354 mChi2Refit->SetOption("logy");
355 mChi2Refit->GetYaxis()->SetTitleOffset(1.4);
356 mDCAr = new TH1F("mDCAr", "DCA of TPC tracks; DCAr", 100, -mDCATPCCutY, mDCATPCCutY);
357 mDCArVsPtNum = new TH2F("mDCArVsPtNum", "DCA of TPC tracks Vs Pt Num; #it{p}_{T} [GeV/c]; DCAr", 100, 0, 20., 100, -mDCATPCCutY, mDCATPCCutY);
358 mDCArVsPtNum->Sumw2();
359 mDCArVsPtDen = new TH2F("mDCArVsPtDen", "DCA of TPC tracks Vs Pt Den; #it{p}_{T} [GeV/c]; DCAr", 100, 0, 20., 100, -mDCATPCCutY, mDCATPCCutY);
360 mDCArVsPtDen->Sumw2();
361 mFractionITSTPCmatchDCArVsPt = new TEfficiency("mFractionITSTPCmatchDCArVsPt", "Fraction of ITSTPC matched tracks wrt TPC vs DCAr; #it{p}_{T} [GeV#it{c}]; DCAr; Eff", 100, 0, 20., 200, -30, 30);
362
363 mTimeResVsPt = new TH2F("mTimeResVsPt", "Time resolution vs Pt; Pt [GeV/c]; time res [us]", nbinsPt, xbinsPt, 100, 0.f, 2.f);
364 mTimeResVsPt->SetOption("colz logz logy logx");
365 mTimeResVsPt->GetYaxis()->SetTitleOffset(1.4);
366
367 if (mUseMC) {
368 mcReader.initFromDigitContext("collisioncontext.root");
369
370 for (int i = 0; i < matchType::SIZE; ++i) {
371 mPtPhysPrimNum[i] = new TH1F(Form("mPtPhysPrimNum_%s", title[i].c_str()), Form("Pt distribution of matched tracks (physical primary), wrt %s tracks %s; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str()), nbinsPt, xbinsPt);
372 mPtPhysPrimNum[i]->Sumw2();
373 mPtPhysPrimDen[i] = new TH1F(Form("mPtPhysPrimDen_%s", title[i].c_str()), Form("Pt distribution of %s tracks (physical primary) %s; Pt [GeV/c]; dNdPt", title[i].c_str(), etaSel[i].c_str()), nbinsPt, xbinsPt);
374 mPtPhysPrimDen[i]->Sumw2();
375 mFractionITSTPCmatchPhiPhysPrim[i] = new TEfficiency(Form("mFractionITSTPCmatchPhiPhysPrim_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Phi (physical primary), wrt %s tracks %s; Phi [rad]; Eff", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
376
377 mEtaPhysPrimNum[i] = new TH1F(Form("mEtaPhysPrimNum_%s", title[i].c_str()), Form("Eta distribution of matched tracks (physical primary), wrt %s tracks; Eta; dNdEta", title[i].c_str()), 100, -2.f, 2.f);
378 mEtaPhysPrimNum[i]->Sumw2();
379 mEtaPhysPrimDen[i] = new TH1F(Form("mEtaPhysPrimDen_%s", title[i].c_str()), Form("Eta distribution of %s tracks (physical primary); Eta; dNdEta", title[i].c_str()), 100, -2.f, 2.f);
380 mEtaPhysPrimDen[i]->Sumw2();
381 mFractionITSTPCmatchEtaPhysPrim[i] = new TEfficiency(Form("mFractionITSTPCmatchEtaPhysPrim_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Eta (physical primary), wrt %s tracks; Eta; Eff", title[i].c_str()), 100, -2.f, 2.f);
382
383 mPhiPhysPrimNum[i] = new TH1F(Form("mPhiPhysPrimNum_%s", title[i].c_str()), Form("Phi distribution of matched tracks (physical primary), wrt %s tracks %s; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
384 mPhiPhysPrimNum[i]->Sumw2();
385 mPhiPhysPrimDen[i] = new TH1F(Form("mPhiPhysPrimDen_%s", title[i].c_str()), Form("Phi distribution of %s tracks (physical primary) %s; Phi [rad]; dNdPhi", title[i].c_str(), etaSel[i].c_str()), 100, 0.f, 2 * TMath::Pi());
386 mPhiPhysPrimDen[i]->Sumw2();
387 mFractionITSTPCmatchPhysPrim[i] = new TEfficiency(Form("mFractionITSTPCmatchPhysPrim_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Pt (physical primary), wrt %s tracks %s; Pt [GeV/c]; Eff", title[i].c_str(), etaSel[i].c_str()), nbinsPt, xbinsPt);
388
389 m1OverPtPhysPrimNum[i] = new TH1D(Form("m1OverPtPhysPrimNum_%s", title[i].c_str()), Form("1/Pt distribution of matched tracks (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
390 m1OverPtPhysPrimNum[i]->Sumw2();
391 m1OverPtPhysPrimDen[i] = new TH1D(Form("m1OverPtPhysPrimDen_%s", title[i].c_str()), Form("1/PtPt distribution of %s tracks (physical primary) %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
392 m1OverPtPhysPrimDen[i]->Sumw2();
393 mFractionITSTPCmatchPhysPrim1OverPt[i] = new TEfficiency(Form("mFractionITSTPCmatchPhysPrim1OverPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs 1/Pt (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; Eff", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
394 }
395 }
396
397 // log binning for pT for K0s
398 const Int_t nbinsPtK0 = 10;
399 const Double_t xminPtK0 = 0.01;
400 const Double_t xmaxPtK0 = 20;
401 Double_t* xbinsPtK0 = new Double_t[nbinsPtK0 + 1];
402 Double_t xlogminPtK0 = TMath::Log10(xminPtK0);
403 Double_t xlogmaxPtK0 = TMath::Log10(xmaxPtK0);
404 Double_t dlogxPtK0 = (xlogmaxPtK0 - xlogminPtK0) / nbinsPtK0;
405 for (int i = 0; i <= nbinsPtK0; i++) {
406 Double_t xlogPtK0 = xlogminPtK0 + i * dlogxPtK0;
407 xbinsPtK0[i] = TMath::Exp(TMath::Log(10) * xlogPtK0);
408 }
409 // the other bins
410 const Int_t nbinsMassK0 = 100;
411 Double_t* ybinsMassK0 = new Double_t[nbinsMassK0 + 1];
412 Double_t yminMassK0 = 0.4;
413 Double_t ymaxMassK0 = 0.6;
414 Double_t dyMassK0 = (ymaxMassK0 - yminMassK0) / nbinsMassK0;
415 for (int i = 0; i <= nbinsMassK0; i++) {
416 ybinsMassK0[i] = yminMassK0 + i * dyMassK0;
417 }
418 const Int_t nbinsMultK0pp = mNBinsTPCOccpp;
419 Double_t* zbinsMultK0pp = new Double_t[nbinsMultK0pp + 1];
420 Double_t zminMultK0pp = mMinTPCOccpp;
421 Double_t zmaxMultK0pp = mMaxTPCOccpp;
422 Double_t dzMultK0pp = (zmaxMultK0pp - zminMultK0pp) / nbinsMultK0pp;
423 for (int i = 0; i <= nbinsMultK0pp; i++) {
424 zbinsMultK0pp[i] = zminMultK0pp + i * dzMultK0pp;
425 }
426
427 const Int_t nbinsMultK0PbPb = mNBinsTPCOccPbPb;
428 Double_t* zbinsMultK0PbPb = new Double_t[nbinsMultK0PbPb + 1];
429 Double_t zminMultK0PbPb = mMinTPCOccPbPb;
430 Double_t zmaxMultK0PbPb = mMaxTPCOccPbPb;
431 Double_t dzMultK0PbPb = (zmaxMultK0PbPb - zminMultK0PbPb) / nbinsMultK0PbPb;
432 for (int i = 0; i <= nbinsMultK0PbPb; i++) {
433 zbinsMultK0PbPb[i] = zminMultK0PbPb + i * dzMultK0PbPb;
434 }
435
436 if (mDoK0QC) {
437 // V0s
438 mK0MassVsPtVsOccpp = new TH3F("mK0MassVsPtVsOccpp", "K0 invariant mass vs Pt vs TPC occupancy; Pt [GeV/c]; K0s mass [GeV/c^2]; TPC occ.", nbinsPtK0, xbinsPtK0, nbinsMassK0, ybinsMassK0, nbinsMultK0pp, zbinsMultK0pp);
439
440 mK0MassVsPtVsOccPbPb = new TH3F("mK0MassVsPtVsOccPbPb", "K0 invariant mass vs Pt vs TPC occupancy; Pt [GeV/c]; K0s mass [GeV/c^2]; TPC occ", nbinsPtK0, xbinsPtK0, nbinsMassK0, ybinsMassK0, nbinsMultK0PbPb, zbinsMultK0PbPb);
441 }
442
443 LOG(info) << "Printing configuration cuts";
444 printParams();
445
446 delete[] xbinsPt;
447 delete[] xbinsPtK0;
448 delete[] ybinsMassK0;
449 delete[] zbinsMultK0pp;
450 delete[] zbinsMultK0PbPb;
451
452 return true;
453}
454
455//__________________________________________________________
456
458{
459
460 // initialize data request, if it was not already done
461
462 mSrc &= mAllowedSources;
463
464 if (!mSrc[GID::Source::ITSTPC] || !mSrc[GID::Source::TPC] || !mSrc[GID::Source::ITS]) {
465 LOG(fatal) << "We cannot do ITSTPC QC, some sources are missing, check sources in " << mSrc;
466 }
467
468 mDataRequest = std::make_shared<o2::globaltracking::DataRequest>();
469 mDataRequest->requestTracks(mSrc, mUseMC);
470 if (mDoK0QC) {
471 mDataRequest->requestPrimaryVertices(mUseMC);
472 mDataRequest->requestSecondaryVertices(mUseMC);
473 mDataRequest->requestTPCOccMap();
474 }
475}
476
477//__________________________________________________________
478
480{
481 // Getting the B field
482 mBz = o2::base::Propagator::Instance()->getNominalBz();
483
484 // Getting the SVertexer config params
485 if (mTimestamp == -1 && mDoK0QC) {
486 // we have not yet initialized the SVertexer params; let's do it
487 ctx.inputs().get<o2::vertexing::SVertexerParams*>("SVParam");
488 const auto& svparam = o2::vertexing::SVertexerParams::Instance();
489 mFitterV0.setUseAbsDCA(svparam.useAbsDCA);
490 mFitterV0.setMaxR(svparam.maxRIni);
491 mFitterV0.setMinParamChange(svparam.minParamChange);
492 mFitterV0.setMinRelChi2Change(svparam.minRelChi2Change);
493 mFitterV0.setMaxDZIni(svparam.maxDZIni);
494 mFitterV0.setMaxDXYIni(svparam.maxDXYIni);
495 mFitterV0.setMaxChi2(svparam.maxChi2);
496 mFitterV0.setMatCorrType(o2::base::Propagator::MatCorrType(svparam.matCorr));
497 mFitterV0.setUsePropagator(svparam.usePropagator);
498 mFitterV0.setRefitWithMatCorr(svparam.refitWithMatCorr);
499 mFitterV0.setMaxStep(svparam.maxStep);
500 mFitterV0.setMaxSnp(svparam.maxSnp);
501 mFitterV0.setMinXSeed(svparam.minXSeed);
502
503 mTimestamp = ctx.services().get<o2::framework::TimingInfo>().creation;
505 if (grplhcif->getBeamZ(0) != 1 || grplhcif->getBeamZ(1) != 1) {
506 LOG(info) << "We are in Heavy Ion: Z for beam 0 = " << grplhcif->getBeamZ(0) << " ; Z for beam 1 = " << grplhcif->getBeamZ(1);
507 mIsHI = true;
508 } else {
509 LOG(info) << "We are not in Heavy Ion: Z for beam 0 = " << grplhcif->getBeamZ(0) << " ; Z for beam 1 = " << grplhcif->getBeamZ(1);
510 }
511 }
512
513 static int evCount = 0;
514 mRecoCont.collectData(ctx, *mDataRequest);
515 mTPCTracks = mRecoCont.getTPCTracks();
516 mITSTracks = mRecoCont.getITSTracks();
517 mITSTPCTracks = mRecoCont.getTPCITSTracks();
518
519 LOG(info) << "****** Number of found ITSTPC tracks = " << mITSTPCTracks.size();
520 LOG(info) << "****** Number of found TPC tracks = " << mTPCTracks.size();
521 LOG(info) << "****** Number of found ITS tracks = " << mITSTracks.size();
522
523 // cache selection for TPC and ITS tracks
524 std::vector<bool> isTPCTrackSelectedEntry(mTPCTracks.size(), false);
525 std::vector<bool> isITSTrackSelectedEntry(mITSTracks.size(), false);
526 TrackCuts cuts;
527 // ITS track
528 cuts.setMinPtITSCut(mPtITSCut);
529 cuts.setEtaITSCut(mEtaITSCut);
530 cuts.setMinNClustersITS(mMinNClustersITS);
531 cuts.setMaxChi2PerClusterITS(mMaxChi2PerClusterITS);
532 for (auto it = mRequiredITSHits.begin(); it != mRequiredITSHits.end(); it++) {
533 cuts.setRequireHitsInITSLayers((*it).first, (*it).second);
534 }
535 // TPC track
536 cuts.setMinPtTPCCut(mPtTPCCut);
537 cuts.setEtaTPCCut(mEtaTPCCut);
538 cuts.setMinNTPCClustersCut(mNTPCClustersCut);
539 cuts.setMaxDCATPCCut(mDCATPCCut);
540 cuts.setMaxDCATPCCutY(mDCATPCCutY);
541 // ITS-TPC track kinematics
542 cuts.setMinPtCut(mPtCut);
543 cuts.setMaxPtCut(mPtMaxCut);
544 cuts.setEtaCut(-mEtaCut, mEtaCut);
545
546 for (size_t itrk = 0; itrk < mTPCTracks.size(); ++itrk) {
547 auto const& trkTpc = mTPCTracks[itrk];
549 if (cuts.isSelected(id, mRecoCont)) {
550 // NB: same cuts for numerator and denominator tracks of ITS-TPC matching
551 // To change cuts only for numerator, something like o2::dataformats::GlobalTrackID id(itrk, GID::ITSTPC) is necessary
552 isTPCTrackSelectedEntry[itrk] = true;
553 }
554 }
555
556 for (size_t itrk = 0; itrk < mITSTracks.size(); ++itrk) {
557 auto const& trkIts = mITSTracks[itrk];
559 if (cuts.isSelected(id, mRecoCont)) {
560 // NB: same cuts for numerator and denominator tracks of ITS-TPC matching
561 // To change cuts only for numerator, something like o2::dataformats::GlobalTrackID id(itrk, GID::ITSTPC) is necessary
562 isITSTrackSelectedEntry[itrk] = true;
563 }
564 }
565
566 // numerator + eta, chi2...
567 if (mUseMC) {
568 for (int i = 0; i < matchType::SIZE; ++i) {
569 mMapLabels[i].clear();
570 }
571 for (int itrk = 0; itrk < static_cast<int>(mITSTPCTracks.size()); ++itrk) {
572 auto const& trk = mITSTPCTracks[itrk];
573 auto idxTrkTpc = trk.getRefTPC().getIndex();
574 if (trk.getRefITS().getSource() != GID::ITS) {
575 continue;
576 }
577 if (isTPCTrackSelectedEntry[idxTrkTpc]) {
578 auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::ITSTPC});
579 if (!lbl.isValid()) {
580 continue;
581 }
582 if (mMapLabels[matchType::TPC].find(lbl) == mMapLabels[matchType::TPC].end()) {
583 int source = lbl.getSourceID();
584 int event = lbl.getEventID();
585 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks(source, event);
586 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
587 if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) {
588 mMapLabels[matchType::TPC].insert({lbl, {.mIdx = itrk, .mIsPhysicalPrimary = true}});
589 } else {
590 mMapLabels[matchType::TPC].insert({lbl, {.mIdx = itrk, .mIsPhysicalPrimary = false}});
591 }
592 } else {
593 // winner (if more tracks have the same label) has the highest pt
594 if (mITSTPCTracks[mMapLabels[matchType::TPC].at(lbl).mIdx].getPt() < trk.getPt()) {
595 mMapLabels[matchType::TPC].at(lbl).mIdx = itrk;
596 }
597 }
598 }
599 auto idxTrkIts = trk.getRefITS().getIndex();
600 if (isITSTrackSelectedEntry[idxTrkIts]) {
601 auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::ITSTPC});
602 if (!lbl.isValid()) {
603 continue;
604 }
605 if (mMapLabels[matchType::ITS].find(lbl) == mMapLabels[matchType::ITS].end()) {
606 int source = lbl.getSourceID();
607 int event = lbl.getEventID();
608 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks(source, event);
609 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
610 if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) {
611 mMapLabels[matchType::ITS].insert({lbl, {.mIdx = itrk, .mIsPhysicalPrimary = true}});
612 } else {
613 mMapLabels[matchType::ITS].insert({lbl, {.mIdx = itrk, .mIsPhysicalPrimary = false}});
614 }
615 } else {
616 // winner (if more tracks have the same label) has the highest pt
617 if (mITSTPCTracks[mMapLabels[matchType::ITS].at(lbl).mIdx].getPt() < trk.getPt()) {
618 mMapLabels[matchType::ITS].at(lbl).mIdx = itrk;
619 }
620 }
621 }
622 }
623 LOG(debug) << "number of entries in map for nominator (without duplicates) = " << mMapLabels.size();
624 // now we use only the tracks in the map to fill the histograms (--> tracks have passed the
625 // track selection and there are no duplicated tracks wrt the same MC label)
626 for (int i = 0; i < matchType::SIZE; ++i) {
627 for (auto const& el : mMapLabels[i]) {
628 auto const& trk = mITSTPCTracks[el.second.mIdx];
630 bool isEtaITSOk = true;
631 if (i == matchType::TPC) {
632 trkDen = mTPCTracks[trk.getRefTPC()];
633 } else {
634 trkDen = mITSTracks[trk.getRefITS()];
635 if (std::abs(trkDen.getEta()) > mEtaITSCut) {
636 // ITS track outside |eta | < 0.9, we don't fill pt, nor phi , nor phi vs pt histos
637 isEtaITSOk = false;
638 }
639 }
640 if (isEtaITSOk) {
641 mPtNum[i]->Fill(trkDen.getPt());
642 if (std::abs(trkDen.getEta()) > mEtaNo0Cut) {
643 mPtNum_noEta0[i]->Fill(trkDen.getPt());
644 }
645 mPhiNum[i]->Fill(trkDen.getPhi());
646 mPhiVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getPhi());
647 m1OverPtNum[i]->Fill(trkDen.getSign() * trkDen.getPtInv());
648 mEtaPhiPtNum[i]->Fill(trkDen.getEta(), trkDen.getPhi(), trkDen.getPt());
649 // we fill also the denominator
650 mPtDen[i]->Fill(trkDen.getPt());
651 if (std::abs(trkDen.getEta()) > mEtaNo0Cut) {
652 mPtDen_noEta0[i]->Fill(trkDen.getPt());
653 }
654 mPhiDen[i]->Fill(trkDen.getPhi());
655 mPhiVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getPhi());
656 m1OverPtDen[i]->Fill(trkDen.getSign() * trkDen.getPtInv());
657 mEtaPhiPtDen[i]->Fill(trkDen.getEta(), trkDen.getPhi(), trkDen.getPt());
658 if (mUseTrkPID) { // Vs Tracking PID hypothesis
659 mPtNumVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getPt());
660 mPhiNumVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getPhi());
661 // we fill also the denominator
662 mPtDenVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getPt());
663 mPhiDenVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getPhi());
664 }
665 }
666 mEtaNum[i]->Fill(trkDen.getEta());
667 mEtaVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getEta());
668 // we fill also the denominator
669 mEtaDen[i]->Fill(trkDen.getEta());
670 mEtaVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getEta());
671 if (i == matchType::TPC) {
672 auto tpcTrk = mTPCTracks[trk.getRefTPC()];
673 mClsVsPtNum[i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
674 mChi2VsPtNum[i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
675 mClsVsPtDen[i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
676 mChi2VsPtDen[i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
678 std::array<float, 2> dca{};
679 if (tpcTrk.propagateParamToDCA(v, mBz, &dca)) {
680 mDCArVsPtNum->Fill(tpcTrk.getPt(), dca[0]);
681 mDCArVsPtDen->Fill(tpcTrk.getPt(), dca[0]);
682 }
683 } else {
684 const auto& itsTrk = mITSTracks[trk.getRefITS()];
685 mClsVsPtNum[i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
686 mChi2VsPtNum[i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
687 mClsVsPtDen[i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
688 mChi2VsPtDen[i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
689 }
690 if (mUseTrkPID) { // Vs Tracking PID hypothesis
691 mEtaNumVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getEta());
692 // we fill also the denominator
693 mEtaDenVsTrkPID[i][trkDen.getPID()]->Fill(trkDen.getEta());
694 }
695 if (el.second.mIsPhysicalPrimary) {
696 if (isEtaITSOk) {
697 mPtPhysPrimNum[i]->Fill(trkDen.getPt());
698 mPhiPhysPrimNum[i]->Fill(trkDen.getPhi());
699 m1OverPtPhysPrimNum[i]->Fill(trkDen.getSign() * trkDen.getPtInv());
700 // we fill also the denominator
701 mPtPhysPrimDen[i]->Fill(trkDen.getPt());
702 mPhiPhysPrimDen[i]->Fill(trkDen.getPhi());
703 m1OverPtPhysPrimDen[i]->Fill(trkDen.getSign() * trkDen.getPtInv());
704 }
705 mEtaPhysPrimNum[i]->Fill(trkDen.getEta());
706 // we fill also the denominator
707 mEtaPhysPrimDen[i]->Fill(trkDen.getEta());
708 }
709 ++mNITSTPCSelectedTracks[i];
710 }
711 }
712 }
713 int iITSTPC = 0;
714 for (auto const& trk : mITSTPCTracks) {
715 if (trk.getRefTPC().getIndex() >= mTPCTracks.size()) {
716 LOG(fatal) << "******************** ATTENTION! for TPC track associated to matched track: idx = " << trk.getRefTPC().getIndex() << ", size of container = " << mTPCTracks.size() << " in TF " << evCount;
717 }
718 std::array<std::string, 2> title{"TPC", "ITS"};
719 for (int i = 0; i < matchType::SIZE; ++i) {
721 unsigned int idxTrkRef{0};
722 bool fillHisto = false;
723 bool isEtaITSOk = true;
724 if (i == matchType::TPC) {
725 trkRef = mTPCTracks[trk.getRefTPC()];
726 idxTrkRef = trk.getRefTPC().getIndex();
727 if (isTPCTrackSelectedEntry[idxTrkRef]) {
728 fillHisto = true;
729 ++mNITSTPCSelectedTracks[i];
730 }
731 } else {
732 idxTrkRef = trk.getRefITS().getIndex();
733 if (trk.getRefITS().getSource() == GID::ITSAB) {
734 // do not use afterburner tracks
735 LOG(debug) << "Track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " is from afterburner";
736 continue;
737 }
738 if (idxTrkRef >= mITSTracks.size()) {
739 LOG(fatal) << "******************** ATTENTION! for ITS track associated to matched track (NOT from AB): idx = " << trk.getRefITS().getIndex() << ", size of container = " << mITSTracks.size() << " in TF " << evCount;
740 }
741 trkRef = mITSTracks[trk.getRefITS()];
742 LOG(debug) << "Checking track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " and pt = " << trkRef.getPt();
743 if (isITSTrackSelectedEntry[idxTrkRef]) {
744 LOG(debug) << "Track was selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we keep it in the numerator, pt = " << trkRef.getPt();
745 fillHisto = true;
746 ++mNITSTPCSelectedTracks[i];
747 } else {
748 LOG(debug) << "Track was not selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we don't keep it in the numerator, pt = " << trkRef.getPt();
749 }
750 if (std::abs(trkRef.getEta()) > mEtaITSCut) {
751 // ITS track outside |eta | < 0.9, we don't fill pt, nor phi , nor phi vs pt histos
752 isEtaITSOk = false;
753 LOG(debug) << "Track (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " will be discarded when filling pt of phi related histograms, since eta = " << trkRef.getEta() << " , we don't keep it in the numerator, pt = " << trkRef.getPt();
754 }
755 }
756 if (fillHisto) {
757 if (!mUseMC) {
758 LOG(debug) << "Filling num (" << title[i] << ") with track with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " with pt = " << trkRef.getPt();
759 if (isEtaITSOk) {
760 mPtNum[i]->Fill(trkRef.getPt());
761 if (std::abs(trkRef.getEta()) > mEtaNo0Cut) {
762 mPtNum_noEta0[i]->Fill(trkRef.getPt());
763 }
764 mPhiNum[i]->Fill(trkRef.getPhi());
765 if (mUseTrkPID) { // Vs Tracking PID hypothesis
766 mPtNumVsTrkPID[i][trkRef.getPID()]->Fill(trkRef.getPt());
767 mPhiNumVsTrkPID[i][trkRef.getPID()]->Fill(trkRef.getPhi());
768 }
769 mPhiVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getPhi());
770 m1OverPtNum[i]->Fill(trkRef.getSign() * trkRef.getPtInv());
771 mEtaPhiPtNum[i]->Fill(trkRef.getEta(), trkRef.getPhi(), trkRef.getPt());
772 }
773 mEtaNum[i]->Fill(trkRef.getEta());
774 if (mUseTrkPID) { // Vs Tracking PID hypothesis
775 mEtaNumVsTrkPID[i][trkRef.getPID()]->Fill(trkRef.getEta());
776 }
777 mEtaVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getEta());
778 if (i == matchType::TPC) {
779 const auto& tpcTrk = mTPCTracks[trk.getRefTPC()];
780 mClsVsPtNum[i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
781 mChi2VsPtNum[i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
782 } else {
783 const auto& itsTrk = mITSTracks[trk.getRefITS()];
784 mClsVsPtNum[i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
785 mChi2VsPtNum[i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
786 }
787 }
788 if (i == matchType::TPC) {
789 mResidualPt->Fill(trk.getPt(), trk.getPt() - trkRef.getPt());
790 mResidualPhi->Fill(trk.getPhi(), trk.getPhi() - trkRef.getPhi());
791 mResidualEta->Fill(trk.getEta(), trk.getEta() - trkRef.getEta());
792 mChi2Matching->Fill(trk.getChi2Match());
793 mChi2Refit->Fill(trk.getChi2Refit());
794 mTimeResVsPt->Fill(trkRef.getPt(), trk.getTimeMUS().getTimeStampError());
796 std::array<float, 2> dca{-999, -999};
797 if (trkRef.propagateParamToDCA(v, mBz, &dca)) {
798 mDCAr->Fill(dca[0]);
799 if (!mUseMC) {
800 mDCArVsPtNum->Fill(trkRef.getPt(), dca[0]);
801 }
802 }
803 LOG(debug) << "*** chi2Matching = " << trk.getChi2Match() << ", chi2refit = " << trk.getChi2Refit() << ", timeResolution = " << trk.getTimeMUS().getTimeStampError();
804 }
805 } else {
806 LOG(debug) << "Not filling num (" << title[i] << ") for ITSTPC track " << iITSTPC << " for track with pt " << trkRef.getPt();
807 }
808 }
809 ++iITSTPC;
810 }
811
812 // now filling the denominator for the efficiency calculation
813 if (mUseMC) {
814 for (int i = 0; i < matchType::SIZE; ++i) {
815 mMapRefLabels[i].clear();
816 }
817 // filling the map where we store for each MC label, the track id of the reconstructed
818 // track with the highest number of TPC clusters
819 for (int itrk = 0; itrk < static_cast<int>(mTPCTracks.size()); ++itrk) {
820 auto const& trk = mTPCTracks[itrk];
821 if (isTPCTrackSelectedEntry[itrk]) {
822 auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::TPC});
823 if (!lbl.isValid()) {
824 continue;
825 }
826 if (mMapLabels[matchType::TPC].find(lbl) != mMapLabels[matchType::TPC].end()) {
827 // the track was already added to the denominator
828 continue;
829 }
830 if (mMapRefLabels[matchType::TPC].find(lbl) == mMapRefLabels[matchType::TPC].end()) {
831 int source = lbl.getSourceID();
832 int event = lbl.getEventID();
833 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks(source, event);
834 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
835 if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) {
836 mMapRefLabels[matchType::TPC].insert({lbl, {itrk, true}});
837 } else {
838 mMapRefLabels[matchType::TPC].insert({lbl, {itrk, false}});
839 }
840 } else {
841 // winner (if more tracks have the same label) has the highest number of TPC clusters
842 if (mTPCTracks[mMapRefLabels[matchType::TPC].at(lbl).mIdx].getNClusters() < trk.getNClusters()) {
843 mMapRefLabels[matchType::TPC].at(lbl).mIdx = itrk;
844 }
845 }
846 }
847 }
848 // same for ITS
849 // filling the map where we store for each MC label, the track id of the reconstructed
850 // track with the highest number of ITS clusters
851 for (int itrk = 0; itrk < static_cast<int>(mITSTracks.size()); ++itrk) {
852 auto const& trk = mITSTracks[itrk];
853 if (isITSTrackSelectedEntry[itrk]) {
854 auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::ITS});
855 if (!lbl.isValid()) {
856 continue;
857 }
858 if (mMapLabels[matchType::ITS].find(lbl) != mMapLabels[matchType::ITS].end()) {
859 // the track was already added to the denominator
860 continue;
861 }
862 if (mMapRefLabels[matchType::ITS].find(lbl) == mMapRefLabels[matchType::ITS].end()) {
863 int source = lbl.getSourceID();
864 int event = lbl.getEventID();
865 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks(source, event);
866 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
867 if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) {
868 mMapRefLabels[matchType::ITS].insert({lbl, {itrk, true}});
869 } else {
870 mMapRefLabels[matchType::ITS].insert({lbl, {itrk, false}});
871 }
872 } else {
873 // winner (if more tracks have the same label) has the highest number of ITS clusters
874 if (mITSTracks[mMapRefLabels[matchType::ITS].at(lbl).mIdx].getNClusters() < trk.getNClusters()) {
875 mMapRefLabels[matchType::ITS].at(lbl).mIdx = itrk;
876 }
877 }
878 }
879 }
880 LOG(debug) << "number of entries in map for denominator of TPC tracks (without duplicates) = " << mMapRefLabels[matchType::TPC].size() + mMapLabels[matchType::TPC].size();
881 LOG(debug) << "number of entries in map for denominator of ITS tracks (without duplicates) = " << mMapRefLabels[matchType::ITS].size() + mMapLabels[matchType::ITS].size();
882 // now we use only the tracks in the map to fill the histograms (--> tracks have passed the
883 // track selection and there are no duplicated tracks wrt the same MC label)
884 for (auto const& el : mMapRefLabels[matchType::TPC]) {
885 auto const& trk = mTPCTracks[el.second.mIdx];
886 mPtDen[matchType::TPC]->Fill(trk.getPt());
887 if (std::abs(trk.getEta()) > mEtaNo0Cut) {
888 mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt());
889 }
890 mPhiDen[matchType::TPC]->Fill(trk.getPhi());
891 mPhiVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getPhi());
892 mEtaPhiPtDen[matchType::TPC]->Fill(trk.getEta(), trk.getPhi(), trk.getPt());
893 mEtaDen[matchType::TPC]->Fill(trk.getEta());
894 mEtaVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getEta());
895 m1OverPtDen[matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
896 mClsVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getNClusters());
897 mChi2VsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getChi2());
899 std::array<float, 2> dca{};
900 if (auto trc = trk; trc.propagateParamToDCA(v, mBz, &dca)) {
901 mDCArVsPtDen->Fill(trc.getPt(), dca[0]);
902 }
903 if (el.second.mIsPhysicalPrimary) {
904 mPtPhysPrimDen[matchType::TPC]->Fill(trk.getPt());
905 mPhiPhysPrimDen[matchType::TPC]->Fill(trk.getPhi());
906 mEtaPhysPrimDen[matchType::TPC]->Fill(trk.getEta());
907 m1OverPtPhysPrimDen[matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
908 }
909 ++mNTPCSelectedTracks;
910 }
911 for (auto const& el : mMapRefLabels[matchType::ITS]) {
912 auto const& trk = mITSTracks[el.second.mIdx];
913 if (std::abs(trk.getEta()) < mEtaITSCut) {
914 mPtDen[matchType::ITS]->Fill(trk.getPt());
915 if (std::abs(trk.getEta()) > mEtaNo0Cut) {
916 mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt());
917 }
918 mPhiDen[matchType::ITS]->Fill(trk.getPhi());
919 mPhiVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getPhi());
920 mEtaPhiPtDen[matchType::ITS]->Fill(trk.getEta(), trk.getPhi(), trk.getPt());
921 m1OverPtDen[matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
922 }
923 mEtaDen[matchType::ITS]->Fill(trk.getEta());
924 mEtaVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getEta());
925 mClsVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getNClusters());
926 mChi2VsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getChi2());
927 if (el.second.mIsPhysicalPrimary) {
928 if (std::abs(trk.getEta()) < mEtaITSCut) {
929 mPtPhysPrimDen[matchType::ITS]->Fill(trk.getPt());
930 mPhiPhysPrimDen[matchType::ITS]->Fill(trk.getPhi());
931 m1OverPtPhysPrimDen[matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
932 }
933 mEtaPhysPrimDen[matchType::ITS]->Fill(trk.getEta());
934 }
935 ++mNITSSelectedTracks;
936 }
937 } else {
938 // if we are in data, we loop over all tracks (no check on the label)
939 for (size_t itrk = 0; itrk < mTPCTracks.size(); ++itrk) {
940 auto const& trk = mTPCTracks[itrk];
941 if (isTPCTrackSelectedEntry[itrk]) {
942 LOG(debug) << "Filling den (TPC) with track with pt = " << trk.getPt();
943 mPtDen[matchType::TPC]->Fill(trk.getPt());
944 if (std::abs(trk.getEta()) > mEtaNo0Cut) {
945 mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt());
946 } else {
947 LOG(debug) << "Track (ITS) " << itrk << " with pt = " << trk.getPt() << " and eta = " << trk.getEta() << " not used for den pt, phi, phi vs pt, 1.pt histos";
948 }
949 mPhiDen[matchType::TPC]->Fill(trk.getPhi());
950 mPhiVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getPhi());
951 mEtaPhiPtDen[matchType::TPC]->Fill(trk.getEta(), trk.getPhi(), trk.getPt());
952 mEtaDen[matchType::TPC]->Fill(trk.getEta());
953 mEtaVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getEta());
954 m1OverPtDen[matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
955 mClsVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getNClusters());
956 mChi2VsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getChi2());
958 std::array<float, 2> dca{};
959 if (auto trc = trk; trc.propagateParamToDCA(v, mBz, &dca)) {
960 mDCArVsPtDen->Fill(trc.getPt(), dca[0]);
961 }
962 ++mNTPCSelectedTracks;
963 }
964 }
965 for (size_t itrk = 0; itrk < mITSTracks.size(); ++itrk) {
966 auto const& trk = mITSTracks[itrk];
967 LOG(debug) << "Checking den for track (ITS) " << itrk << " with pt " << trk.getPt() << " and eta = " << trk.getEta();
968 if (isITSTrackSelectedEntry[itrk]) {
969 if (std::abs(trk.getEta()) < mEtaITSCut) {
970 LOG(debug) << "Filling den for track (ITS) " << itrk << " with pt = " << trk.getPt() << " and eta = " << trk.getEta();
971 mPtDen[matchType::ITS]->Fill(trk.getPt());
972 if (std::abs(trk.getEta()) > mEtaNo0Cut) {
973 mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt());
974 }
975 mPhiDen[matchType::ITS]->Fill(trk.getPhi());
976 mPhiVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getPhi());
977 mEtaPhiPtDen[matchType::ITS]->Fill(trk.getEta(), trk.getPhi(), trk.getPt());
978 m1OverPtDen[matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
979 } else {
980 LOG(debug) << "Track (ITS) " << itrk << " with pt = " << trk.getPt() << " and eta = " << trk.getEta() << " not used for num pt, phi, phi vs pt, 1.pt histos";
981 }
982 mEtaDen[matchType::ITS]->Fill(trk.getEta());
983 mEtaVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getEta());
984 mClsVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getNClusters());
985 mChi2VsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getChi2());
986 ++mNITSSelectedTracks;
987 } else {
988 LOG(debug) << "Not filling for this track (ITS) " << itrk << " with pt = " << trk.getPt();
989 }
990 }
991 }
992
993 if (mDoK0QC && mRecoCont.getPrimaryVertices().size() > 0) {
994 // now doing K0S
995 mFitterV0.setBz(mBz);
996 const auto pvertices = mRecoCont.getPrimaryVertices();
997 LOG(info) << "****** Number of PVs = " << pvertices.size();
998
999 // getting occupancy estimator
1000 mNHBPerTF = o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF();
1001 if (!mParam) {
1002 // for occupancy estimator
1003 mParam = o2::gpu::GPUO2InterfaceUtils::getFullParamShared(0.f, mNHBPerTF);
1004 }
1005 size_t occupancyMapSizeBytes = o2::gpu::GPUO2InterfaceRefit::fillOccupancyMapGetSize(mNHBPerTF, mParam.get());
1006 LOG(debug) << "occupancyMapSizeBytes = " << occupancyMapSizeBytes;
1007 mTPCRefitterOccMap = mRecoCont.occupancyMapTPC;
1008 o2::gpu::GPUO2InterfaceUtils::paramUseExternalOccupancyMap(mParam.get(), mNHBPerTF, mTPCRefitterOccMap.data(), occupancyMapSizeBytes);
1009
1010 std::vector<float> mTBinClOcc;
1011 mTBinClOcc.clear();
1012 int mNTPCOccBinLength = mParam->rec.tpc.occupancyMapTimeBins;
1013 LOG(debug) << "mNTPCOccBinLength = " << mNTPCOccBinLength;
1014 mNTPCOccBinLengthInv = 1. / mNTPCOccBinLength;
1015 if (mNTPCOccBinLength > 1 && mTPCRefitterOccMap.size()) {
1016 int nTPCBinsInTF = mNHBPerTF * o2::constants::lhc::LHCMaxBunches / 8; // number of TPC time bins in 1 TF, considering that 1 TPC time bin is 8 bunches
1017 int ninteg = 0;
1018 int nTPCOccBinsInTF = nTPCBinsInTF * mNTPCOccBinLengthInv; // how many occupancy bins in 1 TF; mNTPCOccBinLengthInv is the inverse of the length of an occupancy bin
1019 int sumBins = std::max(1, int(o2::constants::lhc::LHCMaxBunches / 8 * mNTPCOccBinLengthInv)); // we will integrate occupancy at max for this number of bins: the max between 1 and the number of occupancy bins in 1 orbit
1020 LOG(debug) << "number of TPC TB in 1 TF = nTPCBinsInTF = " << nTPCBinsInTF << " ; number of occupancy bins in 1 TF = nTPCOccBinsInTF = " << nTPCOccBinsInTF;
1021 LOG(debug) << "bins to integrate = sumBins = " << sumBins;
1022 mTBinClOcc.resize(nTPCOccBinsInTF);
1023 std::vector<float> mltHistTB(nTPCOccBinsInTF);
1024 float sm = 0., tb = 0.5 * mNTPCOccBinLength;
1025 bool foundNotZero = false;
1026 for (int i = 0; i < nTPCOccBinsInTF; i++) { // for every occupancy bin in the TF
1027 mltHistTB[i] = mParam->GetUnscaledMult(tb);
1028 if (mParam->GetUnscaledMult(tb) != 0) {
1029 LOG(debug) << "i = " << i << " tb = " << tb << " mltHistTB[" << i << "] = " << mltHistTB[i];
1030 foundNotZero = true;
1031 }
1032 tb += mNTPCOccBinLength;
1033 }
1034 if (!foundNotZero) {
1035 LOG(debug) << "No mult bin was found different from 0!";
1036 }
1037 foundNotZero = false;
1038 // now we fill the occupancy map; we integrate the sumBins after the current one, but when we are at the last 27 bins of the TF, where we integrate what we have left till the end of the TF; for practical reasons, we start from the end, adding all the time, and then also removing the last bin, when we have enough, so that we always add together sumBins bins (except, as said, for the last part of the TF)
1039 for (int i = nTPCOccBinsInTF; i--;) {
1040 if (mltHistTB[i] != 0) {
1041 foundNotZero = true;
1042 }
1043 LOG(debug) << "i = " << i << " sm before = " << sm;
1044 sm += mltHistTB[i];
1045 LOG(debug) << "i = " << i << " sm after = " << sm;
1046 if (i + sumBins < nTPCOccBinsInTF) {
1047 LOG(debug) << "i = " << i << " sumBins = " << sumBins << " nTPCOccBinsInTF = " << nTPCOccBinsInTF << " we have to decrease sm by = " << mltHistTB[i + sumBins];
1048 sm -= mltHistTB[i + sumBins];
1049 LOG(debug) << "i = " << i << " sm after 2 = " << sm;
1050 }
1051 mTBinClOcc[i] = sm;
1052 LOG(debug) << "i = " << i << " mTBinClOcc[" << i << "] = " << mTBinClOcc[i];
1053 }
1054 if (!foundNotZero) {
1055 LOG(debug) << "No mult bin was found different from 0! sm = " << sm;
1056 }
1057 } else {
1058 mTBinClOcc.resize(1);
1059 }
1060 auto v0IDs = mRecoCont.getV0sIdx();
1061 auto nv0 = v0IDs.size();
1062 if (nv0 > mRecoCont.getV0s().size()) {
1063 mRefit = true;
1064 }
1065 LOG(debug) << "Found " << mRecoCont.getV0s().size() << " V0s in reco container";
1066 LOG(debug) << "Found " << nv0 << " V0s ids";
1067 // associating sec vtxs to prim vtx
1068 std::map<int, std::vector<int>> pv2sv;
1069 static int tfID = 0;
1070 for (int iv = 0; iv < nv0; iv++) {
1071 const auto v0id = v0IDs[iv];
1072 o2::dataformats::GlobalTrackID id0 = v0id.getProngID(0), id1 = v0id.getProngID(1);
1073 if (id0.getSourceDetectorsMask()[DetID::ITS] && id1.getSourceDetectorsMask()[DetID::ITS] &&
1074 mRecoCont.isTrackSourceLoaded(id0.getSource()) && mRecoCont.isTrackSourceLoaded(id1.getSource())) { // taking only tracks for which there is the ITS in the track sources
1075 pv2sv[v0id.getVertexID()].push_back(iv);
1076 } else {
1077 LOG(debug) << "Skipping this V0: the track sources do not contain ITS";
1078 }
1079 }
1080 int nV0sOk = 0;
1081 // processing every sec vtx for each prim vtx
1082 int myCount = 0;
1083 for (auto it : pv2sv) {
1084 int pvID = it.first;
1085 auto& vv = it.second;
1086 if (pvID < 0 || vv.size() == 0) {
1087 continue;
1088 }
1089 const auto& pv = mRecoCont.getPrimaryVertex(pvID);
1090 float pvTime = pv.getTimeStamp().getTimeStamp(); // in \mus
1091 for (int iv0 : vv) {
1092 nV0sOk += processV0(iv0, mRecoCont, mTBinClOcc, pvTime) ? 1 : 0;
1093 }
1094 ++myCount;
1095 }
1096
1097 LOG(debug) << "Processed " << nV0sOk << " V0s";
1098 }
1099 evCount++;
1100}
1101
1102//__________________________________________________________
1103bool MatchITSTPCQC::processV0(int iv, o2::globaltracking::RecoContainer& recoData, std::vector<float>& mTBinClOcc, float pvTime)
1104{
1106 auto v0s = recoData.getV0s();
1107 auto v0IDs = recoData.getV0sIdx();
1108 static int tfID = 0;
1109
1110 const auto& v0id = v0IDs[iv];
1111 ++mNK0;
1112 if (mNK0 % int(1 / mK0Scaling) == 0) {
1113 LOG(debug) << "Checking " << mNK0 << "th V0: refitting it, since we keep " << mK0Scaling * 100 << "% of all V0s";
1114 } else {
1115 LOG(debug) << "Checking " << mNK0 << "th K0: NOT refitting it, but skipping it, since we keep " << mK0Scaling * 100 << "% of all V0s";
1116 return false;
1117 }
1118 if (mRefit && !refitV0(v0id, v0, recoData)) {
1119 return false;
1120 }
1121 const auto& v0sel = mRefit ? v0 : v0s[iv];
1122 if (mMaxEtaK0 < std::abs(v0sel.getEta())) {
1123 return false;
1124 }
1125
1126 if (mCutK0Mass > 0 && std::abs(std::sqrt(v0sel.calcMass2AsK0()) - 0.497) > mCutK0Mass || v0sel.getDCA() > mK0MaxDCA || v0sel.getCosPA() < mK0MinCosPA) {
1127 if (v0sel.getDCA() > mK0MaxDCA && v0sel.getCosPA() < mK0MinCosPA) {
1128 LOG(debug) << "v0sel.getDCA() = " << v0sel.getDCA() << " max is " << mK0MaxDCA << " returning ... ";
1129 }
1130 if (v0sel.getCosPA() > mK0MinCosPA) {
1131 LOG(debug) << "v0sel.getCosPA() = " << v0sel.getCosPA() << " min is " << mK0MinCosPA << " returning ... ";
1132 }
1133 return false;
1134 }
1135 // get the corresponding PV
1136 int tb = pvTime / (8 * o2::constants::lhc::LHCBunchSpacingMUS) * mNTPCOccBinLengthInv; // V0 time in TPC time bins
1137 LOG(debug) << "pvTime = " << pvTime << " tb = " << tb;
1138 float mltTPC = tb < 0 ? mTBinClOcc[0] : (tb >= mTBinClOcc.size() ? mTBinClOcc.back() : mTBinClOcc[tb]);
1139 ++mNK0;
1140 LOG(debug) << "Filling K0 histogram with pt = " << v0sel.getPt() << " mass = " << std::sqrt(v0sel.calcMass2AsK0()) << " mult TPC = " << mltTPC;
1141 if (!mIsHI) {
1142 mK0MassVsPtVsOccpp->Fill(v0sel.getPt(), std::sqrt(v0sel.calcMass2AsK0()), mltTPC);
1143 } else {
1144 mK0MassVsPtVsOccPbPb->Fill(v0sel.getPt(), std::sqrt(v0sel.calcMass2AsK0()), mltTPC);
1145 }
1146 return true;
1147}
1148
1149//__________________________________________________________
1151{
1152 LOG(debug) << "Refitting V0";
1153 if (!recoData.isTrackSourceLoaded(id.getProngID(0).getSource()) || !recoData.isTrackSourceLoaded(id.getProngID(1).getSource())) {
1154 return false;
1155 }
1156 auto seedP = recoData.getTrackParam(id.getProngID(0));
1157 auto seedN = recoData.getTrackParam(id.getProngID(1));
1158 bool isTPConly = (id.getProngID(0).getSource() == o2::dataformats::GlobalTrackID::TPC) || (id.getProngID(1).getSource() == o2::dataformats::GlobalTrackID::TPC);
1159 const auto& svparam = o2::vertexing::SVertexerParams::Instance();
1160 if (svparam.mTPCTrackPhotonTune && isTPConly) {
1161 mFitterV0.setMaxDZIni(svparam.mTPCTrackMaxDZIni);
1162 mFitterV0.setMaxDXYIni(svparam.mTPCTrackMaxDXYIni);
1163 mFitterV0.setMaxChi2(svparam.mTPCTrackMaxChi2);
1164 mFitterV0.setCollinear(true);
1165 }
1166 int nCand = mFitterV0.process(seedP, seedN);
1167 if (svparam.mTPCTrackPhotonTune && isTPConly) { // restore
1168 // Reset immediately to the defaults
1169 mFitterV0.setMaxDZIni(svparam.maxDZIni);
1170 mFitterV0.setMaxDXYIni(svparam.maxDXYIni);
1171 mFitterV0.setMaxChi2(svparam.maxChi2);
1172 mFitterV0.setCollinear(false);
1173 }
1174 if (nCand == 0) { // discard this pair
1175 return false;
1176 }
1177 const int cand = 0;
1178 if (!mFitterV0.isPropagateTracksToVertexDone(cand) && !mFitterV0.propagateTracksToVertex(cand)) {
1179 return false;
1180 }
1181 const auto& trPProp = mFitterV0.getTrack(0, cand);
1182 const auto& trNProp = mFitterV0.getTrack(1, cand);
1183 std::array<float, 3> pP{}, pN{};
1184 trPProp.getPxPyPzGlo(pP);
1185 trNProp.getPxPyPzGlo(pN);
1186 std::array<float, 3> pV0 = {pP[0] + pN[0], pP[1] + pN[1], pP[2] + pN[2]};
1187 auto p2V0 = pV0[0] * pV0[0] + pV0[1] * pV0[1] + pV0[2] * pV0[2];
1188 const auto& pv = recoData.getPrimaryVertex(id.getVertexID());
1189 const auto v0XYZ = mFitterV0.getPCACandidatePos(cand);
1190 float dx = v0XYZ[0] - pv.getX(), dy = v0XYZ[1] - pv.getY(), dz = v0XYZ[2] - pv.getZ(), prodXYZv0 = dx * pV0[0] + dy * pV0[1] + dz * pV0[2];
1191 float cosPA = prodXYZv0 / std::sqrt((dx * dx + dy * dy + dz * dz) * p2V0);
1192 new (&v0) o2::dataformats::V0(v0XYZ, pV0, mFitterV0.calcPCACovMatrixFlat(cand), trPProp, trNProp);
1193 v0.setDCA(mFitterV0.getChi2AtPCACandidate(cand));
1194 v0.setCosPA(cosPA);
1195 return true;
1196}
1197
1198//__________________________________________________________
1200{
1201
1202 std::array<std::string, 2> title{"TPC", "ITS"};
1203
1204 // first we use denominators and nominators to set the TEfficiency; later they are scaled
1205
1206 // filling the efficiency
1207 for (int ti = 0; ti < matchType::SIZE; ++ti) {
1208 setEfficiency(mFractionITSTPCmatch[ti], mPtNum[ti], mPtDen[ti]);
1209 setEfficiency(mFractionITSTPCmatch_noEta0[ti], mPtNum_noEta0[ti], mPtDen_noEta0[ti]);
1210 setEfficiency(mFractionITSTPCmatchPhi[ti], mPhiNum[ti], mPhiDen[ti]);
1211 setEfficiency(mFractionITSTPCmatchEta[ti], mEtaNum[ti], mEtaDen[ti]);
1212 setEfficiency<2>(mFractionITSTPCmatchPhiVsPt[ti], mPhiVsPtNum[ti], mPhiVsPtDen[ti]);
1213 setEfficiency<2>(mFractionITSTPCmatchEtaVsPt[ti], mEtaVsPtNum[ti], mEtaVsPtDen[ti]);
1214 setEfficiency(mFractionITSTPCmatch1OverPt[ti], m1OverPtNum[ti], m1OverPtDen[ti]);
1215 setEfficiency<2>(mFractionITSTPCmatchClsVsPt[ti], mClsVsPtNum[ti], mClsVsPtDen[ti]);
1216 setEfficiency<2>(mFractionITSTPCmatchChi2VsPt[ti], mChi2VsPtNum[ti], mChi2VsPtDen[ti]);
1217 if (mUseTrkPID) { // Vs Tracking PID hypothesis
1218 for (int j = 0; j < o2::track::PID::NIDs; ++j) {
1219 setEfficiency(mFractionITSTPCmatchPtVsTrkPID[ti][j], mPtNumVsTrkPID[ti][j], mPtDenVsTrkPID[ti][j]);
1220 setEfficiency(mFractionITSTPCmatchPhiVsTrkPID[ti][j], mPhiNumVsTrkPID[ti][j], mPhiDenVsTrkPID[ti][j]);
1221 setEfficiency(mFractionITSTPCmatchEtaVsTrkPID[ti][j], mEtaNumVsTrkPID[ti][j], mEtaDenVsTrkPID[ti][j]);
1222 }
1223 }
1224 if (mUseMC) {
1225 setEfficiency(mFractionITSTPCmatchPhysPrim[ti], mPtPhysPrimNum[ti], mPtPhysPrimDen[ti]);
1226 setEfficiency(mFractionITSTPCmatchPhiPhysPrim[ti], mPhiPhysPrimNum[ti], mPhiPhysPrimDen[ti]);
1227 setEfficiency(mFractionITSTPCmatchEtaPhysPrim[ti], mEtaPhysPrimNum[ti], mEtaPhysPrimDen[ti]);
1228 setEfficiency(mFractionITSTPCmatchPhysPrim1OverPt[ti], m1OverPtPhysPrimNum[ti], m1OverPtPhysPrimDen[ti]);
1229 }
1230 }
1231 setEfficiency<2>(mFractionITSTPCmatchDCArVsPt, mDCArVsPtNum, mDCArVsPtDen);
1232 /*
1233 mPtTPC->Scale(scaleFactTPC);
1234 mPt->Scale(scaleFactITSTPC);
1235 mPhiTPC->Scale(scaleFactTPC);
1236 mPhi->Scale(scaleFactITSTPC);
1237 if (mUseMC) {
1238 mPtTPCPhysPrim->Scale(scaleFactTPC);
1239 mPtPhysPrim->Scale(scaleFactITSTPC);
1240 mPhiTPCPhysPrim->Scale(scaleFactTPC);
1241 mPhiPhysPrim->Scale(scaleFactITSTPC);
1242 }
1243 mEta->Scale(scaleFactITSTPC);
1244 mChi2Matching->Scale(scaleFactITSTPC);
1245 mChi2Refit->Scale(scaleFactITSTPC);
1246 //mTimeResVsPt->Scale(scaleFactITSTPC); // if to few entries, one sees nothing after normalization --> let's not normalize
1247 */
1248}
1249
1250//__________________________________________________________
1251template <int DIM, bool DEBUG>
1252void MatchITSTPCQC::setEfficiency(TEfficiency* eff, TH1* hnum, TH1* hden)
1253{
1254 // Trivial check if we initalized
1255 if (eff == nullptr) {
1256 LOG(fatal) << "Cannot get TEfficiency object ";
1257 }
1258 if (hnum == nullptr) {
1259 LOG(fatal) << "Cannot get numerator histogram for TEfficiency object " << eff->GetName();
1260 }
1261 if (hden == nullptr) {
1262 LOG(fatal) << "Cannot get denominator histogram for TEfficiency object " << eff->GetName();
1263 }
1264
1265 // we need to force to replace the total histogram, otherwise it will compare it to the previous passed one, and it might get an error of inconsistency in the bin contents
1266 if constexpr (DEBUG) { // checking
1267 bool bad{false};
1268 LOG(info) << "Setting efficiency " << eff->GetName() << " from " << hnum->GetName() << " and " << hden->GetName();
1269 LOG(info) << "Num " << hnum->GetName() << " " << hnum->GetNbinsX() << " " << hnum->GetNbinsY() << " with " << hnum->GetEntries() << " entries";
1270 LOG(info) << "Den " << hden->GetName() << " " << hden->GetNbinsX() << " " << hden->GetNbinsY() << " with " << hden->GetEntries() << " entries";
1271 if (hnum->GetDimension() != hden->GetDimension()) {
1272 LOGP(warning, "Histograms have different dimensions (num={} to den={})", hnum->GetDimension(), hden->GetDimension());
1273 bad = true;
1274 }
1275 if (!TEfficiency::CheckBinning(*hnum, *hden)) {
1276 LOGP(warning, "Histograms do not have a compatible binning");
1277 bad = true;
1278 }
1279 if constexpr (DIM == 3) {
1280 for (int i = 1; i <= hden->GetNbinsX(); i++) {
1281 for (int j = 1; j <= hden->GetNbinsY(); j++) {
1282 for (int k = 1; k <= hden->GetNbinsZ(); k++) {
1283 if (hden->GetBinContent(i, j, k) < hnum->GetBinContent(i, j, k)) {
1284 LOGP(warning, "bin {}/{}/{} -> den: {} < num: {}", i, j, k, hden->GetBinContent(i, j, k), hnum->GetBinContent(i, j, k));
1285 bad = true;
1286 }
1287 }
1288 }
1289 }
1290 } else if constexpr (DIM == 2) {
1291 for (int i = 1; i <= hden->GetNbinsX(); i++) {
1292 for (int j = 1; j <= hden->GetNbinsY(); j++) {
1293 if (hden->GetBinContent(i, j) < hnum->GetBinContent(i, j)) {
1294 LOGP(warning, "bin {}/{} -> den: {} < num: {}", i, j, hden->GetBinContent(i, j), hnum->GetBinContent(i, j));
1295 bad = true;
1296 }
1297 }
1298 }
1299 } else {
1300 for (int i = 1; i <= hden->GetNbinsX(); i++) {
1301 if (hden->GetBinContent(i) < hnum->GetBinContent(i)) {
1302 LOG(warning) << "bin " << i << " den: " << hden->GetBinContent(i) << " < num: " << hnum->GetBinContent(i) << " should be the opposite";
1303 bad = true;
1304 }
1305 }
1306 }
1307 if (bad) {
1308 LOG(info) << " `--> Histogram is bad!";
1309 return;
1310 } else {
1311 LOG(info) << " `--> Histogram is good!";
1312 }
1313 }
1314 // we need to force to replace the total histogram, otherwise it will compare it to the previous passed one, and it might get an error of inconsistency in the bin contents
1315 if (!eff->SetTotalHistogram(*hden, "f")) {
1316 LOG(fatal) << "Something went wrong when defining the efficiency denominator " << eff->GetName() << " from " << hnum->GetName();
1317 }
1318 if (!eff->SetPassedHistogram(*hnum, "")) {
1319 LOG(fatal) << "Something went wrong when defining the efficiency numerator " << eff->GetName() << " from " << hnum->GetName();
1320 }
1321 if constexpr (DIM == 3) {
1322 eff->SetTitle(Form("%s;%s;%s;%s;%s", eff->GetTitle(), hnum->GetXaxis()->GetTitle(), hnum->GetYaxis()->GetTitle(), hnum->GetZaxis()->GetTitle(), "Efficiency"));
1323 } else if constexpr (DIM == 2) {
1324 eff->SetTitle(Form("%s;%s;%s;%s", eff->GetTitle(), hnum->GetXaxis()->GetTitle(), hnum->GetYaxis()->GetTitle(), "Efficiency"));
1325 } else {
1326 eff->SetTitle(Form("%s;%s;%s", eff->GetTitle(), hnum->GetXaxis()->GetTitle(), "Efficiency"));
1327 }
1328}
1329
1330//__________________________________________________________
1331
1332void MatchITSTPCQC::getHistos(TObjArray& objar)
1333{
1334
1335 for (int i = 0; i < matchType::SIZE; ++i) {
1336 objar.Add(mPtNum[i]);
1337 objar.Add(mPtDen[i]);
1338 objar.Add(mFractionITSTPCmatch[i]);
1339
1340 objar.Add(mPtNum_noEta0[i]);
1341 objar.Add(mPtDen_noEta0[i]);
1342 objar.Add(mFractionITSTPCmatch_noEta0[i]);
1343
1344 objar.Add(mPtPhysPrimNum[i]);
1345 objar.Add(mPtPhysPrimDen[i]);
1346 objar.Add(mFractionITSTPCmatchPhysPrim[i]);
1347
1348 objar.Add(mPhiNum[i]);
1349 objar.Add(mPhiDen[i]);
1350 objar.Add(mFractionITSTPCmatchPhi[i]);
1351
1352 if (mUseTrkPID) { // Vs Tracking PID hypothesis
1353 for (int j = 0; j < o2::track::PID::NIDs; ++j) {
1354 // Pt
1355 objar.Add(mPtNumVsTrkPID[i][j]);
1356 objar.Add(mPtDenVsTrkPID[i][j]);
1357 objar.Add(mFractionITSTPCmatchPtVsTrkPID[i][j]);
1358 // Phi
1359 objar.Add(mPhiNumVsTrkPID[i][j]);
1360 objar.Add(mPhiDenVsTrkPID[i][j]);
1361 objar.Add(mFractionITSTPCmatchPhiVsTrkPID[i][j]);
1362 // Eta
1363 objar.Add(mEtaNumVsTrkPID[i][j]);
1364 objar.Add(mEtaDenVsTrkPID[i][j]);
1365 objar.Add(mFractionITSTPCmatchEtaVsTrkPID[i][j]);
1366 }
1367 }
1368
1369 objar.Add(mPhiPhysPrimNum[i]);
1370 objar.Add(mPhiPhysPrimDen[i]);
1371 objar.Add(mFractionITSTPCmatchPhiPhysPrim[i]);
1372
1373 objar.Add(mPhiVsPtNum[i]);
1374 objar.Add(mPhiVsPtDen[i]);
1375 objar.Add(mFractionITSTPCmatchPhiVsPt[i]);
1376
1377 objar.Add(mEtaNum[i]);
1378 objar.Add(mEtaDen[i]);
1379 objar.Add(mFractionITSTPCmatchEta[i]);
1380
1381 objar.Add(mEtaPhysPrimNum[i]);
1382 objar.Add(mEtaPhysPrimDen[i]);
1383 objar.Add(mFractionITSTPCmatchEtaPhysPrim[i]);
1384
1385 objar.Add(mEtaVsPtNum[i]);
1386 objar.Add(mEtaVsPtDen[i]);
1387 objar.Add(mFractionITSTPCmatchEtaVsPt[i]);
1388
1389 objar.Add(mClsVsPtNum[i]);
1390 objar.Add(mClsVsPtDen[i]);
1391 objar.Add(mFractionITSTPCmatchClsVsPt[i]);
1392
1393 objar.Add(mChi2VsPtNum[i]);
1394 objar.Add(mChi2VsPtDen[i]);
1395 objar.Add(mFractionITSTPCmatchChi2VsPt[i]);
1396
1397 objar.Add(m1OverPtNum[i]);
1398 objar.Add(m1OverPtDen[i]);
1399 objar.Add(mFractionITSTPCmatch1OverPt[i]);
1400
1401 objar.Add(m1OverPtPhysPrimNum[i]);
1402 objar.Add(m1OverPtPhysPrimDen[i]);
1403 objar.Add(mFractionITSTPCmatchPhysPrim1OverPt[i]);
1404
1405 objar.Add(mEtaPhiPtNum[i]);
1406 objar.Add(mEtaPhiPtDen[i]);
1407 }
1408 objar.Add(mChi2Matching);
1409 objar.Add(mChi2Refit);
1410 objar.Add(mTimeResVsPt);
1411 objar.Add(mResidualPt);
1412 objar.Add(mResidualPhi);
1413 objar.Add(mResidualEta);
1414 objar.Add(mDCAr);
1415 objar.Add(mDCArVsPtNum);
1416 objar.Add(mDCArVsPtDen);
1417 objar.Add(mFractionITSTPCmatchDCArVsPt);
1418
1419 // V0
1420 objar.Add(mK0MassVsPtVsOccpp);
1421 objar.Add(mK0MassVsPtVsOccPbPb);
1422}
1423
1425{
1426 LOG(info) << "MatchITSTPCQC parameters:";
1427 LOG(info) << " - minPtBins = " << mPtBins;
1428 LOG(info) << " - minPtITSCut = " << mPtITSCut;
1429 LOG(info) << " - etaITSCut = " << mEtaITSCut;
1430 LOG(info) << " - minNITSClustersCut = " << mMinNClustersITS;
1431 LOG(info) << " - maxChi2PerClusterITS = " << mMaxChi2PerClusterITS;
1432 LOG(info) << " - minPtTPCCut = " << mPtTPCCut;
1433 LOG(info) << " - etaTPCCut = " << mEtaTPCCut;
1434 LOG(info) << " - minNTPCClustersCut = " << mNTPCClustersCut;
1435 LOG(info) << " - mEtaNo0Cut = " << mEtaNo0Cut;
1436 LOG(info) << " - minDCACut = " << mDCATPCCut;
1437 LOG(info) << " - minDCACutY = " << mDCATPCCutY;
1438 LOG(info) << " - minPtCut = " << mPtCut;
1439 LOG(info) << " - maxPtCut = " << mPtMaxCut;
1440 LOG(info) << " - etaCut = " << mEtaCut;
1441 LOG(info) << " - cutK0Mass = " << mCutK0Mass;
1442 LOG(info) << " - maxEtaK0 = " << mMaxEtaK0;
1443 LOG(info) << " - minTPCOccpp = " << mMinTPCOccpp;
1444 LOG(info) << " - maxTPCOccpp = " << mMaxTPCOccpp;
1445 LOG(info) << " - nBinsTPCOccpp = " << mNBinsTPCOccpp;
1446 LOG(info) << " - minTPCOccPbPb = " << mMinTPCOccPbPb;
1447 LOG(info) << " - maxTPCOccPbPb = " << mMaxTPCOccPbPb;
1448 LOG(info) << " - nBinsTPCOccPbPb = " << mNBinsTPCOccPbPb;
1449}
#define DEBUG
Class to perform track cuts.
Class to perform QC for ITSTPC matching.
int32_t i
Helper for geometry and GRP related CCDB requests.
Header to collect LHC related constants.
Utility functions for MC particles.
uint32_t j
Definition RawData.h:0
Configurable params for secondary vertexer.
Result of refitting TPC-ITS matched track.
std::ostringstream debug
int getSourceID() const
void setMinPtCut(float value)
ITS+TPC kinematics.
Definition TrackCuts.h:73
void setMinNClustersITS(int32_t value)
Definition TrackCuts.h:59
void setMinNTPCClustersCut(int32_t value)
Definition TrackCuts.h:69
bool isSelected(GID trackIndex, o2::globaltracking::RecoContainer &data)
Definition TrackCuts.h:82
void setMaxPtCut(float value)
Definition TrackCuts.h:74
void setEtaITSCut(float value)
Definition TrackCuts.h:58
void setMaxChi2PerClusterITS(float value)
Definition TrackCuts.h:60
void setEtaTPCCut(float value)
Definition TrackCuts.h:68
void setMaxDCATPCCut(float value)
Definition TrackCuts.h:70
void setMinPtITSCut(float value)
Definition TrackCuts.h:57
void setMinPtTPCCut(float value)
TPC.
Definition TrackCuts.h:67
void setEtaCut(float valueMin, float valueMax)
Definition TrackCuts.h:75
void setMaxDCATPCCutY(float value)
Definition TrackCuts.h:71
void setRequireHitsInITSLayers(int8_t minNRequiredHits, std::set< uint8_t > requiredLayers)
Definition TrackCuts.h:61
static GRPGeomHelper & instance()
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
Definition Propagator.h:143
void setDCA(float d)
Definition V0.h:47
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
static constexpr ID ITS
Definition DetID.h:63
decltype(auto) get(R binding, int part=0) const
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
bool processV0(int iv, o2::globaltracking::RecoContainer &recoData, std::vector< float > &mTBinClOcc, float pvTime)
bool refitV0(const o2::dataformats::V0Index &id, o2::dataformats::V0 &v0, o2::globaltracking::RecoContainer &recoData)
void getHistos(TObjArray &objar)
void run(o2::framework::ProcessingContext &ctx)
static size_t fillOccupancyMapGetSize(uint32_t nHbfPerTf, const GPUParam *param=nullptr)
static void paramUseExternalOccupancyMap(GPUParam *param, uint32_t nHbfPerTf, const uint32_t *occupancymap, int32_t occupancyMapSize)
static std::shared_ptr< GPUParam > getFullParamShared(float solenoidBz, uint32_t nHbfPerTf=0, std::unique_ptr< GPUO2InterfaceConfiguration > *pConfiguration=nullptr, std::unique_ptr< GPUSettingsO2 > *pO2Settings=nullptr, bool *autoMaxTimeBin=nullptr)
static bool isPhysicalPrimary(o2::MCTrack const &p, std::vector< o2::MCTrack > const &pcontainer)
Definition MCUtils.cxx:73
bool initFromDigitContext(std::string_view filename)
std::vector< MCTrack > const & getTracks(int source, int event) const
variant returning all tracks for source and event at once
static constexpr ID NIDs
number of defined IDs
Definition PID.h:106
o2::gpu::gpustd::array< float, 6 > calcPCACovMatrixFlat(int cand=0) const
Definition DCAFitterN.h:216
Track & getTrack(int i, int cand=0)
Definition DCAFitterN.h:182
float getChi2AtPCACandidate(int cand=0) const
Definition DCAFitterN.h:168
struct _cl_event * event
Definition glcorearb.h:2982
const GLdouble * v
Definition glcorearb.h:832
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLfloat v0
Definition glcorearb.h:811
GLuint id
Definition glcorearb.h:650
constexpr double LHCBunchSpacingMUS
constexpr int LHCMaxBunches
TrackParCovF TrackParCov
Definition Track.h:33
o2::MCCompLabel getTrackMCLabel(GTrackID id) const
const o2::track::TrackParCov & getTrackParam(GTrackID gidx) const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
const o2::dataformats::PrimaryVertex & getPrimaryVertex(int i) const
gsl::span< const unsigned int > occupancyMapTPC
externally set TPC clusters occupancy map
bool useAbsDCA
use abs dca minimization
bool usePropagator
use external propagator
float maxRIni
don't consider as a seed (circles intersection) if its R exceeds this
float minParamChange
stop when tracks X-params being minimized change by less that this value
float maxSnp
max snp when external propagator is used
float minXSeed
minimal X of seed in prong frame (within the radial resolution track should not go to negative X)
int matCorr
material correction to use
float maxDZIni
don't consider as a seed (circles intersection) if Z distance exceeds this
float maxStep
max step size when external propagator is used
float minRelChi2Change
stop when chi2 changes by less than this value
float maxChi2
max dca from prongs to vertex
bool refitWithMatCorr
refit V0 applying material corrections
float maxDXYIni
don't consider as a seed (circles intersection) if XY distance exceeds this
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"