61 unsigned char isReco = 0u;
62 unsigned char isFake = 0u;
63 bool isPrimary =
false;
64 unsigned char storedStatus = 2;
65 const char* prodProcessName;
74 std::shared_ptr<o2::steer::MCKinematicsReader> kineReader,
75 std::shared_ptr<o2::base::GRPGeomRequest> gr) : mDataRequest(dr), mTracksSrc(
src), mKineReader(kineReader), mGGCCDBRequest(gr)
78 LOGP(info,
"Read MCKine reader with {} sources", mKineReader->getNSources());
89 void setEfficiencyGraph(
std::unique_ptr<TEfficiency>&, const
char*, const
char*, const
int, const
double, const
double, const
int, const
double);
101 gsl::span<const
o2::itsmft::CompClusterExt> mClusters;
102 gsl::span<const
int> mInputITSidxs;
107 std::shared_ptr<DataRequest> mDataRequest;
108 std::vector<std::vector<std::vector<ParticleInfo>>> mParticleInfo;
109 unsigned short mMask = 0x7f;
112 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
115 std::unique_ptr<TH1D> mGoodPt;
116 std::unique_ptr<TH1D> mGoodEta;
117 std::unique_ptr<TH1D> mGoodPtSec;
118 std::unique_ptr<TH1D> mGoodEtaSec;
119 std::unique_ptr<TH1D> mGoodChi2;
120 std::unique_ptr<TH1D> mFakePt;
121 std::unique_ptr<TH1D> mFakeEta;
122 std::unique_ptr<TH1D> mFakePtSec;
123 std::unique_ptr<TH1D> mFakeEtaSec;
124 std::unique_ptr<TH1D> mMultiFake;
125 std::unique_ptr<TH1D> mFakeChi2;
126 std::unique_ptr<TH1D> mClonePt;
127 std::unique_ptr<TH1D> mCloneEta;
129 std::unique_ptr<TH1D> mDenominatorPt;
130 std::unique_ptr<TH1D> mDenominatorEta;
131 std::unique_ptr<TH1D> mDenominatorPtSec;
132 std::unique_ptr<TH1D> mDenominatorEtaSec;
134 std::unique_ptr<TH2D> processvsZ;
135 std::unique_ptr<TH2D> processvsRad;
136 std::unique_ptr<TH2D> processvsRadOther;
137 std::unique_ptr<TH2D> processvsRadNotTracked;
138 std::unique_ptr<TH2D> processvsEtaNotTracked;
140 std::unique_ptr<TEfficiency> mEffPt;
141 std::unique_ptr<TEfficiency> mEffFakePt;
142 std::unique_ptr<TEfficiency> mEffClonesPt;
143 std::unique_ptr<TEfficiency> mEffEta;
144 std::unique_ptr<TEfficiency> mEffFakeEta;
145 std::unique_ptr<TEfficiency> mEffClonesEta;
147 std::unique_ptr<TEfficiency> mEffPtSec;
148 std::unique_ptr<TEfficiency> mEffFakePtSec;
149 std::unique_ptr<TEfficiency> mEffEtaSec;
150 std::unique_ptr<TEfficiency> mEffFakeEtaSec;
152 std::unique_ptr<TH1D> mPtResolution;
153 std::unique_ptr<TH2D> mPtResolution2D;
154 std::unique_ptr<TH1D> mPtResolutionSec;
155 std::unique_ptr<TH1D> mPtResolutionPrim;
156 std::unique_ptr<TGraphErrors> g1;
158 const char* ParticleName[7] = {
"e^{-/+}",
"#pi^{-/+}",
"p",
"^{2}H",
"^{3}He",
"_{#Lambda}^{3}H",
"k^{+/-}"};
159 const int PdgcodeClusterFake[7] = {11, 211, 2212, 1000010020, 100002030, 1010010030, 321};
160 const char*
name[3] = {
"_{#Lambda}^{3}H",
"#Lambda",
"k^{0}_{s}"};
161 const char* particleToanalize[4] = {
"IperT",
"Lambda",
"k0s",
"Tot"};
162 const int PDG[3] = {1010010030, 3122, 310};
163 const char* ProcessName[50];
164 int colorArr[4] = {kGreen, kRed, kBlue, kOrange};
166 std::vector<std::vector<TH1I*>> histLength, histLength1Fake, histLength2Fake, histLength3Fake, histLengthNoCl, histLength1FakeNoCl, histLength2FakeNoCl, histLength3FakeNoCl;
167 std::vector<THStack*> stackLength, stackLength1Fake, stackLength2Fake, stackLength3Fake;
168 std::vector<TLegend*> legends, legends1Fake, legends2Fake, legends3Fake;
169 std::vector<std::unique_ptr<TH2D>> mClusterFake;
170 std::vector<std::vector<std::unique_ptr<TH1D>>> mGoodPts, mFakePts, mTotPts, mGoodEtas, mTotEtas, mFakeEtas;
171 std::vector<std::vector<std::unique_ptr<TEfficiency>>> mEffGoodPts, mEffFakePts, mEffGoodEtas, mEffFakeEtas;
172 std::vector<std::unique_ptr<TH1D>> mGoodRad, mFakeRad, mTotRad, mGoodZ, mFakeZ, mTotZ;
173 std::vector<std::unique_ptr<TEfficiency>> mEffGoodRad, mEffFakeRad, mEffGoodZ, mEffFakeZ;
175 std::unique_ptr<TCanvas> mCanvasPt;
176 std::unique_ptr<TCanvas> mCanvasPtSec;
177 std::unique_ptr<TCanvas> mCanvasPt2;
178 std::unique_ptr<TCanvas> mCanvasPt2fake;
179 std::unique_ptr<TCanvas> mCanvasEta;
180 std::unique_ptr<TCanvas> mCanvasEtaSec;
181 std::unique_ptr<TCanvas> mCanvasRad;
182 std::unique_ptr<TCanvas> mCanvasZ;
183 std::unique_ptr<TCanvas> mCanvasRadD;
184 std::unique_ptr<TCanvas> mCanvasZD;
185 std::unique_ptr<TCanvas> mCanvasPtRes;
186 std::unique_ptr<TCanvas> mCanvasPtRes2;
187 std::unique_ptr<TCanvas> mCanvasPtRes3;
188 std::unique_ptr<TCanvas> mCanvasPtRes4;
189 std::unique_ptr<TLegend> mLegendPt;
190 std::unique_ptr<TLegend> mLegendEta;
191 std::unique_ptr<TLegend> mLegendPtSec;
192 std::unique_ptr<TLegend> mLegendEtaSec;
193 std::unique_ptr<TLegend> mLegendPtRes;
194 std::unique_ptr<TLegend> mLegendPtRes2;
195 std::unique_ptr<TLegend> mLegendZ;
196 std::unique_ptr<TLegend> mLegendRad;
197 std::unique_ptr<TLegend> mLegendZD;
198 std::unique_ptr<TLegend> mLegendRadD;
199 std::vector<TH1D> Histo;
201 float rLayer0 = 2.34;
202 float rLayer1 = 3.15;
203 float rLayer2 = 3.93;
204 float rLayer3 = 19.605;
207 double sigmaerr[100];
212 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
220 mOutFileName = pars.outFileName;
221 mMask = pars.trackLengthMask;
223 std::vector<double> xbins;
224 xbins.resize(pars.effHistBins + 1);
225 double a = std::log(pars.effPtCutHigh / pars.effPtCutLow) / pars.effHistBins;
226 for (
int i{0};
i <= pars.effHistBins;
i++) {
227 xbins[
i] = pars.effPtCutLow * std::exp(
i *
a);
229 for (
int yy = 0; yy < 50; yy++) {
230 ProcessName[yy] =
" ";
232 mGoodPt = std::make_unique<TH1D>(
"goodPt",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
233 mGoodEta = std::make_unique<TH1D>(
"goodEta",
";#eta;Number of tracks", 60, -3, 3);
234 mGoodPtSec = std::make_unique<TH1D>(
"goodPtSec",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
235 mGoodEtaSec = std::make_unique<TH1D>(
"goodEtaSec",
";#eta;Number of tracks", 60, -3, 3);
236 mGoodChi2 = std::make_unique<TH1D>(
"goodChi2",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", 200, 0, 100);
238 mFakePt = std::make_unique<TH1D>(
"fakePt",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
239 mFakeEta = std::make_unique<TH1D>(
"fakeEta",
";#eta;Number of tracks", 60, -3, 3);
240 mFakePtSec = std::make_unique<TH1D>(
"fakePtSec",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
241 mFakeEtaSec = std::make_unique<TH1D>(
"fakeEtaSec",
";#eta;Number of tracks", 60, -3, 3);
242 mFakeChi2 = std::make_unique<TH1D>(
"fakeChi2",
";#it{p}_{T} (GeV/#it{c});Fak", 200, 0, 100);
244 mMultiFake = std::make_unique<TH1D>(
"multiFake",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
246 mClonePt = std::make_unique<TH1D>(
"clonePt",
";#it{p}_{T} (GeV/#it{c});Clone", pars.effHistBins, xbins.data());
247 mCloneEta = std::make_unique<TH1D>(
"cloneEta",
";#eta;Number of tracks", 60, -3, 3);
249 mDenominatorPt = std::make_unique<TH1D>(
"denominatorPt",
";#it{p}_{T} (GeV/#it{c});Den", pars.effHistBins, xbins.data());
250 mDenominatorEta = std::make_unique<TH1D>(
"denominatorEta",
";#eta;Number of tracks", 60, -3, 3);
251 mDenominatorPtSec = std::make_unique<TH1D>(
"denominatorPtSec",
";#it{p}_{T} (GeV/#it{c});Den", pars.effHistBins, xbins.data());
252 mDenominatorEtaSec = std::make_unique<TH1D>(
"denominatorEtaSec",
";#eta;Number of tracks", 60, -3, 3);
254 processvsZ = std::make_unique<TH2D>(
"Process",
";z_{SV} [cm]; production process", 100, -50, 50., 50, 0, 50);
255 processvsRad = std::make_unique<TH2D>(
"ProcessR",
";decay radius [cm]; production process", 100, 0, 25., 50, 0, 50);
256 processvsRadOther = std::make_unique<TH2D>(
"ProcessRO",
";decay radius [cm]; production process", 200, 0, 25., 50, 0, 50);
257 processvsRadNotTracked = std::make_unique<TH2D>(
"ProcessRNoT",
";decay radius [cm]; production process", 200, 0, 25., 50, 0, 50);
258 processvsEtaNotTracked = std::make_unique<TH2D>(
"ProcessENoT",
";#eta; production process", 60, -3, 3, 50, 0, 50);
272 mClusterFake.resize(4);
273 for (
int i = 0;
i < 4;
i++) {
274 mGoodPts[
i].resize(4);
275 mFakePts[
i].resize(4);
276 mTotPts[
i].resize(4);
277 mGoodEtas[
i].resize(4);
278 mFakeEtas[
i].resize(4);
279 mTotEtas[
i].resize(4);
281 for (
int ii = 0; ii < 4; ii++) {
283 mGoodRad[ii] = std::make_unique<TH1D>(Form(
"goodRad_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, 0., 20.);
284 mFakeRad[ii] = std::make_unique<TH1D>(Form(
"FakeRad_%s", particleToanalize[ii]),
";#eta;Number of tracks", 100, 0., 20.);
285 mTotRad[ii] = std::make_unique<TH1D>(Form(
"TotRad_%s", particleToanalize[ii]),
";#eta;Number of tracks", 100, 0., 20.);
287 mGoodZ[ii] = std::make_unique<TH1D>(Form(
"goodZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
288 mFakeZ[ii] = std::make_unique<TH1D>(Form(
"FakeZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
289 mTotZ[ii] = std::make_unique<TH1D>(Form(
"TotZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
290 mClusterFake[ii] = std::make_unique<TH2D>(Form(
"Clusters_fake_%s", ParticleName[ii]),
";particle generating fake cluster; production process", 7, 0., 7., 50, 0, 50);
292 mGoodRad[ii]->Sumw2();
293 mFakeRad[ii]->Sumw2();
294 mTotRad[ii]->Sumw2();
299 for (
int yy = 0; yy < 4; yy++) {
300 mGoodPts[ii][yy] = std::make_unique<TH1D>(Form(
"goodPts_%s_%d", particleToanalize[ii], yy),
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
301 mFakePts[ii][yy] = std::make_unique<TH1D>(Form(
"FakePts_%s_%d", particleToanalize[ii], yy),
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
302 mTotPts[ii][yy] = std::make_unique<TH1D>(Form(
"TotPts_%s_%d", particleToanalize[ii], yy),
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
304 mGoodEtas[ii][yy] = std::make_unique<TH1D>(Form(
"goodEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
305 mFakeEtas[ii][yy] = std::make_unique<TH1D>(Form(
"FakeEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
306 mTotEtas[ii][yy] = std::make_unique<TH1D>(Form(
"TotEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
308 mGoodPts[ii][yy]->Sumw2();
309 mFakePts[ii][yy]->Sumw2();
310 mTotPts[ii][yy]->Sumw2();
311 mGoodEtas[ii][yy]->Sumw2();
312 mFakeEtas[ii][yy]->Sumw2();
313 mTotEtas[ii][yy]->Sumw2();
317 mPtResolution = std::make_unique<TH1D>(
"PtResolution",
";#it{p}_{T} ;Den", 100, -1, 1);
318 mPtResolutionSec = std::make_unique<TH1D>(
"PtResolutionSec",
";#it{p}_{T} ;Den", 100, -1, 1);
319 mPtResolutionPrim = std::make_unique<TH1D>(
"PtResolutionPrim",
";#it{p}_{T} ;Den", 100, -1, 1);
320 mPtResolution2D = std::make_unique<TH2D>(
"#it{p}_{T} Resolution vs #it{p}_{T}",
";#it{p}_{T} (GeV/#it{c});#Delta p_{T}/p_{T_{MC}", 100, 0, 10, 100, -1, 1);
322 mPtResolution->Sumw2();
323 mPtResolutionSec->Sumw2();
324 mPtResolutionPrim->Sumw2();
329 mGoodEtaSec->Sumw2();
336 mDenominatorPt->Sumw2();
338 histLength.resize(4);
339 histLength1Fake.resize(4);
340 histLength2Fake.resize(4);
341 histLength3Fake.resize(4);
342 histLengthNoCl.resize(4);
343 histLength1FakeNoCl.resize(4);
344 histLength2FakeNoCl.resize(4);
345 histLength3FakeNoCl.resize(4);
346 stackLength.resize(4);
347 stackLength1Fake.resize(4);
348 stackLength2Fake.resize(4);
349 stackLength3Fake.resize(4);
350 for (
int yy = 0; yy < 4; yy++) {
351 histLength[yy].resize(3);
352 histLength1Fake[yy].resize(3);
353 histLength2Fake[yy].resize(3);
354 histLength3Fake[yy].resize(3);
355 histLengthNoCl[yy].resize(3);
356 histLength1FakeNoCl[yy].resize(3);
357 histLength2FakeNoCl[yy].resize(3);
358 histLength3FakeNoCl[yy].resize(3);
361 legends1Fake.resize(4);
362 legends2Fake.resize(4);
363 legends3Fake.resize(4);
365 for (
int iH{4}; iH < 8; ++iH) {
368 for (
int jj = 0; jj < 3; jj++) {
369 histLength[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_%s", iH,
name[jj]), Form(
"#exists cluster %s",
name[jj]), 7, -.5, 6.5);
370 histLength[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
371 histLength[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
372 histLengthNoCl[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_nocl_%s", iH,
name[jj]), Form(
"#slash{#exists} cluster %s",
name[jj]), 7, -.5, 6.5);
373 histLengthNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
374 histLengthNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
376 stackLength[iH - 4] =
new THStack(Form(
"stack_trk_len_%d", iH), Form(
"trk_len=%d", iH));
378 stackLength[iH - 4]->Add(histLength[iH - 4][jj]);
379 stackLength[iH - 4]->Add(histLengthNoCl[iH - 4][jj]);
381 histLength1Fake[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_1f_%s", iH,
name[jj]), Form(
"#exists cluster %s",
name[jj]), 7, -.5, 6.5);
382 histLength1Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
383 histLength1Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
384 histLength1FakeNoCl[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_1f_nocl_%s", iH,
name[jj]), Form(
"#slash{#exists} cluster %s",
name[jj]), 7, -.5, 6.5);
385 histLength1FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
386 histLength1FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
388 stackLength1Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_1f", iH), Form(
"trk_len=%d, 1 Fake", iH));
390 stackLength1Fake[iH - 4]->Add(histLength1Fake[iH - 4][jj]);
391 stackLength1Fake[iH - 4]->Add(histLength1FakeNoCl[iH - 4][jj]);
393 histLength2Fake[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_2f_%s", iH,
name[jj]), Form(
"#exists cluster %s",
name[jj]), 7, -.5, 6.5);
394 histLength2Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
395 histLength2Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
396 histLength2FakeNoCl[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_2f_nocl_%s", iH,
name[jj]), Form(
"#slash{#exists} cluster %s",
name[jj]), 7, -.5, 6.5);
397 histLength2FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
398 histLength2FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
400 stackLength2Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_2f", iH), Form(
"trk_len=%d, 2 Fake", iH));
402 stackLength2Fake[iH - 4]->Add(histLength2Fake[iH - 4][jj]);
403 stackLength2Fake[iH - 4]->Add(histLength2FakeNoCl[iH - 4][jj]);
405 histLength3Fake[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_3f_%s", iH,
name[jj]), Form(
"#exists cluster %s",
name[jj]), 7, -.5, 6.5);
406 histLength3Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
407 histLength3Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
409 histLength3FakeNoCl[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_3f_nocl_%s", iH,
name[jj]), Form(
"#slash{#exists} cluster %s",
name[jj]), 7, -.5, 6.5);
410 histLength3FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
411 histLength3FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
413 stackLength3Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_3f", iH), Form(
"trk_len=%d, 3 Fake", iH));
415 stackLength3Fake[iH - 4]->Add(histLength3Fake[iH - 4][jj]);
416 stackLength3Fake[iH - 4]->Add(histLength3FakeNoCl[iH - 4][jj]);
447 LOGP(info,
"** Filling particle table ... ");
448 mParticleInfo.resize(mKineReader->getNSources());
449 for (
int iSource{0}; iSource < mKineReader->getNSources(); ++iSource) {
450 mParticleInfo[iSource].resize(mKineReader->getNEvents(iSource));
451 for (
int iEvent{0}; iEvent < mKineReader->getNEvents(iSource); ++iEvent) {
452 mParticleInfo[iSource][iEvent].resize(mKineReader->getTracks(iSource, iEvent).size());
453 for (
auto iPart{0}; iPart < mKineReader->getTracks(iEvent).
size(); ++iPart) {
454 auto& part = mKineReader->getTracks(iSource, iEvent)[iPart];
455 mParticleInfo[iSource][iEvent][iPart].event = iEvent;
456 mParticleInfo[iSource][iEvent][iPart].pdg = part.GetPdgCode();
457 mParticleInfo[iSource][iEvent][iPart].pt = part.GetPt();
458 mParticleInfo[iSource][iEvent][iPart].phi = part.GetPhi();
459 mParticleInfo[iSource][iEvent][iPart].eta = part.GetEta();
460 mParticleInfo[iSource][iEvent][iPart].vx = part.Vx();
461 mParticleInfo[iSource][iEvent][iPart].vy = part.Vy();
462 mParticleInfo[iSource][iEvent][iPart].vz = part.Vz();
463 mParticleInfo[iSource][iEvent][iPart].isPrimary = part.isPrimary();
464 mParticleInfo[iSource][iEvent][iPart].mother = part.getMotherTrackId();
465 mParticleInfo[iSource][iEvent][iPart].prodProcessName = part.getProdProcessAsString();
466 mParticleInfo[iSource][iEvent][iPart].prodProcess = part.getProcess();
470 LOGP(info,
"** Creating particle/clusters correspondance ... ");
471 for (
auto iSource{0}; iSource < mParticleInfo.size(); ++iSource) {
472 for (
auto iCluster{0}; iCluster < mClusters.size(); ++iCluster) {
473 auto labs = mClustersMCLCont->
getLabels(iCluster);
474 for (
auto& lab : labs) {
475 if (!lab.isValid()) {
478 int trackID, evID, srcID;
480 lab.get(trackID, evID, srcID, fake);
481 auto& cluster = mClusters[iCluster];
483 mParticleInfo[srcID][evID][trackID].clusters |= (1 <<
layer);
487 LOGP(info,
"** Analysing tracks ... ");
488 int unaccounted{0}, good{0}, fakes{0};
490 int nPartForSpec[4][4];
491 int nPartGoodorFake[4][4][2];
492 for (
int n = 0;
n < 4;
n++) {
493 for (
int m = 0;
m < 4;
m++) {
494 nPartForSpec[
n][
m] = 0;
495 for (
int h = 0;
h < 2;
h++) {
496 nPartGoodorFake[
n][
m][
h] = 0;
505 for (
auto iTrack{0}; iTrack < mTracks.size(); ++iTrack) {
506 auto& lab = mTracksMCLabels[iTrack];
507 if (!lab.isSet() || lab.isNoise()) {
511 int trackID, evID, srcID;
513 lab.get(trackID, evID, srcID, fake);
520 mParticleInfo[srcID][evID][trackID].isReco += !fake;
521 mParticleInfo[srcID][evID][trackID].isFake += fake;
522 if (mTracks[iTrack].isBetter(mParticleInfo[srcID][evID][trackID].track, 1.e9)) {
523 mParticleInfo[srcID][evID][trackID].storedStatus = fake;
524 mParticleInfo[srcID][evID][trackID].track = mTracks[iTrack];
529 LOGP(info,
"** Some statistics:");
530 LOGP(info,
"\t- Total number of tracks: {}", mTracks.size());
531 LOGP(info,
"\t- Total number of tracks not corresponding to particles: {} ({:.2f} %)", unaccounted, unaccounted * 100. / mTracks.size());
532 LOGP(info,
"\t- Total number of fakes: {} ({:.2f} %)", fakes, fakes * 100. / mTracks.size());
533 LOGP(info,
"\t- Total number of good: {} ({:.2f} %)", good, good * 100. / mTracks.size());
535 LOGP(info,
"** Filling histograms ... ");
538 int totP{0}, goodP{0}, fakeP{0};
540 for (
auto& evInfo : mParticleInfo[0]) {
542 for (
auto& part : evInfo) {
544 if (strcmp(ProcessName[part.prodProcess],
" ")) {
545 ProcessName[part.prodProcess] = part.prodProcessName;
547 if ((part.clusters & 0x7f) == mMask) {
553 if (part.isPrimary) {
555 mDenominatorPt->Fill(part.pt);
556 mDenominatorEta->Fill(part.eta);
558 mGoodPt->Fill(part.pt);
559 mGoodEta->Fill(part.eta);
561 if (part.isReco > 1) {
562 for (
int _i{0}; _i < part.isReco - 1; ++_i) {
563 mClonePt->Fill(part.pt);
564 mCloneEta->Fill(part.eta);
569 mFakePt->Fill(part.pt);
570 mFakeEta->Fill(part.eta);
572 if (part.isFake > 1) {
573 for (
int _i{0}; _i < part.isFake - 1; ++_i) {
574 mMultiFake->Fill(part.pt);
584 if (!part.isPrimary) {
585 int TrackID, EvID, SrcID;
586 int pdgcode = mParticleInfo[0][evID][part.mother].pdg;
588 float rad = sqrt(pow(part.vx, 2) + pow(part.vy, 2));
591 if ((rad < rLayer0) && (part.clusters == 0x7f || part.clusters == 0x3f || part.clusters == 0x1f || part.clusters == 0x0f)) {
594 if (rad < rLayer1 && rad > rLayer0 && (part.clusters == 0x1e || part.clusters == 0x3e || part.clusters == 0x7e)) {
597 if (rad < rLayer2 && rad > rLayer1 && (part.clusters == 0x7c || part.clusters == 0x3c)) {
600 if (rad < rLayer3 && rad > rLayer2 && part.clusters == 0x78) {
603 if (nlayer == 0 || nlayer == 1 || nlayer == 2 || nlayer == 3) {
606 processvsZ->Fill(part.vz, part.prodProcess);
607 processvsRad->Fill(rad, part.prodProcess);
608 mDenominatorPtSec->Fill(part.pt);
609 mDenominatorEtaSec->Fill(part.eta);
610 mTotRad[3]->Fill(rad);
611 mTotZ[3]->Fill(part.vz);
612 mTotPts[nlayer][3]->Fill(part.pt);
613 mTotEtas[nlayer][3]->Fill(part.eta);
614 mTotPts[nlayer][3]->Fill(part.pt);
615 mTotEtas[nlayer][3]->Fill(part.eta);
616 if (pdgcode == PDG[0] || pdgcode == -1 * PDG[0]) {
619 if (pdgcode == PDG[1] || pdgcode == -1 * PDG[1]) {
622 if (pdgcode == PDG[2] || pdgcode == -1 * PDG[2]) {
627 mGoodPts[3][nlayer]->Fill(part.pt);
628 mGoodEtas[3][nlayer]->Fill(part.eta);
629 mGoodPtSec->Fill(part.pt);
630 mGoodEtaSec->Fill(part.eta);
631 mGoodRad[3]->Fill(rad);
632 mGoodZ[3]->Fill(part.vz);
636 mFakePts[3][nlayer]->Fill(part.pt);
637 mFakeEtas[3][nlayer]->Fill(part.eta);
638 mFakePtSec->Fill(part.pt);
639 mFakeEtaSec->Fill(part.eta);
640 mFakeRad[3]->Fill(rad);
641 mFakeZ[3]->Fill(part.vz);
645 mTotRad[idxPart]->Fill(rad);
646 mTotZ[idxPart]->Fill(part.vz);
647 mTotPts[idxPart][nlayer]->Fill(part.pt);
648 mTotEtas[idxPart][nlayer]->Fill(part.eta);
650 mGoodRad[idxPart]->Fill(rad);
651 mGoodZ[idxPart]->Fill(part.vz);
652 mGoodPts[idxPart][nlayer]->Fill(part.pt);
653 mGoodEtas[idxPart][nlayer]->Fill(part.eta);
656 mFakeRad[idxPart]->Fill(rad);
657 mFakeZ[idxPart]->Fill(part.vz);
658 mFakePts[idxPart][nlayer]->Fill(part.pt);
659 mFakeEtas[idxPart][nlayer]->Fill(part.eta);
663 if (pdgcode != 1010010030 && pdgcode != 3122 && pdgcode != 310 && pdgcode != -1010010030 && pdgcode != -310 && pdgcode != -3122) {
665 processvsRadOther->Fill(rad, part.prodProcess);
668 if (!part.isFake && !part.isReco) {
669 processvsEtaNotTracked->Fill(part.eta, part.prodProcess);
670 processvsRadNotTracked->Fill(rad, part.prodProcess);
672 if (ngoodfake == 1 || ngoodfake == 0) {
673 nPartGoodorFake[idxPart][nlayer][ngoodfake]++;
675 nPartForSpec[idxPart][nlayer]++;
679 for (
unsigned int bit{0}; bit <
sizeof(part.clusters) * 8; ++bit) {
680 nCl += bool(part.clusters & (1 << bit));
686 auto& track = part.track;
687 auto len = track.getNClusters();
688 int nclu = track.getNumberOfClusters();
689 int firstclu = track.getFirstClusterEntry();
690 for (
int iLayer{0}; iLayer < 7; ++iLayer) {
691 if (track.hasHitOnLayer(iLayer)) {
692 if (track.isFakeOnLayer(iLayer)) {
694 if (part.clusters & (0x1 << iLayer)) {
695 histLength[
len - 4][idxPart]->Fill(iLayer);
696 if (track.getNFakeClusters() == 1) {
697 histLength1Fake[
len - 4][idxPart]->Fill(iLayer);
699 if (track.getNFakeClusters() == 2) {
700 histLength2Fake[
len - 4][idxPart]->Fill(iLayer);
702 if (track.getNFakeClusters() == 3) {
703 histLength3Fake[
len - 4][idxPart]->Fill(iLayer);
707 histLengthNoCl[
len - 4][idxPart]->Fill(iLayer);
708 if (track.getNFakeClusters() == 1) {
709 histLength1FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
711 if (track.getNFakeClusters() == 2) {
712 histLength2FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
714 if (track.getNFakeClusters() == 3) {
715 histLength3FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
718 auto labs = mClustersMCLCont->
getLabels(mInputITSidxs[firstclu - 1 - iLayer + track.getFirstClusterLayer() + nclu]);
720 for (
auto& lab : labs) {
721 if (!lab.isValid()) {
726 lab.get(TrackID, EvID, SrcID, fakec);
728 for (
int hg = 0; hg < 7; hg++) {
729 if (mParticleInfo[SrcID][EvID][TrackID].pdg == PdgcodeClusterFake[hg] || mParticleInfo[SrcID][EvID][TrackID].pdg == -1 * (PdgcodeClusterFake[hg])) {
734 mClusterFake[idxPart]->Fill(intHisto, mParticleInfo[SrcID][EvID][TrackID].prodProcess);
749 int totgood{0}, totfake{0}, totI{0}, totL{0}, totK{0}, totO{0};
750 for (
int xx = 0; xx < 4; xx++) {
751 for (
int yy = 0; yy < 4; yy++) {
752 totgood = totgood + nPartGoodorFake[xx][yy][1];
753 totfake = totfake + nPartGoodorFake[xx][yy][0];
755 totI = totI + nPartForSpec[0][yy];
758 totL = totL + nPartForSpec[1][yy];
761 totK = totK + nPartForSpec[2][yy];
764 totO = totO + nPartForSpec[3][yy];
768 LOGP(info,
"number of primary tracks: {}, good:{}, fake:{}", totP, goodP, fakeP);
769 int goodI = nPartGoodorFake[0][0][1] + nPartGoodorFake[0][1][1] + nPartGoodorFake[0][2][1] + nPartGoodorFake[0][3][1];
770 int goodL = nPartGoodorFake[1][0][1] + nPartGoodorFake[1][1][1] + nPartGoodorFake[1][2][1] + nPartGoodorFake[1][3][1];
771 int goodK = nPartGoodorFake[2][0][1] + nPartGoodorFake[2][1][1] + nPartGoodorFake[2][2][1] + nPartGoodorFake[2][3][1];
772 int fakeI = nPartGoodorFake[0][0][0] + nPartGoodorFake[0][1][0] + nPartGoodorFake[0][2][0] + nPartGoodorFake[0][3][0];
773 int fakeL = nPartGoodorFake[1][0][0] + nPartGoodorFake[1][1][0] + nPartGoodorFake[1][2][0] + nPartGoodorFake[1][3][0];
774 int fakeK = nPartGoodorFake[2][0][0] + nPartGoodorFake[2][1][0] + nPartGoodorFake[2][2][0] + nPartGoodorFake[2][3][0];
775 LOGP(info,
"** Some statistics on secondary tracks:");
777 LOGP(info,
"\t- Total number of secondary tracks: {}", totsec);
778 LOGP(info,
"\t- Total number of secondary trackeable tracks : {}", totsecCont);
779 LOGP(info,
"\t- Total number of secondary trackeable tracks good: {}, fake: {}", totgood, totfake);
780 LOGP(info,
"\t- Total number of secondary trackeable tracks from IperT: {} = {} %, Good={} % , fake={} %", totI, 100 * totI / totsecCont, 100 * goodI / totI, 100 * fakeI / totI);
781 LOGP(info,
"\t- Total number of secondary trackeable tracks from Lam: {} = {} %, Good={} % , fake={} %", totL, 100 * totL / totsecCont, 100 * goodL / totL, 100 * fakeL / totL);
782 LOGP(info,
"\t- Total number of secondary trackeable tracks from k: {} = {} %, Good={} % , fake={} %", totK, 100 * totK / totsecCont, 100 * goodK / totK, 100 * fakeK / totK);
783 LOGP(info,
"\t- Total number of secondary trackeable tracks from Other: {} = {} %", totO, 100 * totO / totsecCont);
785 LOGP(info,
"** Computing efficiencies ...");
787 mEffPt = std::make_unique<TEfficiency>(*mGoodPt, *mDenominatorPt);
788 mEffFakePt = std::make_unique<TEfficiency>(*mFakePt, *mDenominatorPt);
789 mEffClonesPt = std::make_unique<TEfficiency>(*mClonePt, *mDenominatorPt);
791 mEffEta = std::make_unique<TEfficiency>(*mGoodEta, *mDenominatorEta);
792 mEffFakeEta = std::make_unique<TEfficiency>(*mFakeEta, *mDenominatorEta);
793 mEffClonesEta = std::make_unique<TEfficiency>(*mCloneEta, *mDenominatorEta);
795 mEffPtSec = std::make_unique<TEfficiency>(*mGoodPtSec, *mDenominatorPtSec);
796 mEffFakePtSec = std::make_unique<TEfficiency>(*mFakePtSec, *mDenominatorPtSec);
798 mEffEtaSec = std::make_unique<TEfficiency>(*mGoodEtaSec, *mDenominatorEtaSec);
799 mEffFakeEtaSec = std::make_unique<TEfficiency>(*mFakeEtaSec, *mDenominatorEtaSec);
801 for (
int ii = 0; ii < 4; ii++) {
802 for (
int yy = 0; yy < 4; yy++) {
803 mEffGoodPts[ii][yy] = std::make_unique<TEfficiency>(*mGoodPts[ii][yy], *mTotPts[ii][yy]);
804 mEffFakePts[ii][yy] = std::make_unique<TEfficiency>(*mFakePts[ii][yy], *mTotPts[ii][yy]);
805 mEffGoodEtas[ii][yy] = std::make_unique<TEfficiency>(*mGoodEtas[ii][yy], *mTotEtas[ii][yy]);
806 mEffFakeEtas[ii][yy] = std::make_unique<TEfficiency>(*mFakeEtas[ii][yy], *mTotEtas[ii][yy]);
808 mEffGoodRad[ii] = std::make_unique<TEfficiency>(*mGoodRad[ii], *mTotRad[ii]);
809 mEffFakeRad[ii] = std::make_unique<TEfficiency>(*mFakeRad[ii], *mTotRad[ii]);
810 mEffGoodZ[ii] = std::make_unique<TEfficiency>(*mGoodZ[ii], *mTotZ[ii]);
811 mEffFakeZ[ii] = std::make_unique<TEfficiency>(*mFakeZ[ii], *mTotZ[ii]);
814 LOGP(info,
"** Analysing pT resolution...");
815 for (
auto iTrack{0}; iTrack < mTracks.size(); ++iTrack) {
816 auto& lab = mTracksMCLabels[iTrack];
817 if (!lab.isSet() || lab.isNoise()) {
820 int trackID, evID, srcID;
822 lab.get(trackID, evID, srcID, fake);
826 mPtResolution->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
827 mPtResolution2D->Fill(mParticleInfo[srcID][evID][trackID].pt, (mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
828 if (!mParticleInfo[srcID][evID][trackID].isPrimary) {
829 mPtResolutionSec->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
831 mPtResolutionPrim->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
834 for (
int yy = 0; yy < 100; yy++) {
841 for (
int yy = 0; yy < 100; yy++) {
842 TH1D* projh2X = mPtResolution2D->ProjectionY(
"projh2X", yy, yy + 1,
"");
843 TF1* f1 =
new TF1(
"f1",
"gaus", -0.2, 0.2);
845 if (f1->GetParameter(2) > 0. && f1->GetParameter(2) < 1. && f1->GetParameter(1) < 1.) {
846 sigma[yy] = f1->GetParameter(2);
847 sigmaerr[yy] = f1->GetParError(2);
848 meanPt[yy] = ((8. / 100.) * yy + (8. / 100.) * (yy + 1)) / 2;
881 TFile fout(mOutFileName.c_str(),
"recreate");
883 setEfficiencyGraph(mEffPt,
"Good_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kAzure + 4, 0.65);
884 fout.WriteTObject(mEffPt.get());
886 setEfficiencyGraph(mEffFakePt,
"Fake_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kRed, 0.65);
887 fout.WriteTObject(mEffFakePt.get());
889 setEfficiencyGraph(mEffPtSec,
"Good_ptSec",
";#it{p}_{T} (GeV/#it{c});efficiency secondary particle", kOrange + 7);
890 fout.WriteTObject(mEffPtSec.get());
892 setEfficiencyGraph(mEffFakePtSec,
"Fake_ptSec",
";#it{p}_{T} (GeV/#it{c});efficiency secondary particle", kGray + 2);
893 fout.WriteTObject(mEffFakePtSec.get());
895 setEfficiencyGraph(mEffClonesPt,
"Clone_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kGreen + 2, 0.65);
896 fout.WriteTObject(mEffClonesPt.get());
898 setEfficiencyGraph(mEffEta,
"Good_eta",
";#eta;efficiency primary particle", kAzure + 4, 0.65);
899 fout.WriteTObject(mEffEta.get());
901 setEfficiencyGraph(mEffFakeEta,
"Fake_eta",
";#eta;efficiency primary particle", kRed + 1, 0.65);
902 fout.WriteTObject(mEffFakeEta.get());
904 setEfficiencyGraph(mEffEtaSec,
"Good_etaSec",
";#eta;efficiency secondary particle", kOrange + 7);
905 fout.WriteTObject(mEffEtaSec.get());
907 setEfficiencyGraph(mEffFakeEtaSec,
"Fake_etaSec",
";#eta;efficiency secondary particle", kGray + 2);
908 fout.WriteTObject(mEffFakeEtaSec.get());
910 setEfficiencyGraph(mEffClonesEta,
"Clone_eta",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kGreen + 2, 0.65);
911 fout.WriteTObject(mEffClonesEta.get());
913 for (
int aa = 0; aa < 4; aa++) {
914 setEfficiencyGraph(mEffGoodRad[aa], Form(
"Good_Rad_%s", particleToanalize[aa]),
";Radius [cm];efficiency secondary particle", colorArr[aa]);
915 fout.WriteTObject(mEffGoodRad[aa].
get());
917 setEfficiencyGraph(mEffGoodRad[aa], Form(
"Fake_Rad_%s", particleToanalize[aa]),
";Radius [cm];efficiency secondary particle", colorArr[aa] - 9);
918 fout.WriteTObject(mEffGoodRad[aa].
get());
920 setEfficiencyGraph(mEffGoodZ[aa], Form(
"Good_Z_%s", particleToanalize[aa]),
";Z_{sv} [cm];efficiency secondary particle", colorArr[aa]);
921 fout.WriteTObject(mEffGoodZ[aa].
get());
923 setEfficiencyGraph(mEffGoodZ[aa], Form(
"Fake_Z_%s", particleToanalize[aa]),
";Z_{sv} [cm];efficiency secondary particle", colorArr[aa] - 9);
924 fout.WriteTObject(mEffGoodZ[aa].
get());
926 for (
int bb = 0;
bb < 4;
bb++) {
927 setEfficiencyGraph(mEffGoodPts[aa][
bb], Form(
"EffPtGood_%sl%d", particleToanalize[aa],
bb), Form(
"Good Sec Tracks_%s, L%d"
928 ";#it{p}_{T} (GeV/#it{c});efficiency secondary particle ",
929 particleToanalize[aa],
bb),
931 setEfficiencyGraph(mEffFakePts[aa][
bb], Form(
"EffPtFake_%sl%d", particleToanalize[aa],
bb), Form(
"Fake Sec Tracks_%s, L%d"
932 ";#it{p}_{T} (GeV/#it{c});efficiency secondary particle ",
933 particleToanalize[aa],
bb),
935 setEfficiencyGraph(mEffGoodEtas[aa][
bb], Form(
"EffEtaGood_%sl%d", particleToanalize[aa],
bb), Form(
"Good Sec Tracks_%s, L%d"
936 ";#eta ;efficiency secondary particle ",
937 particleToanalize[aa],
bb),
939 setEfficiencyGraph(mEffFakeEtas[aa][
bb], Form(
"EffEtaFake_%sl%d", particleToanalize[aa],
bb), Form(
"Fake Sec Tracks_%s, L%d"
940 ";#eta ;efficiency secondary particle ",
941 particleToanalize[aa],
bb),
944 fout.WriteTObject(mEffGoodPts[aa][
bb].
get());
945 fout.WriteTObject(mEffFakePts[aa][
bb].
get());
946 fout.WriteTObject(mEffGoodEtas[aa][
bb].
get());
947 fout.WriteTObject(mEffFakeEtas[aa][
bb].
get());
949 for (
int i = 0;
i < 3;
i++) {
950 fout.WriteTObject(histLength[aa][
i], Form(
"trk_len_%d_%s", 4 + aa,
name[
i]));
951 fout.WriteTObject(histLength1Fake[aa][
i], Form(
"trk_len_%d_1f_%s", 4 + aa,
name[
i]));
952 fout.WriteTObject(histLength2Fake[aa][
i], Form(
"trk_len_%d_2f_%s", 4 + aa,
name[
i]));
953 fout.WriteTObject(histLength3Fake[aa][
i], Form(
"trk_len_%d_3f_%s", 4 + aa,
name[
i]));
954 fout.WriteTObject(histLengthNoCl[aa][
i], Form(
"trk_len_%d_nocl_%s", 4 + aa,
name[
i]));
955 fout.WriteTObject(histLength1FakeNoCl[aa][
i], Form(
"trk_len_%d_1f_nocl_%s", 4 + aa,
name[
i]));
956 fout.WriteTObject(histLength2FakeNoCl[aa][
i], Form(
"trk_len_%d_2f_nocl_%s", 4 + aa,
name[
i]));
957 fout.WriteTObject(histLength3FakeNoCl[aa][
i], Form(
"trk_len_%d_3f_nocl_%s", 4 + aa,
name[
i]));
961 for (
int j = 0;
j < 4;
j++) {
962 for (
int i = 1;
i <= 7;
i++) {
963 mClusterFake[
j]->GetXaxis()->SetBinLabel(
i, ParticleName[
i - 1]);
965 for (
int i = 1;
i <= 50;
i++) {
966 mClusterFake[
j]->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
968 processvsZ->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
969 processvsRad->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
970 processvsRadOther->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
971 processvsRadNotTracked->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
972 processvsEtaNotTracked->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
975 fout.WriteTObject(mClusterFake[
j].
get());
978 fout.WriteTObject(processvsZ.get());
979 fout.WriteTObject(processvsRad.get());
980 fout.WriteTObject(processvsRadOther.get());
981 fout.WriteTObject(processvsRadNotTracked.get());
982 fout.WriteTObject(processvsEtaNotTracked.get());
986 gStyle->SetTitleSize(0.035,
"xy");
987 gStyle->SetLabelSize(0.035,
"xy");
988 gStyle->SetPadRightMargin(0.035);
989 gStyle->SetPadTopMargin(0.035);
990 gStyle->SetPadLeftMargin(0.19);
991 gStyle->SetPadBottomMargin(0.17);
992 gStyle->SetTitleOffset(1.4,
"x");
993 gStyle->SetTitleOffset(1.1,
"y");
994 gStyle->SetPadTickX(1);
995 gStyle->SetPadTickY(1);
996 gStyle->SetGridStyle(3);
997 gStyle->SetGridWidth(1);
999 mCanvasPt = std::make_unique<TCanvas>(
"cPt",
"cPt", 1600, 1200);
1001 mCanvasPt->SetLogx();
1002 mCanvasPt->SetGrid();
1004 mEffFakePt->Draw(
"pz same");
1005 mEffClonesPt->Draw(
"pz same");
1006 mLegendPt = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1007 mLegendPt->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1008 mLegendPt->AddEntry(
"Good_pt",
"good (100% cluster purity)",
"lep");
1009 mLegendPt->AddEntry(
"Fake_pt",
"fake",
"lep");
1010 mLegendPt->AddEntry(
"Clone_pt",
"clone",
"lep");
1012 mCanvasPt->SaveAs(
"eff_pt.png");
1014 mCanvasPtSec = std::make_unique<TCanvas>(
"cPtSec",
"cPtSec", 1600, 1200);
1016 mCanvasPtSec->SetLogx();
1017 mCanvasPtSec->SetGrid();
1018 mEffPtSec->Draw(
"pz");
1019 mEffFakePtSec->Draw(
"pz same");
1020 mLegendPtSec = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1021 mLegendPtSec->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1022 mLegendPtSec->AddEntry(
"Good_ptSec",
"good (100% cluster purity)",
"lep");
1023 mLegendPtSec->AddEntry(
"Fake_tSec",
"fake",
"lep");
1024 mLegendPtSec->Draw();
1025 mCanvasPtSec->SaveAs(
"eff_ptSec.png");
1027 mCanvasEta = std::make_unique<TCanvas>(
"cEta",
"cEta", 1600, 1200);
1029 mCanvasEta->SetGrid();
1030 mEffEta->Draw(
"pz");
1031 mEffFakeEta->Draw(
"pz same");
1032 mEffClonesEta->Draw(
"pz same");
1033 mLegendEta = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1034 mLegendEta->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1035 mLegendEta->AddEntry(
"Good_eta",
"good (100% cluster purity)",
"lep");
1036 mLegendEta->AddEntry(
"Fake_eta",
"fake",
"lep");
1037 mLegendEta->AddEntry(
"Clone_eta",
"clone",
"lep");
1039 mCanvasEta->SaveAs(
"eff_eta.png");
1041 mCanvasEtaSec = std::make_unique<TCanvas>(
"cEtaSec",
"cEtaSec", 1600, 1200);
1042 mCanvasEtaSec->cd();
1043 mCanvasEtaSec->SetGrid();
1044 mEffEtaSec->Draw(
"pz");
1045 mEffFakeEtaSec->Draw(
"pz same");
1046 mLegendEtaSec = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1047 mLegendEtaSec->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1048 mLegendEtaSec->AddEntry(
"Good_etaSec",
"good (100% cluster purity)",
"lep");
1049 mLegendEtaSec->AddEntry(
"Fake_etaSec",
"fake",
"lep");
1050 mLegendEtaSec->Draw();
1051 mCanvasEtaSec->SaveAs(
"eff_EtaSec.png");
1053 mCanvasRad = std::make_unique<TCanvas>(
"cRad",
"cRad", 1600, 1200);
1055 mCanvasRad->SetGrid();
1056 mEffGoodRad[3]->Draw(
"pz");
1057 mEffFakeRad[3]->Draw(
"pz same");
1058 mCanvasRad->SetLogy();
1059 mLegendRad = std::make_unique<TLegend>(0.8, 0.4, 0.95, 0.6);
1060 mLegendRad->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1061 mLegendRad->AddEntry(Form(
"Good_Rad_%s", particleToanalize[3]),
"good",
"lep");
1062 mLegendRad->AddEntry(Form(
"Fake_Rad_%s", particleToanalize[3]),
"fake",
"lep");
1064 mCanvasRad->SaveAs(
"eff_rad_sec.png");
1066 mCanvasZ = std::make_unique<TCanvas>(
"cZ",
"cZ", 1600, 1200);
1068 mCanvasZ->SetGrid();
1069 mCanvasZ->SetLogy();
1070 mEffGoodZ[3]->Draw(
"pz");
1071 mEffFakeZ[3]->Draw(
"pz same");
1072 mCanvasZ->SetLogy();
1073 mLegendZ = std::make_unique<TLegend>(0.8, 0.4, 0.95, 0.6);
1074 mLegendZ->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1075 mLegendZ->AddEntry(Form(
"Good_Z_%s", particleToanalize[3]),
"good",
"lep");
1076 mLegendZ->AddEntry(Form(
"Fake_Z_%s", particleToanalize[3]),
"fake",
"lep");
1078 mCanvasZ->SaveAs(
"eff_Z_sec.png");
1081 mCanvasRadD = std::make_unique<TCanvas>(
"cRadD",
"cRadD", 1600, 1200);
1083 mCanvasRadD->SetGrid();
1084 mCanvasRadD->SetLogy();
1085 mLegendRadD = std::make_unique<TLegend>(0.8, 0.64, 0.95, 0.8);
1086 mLegendRadD->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1087 for (
int i = 0;
i < 3;
i++) {
1089 mEffGoodRad[
i]->Draw(
"pz");
1091 mEffGoodRad[
i]->Draw(
"pz same");
1092 mEffFakeRad[
i]->Draw(
"pz same");
1093 mLegendRadD->AddEntry(Form(
"Good_Rad%s", particleToanalize[
i]), Form(
"%s_good",
name[
i]),
"lep");
1094 mLegendRadD->AddEntry(Form(
"Fake_Rad%s", particleToanalize[
i]), Form(
"%s_fake",
name[
i]),
"lep");
1097 mLegendRadD->Draw();
1098 mCanvasRadD->SaveAs(
"eff_RadD_sec.png");
1100 mCanvasZD = std::make_unique<TCanvas>(
"cZD",
"cZD", 1600, 1200);
1102 mCanvasZD->SetGrid();
1103 mCanvasZD->SetLogy();
1104 mLegendZD = std::make_unique<TLegend>(0.8, 0.64, 0.95, 0.8);
1105 mLegendZD->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1106 for (
int i = 0;
i < 3;
i++) {
1108 mEffGoodZ[
i]->Draw(
"pz");
1110 mEffGoodZ[
i]->Draw(
"pz same");
1111 mEffFakeZ[
i]->Draw(
"pz same");
1112 mLegendZD->AddEntry(Form(
"Good_Z%s", particleToanalize[
i]), Form(
"%s_good",
name[
i]),
"lep");
1113 mLegendZD->AddEntry(Form(
"Fake_Z%s", particleToanalize[
i]), Form(
"%s_fake",
name[
i]),
"lep");
1117 mCanvasZD->SaveAs(
"eff_ZD_sec.png");
1119 mPtResolution->SetName(
"#it{p}_{T} resolution");
1120 mPtResolution->SetTitle(
";#Delta p_{T}/p_{T_{MC}} ;Entries");
1121 mPtResolution->SetFillColor(kAzure + 4);
1122 mPtResolutionPrim->SetFillColor(kRed);
1123 mPtResolutionSec->SetFillColor(kOrange);
1124 mPtResolutionPrim->SetTitle(
";#Delta p_{T}/p_{T_{MC}} ;Entries");
1125 mPtResolutionSec->SetTitle(
";#Delta #it{p}_{T}/#it{p}_{T_{MC}} ;Entries");
1126 mPtResolution2D->SetTitle(
";#it{p}_{T_{MC}} [GeV];#Delta #it{p}_{T}/#it{p}_{T_{MC}}");
1128 fout.WriteTObject(mPtResolution.get());
1129 fout.WriteTObject(mPtResolutionPrim.get());
1130 fout.WriteTObject(mPtResolutionSec.get());
1131 fout.WriteTObject(mPtResolution2D.get());
1133 mCanvasPtRes = std::make_unique<TCanvas>(
"cPtr",
"cPtr", 1600, 1200);
1135 mPtResolution->Draw(
"HIST");
1136 mLegendPtRes = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1137 mLegendPtRes->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1138 mLegendPtRes->AddEntry(
"mPtResolution",
"All events",
"lep");
1139 mLegendPtRes->Draw();
1140 mCanvasPtRes->SaveAs(
"ptRes.png");
1142 mCanvasPtRes2 = std::make_unique<TCanvas>(
"cPtr2",
"cPtr2", 1600, 1200);
1143 mCanvasPtRes2->cd();
1144 mPtResolution2D->Draw();
1145 mCanvasPtRes2->SaveAs(
"ptRes2.png");
1147 mCanvasPtRes3 = std::make_unique<TCanvas>(
"cPtr3",
"cPtr3", 1600, 1200);
1148 mCanvasPtRes3->cd();
1150 auto* g1 =
new TGraphErrors(100, meanPt, sigma, aa, sigmaerr);
1151 g1->SetMarkerStyle(8);
1152 g1->SetMarkerColor(kGreen);
1153 g1->GetXaxis()->SetTitle(
" #it{p}_{T} [GeV]");
1154 g1->GetYaxis()->SetTitle(
"#sigma #Delta #it{p}_{T}/#it{p}_{T_{MC}}");
1155 g1->GetYaxis()->SetLimits(0, 1);
1156 g1->GetXaxis()->SetLimits(0, 10.);
1158 g1->GetYaxis()->SetRangeUser(0, 1);
1159 g1->GetXaxis()->SetRangeUser(0, 10.);
1160 mCanvasPtRes3->SaveAs(
"ptRes3.png");
1162 mCanvasPtRes4 = std::make_unique<TCanvas>(
"cPt4",
"cPt4", 1600, 1200);
1163 mCanvasPtRes4->cd();
1164 mPtResolutionPrim->SetName(
"mPtResolutionPrim");
1165 mPtResolutionSec->SetName(
"mPtResolutionSec");
1166 mPtResolutionPrim->Draw(
"same hist");
1167 mPtResolutionSec->Draw(
"same hist");
1168 mLegendPtRes2 = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1170 mLegendPtRes2->SetHeader(Form(
"%zu events PP", mKineReader->getNEvents(0)),
"C");
1171 mLegendPtRes2->AddEntry(
"mPtResolutionPrim",
"Primary events",
"f");
1172 mLegendPtRes2->AddEntry(
"mPtResolutionSec",
"Secondary events",
"f");
1173 mLegendPtRes2->Draw(
"same");
1174 mLegendPtRes2->SaveAs(
"ptRes4.png");
1176 auto canvas =
new TCanvas(
"fc_canvas",
"Fake clusters", 1600, 1000);
1177 canvas->Divide(4, 2);
1178 for (
int iH{0}; iH < 4; ++iH) {
1180 stackLength[iH]->Draw();
1181 stackLength[iH]->GetXaxis()->SetTitle(
"Layer");
1182 gPad->BuildLegend();
1184 for (
int iH{0}; iH < 4; ++iH) {
1186 stackLength1Fake[iH]->Draw();
1187 stackLength1Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1188 gPad->BuildLegend();
1191 canvas->SaveAs(
"fakeClusters2.png",
"recreate");
1193 auto canvas2 =
new TCanvas(
"fc_canvas2",
"Fake clusters", 1600, 1000);
1194 canvas2->Divide(4, 2);
1196 for (
int iH{0}; iH < 4; ++iH) {
1197 canvas2->cd(iH + 1);
1198 stackLength2Fake[iH]->Draw();
1199 stackLength2Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1200 gPad->BuildLegend();
1202 for (
int iH{0}; iH < 4; ++iH) {
1203 canvas2->cd(iH + 5);
1204 stackLength3Fake[iH]->Draw();
1205 stackLength3Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1206 gPad->BuildLegend();
1208 canvas2->SaveAs(
"fakeClusters3.png",
"recreate");
1210 auto canvasPtfake =
new TCanvas(
"canvasPtfake",
"Fake pt", 1600, 1000);
1211 canvasPtfake->Divide(2, 2);
1213 for (
int iH{0}; iH < 4; ++iH) {
1214 canvasPtfake->cd(iH + 1);
1215 for (
int v = 0;
v < 4;
v++) {
1217 canvasPtfake->cd(iH + 1);
1220 mEffFakePts[
v][iH]->Draw();
1222 mEffFakePts[
v][iH]->Draw(
"same");
1225 gPad->BuildLegend();
1227 gPad->SetTitle(Form(
"#it{p}_{T}, Fake Tracks, layer %d", iH));
1228 gPad->SetName(Form(
"#it{p}_{T}, Fake Tracks, layer %d", iH));
1230 canvasPtfake->SaveAs(
"PtforPartFake.png",
"recreate");
1232 auto canvasPtGood =
new TCanvas(
"canvasPtGood",
"Good pt", 1600, 1000);
1233 canvasPtGood->Divide(2, 2);
1235 for (
int iH{0}; iH < 4; ++iH) {
1236 canvasPtGood->cd(iH + 1);
1237 for (
int v = 0;
v < 4;
v++) {
1239 canvasPtGood->cd(iH + 1);
1242 mEffGoodPts[
v][iH]->Draw();
1244 mEffGoodPts[
v][iH]->Draw(
"same");
1247 gPad->BuildLegend();
1249 gPad->SetTitle(Form(
"#it{p}_{T}, Good Tracks, layer %d", iH));
1250 gPad->SetName(Form(
"#it{p}_{T}, Good Tracks, layer %d", iH));
1253 auto canvasEtafake =
new TCanvas(
"canvasEtafake",
"Fake Eta", 1600, 1000);
1254 canvasEtafake->Divide(2, 2);
1256 for (
int iH{0}; iH < 4; ++iH) {
1257 canvasEtafake->cd(iH + 1);
1258 for (
int v = 0;
v < 4;
v++) {
1260 canvasEtafake->cd(iH + 1);
1263 mEffFakeEtas[
v][iH]->Draw();
1265 mEffFakeEtas[
v][iH]->Draw(
"same");
1268 gPad->BuildLegend();
1270 gPad->SetTitle(Form(
"#eta, Fake Tracks, layer %d", iH));
1271 gPad->SetName(Form(
"#eta, Fake Tracks, layer %d", iH));
1273 auto canvasEtaGood =
new TCanvas(
"canvasEtaGood",
"Good Eta", 1600, 1000);
1274 canvasEtaGood->Divide(2, 2);
1276 for (
int iH{0}; iH < 4; ++iH) {
1277 canvasEtaGood->cd(iH + 1);
1278 for (
int v = 0;
v < 4;
v++) {
1280 canvasEtaGood->cd(iH + 1);
1283 mEffGoodEtas[
v][iH]->Draw();
1285 mEffGoodEtas[
v][iH]->Draw(
"same");
1288 gPad->BuildLegend();
1290 gPad->SetTitle(Form(
"#eta, Good Tracks, layer %d", iH));
1291 gPad->SetName(Form(
"#eta, Good Tracks, layer %d", iH));
1294 auto canvasI =
new TCanvas(
"canvasI",
"canvasI", 1600, 1000);
1296 mClusterFake[0]->Draw(
"COLZ");
1297 canvasI->SaveAs(
"Iper2D.png",
"recreate");
1299 auto canvasL =
new TCanvas(
"canvasL",
"canvasL", 1600, 1000);
1301 mClusterFake[1]->Draw(
"COLZ");
1302 canvasL->SaveAs(
"Lam2D.png",
"recreate");
1304 auto canvasK =
new TCanvas(
"canvasK",
"canvasK", 1600, 1000);
1306 mClusterFake[2]->Draw(
"COLZ");
1307 canvasK->SaveAs(
"K2D.png",
"recreate");
1309 auto canvasZProd =
new TCanvas(
"canvasZProd",
"canvasZProd", 1600, 1000);
1311 processvsZ->Draw(
"COLZ");
1312 canvasZProd->SaveAs(
"prodvsZ.png",
"recreate");
1313 auto canvasRadProd =
new TCanvas(
"canvasRadProd",
"canvasRadProd", 1600, 1000);
1314 canvasRadProd->cd();
1315 processvsRad->Draw(
"COLZ");
1316 canvasRadProd->SaveAs(
"prodvsRad.png",
"recreate");
1317 auto canvasRadProdO =
new TCanvas(
"canvasRadProdO",
"canvasRadProdO", 1600, 1000);
1318 canvasRadProdO->cd();
1319 processvsRadOther->Draw(
"COLZ");
1320 canvasRadProdO->SaveAs(
"prodvsRadO.png",
"recreate");
1321 auto canvasRadProNOTr =
new TCanvas(
"canvasRadProNOTr",
"canvasRadProNOTr", 1600, 1000);
1322 canvasRadProNOTr->cd();
1323 processvsRadNotTracked->Draw(
"COLZ");
1324 canvasRadProNOTr->SaveAs(
"prodvsRadNoTr.png",
"recreate");
1325 auto canvasEtaProNOTr =
new TCanvas(
"canvasEtaProNOTr",
"canvasEtaProNOTr", 1600, 1000);
1326 canvasEtaProNOTr->cd();
1327 processvsEtaNotTracked->Draw(
"COLZ");
1328 canvasEtaProNOTr->SaveAs(
"prodvsEtaNoTr.png",
"recreate");
1332 mCanvasEta->Write();
1333 mCanvasPtSec->Write();
1334 mCanvasEtaSec->Write();
1335 mCanvasPtRes->Write();
1336 mCanvasPtRes2->Write();
1337 mCanvasPtRes3->Write();
1338 mCanvasPtRes4->Write();
1339 mCanvasRad->Write();
1341 mCanvasRadD->Write();
1345 canvasPtfake->Write();