203 LOGP(
debug,
"Creating Variable Binning");
204 std::array<std::string, 2> title{
"TPC",
"ITS"};
205 std::array<std::string, 2> etaSel{
"",
", |eta| < 0.9"};
206 std::array<int, 2> maxNCls{156, 7};
208 const Int_t nbinsPt = 100;
209 const Double_t xminPt = 0.01;
210 const Double_t xmaxPt = 20;
211 Double_t* xbinsPt =
new Double_t[nbinsPt + 1];
212 Double_t xlogminPt = TMath::Log10(xminPt);
213 Double_t xlogmaxPt = TMath::Log10(xmaxPt);
214 Double_t dlogxPt = (xlogmaxPt - xlogminPt) / nbinsPt;
215 for (
int i = 0;
i <= nbinsPt;
i++) {
216 Double_t xlogPt = xlogminPt +
i * dlogxPt;
217 xbinsPt[
i] = TMath::Exp(TMath::Log(10) * xlogPt);
220 LOGP(
debug,
"Creating Histograms");
224 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()), 100, 0.f, 20.f);
226 mPtNum[
i]->SetOption(
"logy");
227 mPtNum[
i]->GetYaxis()->SetTitleOffset(1.4);
228 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()), 100, 0.f, 20.f);
230 mPtDen[
i]->SetOption(
"logy");
231 mPtDen[
i]->GetYaxis()->SetTitleOffset(1.4);
232 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()), 100, 0.f, 20.f);
233 mPtNum_noEta0[
i] =
new TH1D(Form(
"mPtNum_noEta0_%s", title[
i].c_str()), Form(
"Pt distribution of ITSTPC matched tracks without |eta| < 0.05, wrt %s tracks %s; Pt [GeV/c]; dNdPt", title[
i].c_str(), etaSel[
i].c_str()), 100, 0.f, 20.f);
234 mPtNum_noEta0[
i]->Sumw2();
235 mPtNum_noEta0[
i]->SetOption(
"logy");
236 mPtNum_noEta0[
i]->GetYaxis()->SetTitleOffset(1.4);
237 mPtDen_noEta0[
i] =
new TH1D(Form(
"mPtDen_noEta0_%s", title[
i].c_str()), Form(
"Pt distribution of %s tracks without |eta| < 0.05 %s; Pt [GeV/c]; dNdPt", title[
i].c_str(), etaSel[
i].c_str()), 100, 0.f, 20.f);
238 mPtDen_noEta0[
i]->Sumw2();
239 mPtDen_noEta0[
i]->SetOption(
"logy");
240 mPtDen_noEta0[
i]->GetYaxis()->SetTitleOffset(1.4);
241 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| < 0.05 %s; Pt [GeV/c]; Eff", title[
i].c_str(), etaSel[
i].c_str()), 100, 0.f, 20.f);
244 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());
246 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());
248 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());
249 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()), 100, 0.f, 20.f, 100, 0.f, 2 * TMath::Pi());
250 mPhiVsPtNum[
i]->Sumw2();
251 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()), 100, 0.f, 20.f, 100, 0.f, 2 * TMath::Pi());
252 mPhiVsPtDen[
i]->Sumw2();
253 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()), 100, 0.f, 20.f, 100, 0.f, 2 * TMath::Pi());
256 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);
258 mEtaNum[
i]->GetYaxis()->SetTitleOffset(1.4);
259 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);
261 mEtaDen[
i]->GetYaxis()->SetTitleOffset(1.4);
262 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);
263 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()), 100, 0.f, 20.f, 100, -2.f, 2.f);
264 mEtaVsPtNum[
i]->Sumw2();
265 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()), 100, 0.f, 20.f, 100, -2.f, 2.f);
266 mEtaVsPtDen[
i]->Sumw2();
267 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()), 100, 0.f, 20.f, 100, -2.f, 2.f);
270 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()), 100, 0.f, 20.f, maxNCls[
i], 0, maxNCls[
i]);
271 mClsVsPtNum[
i]->Sumw2();
272 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()), 100, 0.f, 20.f, maxNCls[
i], 0, maxNCls[
i]);
273 mClsVsPtDen[
i]->Sumw2();
274 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()), 100, 0.f, 20.f, maxNCls[
i], 0, maxNCls[
i]);
277 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()), 100, 0.f, 20.f, 200, 0, 300);
278 mChi2VsPtNum[
i]->Sumw2();
279 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()), 100, 0.f, 20.f, 200, 0, 300);
280 mChi2VsPtDen[
i]->Sumw2();
281 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()), 100, 0.f, 20.f, 200, 0, 300);
284 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);
285 m1OverPtNum[
i]->Sumw2();
286 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);
287 m1OverPtDen[
i]->Sumw2();
288 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);
293 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), 100, 0.f, 20.f);
294 mPtNumVsTrkPID[
i][
j]->Sumw2();
295 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), 100, 0.f, 20.f);
296 mPtDenVsTrkPID[
i][
j]->Sumw2();
297 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), 100, 0.f, 20.f);
300 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());
301 mPhiNumVsTrkPID[
i][
j]->Sumw2();
302 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());
303 mPhiDenVsTrkPID[
i][
j]->Sumw2();
304 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());
307 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);
308 mEtaNumVsTrkPID[
i][
j]->Sumw2();
309 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);
310 mEtaDenVsTrkPID[
i][
j]->Sumw2();
311 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);
316 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]", 100, 0.f, 20.f, 100, -1.f, 1.f);
317 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);
318 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);
319 mChi2Matching =
new TH1F(
"mChi2Matching",
"Chi2 of matching; chi2", 200, 0, 300);
320 mChi2Matching->SetOption(
"logy");
321 mChi2Matching->GetYaxis()->SetTitleOffset(1.4);
322 mChi2Refit =
new TH1F(
"mChi2Refit",
"Chi2 of refit; chi2", 200, 0, 300);
323 mChi2Refit->SetOption(
"logy");
324 mChi2Refit->GetYaxis()->SetTitleOffset(1.4);
325 mDCAr =
new TH1F(
"mDCAr",
"DCA of TPC tracks; DCAr", 200, -100, 100);
326 mDCArVsPtNum =
new TH2F(
"mDCArVsPtNum",
"DCA of TPC tracks Vs Pt Num; #it{p}_{T} [GeV/c]; DCAr", 100, 0, 20., 200, -30, 30);
327 mDCArVsPtNum->Sumw2();
328 mDCArVsPtDen =
new TH2F(
"mDCArVsPtDen",
"DCA of TPC tracks Vs Pt Den; #it{p}_{T} [GeV/c]; DCAr", 100, 0, 20., 200, -30, 30);
329 mDCArVsPtDen->Sumw2();
330 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);
332 mTimeResVsPt =
new TH2F(
"mTimeResVsPt",
"Time resolution vs Pt; Pt [GeV/c]; time res [us]", nbinsPt, xbinsPt, 100, 0.f, 2.f);
333 mTimeResVsPt->SetOption(
"colz logz logy logx");
334 mTimeResVsPt->GetYaxis()->SetTitleOffset(1.4);
340 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);
341 mPtPhysPrimNum[
i]->Sumw2();
342 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);
343 mPtPhysPrimDen[
i]->Sumw2();
344 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());
346 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);
347 mEtaPhysPrimNum[
i]->Sumw2();
348 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);
349 mEtaPhysPrimDen[
i]->Sumw2();
350 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);
352 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());
353 mPhiPhysPrimNum[
i]->Sumw2();
354 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());
355 mPhiPhysPrimDen[
i]->Sumw2();
356 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);
358 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()), 100, -20.f, 20.f);
359 m1OverPtPhysPrimNum[
i]->Sumw2();
360 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()), 100, -20.f, 20.f);
361 m1OverPtPhysPrimDen[
i]->Sumw2();
362 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()), 100, -20.f, 20.f);
394 static int evCount = 0;
400 LOG(
debug) <<
"****** Number of found ITSTPC tracks = " << mITSTPCTracks.size();
401 LOG(
debug) <<
"****** Number of found TPC tracks = " << mTPCTracks.size();
402 LOG(
debug) <<
"****** Number of found ITS tracks = " << mITSTracks.size();
405 std::vector<bool> isTPCTrackSelectedEntry(mTPCTracks.size(),
false);
406 std::vector<bool> isITSTrackSelectedEntry(mITSTracks.size(),
false);
413 for (
auto it = mRequiredITSHits.begin(); it != mRequiredITSHits.end(); it++) {
427 for (
size_t itrk = 0; itrk < mTPCTracks.size(); ++itrk) {
428 auto const& trkTpc = mTPCTracks[itrk];
433 isTPCTrackSelectedEntry[itrk] =
true;
437 for (
size_t itrk = 0; itrk < mITSTracks.size(); ++itrk) {
438 auto const& trkIts = mITSTracks[itrk];
443 isITSTrackSelectedEntry[itrk] =
true;
450 mMapLabels[
i].clear();
452 for (
int itrk = 0; itrk < static_cast<int>(mITSTPCTracks.size()); ++itrk) {
453 auto const& trk = mITSTPCTracks[itrk];
454 auto idxTrkTpc = trk.getRefTPC().getIndex();
455 if (trk.getRefITS().getSource() !=
GID::ITS) {
458 if (isTPCTrackSelectedEntry[idxTrkTpc] ==
true) {
460 if (!lbl.isValid()) {
465 int event = lbl.getEventID();
467 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
475 if (mITSTPCTracks[mMapLabels[
matchType::TPC].at(lbl).mIdx].getPt() < trk.getPt()) {
480 auto idxTrkIts = trk.getRefITS().getIndex();
481 if (isITSTrackSelectedEntry[idxTrkIts] ==
true) {
483 if (!lbl.isValid()) {
488 int event = lbl.getEventID();
490 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
498 if (mITSTPCTracks[mMapLabels[
matchType::ITS].at(lbl).mIdx].getPt() < trk.getPt()) {
504 LOG(info) <<
"number of entries in map for nominator (without duplicates) = " << mMapLabels.size();
508 for (
auto const& el : mMapLabels[
i]) {
509 auto const& trk = mITSTPCTracks[el.second.mIdx];
511 bool isEtaITSOk =
true;
513 trkDen = mTPCTracks[trk.getRefTPC()];
515 trkDen = mITSTracks[trk.getRefITS()];
516 if (std::abs(trkDen.getEta()) > 0.9) {
522 mPtNum[
i]->Fill(trkDen.getPt());
523 if (std::abs(trkDen.getEta()) > 0.05) {
524 mPtNum_noEta0[
i]->Fill(trkDen.getPt());
526 mPhiNum[
i]->Fill(trkDen.getPhi());
527 mPhiVsPtNum[
i]->Fill(trkDen.getPt(), trkDen.getPhi());
528 m1OverPtNum[
i]->Fill(trkDen.getSign() * trkDen.getPtInv());
530 mPtDen[
i]->Fill(trkDen.getPt());
531 if (std::abs(trkDen.getEta()) > 0.05) {
532 mPtDen_noEta0[
i]->Fill(trkDen.getPt());
534 mPhiDen[
i]->Fill(trkDen.getPhi());
535 mPhiVsPtDen[
i]->Fill(trkDen.getPt(), trkDen.getPhi());
536 m1OverPtDen[
i]->Fill(trkDen.getSign() * trkDen.getPtInv());
538 mPtNumVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getPt());
539 mPhiNumVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getPhi());
541 mPtDenVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getPt());
542 mPhiDenVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getPhi());
545 mEtaNum[
i]->Fill(trkDen.getEta());
546 mEtaVsPtNum[
i]->Fill(trkDen.getPt(), trkDen.getEta());
548 mEtaDen[
i]->Fill(trkDen.getEta());
549 mEtaVsPtDen[
i]->Fill(trkDen.getPt(), trkDen.getEta());
551 auto tpcTrk = mTPCTracks[trk.getRefTPC()];
552 mClsVsPtNum[
i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
553 mChi2VsPtNum[
i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
554 mClsVsPtDen[
i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
555 mChi2VsPtDen[
i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
557 std::array<float, 2> dca{};
558 if (tpcTrk.propagateParamToDCA(
v, mBz, &dca)) {
559 mDCArVsPtNum->Fill(tpcTrk.getPt(), dca[0]);
560 mDCArVsPtDen->Fill(tpcTrk.getPt(), dca[0]);
563 const auto& itsTrk = mITSTracks[trk.getRefITS()];
564 mClsVsPtNum[
i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
565 mChi2VsPtNum[
i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
566 mClsVsPtDen[
i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
567 mChi2VsPtDen[
i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
570 mEtaNumVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getEta());
572 mEtaDenVsTrkPID[
i][trkDen.getPID()]->Fill(trkDen.getEta());
574 if (el.second.mIsPhysicalPrimary) {
576 mPtPhysPrimNum[
i]->Fill(trkDen.getPt());
577 mPhiPhysPrimNum[
i]->Fill(trkDen.getPhi());
578 m1OverPtPhysPrimNum[
i]->Fill(trkDen.getSign() * trkDen.getPtInv());
580 mPtPhysPrimDen[
i]->Fill(trkDen.getPt());
581 mPhiPhysPrimDen[
i]->Fill(trkDen.getPhi());
582 m1OverPtPhysPrimDen[
i]->Fill(trkDen.getSign() * trkDen.getPtInv());
584 mEtaPhysPrimNum[
i]->Fill(trkDen.getEta());
586 mEtaPhysPrimDen[
i]->Fill(trkDen.getEta());
588 ++mNITSTPCSelectedTracks[
i];
593 for (
auto const& trk : mITSTPCTracks) {
594 if (trk.getRefTPC().getIndex() >= mTPCTracks.size()) {
595 LOG(fatal) <<
"******************** ATTENTION! for TPC track associated to matched track: idx = " << trk.getRefTPC().getIndex() <<
", size of container = " << mTPCTracks.size() <<
" in TF " << evCount;
597 std::array<std::string, 2> title{
"TPC",
"ITS"};
601 bool fillHisto =
false;
602 bool isEtaITSOk =
true;
604 trkRef = mTPCTracks[trk.getRefTPC()];
605 idxTrkRef = trk.getRefTPC().getIndex();
606 if (isTPCTrackSelectedEntry[idxTrkRef] ==
true) {
608 ++mNITSTPCSelectedTracks[
i];
611 idxTrkRef = trk.getRefITS().getIndex();
612 if (trk.getRefITS().getSource() ==
GID::ITSAB) {
614 LOG(
debug) <<
"Track (ITS) with id " << idxTrkRef <<
" for ITSTPC track " << iITSTPC <<
" is from afterburner";
617 if (idxTrkRef >= mITSTracks.size()) {
618 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;
620 trkRef = mITSTracks[trk.getRefITS()];
621 LOG(
debug) <<
"Checking track (ITS) with id " << idxTrkRef <<
" for ITSTPC track " << iITSTPC <<
" and pt = " << trkRef.getPt();
622 if (isITSTrackSelectedEntry[idxTrkRef] ==
true) {
623 LOG(
debug) <<
"Track was selected (ITS), with id " << idxTrkRef <<
" for ITSTPC track " << iITSTPC <<
" , we keep it in the numerator, pt = " << trkRef.getPt();
625 ++mNITSTPCSelectedTracks[
i];
627 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();
629 if (std::abs(trkRef.getEta()) > 0.9) {
632 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();
635 if (fillHisto ==
true) {
637 LOG(
debug) <<
"Filling num (" << title[
i] <<
") with track with id " << idxTrkRef <<
" for ITSTPC track " << iITSTPC <<
" with pt = " << trkRef.getPt();
639 mPtNum[
i]->Fill(trkRef.getPt());
640 if (std::abs(trkRef.getEta()) > 0.05) {
641 mPtNum_noEta0[
i]->Fill(trkRef.getPt());
643 mPhiNum[
i]->Fill(trkRef.getPhi());
645 mPtNumVsTrkPID[
i][trkRef.getPID()]->Fill(trkRef.getPt());
646 mPhiNumVsTrkPID[
i][trkRef.getPID()]->Fill(trkRef.getPhi());
648 mPhiVsPtNum[
i]->Fill(trkRef.getPt(), trkRef.getPhi());
649 m1OverPtNum[
i]->Fill(trkRef.getSign() * trkRef.getPtInv());
651 mEtaNum[
i]->Fill(trkRef.getEta());
653 mEtaNumVsTrkPID[
i][trkRef.getPID()]->Fill(trkRef.getEta());
655 mEtaVsPtNum[
i]->Fill(trkRef.getPt(), trkRef.getEta());
657 const auto& tpcTrk = mTPCTracks[trk.getRefTPC()];
658 mClsVsPtNum[
i]->Fill(tpcTrk.getPt(), tpcTrk.getNClusters());
659 mChi2VsPtNum[
i]->Fill(tpcTrk.getPt(), tpcTrk.getChi2());
661 const auto& itsTrk = mITSTracks[trk.getRefITS()];
662 mClsVsPtNum[
i]->Fill(itsTrk.getPt(), itsTrk.getNClusters());
663 mChi2VsPtNum[
i]->Fill(itsTrk.getPt(), itsTrk.getChi2());
667 mResidualPt->Fill(trk.getPt(), trk.getPt() - trkRef.getPt());
668 mResidualPhi->Fill(trk.getPhi(), trk.getPhi() - trkRef.getPhi());
669 mResidualEta->Fill(trk.getEta(), trk.getEta() - trkRef.getEta());
670 mChi2Matching->Fill(trk.getChi2Match());
671 mChi2Refit->Fill(trk.getChi2Refit());
672 mTimeResVsPt->Fill(trkRef.getPt(), trk.getTimeMUS().getTimeStampError());
674 std::array<float, 2> dca;
675 if (trkRef.propagateParamToDCA(
v, mBz, &dca)) {
678 mDCArVsPtNum->Fill(trkRef.getPt(), dca[0]);
681 LOG(
debug) <<
"*** chi2Matching = " << trk.getChi2Match() <<
", chi2refit = " << trk.getChi2Refit() <<
", timeResolution = " << trk.getTimeMUS().getTimeStampError();
684 LOG(
debug) <<
"Not filling num (" << title[
i] <<
") for ITSTPC track " << iITSTPC <<
" for track with pt " << trkRef.getPt();
693 mMapRefLabels[
i].clear();
697 for (
int itrk = 0; itrk < static_cast<int>(mTPCTracks.size()); ++itrk) {
698 auto const& trk = mTPCTracks[itrk];
699 if (isTPCTrackSelectedEntry[itrk] ==
true) {
701 if (!lbl.isValid()) {
710 int event = lbl.getEventID();
712 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
720 if (mTPCTracks[mMapRefLabels[
matchType::TPC].at(lbl).mIdx].getNClusters() < trk.getNClusters()) {
729 for (
int itrk = 0; itrk < static_cast<int>(mITSTracks.size()); ++itrk) {
730 auto const& trk = mITSTracks[itrk];
731 if (isITSTrackSelectedEntry[itrk] ==
true) {
733 if (!lbl.isValid()) {
742 int event = lbl.getEventID();
744 const o2::MCTrack& p = pcontainer[lbl.getTrackID()];
752 if (mITSTracks[mMapRefLabels[
matchType::ITS].at(lbl).mIdx].getNClusters() < trk.getNClusters()) {
758 LOG(info) <<
"number of entries in map for denominator of TPC tracks (without duplicates) = " << mMapRefLabels[
matchType::TPC].size() + mMapLabels[
matchType::TPC].size();
759 LOG(info) <<
"number of entries in map for denominator of ITS tracks (without duplicates) = " << mMapRefLabels[
matchType::ITS].size() + mMapLabels[
matchType::ITS].size();
763 auto const& trk = mTPCTracks[el.second.mIdx];
765 if (std::abs(trk.getEta()) > 0.05) {
772 m1OverPtDen[
matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
773 mClsVsPtDen[
matchType::TPC]->Fill(trk.getPt(), trk.getNClusters());
776 std::array<float, 2> dca{};
777 if (
auto trc = trk; trc.propagateParamToDCA(
v, mBz, &dca)) {
778 mDCArVsPtDen->Fill(trc.getPt(), dca[0]);
780 if (el.second.mIsPhysicalPrimary) {
784 m1OverPtPhysPrimDen[
matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
786 ++mNTPCSelectedTracks;
789 auto const& trk = mITSTracks[el.second.mIdx];
790 if (std::abs(trk.getEta()) < 0.9) {
792 if (std::abs(trk.getEta()) > 0.05) {
797 m1OverPtDen[
matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
801 mClsVsPtDen[
matchType::ITS]->Fill(trk.getPt(), trk.getNClusters());
803 if (el.second.mIsPhysicalPrimary) {
804 if (std::abs(trk.getEta()) < 0.9) {
807 m1OverPtPhysPrimDen[
matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
811 ++mNITSSelectedTracks;
815 for (
size_t itrk = 0; itrk < mTPCTracks.size(); ++itrk) {
816 auto const& trk = mTPCTracks[itrk];
817 if (isTPCTrackSelectedEntry[itrk] ==
true) {
818 LOG(
debug) <<
"Filling den (TPC) with track with pt = " << trk.getPt();
820 if (std::abs(trk.getEta()) > 0.05) {
823 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";
829 m1OverPtDen[
matchType::TPC]->Fill(trk.getSign() * trk.getPtInv());
830 mClsVsPtDen[
matchType::TPC]->Fill(trk.getPt(), trk.getNClusters());
833 std::array<float, 2> dca{};
834 if (
auto trc = trk; trc.propagateParamToDCA(
v, mBz, &dca)) {
835 mDCArVsPtDen->Fill(trc.getPt(), dca[0]);
837 ++mNTPCSelectedTracks;
840 for (
size_t itrk = 0; itrk < mITSTracks.size(); ++itrk) {
841 auto const& trk = mITSTracks[itrk];
842 LOG(
debug) <<
"Checking den for track (ITS) " << itrk <<
" with pt " << trk.getPt() <<
" and eta = " << trk.getEta();
843 if (isITSTrackSelectedEntry[itrk] ==
true) {
844 if (std::abs(trk.getEta()) < 0.9) {
845 LOG(
debug) <<
"Filling den for track (ITS) " << itrk <<
" with pt = " << trk.getPt() <<
" and eta = " << trk.getEta();
847 if (std::abs(trk.getEta()) > 0.05) {
852 m1OverPtDen[
matchType::ITS]->Fill(trk.getSign() * trk.getPtInv());
854 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";
858 mClsVsPtDen[
matchType::ITS]->Fill(trk.getPt(), trk.getNClusters());
860 ++mNITSSelectedTracks;
862 LOG(
debug) <<
"Not filling for this track (ITS) " << itrk <<
" with pt = " << trk.getPt();
873 std::array<std::string, 2> title{
"TPC",
"ITS"};
879 for (
int i = 0;
i < mPtDen[ti]->GetNbinsX(); ++
i) {
880 if (mPtDen[ti]->GetBinContent(
i + 1) < mPtNum[ti]->GetBinContent(
i + 1)) {
881 LOG(error) << title[ti] <<
": bin " <<
i + 1 <<
" in [" << mPtNum[ti]->GetBinLowEdge(
i + 1) <<
" , " << mPtNum[ti]->GetBinLowEdge(
i + 1) + mPtNum[ti]->GetBinWidth(
i + 1) <<
"]: mPtDen[i] = " << mPtDen[ti]->GetBinContent(
i + 1) <<
", mPtNum[i] = " << mPtNum[ti]->GetBinContent(
i + 1);
884 for (
int i = 0;
i < mPtDen_noEta0[ti]->GetNbinsX(); ++
i) {
885 if (mPtDen_noEta0[ti]->GetBinContent(
i + 1) < mPtNum_noEta0[ti]->GetBinContent(
i + 1)) {
886 LOG(error) << title[ti] <<
": bin " <<
i + 1 <<
" in [" << mPtNum_noEta0[ti]->GetBinLowEdge(
i + 1) <<
" , " << mPtNum_noEta0[ti]->GetBinLowEdge(
i + 1) + mPtNum_noEta0[ti]->GetBinWidth(
i + 1) <<
"]: mPtDen_noEta0[i] = " << mPtDen_noEta0[ti]->GetBinContent(
i + 1) <<
", mPtNum_noEta0[i] = " << mPtNum_noEta0[ti]->GetBinContent(
i + 1);
889 for (
int i = 0;
i < mPhiDen[ti]->GetNbinsX(); ++
i) {
890 if (mPhiDen[ti]->GetBinContent(
i + 1) < mPhiNum[ti]->GetBinContent(
i + 1)) {
891 LOG(error) << title[ti] <<
": bin " <<
i + 1 <<
" in [" << mPhiNum[ti]->GetBinLowEdge(
i + 1) <<
" , " << mPhiNum[ti]->GetBinLowEdge(
i + 1) + mPhiNum[ti]->GetBinWidth(
i + 1) <<
"]: mPhiDen[i] = " << mPhiDen[ti]->GetBinContent(
i + 1) <<
", mPhiNum[i] = " << mPhiNum[ti]->GetBinContent(
i + 1);
894 for (
int i = 0;
i < mEtaDen[ti]->GetNbinsX(); ++
i) {
895 if (mEtaDen[ti]->GetBinContent(
i + 1) < mEtaNum[ti]->GetBinContent(
i + 1)) {
896 LOG(error) << title[ti] <<
": bin " <<
i + 1 <<
" in [" << mEtaNum[ti]->GetBinLowEdge(
i + 1) <<
" , " << mEtaNum[ti]->GetBinLowEdge(
i + 1) + mEtaNum[ti]->GetBinWidth(
i + 1) <<
"]: mEtaDen[i] = " << mEtaDen[ti]->GetBinContent(
i + 1) <<
", mEtaNum[i] = " << mEtaNum[ti]->GetBinContent(
i + 1);
901 setEfficiency(mFractionITSTPCmatch[ti], mPtNum[ti], mPtDen[ti]);
902 setEfficiency(mFractionITSTPCmatch_noEta0[ti], mPtNum_noEta0[ti], mPtDen_noEta0[ti]);
903 setEfficiency(mFractionITSTPCmatchPhi[ti], mPhiNum[ti], mPhiDen[ti]);
904 setEfficiency(mFractionITSTPCmatchEta[ti], mEtaNum[ti], mEtaDen[ti]);
905 setEfficiency(mFractionITSTPCmatchPhiVsPt[ti], mPhiVsPtNum[ti], mPhiVsPtDen[ti],
true);
906 setEfficiency(mFractionITSTPCmatchEtaVsPt[ti], mEtaVsPtNum[ti], mEtaVsPtDen[ti],
true);
907 setEfficiency(mFractionITSTPCmatch1OverPt[ti], m1OverPtNum[ti], m1OverPtDen[ti]);
908 setEfficiency(mFractionITSTPCmatchClsVsPt[ti], mClsVsPtNum[ti], mClsVsPtDen[ti],
true);
909 setEfficiency(mFractionITSTPCmatchChi2VsPt[ti], mChi2VsPtNum[ti], mChi2VsPtDen[ti],
true);
912 setEfficiency(mFractionITSTPCmatchPtVsTrkPID[ti][
j], mPtNumVsTrkPID[ti][
j], mPtDenVsTrkPID[ti][
j]);
913 setEfficiency(mFractionITSTPCmatchPhiVsTrkPID[ti][
j], mPhiNumVsTrkPID[ti][
j], mPhiDenVsTrkPID[ti][
j]);
914 setEfficiency(mFractionITSTPCmatchEtaVsTrkPID[ti][
j], mEtaNumVsTrkPID[ti][
j], mEtaDenVsTrkPID[ti][
j]);
918 setEfficiency(mFractionITSTPCmatchPhysPrim[ti], mPtPhysPrimNum[ti], mPtPhysPrimDen[ti]);
919 setEfficiency(mFractionITSTPCmatchPhiPhysPrim[ti], mPhiPhysPrimNum[ti], mPhiPhysPrimDen[ti]);
920 setEfficiency(mFractionITSTPCmatchEtaPhysPrim[ti], mEtaPhysPrimNum[ti], mEtaPhysPrimDen[ti]);
921 setEfficiency(mFractionITSTPCmatchPhysPrim1OverPt[ti], m1OverPtPhysPrimNum[ti], m1OverPtPhysPrimDen[ti]);
924 setEfficiency(mFractionITSTPCmatchDCArVsPt, mDCArVsPtNum, mDCArVsPtDen,
true);