62 unsigned char isReco = 0u;
63 unsigned char isFake = 0u;
64 bool isPrimary =
false;
65 unsigned char storedStatus = 2;
66 const char* prodProcessName;
75 std::shared_ptr<o2::steer::MCKinematicsReader> kineReader,
76 std::shared_ptr<o2::base::GRPGeomRequest> gr) : mDataRequest(dr), mTracksSrc(
src), mKineReader(kineReader), mGGCCDBRequest(gr)
79 LOGP(info,
"Read MCKine reader with {} sources", mKineReader->getNSources());
90 void setEfficiencyGraph(
std::unique_ptr<TEfficiency>&, const
char*, const
char*, const
int, const
double, const
double, const
int, const
double);
103 int mNLayerSlots = 1;
104 gsl::span<const
int> mInputITSidxs;
109 std::shared_ptr<DataRequest> mDataRequest;
110 std::vector<std::vector<std::vector<ParticleInfo>>> mParticleInfo;
111 unsigned short mMask = 0x7f;
114 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
117 std::unique_ptr<TH1D> mGoodPt;
118 std::unique_ptr<TH1D> mGoodEta;
119 std::unique_ptr<TH1D> mGoodPtSec;
120 std::unique_ptr<TH1D> mGoodEtaSec;
121 std::unique_ptr<TH1D> mGoodChi2;
122 std::unique_ptr<TH1D> mFakePt;
123 std::unique_ptr<TH1D> mFakeEta;
124 std::unique_ptr<TH1D> mFakePtSec;
125 std::unique_ptr<TH1D> mFakeEtaSec;
126 std::unique_ptr<TH1D> mMultiFake;
127 std::unique_ptr<TH1D> mFakeChi2;
128 std::unique_ptr<TH1D> mClonePt;
129 std::unique_ptr<TH1D> mCloneEta;
131 std::unique_ptr<TH1D> mDenominatorPt;
132 std::unique_ptr<TH1D> mDenominatorEta;
133 std::unique_ptr<TH1D> mDenominatorPtSec;
134 std::unique_ptr<TH1D> mDenominatorEtaSec;
136 std::unique_ptr<TH2D> processvsZ;
137 std::unique_ptr<TH2D> processvsRad;
138 std::unique_ptr<TH2D> processvsRadOther;
139 std::unique_ptr<TH2D> processvsRadNotTracked;
140 std::unique_ptr<TH2D> processvsEtaNotTracked;
142 std::unique_ptr<TEfficiency> mEffPt;
143 std::unique_ptr<TEfficiency> mEffFakePt;
144 std::unique_ptr<TEfficiency> mEffClonesPt;
145 std::unique_ptr<TEfficiency> mEffEta;
146 std::unique_ptr<TEfficiency> mEffFakeEta;
147 std::unique_ptr<TEfficiency> mEffClonesEta;
149 std::unique_ptr<TEfficiency> mEffPtSec;
150 std::unique_ptr<TEfficiency> mEffFakePtSec;
151 std::unique_ptr<TEfficiency> mEffEtaSec;
152 std::unique_ptr<TEfficiency> mEffFakeEtaSec;
154 std::unique_ptr<TH1D> mPtResolution;
155 std::unique_ptr<TH2D> mPtResolution2D;
156 std::unique_ptr<TH1D> mPtResolutionSec;
157 std::unique_ptr<TH1D> mPtResolutionPrim;
158 std::unique_ptr<TGraphErrors> g1;
160 const char* ParticleName[7] = {
"e^{-/+}",
"#pi^{-/+}",
"p",
"^{2}H",
"^{3}He",
"_{#Lambda}^{3}H",
"k^{+/-}"};
161 const int PdgcodeClusterFake[7] = {11, 211, 2212, 1000010020, 100002030, 1010010030, 321};
162 const char*
name[3] = {
"_{#Lambda}^{3}H",
"#Lambda",
"k^{0}_{s}"};
163 const char* particleToanalize[4] = {
"IperT",
"Lambda",
"k0s",
"Tot"};
164 const int PDG[3] = {1010010030, 3122, 310};
165 const char* ProcessName[50];
166 int colorArr[4] = {kGreen, kRed, kBlue, kOrange};
168 std::vector<std::vector<TH1I*>> histLength, histLength1Fake, histLength2Fake, histLength3Fake, histLengthNoCl, histLength1FakeNoCl, histLength2FakeNoCl, histLength3FakeNoCl;
169 std::vector<THStack*> stackLength, stackLength1Fake, stackLength2Fake, stackLength3Fake;
170 std::vector<TLegend*> legends, legends1Fake, legends2Fake, legends3Fake;
171 std::vector<std::unique_ptr<TH2D>> mClusterFake;
172 std::vector<std::vector<std::unique_ptr<TH1D>>> mGoodPts, mFakePts, mTotPts, mGoodEtas, mTotEtas, mFakeEtas;
173 std::vector<std::vector<std::unique_ptr<TEfficiency>>> mEffGoodPts, mEffFakePts, mEffGoodEtas, mEffFakeEtas;
174 std::vector<std::unique_ptr<TH1D>> mGoodRad, mFakeRad, mTotRad, mGoodZ, mFakeZ, mTotZ;
175 std::vector<std::unique_ptr<TEfficiency>> mEffGoodRad, mEffFakeRad, mEffGoodZ, mEffFakeZ;
177 std::unique_ptr<TCanvas> mCanvasPt;
178 std::unique_ptr<TCanvas> mCanvasPtSec;
179 std::unique_ptr<TCanvas> mCanvasPt2;
180 std::unique_ptr<TCanvas> mCanvasPt2fake;
181 std::unique_ptr<TCanvas> mCanvasEta;
182 std::unique_ptr<TCanvas> mCanvasEtaSec;
183 std::unique_ptr<TCanvas> mCanvasRad;
184 std::unique_ptr<TCanvas> mCanvasZ;
185 std::unique_ptr<TCanvas> mCanvasRadD;
186 std::unique_ptr<TCanvas> mCanvasZD;
187 std::unique_ptr<TCanvas> mCanvasPtRes;
188 std::unique_ptr<TCanvas> mCanvasPtRes2;
189 std::unique_ptr<TCanvas> mCanvasPtRes3;
190 std::unique_ptr<TCanvas> mCanvasPtRes4;
191 std::unique_ptr<TLegend> mLegendPt;
192 std::unique_ptr<TLegend> mLegendEta;
193 std::unique_ptr<TLegend> mLegendPtSec;
194 std::unique_ptr<TLegend> mLegendEtaSec;
195 std::unique_ptr<TLegend> mLegendPtRes;
196 std::unique_ptr<TLegend> mLegendPtRes2;
197 std::unique_ptr<TLegend> mLegendZ;
198 std::unique_ptr<TLegend> mLegendRad;
199 std::unique_ptr<TLegend> mLegendZD;
200 std::unique_ptr<TLegend> mLegendRadD;
201 std::vector<TH1D> Histo;
203 float rLayer0 = 2.34;
204 float rLayer1 = 3.15;
205 float rLayer2 = 3.93;
206 float rLayer3 = 19.605;
209 double sigmaerr[100];
214 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
222 mOutFileName = pars.outFileName;
223 mMask = pars.trackLengthMask;
225 std::vector<double> xbins;
226 xbins.resize(pars.effHistBins + 1);
227 double a = std::log(pars.effPtCutHigh / pars.effPtCutLow) / pars.effHistBins;
228 for (
int i{0};
i <= pars.effHistBins;
i++) {
229 xbins[
i] = pars.effPtCutLow * std::exp(
i *
a);
231 for (
int yy = 0; yy < 50; yy++) {
232 ProcessName[yy] =
" ";
234 mGoodPt = std::make_unique<TH1D>(
"goodPt",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
235 mGoodEta = std::make_unique<TH1D>(
"goodEta",
";#eta;Number of tracks", 60, -3, 3);
236 mGoodPtSec = std::make_unique<TH1D>(
"goodPtSec",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", pars.effHistBins, xbins.data());
237 mGoodEtaSec = std::make_unique<TH1D>(
"goodEtaSec",
";#eta;Number of tracks", 60, -3, 3);
238 mGoodChi2 = std::make_unique<TH1D>(
"goodChi2",
";#it{p}_{T} (GeV/#it{c});Efficiency (fake-track rate)", 200, 0, 100);
240 mFakePt = std::make_unique<TH1D>(
"fakePt",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
241 mFakeEta = std::make_unique<TH1D>(
"fakeEta",
";#eta;Number of tracks", 60, -3, 3);
242 mFakePtSec = std::make_unique<TH1D>(
"fakePtSec",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
243 mFakeEtaSec = std::make_unique<TH1D>(
"fakeEtaSec",
";#eta;Number of tracks", 60, -3, 3);
244 mFakeChi2 = std::make_unique<TH1D>(
"fakeChi2",
";#it{p}_{T} (GeV/#it{c});Fak", 200, 0, 100);
246 mMultiFake = std::make_unique<TH1D>(
"multiFake",
";#it{p}_{T} (GeV/#it{c});Fak", pars.effHistBins, xbins.data());
248 mClonePt = std::make_unique<TH1D>(
"clonePt",
";#it{p}_{T} (GeV/#it{c});Clone", pars.effHistBins, xbins.data());
249 mCloneEta = std::make_unique<TH1D>(
"cloneEta",
";#eta;Number of tracks", 60, -3, 3);
251 mDenominatorPt = std::make_unique<TH1D>(
"denominatorPt",
";#it{p}_{T} (GeV/#it{c});Den", pars.effHistBins, xbins.data());
252 mDenominatorEta = std::make_unique<TH1D>(
"denominatorEta",
";#eta;Number of tracks", 60, -3, 3);
253 mDenominatorPtSec = std::make_unique<TH1D>(
"denominatorPtSec",
";#it{p}_{T} (GeV/#it{c});Den", pars.effHistBins, xbins.data());
254 mDenominatorEtaSec = std::make_unique<TH1D>(
"denominatorEtaSec",
";#eta;Number of tracks", 60, -3, 3);
256 processvsZ = std::make_unique<TH2D>(
"Process",
";z_{SV} [cm]; production process", 100, -50, 50., 50, 0, 50);
257 processvsRad = std::make_unique<TH2D>(
"ProcessR",
";decay radius [cm]; production process", 100, 0, 25., 50, 0, 50);
258 processvsRadOther = std::make_unique<TH2D>(
"ProcessRO",
";decay radius [cm]; production process", 200, 0, 25., 50, 0, 50);
259 processvsRadNotTracked = std::make_unique<TH2D>(
"ProcessRNoT",
";decay radius [cm]; production process", 200, 0, 25., 50, 0, 50);
260 processvsEtaNotTracked = std::make_unique<TH2D>(
"ProcessENoT",
";#eta; production process", 60, -3, 3, 50, 0, 50);
274 mClusterFake.resize(4);
275 for (
int i = 0;
i < 4;
i++) {
276 mGoodPts[
i].resize(4);
277 mFakePts[
i].resize(4);
278 mTotPts[
i].resize(4);
279 mGoodEtas[
i].resize(4);
280 mFakeEtas[
i].resize(4);
281 mTotEtas[
i].resize(4);
283 for (
int ii = 0; ii < 4; ii++) {
285 mGoodRad[ii] = std::make_unique<TH1D>(Form(
"goodRad_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, 0., 20.);
286 mFakeRad[ii] = std::make_unique<TH1D>(Form(
"FakeRad_%s", particleToanalize[ii]),
";#eta;Number of tracks", 100, 0., 20.);
287 mTotRad[ii] = std::make_unique<TH1D>(Form(
"TotRad_%s", particleToanalize[ii]),
";#eta;Number of tracks", 100, 0., 20.);
289 mGoodZ[ii] = std::make_unique<TH1D>(Form(
"goodZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
290 mFakeZ[ii] = std::make_unique<TH1D>(Form(
"FakeZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
291 mTotZ[ii] = std::make_unique<TH1D>(Form(
"TotZ_%s", particleToanalize[ii]),
";z_{SV} [cm];Number of tracks", 100, -50., 50.);
292 mClusterFake[ii] = std::make_unique<TH2D>(Form(
"Clusters_fake_%s", ParticleName[ii]),
";particle generating fake cluster; production process", 7, 0., 7., 50, 0, 50);
294 mGoodRad[ii]->Sumw2();
295 mFakeRad[ii]->Sumw2();
296 mTotRad[ii]->Sumw2();
301 for (
int yy = 0; yy < 4; yy++) {
302 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());
303 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());
304 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());
306 mGoodEtas[ii][yy] = std::make_unique<TH1D>(Form(
"goodEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
307 mFakeEtas[ii][yy] = std::make_unique<TH1D>(Form(
"FakeEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
308 mTotEtas[ii][yy] = std::make_unique<TH1D>(Form(
"TotEtas_%s_%d", particleToanalize[ii], yy),
";#eta;Number of tracks", 60, -3, 3);
310 mGoodPts[ii][yy]->Sumw2();
311 mFakePts[ii][yy]->Sumw2();
312 mTotPts[ii][yy]->Sumw2();
313 mGoodEtas[ii][yy]->Sumw2();
314 mFakeEtas[ii][yy]->Sumw2();
315 mTotEtas[ii][yy]->Sumw2();
319 mPtResolution = std::make_unique<TH1D>(
"PtResolution",
";#it{p}_{T} ;Den", 100, -1, 1);
320 mPtResolutionSec = std::make_unique<TH1D>(
"PtResolutionSec",
";#it{p}_{T} ;Den", 100, -1, 1);
321 mPtResolutionPrim = std::make_unique<TH1D>(
"PtResolutionPrim",
";#it{p}_{T} ;Den", 100, -1, 1);
322 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);
324 mPtResolution->Sumw2();
325 mPtResolutionSec->Sumw2();
326 mPtResolutionPrim->Sumw2();
331 mGoodEtaSec->Sumw2();
338 mDenominatorPt->Sumw2();
340 histLength.resize(4);
341 histLength1Fake.resize(4);
342 histLength2Fake.resize(4);
343 histLength3Fake.resize(4);
344 histLengthNoCl.resize(4);
345 histLength1FakeNoCl.resize(4);
346 histLength2FakeNoCl.resize(4);
347 histLength3FakeNoCl.resize(4);
348 stackLength.resize(4);
349 stackLength1Fake.resize(4);
350 stackLength2Fake.resize(4);
351 stackLength3Fake.resize(4);
352 for (
int yy = 0; yy < 4; yy++) {
353 histLength[yy].resize(3);
354 histLength1Fake[yy].resize(3);
355 histLength2Fake[yy].resize(3);
356 histLength3Fake[yy].resize(3);
357 histLengthNoCl[yy].resize(3);
358 histLength1FakeNoCl[yy].resize(3);
359 histLength2FakeNoCl[yy].resize(3);
360 histLength3FakeNoCl[yy].resize(3);
363 legends1Fake.resize(4);
364 legends2Fake.resize(4);
365 legends3Fake.resize(4);
367 for (
int iH{4}; iH < 8; ++iH) {
370 for (
int jj = 0; jj < 3; jj++) {
371 histLength[iH - 4][jj] =
new TH1I(Form(
"trk_len_%d_%s", iH,
name[jj]), Form(
"#exists cluster %s",
name[jj]), 7, -.5, 6.5);
372 histLength[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
373 histLength[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
374 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);
375 histLengthNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
376 histLengthNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
378 stackLength[iH - 4] =
new THStack(Form(
"stack_trk_len_%d", iH), Form(
"trk_len=%d", iH));
380 stackLength[iH - 4]->Add(histLength[iH - 4][jj]);
381 stackLength[iH - 4]->Add(histLengthNoCl[iH - 4][jj]);
383 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);
384 histLength1Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
385 histLength1Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
386 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);
387 histLength1FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
388 histLength1FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
390 stackLength1Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_1f", iH), Form(
"trk_len=%d, 1 Fake", iH));
392 stackLength1Fake[iH - 4]->Add(histLength1Fake[iH - 4][jj]);
393 stackLength1Fake[iH - 4]->Add(histLength1FakeNoCl[iH - 4][jj]);
395 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);
396 histLength2Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
397 histLength2Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
398 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);
399 histLength2FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
400 histLength2FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
402 stackLength2Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_2f", iH), Form(
"trk_len=%d, 2 Fake", iH));
404 stackLength2Fake[iH - 4]->Add(histLength2Fake[iH - 4][jj]);
405 stackLength2Fake[iH - 4]->Add(histLength2FakeNoCl[iH - 4][jj]);
407 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);
408 histLength3Fake[iH - 4][jj]->SetFillColor(colorArr[jj] - 9);
409 histLength3Fake[iH - 4][jj]->SetLineColor(colorArr[jj] - 9);
411 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);
412 histLength3FakeNoCl[iH - 4][jj]->SetFillColor(colorArr[jj] + 1);
413 histLength3FakeNoCl[iH - 4][jj]->SetLineColor(colorArr[jj] + 1);
415 stackLength3Fake[iH - 4] =
new THStack(Form(
"stack_trk_len_%d_3f", iH), Form(
"trk_len=%d, 3 Fake", iH));
417 stackLength3Fake[iH - 4]->Add(histLength3Fake[iH - 4][jj]);
418 stackLength3Fake[iH - 4]->Add(histLength3FakeNoCl[iH - 4][jj]);
455 LOGP(info,
"** Filling particle table ... ");
456 mParticleInfo.resize(mKineReader->getNSources());
457 for (
int iSource{0}; iSource < mKineReader->getNSources(); ++iSource) {
458 mParticleInfo[iSource].resize(mKineReader->getNEvents(iSource));
459 for (
int iEvent{0}; iEvent < mKineReader->getNEvents(iSource); ++iEvent) {
460 mParticleInfo[iSource][iEvent].resize(mKineReader->getTracks(iSource, iEvent).size());
461 for (
auto iPart{0}; iPart < mKineReader->getTracks(iEvent).
size(); ++iPart) {
462 auto& part = mKineReader->getTracks(iSource, iEvent)[iPart];
463 mParticleInfo[iSource][iEvent][iPart].event = iEvent;
464 mParticleInfo[iSource][iEvent][iPart].pdg = part.GetPdgCode();
465 mParticleInfo[iSource][iEvent][iPart].pt = part.GetPt();
466 mParticleInfo[iSource][iEvent][iPart].phi = part.GetPhi();
467 mParticleInfo[iSource][iEvent][iPart].eta = part.GetEta();
468 mParticleInfo[iSource][iEvent][iPart].vx = part.Vx();
469 mParticleInfo[iSource][iEvent][iPart].vy = part.Vy();
470 mParticleInfo[iSource][iEvent][iPart].vz = part.Vz();
471 mParticleInfo[iSource][iEvent][iPart].isPrimary = part.isPrimary();
472 mParticleInfo[iSource][iEvent][iPart].mother = part.getMotherTrackId();
473 mParticleInfo[iSource][iEvent][iPart].prodProcessName = part.getProdProcessAsString();
474 mParticleInfo[iSource][iEvent][iPart].prodProcess = part.getProcess();
478 LOGP(info,
"** Creating particle/clusters correspondance ... ");
479 for (
auto iSource{0}; iSource < mParticleInfo.size(); ++iSource) {
480 for (
int lr = 0; lr < mNLayerSlots; lr++) {
481 for (
auto iCluster{0}; iCluster < mClusters[lr].size(); ++iCluster) {
482 auto labs = mClustersMCLCont[lr]->getLabels(iCluster);
483 for (
auto& lab : labs) {
484 if (!lab.isValid()) {
487 int trackID, evID, srcID;
489 lab.get(trackID, evID, srcID, fake);
490 auto& cluster = mClusters[lr][iCluster];
492 mParticleInfo[srcID][evID][trackID].clusters |= (1 <<
layer);
497 LOGP(info,
"** Analysing tracks ... ");
498 int unaccounted{0}, good{0}, fakes{0};
500 int nPartForSpec[4][4];
501 int nPartGoodorFake[4][4][2];
502 for (
int n = 0;
n < 4;
n++) {
503 for (
int m = 0;
m < 4;
m++) {
504 nPartForSpec[
n][
m] = 0;
505 for (
int h = 0;
h < 2;
h++) {
506 nPartGoodorFake[
n][
m][
h] = 0;
515 for (
auto iTrack{0}; iTrack < mTracks.size(); ++iTrack) {
516 auto& lab = mTracksMCLabels[iTrack];
517 if (!lab.isSet() || lab.isNoise()) {
521 int trackID, evID, srcID;
523 lab.get(trackID, evID, srcID, fake);
530 mParticleInfo[srcID][evID][trackID].isReco += !fake;
531 mParticleInfo[srcID][evID][trackID].isFake += fake;
532 if (mTracks[iTrack].isBetter(mParticleInfo[srcID][evID][trackID].
track, 1.e9)) {
533 mParticleInfo[srcID][evID][trackID].storedStatus = fake;
534 mParticleInfo[srcID][evID][trackID].track = mTracks[iTrack];
539 LOGP(info,
"** Some statistics:");
540 LOGP(info,
"\t- Total number of tracks: {}", mTracks.size());
541 LOGP(info,
"\t- Total number of tracks not corresponding to particles: {} ({:.2f} %)", unaccounted, unaccounted * 100. / mTracks.size());
542 LOGP(info,
"\t- Total number of fakes: {} ({:.2f} %)", fakes, fakes * 100. / mTracks.size());
543 LOGP(info,
"\t- Total number of good: {} ({:.2f} %)", good, good * 100. / mTracks.size());
545 LOGP(info,
"** Filling histograms ... ");
548 int totP{0}, goodP{0}, fakeP{0};
550 for (
auto& evInfo : mParticleInfo[0]) {
552 for (
auto& part : evInfo) {
554 if (strcmp(ProcessName[part.prodProcess],
" ")) {
555 ProcessName[part.prodProcess] = part.prodProcessName;
557 if ((part.clusters & 0x7f) == mMask) {
563 if (part.isPrimary) {
565 mDenominatorPt->Fill(part.pt);
566 mDenominatorEta->Fill(part.eta);
568 mGoodPt->Fill(part.pt);
569 mGoodEta->Fill(part.eta);
571 if (part.isReco > 1) {
572 for (
int _i{0}; _i < part.isReco - 1; ++_i) {
573 mClonePt->Fill(part.pt);
574 mCloneEta->Fill(part.eta);
579 mFakePt->Fill(part.pt);
580 mFakeEta->Fill(part.eta);
582 if (part.isFake > 1) {
583 for (
int _i{0}; _i < part.isFake - 1; ++_i) {
584 mMultiFake->Fill(part.pt);
594 if (!part.isPrimary) {
595 int TrackID, EvID, SrcID;
596 int pdgcode = mParticleInfo[0][evID][part.mother].pdg;
598 float rad = sqrt(pow(part.vx, 2) + pow(part.vy, 2));
601 if ((rad < rLayer0) && (part.clusters == 0x7f || part.clusters == 0x3f || part.clusters == 0x1f || part.clusters == 0x0f)) {
604 if (rad < rLayer1 && rad > rLayer0 && (part.clusters == 0x1e || part.clusters == 0x3e || part.clusters == 0x7e)) {
607 if (rad < rLayer2 && rad > rLayer1 && (part.clusters == 0x7c || part.clusters == 0x3c)) {
610 if (rad < rLayer3 && rad > rLayer2 && part.clusters == 0x78) {
613 if (nlayer == 0 || nlayer == 1 || nlayer == 2 || nlayer == 3) {
616 processvsZ->Fill(part.vz, part.prodProcess);
617 processvsRad->Fill(rad, part.prodProcess);
618 mDenominatorPtSec->Fill(part.pt);
619 mDenominatorEtaSec->Fill(part.eta);
620 mTotRad[3]->Fill(rad);
621 mTotZ[3]->Fill(part.vz);
622 mTotPts[nlayer][3]->Fill(part.pt);
623 mTotEtas[nlayer][3]->Fill(part.eta);
624 mTotPts[nlayer][3]->Fill(part.pt);
625 mTotEtas[nlayer][3]->Fill(part.eta);
626 if (pdgcode == PDG[0] || pdgcode == -1 * PDG[0]) {
629 if (pdgcode == PDG[1] || pdgcode == -1 * PDG[1]) {
632 if (pdgcode == PDG[2] || pdgcode == -1 * PDG[2]) {
637 mGoodPts[3][nlayer]->Fill(part.pt);
638 mGoodEtas[3][nlayer]->Fill(part.eta);
639 mGoodPtSec->Fill(part.pt);
640 mGoodEtaSec->Fill(part.eta);
641 mGoodRad[3]->Fill(rad);
642 mGoodZ[3]->Fill(part.vz);
646 mFakePts[3][nlayer]->Fill(part.pt);
647 mFakeEtas[3][nlayer]->Fill(part.eta);
648 mFakePtSec->Fill(part.pt);
649 mFakeEtaSec->Fill(part.eta);
650 mFakeRad[3]->Fill(rad);
651 mFakeZ[3]->Fill(part.vz);
655 mTotRad[idxPart]->Fill(rad);
656 mTotZ[idxPart]->Fill(part.vz);
657 mTotPts[idxPart][nlayer]->Fill(part.pt);
658 mTotEtas[idxPart][nlayer]->Fill(part.eta);
660 mGoodRad[idxPart]->Fill(rad);
661 mGoodZ[idxPart]->Fill(part.vz);
662 mGoodPts[idxPart][nlayer]->Fill(part.pt);
663 mGoodEtas[idxPart][nlayer]->Fill(part.eta);
666 mFakeRad[idxPart]->Fill(rad);
667 mFakeZ[idxPart]->Fill(part.vz);
668 mFakePts[idxPart][nlayer]->Fill(part.pt);
669 mFakeEtas[idxPart][nlayer]->Fill(part.eta);
673 if (pdgcode != 1010010030 && pdgcode != 3122 && pdgcode != 310 && pdgcode != -1010010030 && pdgcode != -310 && pdgcode != -3122) {
675 processvsRadOther->Fill(rad, part.prodProcess);
678 if (!part.isFake && !part.isReco) {
679 processvsEtaNotTracked->Fill(part.eta, part.prodProcess);
680 processvsRadNotTracked->Fill(rad, part.prodProcess);
682 if (ngoodfake == 1 || ngoodfake == 0) {
683 nPartGoodorFake[idxPart][nlayer][ngoodfake]++;
685 nPartForSpec[idxPart][nlayer]++;
689 for (
unsigned int bit{0}; bit <
sizeof(part.clusters) * 8; ++bit) {
690 nCl += bool(part.clusters & (1 << bit));
696 auto&
track = part.track;
698 int nclu =
track.getNumberOfClusters();
699 int firstclu =
track.getFirstClusterEntry();
700 for (
int iLayer{0}; iLayer < 7; ++iLayer) {
701 if (
track.hasHitOnLayer(iLayer)) {
702 if (
track.isFakeOnLayer(iLayer)) {
704 if (part.clusters & (0x1 << iLayer)) {
705 histLength[
len - 4][idxPart]->Fill(iLayer);
706 if (
track.getNFakeClusters() == 1) {
707 histLength1Fake[
len - 4][idxPart]->Fill(iLayer);
709 if (
track.getNFakeClusters() == 2) {
710 histLength2Fake[
len - 4][idxPart]->Fill(iLayer);
712 if (
track.getNFakeClusters() == 3) {
713 histLength3Fake[
len - 4][idxPart]->Fill(iLayer);
717 histLengthNoCl[
len - 4][idxPart]->Fill(iLayer);
718 if (
track.getNFakeClusters() == 1) {
719 histLength1FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
721 if (
track.getNFakeClusters() == 2) {
722 histLength2FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
724 if (
track.getNFakeClusters() == 3) {
725 histLength3FakeNoCl[
len - 4][idxPart]->Fill(iLayer);
728 int clIDlbl = mInputITSidxs[firstclu - 1 - iLayer +
track.getFirstClusterLayer() + nclu];
731 for (
auto& lab : labs) {
732 if (!lab.isValid()) {
737 lab.get(TrackID, EvID, SrcID, fakec);
739 for (
int hg = 0; hg < 7; hg++) {
740 if (mParticleInfo[SrcID][EvID][TrackID].pdg == PdgcodeClusterFake[hg] || mParticleInfo[SrcID][EvID][TrackID].pdg == -1 * (PdgcodeClusterFake[hg])) {
745 mClusterFake[idxPart]->Fill(intHisto, mParticleInfo[SrcID][EvID][TrackID].prodProcess);
760 int totgood{0}, totfake{0}, totI{0}, totL{0}, totK{0}, totO{0};
761 for (
int xx = 0; xx < 4; xx++) {
762 for (
int yy = 0; yy < 4; yy++) {
763 totgood = totgood + nPartGoodorFake[xx][yy][1];
764 totfake = totfake + nPartGoodorFake[xx][yy][0];
766 totI = totI + nPartForSpec[0][yy];
769 totL = totL + nPartForSpec[1][yy];
772 totK = totK + nPartForSpec[2][yy];
775 totO = totO + nPartForSpec[3][yy];
779 LOGP(info,
"number of primary tracks: {}, good:{}, fake:{}", totP, goodP, fakeP);
780 int goodI = nPartGoodorFake[0][0][1] + nPartGoodorFake[0][1][1] + nPartGoodorFake[0][2][1] + nPartGoodorFake[0][3][1];
781 int goodL = nPartGoodorFake[1][0][1] + nPartGoodorFake[1][1][1] + nPartGoodorFake[1][2][1] + nPartGoodorFake[1][3][1];
782 int goodK = nPartGoodorFake[2][0][1] + nPartGoodorFake[2][1][1] + nPartGoodorFake[2][2][1] + nPartGoodorFake[2][3][1];
783 int fakeI = nPartGoodorFake[0][0][0] + nPartGoodorFake[0][1][0] + nPartGoodorFake[0][2][0] + nPartGoodorFake[0][3][0];
784 int fakeL = nPartGoodorFake[1][0][0] + nPartGoodorFake[1][1][0] + nPartGoodorFake[1][2][0] + nPartGoodorFake[1][3][0];
785 int fakeK = nPartGoodorFake[2][0][0] + nPartGoodorFake[2][1][0] + nPartGoodorFake[2][2][0] + nPartGoodorFake[2][3][0];
786 LOGP(info,
"** Some statistics on secondary tracks:");
788 LOGP(info,
"\t- Total number of secondary tracks: {}", totsec);
789 LOGP(info,
"\t- Total number of secondary trackeable tracks : {}", totsecCont);
790 LOGP(info,
"\t- Total number of secondary trackeable tracks good: {}, fake: {}", totgood, totfake);
791 LOGP(info,
"\t- Total number of secondary trackeable tracks from IperT: {} = {} %, Good={} % , fake={} %", totI, 100 * totI / totsecCont, 100 * goodI / totI, 100 * fakeI / totI);
792 LOGP(info,
"\t- Total number of secondary trackeable tracks from Lam: {} = {} %, Good={} % , fake={} %", totL, 100 * totL / totsecCont, 100 * goodL / totL, 100 * fakeL / totL);
793 LOGP(info,
"\t- Total number of secondary trackeable tracks from k: {} = {} %, Good={} % , fake={} %", totK, 100 * totK / totsecCont, 100 * goodK / totK, 100 * fakeK / totK);
794 LOGP(info,
"\t- Total number of secondary trackeable tracks from Other: {} = {} %", totO, 100 * totO / totsecCont);
796 LOGP(info,
"** Computing efficiencies ...");
798 mEffPt = std::make_unique<TEfficiency>(*mGoodPt, *mDenominatorPt);
799 mEffFakePt = std::make_unique<TEfficiency>(*mFakePt, *mDenominatorPt);
800 mEffClonesPt = std::make_unique<TEfficiency>(*mClonePt, *mDenominatorPt);
802 mEffEta = std::make_unique<TEfficiency>(*mGoodEta, *mDenominatorEta);
803 mEffFakeEta = std::make_unique<TEfficiency>(*mFakeEta, *mDenominatorEta);
804 mEffClonesEta = std::make_unique<TEfficiency>(*mCloneEta, *mDenominatorEta);
806 mEffPtSec = std::make_unique<TEfficiency>(*mGoodPtSec, *mDenominatorPtSec);
807 mEffFakePtSec = std::make_unique<TEfficiency>(*mFakePtSec, *mDenominatorPtSec);
809 mEffEtaSec = std::make_unique<TEfficiency>(*mGoodEtaSec, *mDenominatorEtaSec);
810 mEffFakeEtaSec = std::make_unique<TEfficiency>(*mFakeEtaSec, *mDenominatorEtaSec);
812 for (
int ii = 0; ii < 4; ii++) {
813 for (
int yy = 0; yy < 4; yy++) {
814 mEffGoodPts[ii][yy] = std::make_unique<TEfficiency>(*mGoodPts[ii][yy], *mTotPts[ii][yy]);
815 mEffFakePts[ii][yy] = std::make_unique<TEfficiency>(*mFakePts[ii][yy], *mTotPts[ii][yy]);
816 mEffGoodEtas[ii][yy] = std::make_unique<TEfficiency>(*mGoodEtas[ii][yy], *mTotEtas[ii][yy]);
817 mEffFakeEtas[ii][yy] = std::make_unique<TEfficiency>(*mFakeEtas[ii][yy], *mTotEtas[ii][yy]);
819 mEffGoodRad[ii] = std::make_unique<TEfficiency>(*mGoodRad[ii], *mTotRad[ii]);
820 mEffFakeRad[ii] = std::make_unique<TEfficiency>(*mFakeRad[ii], *mTotRad[ii]);
821 mEffGoodZ[ii] = std::make_unique<TEfficiency>(*mGoodZ[ii], *mTotZ[ii]);
822 mEffFakeZ[ii] = std::make_unique<TEfficiency>(*mFakeZ[ii], *mTotZ[ii]);
825 LOGP(info,
"** Analysing pT resolution...");
826 for (
auto iTrack{0}; iTrack < mTracks.size(); ++iTrack) {
827 auto& lab = mTracksMCLabels[iTrack];
828 if (!lab.isSet() || lab.isNoise()) {
831 int trackID, evID, srcID;
833 lab.get(trackID, evID, srcID, fake);
837 mPtResolution->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
838 mPtResolution2D->Fill(mParticleInfo[srcID][evID][trackID].pt, (mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
839 if (!mParticleInfo[srcID][evID][trackID].isPrimary) {
840 mPtResolutionSec->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
842 mPtResolutionPrim->Fill((mParticleInfo[srcID][evID][trackID].pt - mTracks[iTrack].getPt()) / mParticleInfo[srcID][evID][trackID].pt);
845 for (
int yy = 0; yy < 100; yy++) {
852 for (
int yy = 0; yy < 100; yy++) {
853 TH1D* projh2X = mPtResolution2D->ProjectionY(
"projh2X", yy, yy + 1,
"");
854 TF1* f1 =
new TF1(
"f1",
"gaus", -0.2, 0.2);
856 if (f1->GetParameter(2) > 0. && f1->GetParameter(2) < 1. && f1->GetParameter(1) < 1.) {
857 sigma[yy] = f1->GetParameter(2);
858 sigmaerr[yy] = f1->GetParError(2);
859 meanPt[yy] = ((8. / 100.) * yy + (8. / 100.) * (yy + 1)) / 2;
892 TFile fout(mOutFileName.c_str(),
"recreate");
894 setEfficiencyGraph(mEffPt,
"Good_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kAzure + 4, 0.65);
895 fout.WriteTObject(mEffPt.get());
897 setEfficiencyGraph(mEffFakePt,
"Fake_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kRed, 0.65);
898 fout.WriteTObject(mEffFakePt.get());
900 setEfficiencyGraph(mEffPtSec,
"Good_ptSec",
";#it{p}_{T} (GeV/#it{c});efficiency secondary particle", kOrange + 7);
901 fout.WriteTObject(mEffPtSec.get());
903 setEfficiencyGraph(mEffFakePtSec,
"Fake_ptSec",
";#it{p}_{T} (GeV/#it{c});efficiency secondary particle", kGray + 2);
904 fout.WriteTObject(mEffFakePtSec.get());
906 setEfficiencyGraph(mEffClonesPt,
"Clone_pt",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kGreen + 2, 0.65);
907 fout.WriteTObject(mEffClonesPt.get());
909 setEfficiencyGraph(mEffEta,
"Good_eta",
";#eta;efficiency primary particle", kAzure + 4, 0.65);
910 fout.WriteTObject(mEffEta.get());
912 setEfficiencyGraph(mEffFakeEta,
"Fake_eta",
";#eta;efficiency primary particle", kRed + 1, 0.65);
913 fout.WriteTObject(mEffFakeEta.get());
915 setEfficiencyGraph(mEffEtaSec,
"Good_etaSec",
";#eta;efficiency secondary particle", kOrange + 7);
916 fout.WriteTObject(mEffEtaSec.get());
918 setEfficiencyGraph(mEffFakeEtaSec,
"Fake_etaSec",
";#eta;efficiency secondary particle", kGray + 2);
919 fout.WriteTObject(mEffFakeEtaSec.get());
921 setEfficiencyGraph(mEffClonesEta,
"Clone_eta",
";#it{p}_{T} (GeV/#it{c});efficiency primary particle", kGreen + 2, 0.65);
922 fout.WriteTObject(mEffClonesEta.get());
924 for (
int aa = 0; aa < 4; aa++) {
925 setEfficiencyGraph(mEffGoodRad[aa], Form(
"Good_Rad_%s", particleToanalize[aa]),
";Radius [cm];efficiency secondary particle", colorArr[aa]);
926 fout.WriteTObject(mEffGoodRad[aa].
get());
928 setEfficiencyGraph(mEffGoodRad[aa], Form(
"Fake_Rad_%s", particleToanalize[aa]),
";Radius [cm];efficiency secondary particle", colorArr[aa] - 9);
929 fout.WriteTObject(mEffGoodRad[aa].
get());
931 setEfficiencyGraph(mEffGoodZ[aa], Form(
"Good_Z_%s", particleToanalize[aa]),
";Z_{sv} [cm];efficiency secondary particle", colorArr[aa]);
932 fout.WriteTObject(mEffGoodZ[aa].
get());
934 setEfficiencyGraph(mEffGoodZ[aa], Form(
"Fake_Z_%s", particleToanalize[aa]),
";Z_{sv} [cm];efficiency secondary particle", colorArr[aa] - 9);
935 fout.WriteTObject(mEffGoodZ[aa].
get());
937 for (
int bb = 0;
bb < 4;
bb++) {
938 setEfficiencyGraph(mEffGoodPts[aa][
bb], Form(
"EffPtGood_%sl%d", particleToanalize[aa],
bb), Form(
"Good Sec Tracks_%s, L%d"
939 ";#it{p}_{T} (GeV/#it{c});efficiency secondary particle ",
940 particleToanalize[aa],
bb),
942 setEfficiencyGraph(mEffFakePts[aa][
bb], Form(
"EffPtFake_%sl%d", particleToanalize[aa],
bb), Form(
"Fake Sec Tracks_%s, L%d"
943 ";#it{p}_{T} (GeV/#it{c});efficiency secondary particle ",
944 particleToanalize[aa],
bb),
946 setEfficiencyGraph(mEffGoodEtas[aa][
bb], Form(
"EffEtaGood_%sl%d", particleToanalize[aa],
bb), Form(
"Good Sec Tracks_%s, L%d"
947 ";#eta ;efficiency secondary particle ",
948 particleToanalize[aa],
bb),
950 setEfficiencyGraph(mEffFakeEtas[aa][
bb], Form(
"EffEtaFake_%sl%d", particleToanalize[aa],
bb), Form(
"Fake Sec Tracks_%s, L%d"
951 ";#eta ;efficiency secondary particle ",
952 particleToanalize[aa],
bb),
955 fout.WriteTObject(mEffGoodPts[aa][
bb].
get());
956 fout.WriteTObject(mEffFakePts[aa][
bb].
get());
957 fout.WriteTObject(mEffGoodEtas[aa][
bb].
get());
958 fout.WriteTObject(mEffFakeEtas[aa][
bb].
get());
960 for (
int i = 0;
i < 3;
i++) {
961 fout.WriteTObject(histLength[aa][
i], Form(
"trk_len_%d_%s", 4 + aa,
name[
i]));
962 fout.WriteTObject(histLength1Fake[aa][
i], Form(
"trk_len_%d_1f_%s", 4 + aa,
name[
i]));
963 fout.WriteTObject(histLength2Fake[aa][
i], Form(
"trk_len_%d_2f_%s", 4 + aa,
name[
i]));
964 fout.WriteTObject(histLength3Fake[aa][
i], Form(
"trk_len_%d_3f_%s", 4 + aa,
name[
i]));
965 fout.WriteTObject(histLengthNoCl[aa][
i], Form(
"trk_len_%d_nocl_%s", 4 + aa,
name[
i]));
966 fout.WriteTObject(histLength1FakeNoCl[aa][
i], Form(
"trk_len_%d_1f_nocl_%s", 4 + aa,
name[
i]));
967 fout.WriteTObject(histLength2FakeNoCl[aa][
i], Form(
"trk_len_%d_2f_nocl_%s", 4 + aa,
name[
i]));
968 fout.WriteTObject(histLength3FakeNoCl[aa][
i], Form(
"trk_len_%d_3f_nocl_%s", 4 + aa,
name[
i]));
972 for (
int j = 0;
j < 4;
j++) {
973 for (
int i = 1;
i <= 7;
i++) {
974 mClusterFake[
j]->GetXaxis()->SetBinLabel(
i, ParticleName[
i - 1]);
976 for (
int i = 1;
i <= 50;
i++) {
977 mClusterFake[
j]->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
979 processvsZ->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
980 processvsRad->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
981 processvsRadOther->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
982 processvsRadNotTracked->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
983 processvsEtaNotTracked->GetYaxis()->SetBinLabel(
i, ProcessName[
i - 1]);
986 fout.WriteTObject(mClusterFake[
j].
get());
989 fout.WriteTObject(processvsZ.get());
990 fout.WriteTObject(processvsRad.get());
991 fout.WriteTObject(processvsRadOther.get());
992 fout.WriteTObject(processvsRadNotTracked.get());
993 fout.WriteTObject(processvsEtaNotTracked.get());
997 gStyle->SetTitleSize(0.035,
"xy");
998 gStyle->SetLabelSize(0.035,
"xy");
999 gStyle->SetPadRightMargin(0.035);
1000 gStyle->SetPadTopMargin(0.035);
1001 gStyle->SetPadLeftMargin(0.19);
1002 gStyle->SetPadBottomMargin(0.17);
1003 gStyle->SetTitleOffset(1.4,
"x");
1004 gStyle->SetTitleOffset(1.1,
"y");
1005 gStyle->SetPadTickX(1);
1006 gStyle->SetPadTickY(1);
1007 gStyle->SetGridStyle(3);
1008 gStyle->SetGridWidth(1);
1010 mCanvasPt = std::make_unique<TCanvas>(
"cPt",
"cPt", 1600, 1200);
1012 mCanvasPt->SetLogx();
1013 mCanvasPt->SetGrid();
1015 mEffFakePt->Draw(
"pz same");
1016 mEffClonesPt->Draw(
"pz same");
1017 mLegendPt = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1018 mLegendPt->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1019 mLegendPt->AddEntry(
"Good_pt",
"good (100% cluster purity)",
"lep");
1020 mLegendPt->AddEntry(
"Fake_pt",
"fake",
"lep");
1021 mLegendPt->AddEntry(
"Clone_pt",
"clone",
"lep");
1023 mCanvasPt->SaveAs(
"eff_pt.png");
1025 mCanvasPtSec = std::make_unique<TCanvas>(
"cPtSec",
"cPtSec", 1600, 1200);
1027 mCanvasPtSec->SetLogx();
1028 mCanvasPtSec->SetGrid();
1029 mEffPtSec->Draw(
"pz");
1030 mEffFakePtSec->Draw(
"pz same");
1031 mLegendPtSec = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1032 mLegendPtSec->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1033 mLegendPtSec->AddEntry(
"Good_ptSec",
"good (100% cluster purity)",
"lep");
1034 mLegendPtSec->AddEntry(
"Fake_tSec",
"fake",
"lep");
1035 mLegendPtSec->Draw();
1036 mCanvasPtSec->SaveAs(
"eff_ptSec.png");
1038 mCanvasEta = std::make_unique<TCanvas>(
"cEta",
"cEta", 1600, 1200);
1040 mCanvasEta->SetGrid();
1041 mEffEta->Draw(
"pz");
1042 mEffFakeEta->Draw(
"pz same");
1043 mEffClonesEta->Draw(
"pz same");
1044 mLegendEta = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1045 mLegendEta->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1046 mLegendEta->AddEntry(
"Good_eta",
"good (100% cluster purity)",
"lep");
1047 mLegendEta->AddEntry(
"Fake_eta",
"fake",
"lep");
1048 mLegendEta->AddEntry(
"Clone_eta",
"clone",
"lep");
1050 mCanvasEta->SaveAs(
"eff_eta.png");
1052 mCanvasEtaSec = std::make_unique<TCanvas>(
"cEtaSec",
"cEtaSec", 1600, 1200);
1053 mCanvasEtaSec->cd();
1054 mCanvasEtaSec->SetGrid();
1055 mEffEtaSec->Draw(
"pz");
1056 mEffFakeEtaSec->Draw(
"pz same");
1057 mLegendEtaSec = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1058 mLegendEtaSec->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1059 mLegendEtaSec->AddEntry(
"Good_etaSec",
"good (100% cluster purity)",
"lep");
1060 mLegendEtaSec->AddEntry(
"Fake_etaSec",
"fake",
"lep");
1061 mLegendEtaSec->Draw();
1062 mCanvasEtaSec->SaveAs(
"eff_EtaSec.png");
1064 mCanvasRad = std::make_unique<TCanvas>(
"cRad",
"cRad", 1600, 1200);
1066 mCanvasRad->SetGrid();
1067 mEffGoodRad[3]->Draw(
"pz");
1068 mEffFakeRad[3]->Draw(
"pz same");
1069 mCanvasRad->SetLogy();
1070 mLegendRad = std::make_unique<TLegend>(0.8, 0.4, 0.95, 0.6);
1071 mLegendRad->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1072 mLegendRad->AddEntry(Form(
"Good_Rad_%s", particleToanalize[3]),
"good",
"lep");
1073 mLegendRad->AddEntry(Form(
"Fake_Rad_%s", particleToanalize[3]),
"fake",
"lep");
1075 mCanvasRad->SaveAs(
"eff_rad_sec.png");
1077 mCanvasZ = std::make_unique<TCanvas>(
"cZ",
"cZ", 1600, 1200);
1079 mCanvasZ->SetGrid();
1080 mCanvasZ->SetLogy();
1081 mEffGoodZ[3]->Draw(
"pz");
1082 mEffFakeZ[3]->Draw(
"pz same");
1083 mCanvasZ->SetLogy();
1084 mLegendZ = std::make_unique<TLegend>(0.8, 0.4, 0.95, 0.6);
1085 mLegendZ->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1086 mLegendZ->AddEntry(Form(
"Good_Z_%s", particleToanalize[3]),
"good",
"lep");
1087 mLegendZ->AddEntry(Form(
"Fake_Z_%s", particleToanalize[3]),
"fake",
"lep");
1089 mCanvasZ->SaveAs(
"eff_Z_sec.png");
1092 mCanvasRadD = std::make_unique<TCanvas>(
"cRadD",
"cRadD", 1600, 1200);
1094 mCanvasRadD->SetGrid();
1095 mCanvasRadD->SetLogy();
1096 mLegendRadD = std::make_unique<TLegend>(0.8, 0.64, 0.95, 0.8);
1097 mLegendRadD->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1098 for (
int i = 0;
i < 3;
i++) {
1100 mEffGoodRad[
i]->Draw(
"pz");
1102 mEffGoodRad[
i]->Draw(
"pz same");
1103 mEffFakeRad[
i]->Draw(
"pz same");
1104 mLegendRadD->AddEntry(Form(
"Good_Rad%s", particleToanalize[
i]), Form(
"%s_good",
name[
i]),
"lep");
1105 mLegendRadD->AddEntry(Form(
"Fake_Rad%s", particleToanalize[
i]), Form(
"%s_fake",
name[
i]),
"lep");
1108 mLegendRadD->Draw();
1109 mCanvasRadD->SaveAs(
"eff_RadD_sec.png");
1111 mCanvasZD = std::make_unique<TCanvas>(
"cZD",
"cZD", 1600, 1200);
1113 mCanvasZD->SetGrid();
1114 mCanvasZD->SetLogy();
1115 mLegendZD = std::make_unique<TLegend>(0.8, 0.64, 0.95, 0.8);
1116 mLegendZD->SetHeader(Form(
"%zu events PP ", mKineReader->getNEvents(0)),
"C");
1117 for (
int i = 0;
i < 3;
i++) {
1119 mEffGoodZ[
i]->Draw(
"pz");
1121 mEffGoodZ[
i]->Draw(
"pz same");
1122 mEffFakeZ[
i]->Draw(
"pz same");
1123 mLegendZD->AddEntry(Form(
"Good_Z%s", particleToanalize[
i]), Form(
"%s_good",
name[
i]),
"lep");
1124 mLegendZD->AddEntry(Form(
"Fake_Z%s", particleToanalize[
i]), Form(
"%s_fake",
name[
i]),
"lep");
1128 mCanvasZD->SaveAs(
"eff_ZD_sec.png");
1130 mPtResolution->SetName(
"#it{p}_{T} resolution");
1131 mPtResolution->SetTitle(
";#Delta p_{T}/p_{T_{MC}} ;Entries");
1132 mPtResolution->SetFillColor(kAzure + 4);
1133 mPtResolutionPrim->SetFillColor(kRed);
1134 mPtResolutionSec->SetFillColor(kOrange);
1135 mPtResolutionPrim->SetTitle(
";#Delta p_{T}/p_{T_{MC}} ;Entries");
1136 mPtResolutionSec->SetTitle(
";#Delta #it{p}_{T}/#it{p}_{T_{MC}} ;Entries");
1137 mPtResolution2D->SetTitle(
";#it{p}_{T_{MC}} [GeV];#Delta #it{p}_{T}/#it{p}_{T_{MC}}");
1139 fout.WriteTObject(mPtResolution.get());
1140 fout.WriteTObject(mPtResolutionPrim.get());
1141 fout.WriteTObject(mPtResolutionSec.get());
1142 fout.WriteTObject(mPtResolution2D.get());
1144 mCanvasPtRes = std::make_unique<TCanvas>(
"cPtr",
"cPtr", 1600, 1200);
1146 mPtResolution->Draw(
"HIST");
1147 mLegendPtRes = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1148 mLegendPtRes->SetHeader(Form(
"%zu events PP min bias", mKineReader->getNEvents(0)),
"C");
1149 mLegendPtRes->AddEntry(
"mPtResolution",
"All events",
"lep");
1150 mLegendPtRes->Draw();
1151 mCanvasPtRes->SaveAs(
"ptRes.png");
1153 mCanvasPtRes2 = std::make_unique<TCanvas>(
"cPtr2",
"cPtr2", 1600, 1200);
1154 mCanvasPtRes2->cd();
1155 mPtResolution2D->Draw();
1156 mCanvasPtRes2->SaveAs(
"ptRes2.png");
1158 mCanvasPtRes3 = std::make_unique<TCanvas>(
"cPtr3",
"cPtr3", 1600, 1200);
1159 mCanvasPtRes3->cd();
1161 auto* g1 =
new TGraphErrors(100, meanPt, sigma, aa, sigmaerr);
1162 g1->SetMarkerStyle(8);
1163 g1->SetMarkerColor(kGreen);
1164 g1->GetXaxis()->SetTitle(
" #it{p}_{T} [GeV]");
1165 g1->GetYaxis()->SetTitle(
"#sigma #Delta #it{p}_{T}/#it{p}_{T_{MC}}");
1166 g1->GetYaxis()->SetLimits(0, 1);
1167 g1->GetXaxis()->SetLimits(0, 10.);
1169 g1->GetYaxis()->SetRangeUser(0, 1);
1170 g1->GetXaxis()->SetRangeUser(0, 10.);
1171 mCanvasPtRes3->SaveAs(
"ptRes3.png");
1173 mCanvasPtRes4 = std::make_unique<TCanvas>(
"cPt4",
"cPt4", 1600, 1200);
1174 mCanvasPtRes4->cd();
1175 mPtResolutionPrim->SetName(
"mPtResolutionPrim");
1176 mPtResolutionSec->SetName(
"mPtResolutionSec");
1177 mPtResolutionPrim->Draw(
"same hist");
1178 mPtResolutionSec->Draw(
"same hist");
1179 mLegendPtRes2 = std::make_unique<TLegend>(0.19, 0.8, 0.40, 0.96);
1181 mLegendPtRes2->SetHeader(Form(
"%zu events PP", mKineReader->getNEvents(0)),
"C");
1182 mLegendPtRes2->AddEntry(
"mPtResolutionPrim",
"Primary events",
"f");
1183 mLegendPtRes2->AddEntry(
"mPtResolutionSec",
"Secondary events",
"f");
1184 mLegendPtRes2->Draw(
"same");
1185 mLegendPtRes2->SaveAs(
"ptRes4.png");
1187 auto canvas =
new TCanvas(
"fc_canvas",
"Fake clusters", 1600, 1000);
1188 canvas->Divide(4, 2);
1189 for (
int iH{0}; iH < 4; ++iH) {
1191 stackLength[iH]->Draw();
1192 stackLength[iH]->GetXaxis()->SetTitle(
"Layer");
1193 gPad->BuildLegend();
1195 for (
int iH{0}; iH < 4; ++iH) {
1197 stackLength1Fake[iH]->Draw();
1198 stackLength1Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1199 gPad->BuildLegend();
1202 canvas->SaveAs(
"fakeClusters2.png",
"recreate");
1204 auto canvas2 =
new TCanvas(
"fc_canvas2",
"Fake clusters", 1600, 1000);
1205 canvas2->Divide(4, 2);
1207 for (
int iH{0}; iH < 4; ++iH) {
1208 canvas2->cd(iH + 1);
1209 stackLength2Fake[iH]->Draw();
1210 stackLength2Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1211 gPad->BuildLegend();
1213 for (
int iH{0}; iH < 4; ++iH) {
1214 canvas2->cd(iH + 5);
1215 stackLength3Fake[iH]->Draw();
1216 stackLength3Fake[iH]->GetXaxis()->SetTitle(
"Layer");
1217 gPad->BuildLegend();
1219 canvas2->SaveAs(
"fakeClusters3.png",
"recreate");
1221 auto canvasPtfake =
new TCanvas(
"canvasPtfake",
"Fake pt", 1600, 1000);
1222 canvasPtfake->Divide(2, 2);
1224 for (
int iH{0}; iH < 4; ++iH) {
1225 canvasPtfake->cd(iH + 1);
1226 for (
int v = 0;
v < 4;
v++) {
1228 canvasPtfake->cd(iH + 1);
1231 mEffFakePts[
v][iH]->Draw();
1233 mEffFakePts[
v][iH]->Draw(
"same");
1236 gPad->BuildLegend();
1238 gPad->SetTitle(Form(
"#it{p}_{T}, Fake Tracks, layer %d", iH));
1239 gPad->SetName(Form(
"#it{p}_{T}, Fake Tracks, layer %d", iH));
1241 canvasPtfake->SaveAs(
"PtforPartFake.png",
"recreate");
1243 auto canvasPtGood =
new TCanvas(
"canvasPtGood",
"Good pt", 1600, 1000);
1244 canvasPtGood->Divide(2, 2);
1246 for (
int iH{0}; iH < 4; ++iH) {
1247 canvasPtGood->cd(iH + 1);
1248 for (
int v = 0;
v < 4;
v++) {
1250 canvasPtGood->cd(iH + 1);
1253 mEffGoodPts[
v][iH]->Draw();
1255 mEffGoodPts[
v][iH]->Draw(
"same");
1258 gPad->BuildLegend();
1260 gPad->SetTitle(Form(
"#it{p}_{T}, Good Tracks, layer %d", iH));
1261 gPad->SetName(Form(
"#it{p}_{T}, Good Tracks, layer %d", iH));
1264 auto canvasEtafake =
new TCanvas(
"canvasEtafake",
"Fake Eta", 1600, 1000);
1265 canvasEtafake->Divide(2, 2);
1267 for (
int iH{0}; iH < 4; ++iH) {
1268 canvasEtafake->cd(iH + 1);
1269 for (
int v = 0;
v < 4;
v++) {
1271 canvasEtafake->cd(iH + 1);
1274 mEffFakeEtas[
v][iH]->Draw();
1276 mEffFakeEtas[
v][iH]->Draw(
"same");
1279 gPad->BuildLegend();
1281 gPad->SetTitle(Form(
"#eta, Fake Tracks, layer %d", iH));
1282 gPad->SetName(Form(
"#eta, Fake Tracks, layer %d", iH));
1284 auto canvasEtaGood =
new TCanvas(
"canvasEtaGood",
"Good Eta", 1600, 1000);
1285 canvasEtaGood->Divide(2, 2);
1287 for (
int iH{0}; iH < 4; ++iH) {
1288 canvasEtaGood->cd(iH + 1);
1289 for (
int v = 0;
v < 4;
v++) {
1291 canvasEtaGood->cd(iH + 1);
1294 mEffGoodEtas[
v][iH]->Draw();
1296 mEffGoodEtas[
v][iH]->Draw(
"same");
1299 gPad->BuildLegend();
1301 gPad->SetTitle(Form(
"#eta, Good Tracks, layer %d", iH));
1302 gPad->SetName(Form(
"#eta, Good Tracks, layer %d", iH));
1305 auto canvasI =
new TCanvas(
"canvasI",
"canvasI", 1600, 1000);
1307 mClusterFake[0]->Draw(
"COLZ");
1308 canvasI->SaveAs(
"Iper2D.png",
"recreate");
1310 auto canvasL =
new TCanvas(
"canvasL",
"canvasL", 1600, 1000);
1312 mClusterFake[1]->Draw(
"COLZ");
1313 canvasL->SaveAs(
"Lam2D.png",
"recreate");
1315 auto canvasK =
new TCanvas(
"canvasK",
"canvasK", 1600, 1000);
1317 mClusterFake[2]->Draw(
"COLZ");
1318 canvasK->SaveAs(
"K2D.png",
"recreate");
1320 auto canvasZProd =
new TCanvas(
"canvasZProd",
"canvasZProd", 1600, 1000);
1322 processvsZ->Draw(
"COLZ");
1323 canvasZProd->SaveAs(
"prodvsZ.png",
"recreate");
1324 auto canvasRadProd =
new TCanvas(
"canvasRadProd",
"canvasRadProd", 1600, 1000);
1325 canvasRadProd->cd();
1326 processvsRad->Draw(
"COLZ");
1327 canvasRadProd->SaveAs(
"prodvsRad.png",
"recreate");
1328 auto canvasRadProdO =
new TCanvas(
"canvasRadProdO",
"canvasRadProdO", 1600, 1000);
1329 canvasRadProdO->cd();
1330 processvsRadOther->Draw(
"COLZ");
1331 canvasRadProdO->SaveAs(
"prodvsRadO.png",
"recreate");
1332 auto canvasRadProNOTr =
new TCanvas(
"canvasRadProNOTr",
"canvasRadProNOTr", 1600, 1000);
1333 canvasRadProNOTr->cd();
1334 processvsRadNotTracked->Draw(
"COLZ");
1335 canvasRadProNOTr->SaveAs(
"prodvsRadNoTr.png",
"recreate");
1336 auto canvasEtaProNOTr =
new TCanvas(
"canvasEtaProNOTr",
"canvasEtaProNOTr", 1600, 1000);
1337 canvasEtaProNOTr->cd();
1338 processvsEtaNotTracked->Draw(
"COLZ");
1339 canvasEtaProNOTr->SaveAs(
"prodvsEtaNoTr.png",
"recreate");
1343 mCanvasEta->Write();
1344 mCanvasPtSec->Write();
1345 mCanvasEtaSec->Write();
1346 mCanvasPtRes->Write();
1347 mCanvasPtRes2->Write();
1348 mCanvasPtRes3->Write();
1349 mCanvasPtRes4->Write();
1350 mCanvasRad->Write();
1352 mCanvasRadD->Write();
1356 canvasPtfake->Write();