Skip to content

Commit 7dc7111

Browse files
authored
[PWGLF] The histogram p vs pT was added (#11355)
1 parent 503acc0 commit 7dc7111

File tree

1 file changed

+52
-29
lines changed

1 file changed

+52
-29
lines changed

PWGMM/UE/Tasks/dedxAnalysis.cxx

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ struct DedxAnalysis {
4949
OutputObjHandlingPolicy::AnalysisObject,
5050
true,
5151
true};
52+
// Constant values
53+
static constexpr int kEtaIntervals = 8;
54+
static constexpr int kParticlesType = 4;
55+
float tpcCut = 0.6;
56+
float centMin = 0.0;
57+
float centMax = 100.0;
58+
float pionMin = 0.35;
59+
float pionMax = 0.45;
60+
float elTofCut = 0.1;
61+
float pionTofCut = 1.0;
62+
float invMassCut = 0.01;
63+
float invMassCutGamma = 0.0015;
5264

5365
// Configurable Parameters
5466
// Tracks cuts
@@ -84,9 +96,9 @@ struct DedxAnalysis {
8496
"Maximum Mass Gamma"};
8597
Configurable<bool> calibrationMode{"calibrationMode", false, "calibration mode"};
8698
// Histograms names
87-
static constexpr std::string_view kDedxvsMomentumPos[4] = {"dEdx_vs_Momentum_all_Pos", "dEdx_vs_Momentum_Pi_v0_Pos", "dEdx_vs_Momentum_Pr_v0_Pos", "dEdx_vs_Momentum_El_v0_Pos"};
88-
static constexpr std::string_view kDedxvsMomentumNeg[4] = {"dEdx_vs_Momentum_all_Neg", "dEdx_vs_Momentum_Pi_v0_Neg", "dEdx_vs_Momentum_Pr_v0_Neg", "dEdx_vs_Momentum_El_v0_Neg"};
89-
static constexpr double EtaCut[9] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
99+
static constexpr std::string_view kDedxvsMomentumPos[kParticlesType] = {"dEdx_vs_Momentum_all_Pos", "dEdx_vs_Momentum_Pi_v0_Pos", "dEdx_vs_Momentum_Pr_v0_Pos", "dEdx_vs_Momentum_El_v0_Pos"};
100+
static constexpr std::string_view kDedxvsMomentumNeg[kParticlesType] = {"dEdx_vs_Momentum_all_Neg", "dEdx_vs_Momentum_Pi_v0_Neg", "dEdx_vs_Momentum_Pr_v0_Neg", "dEdx_vs_Momentum_El_v0_Neg"};
101+
static constexpr double EtaCut[kEtaIntervals + 1] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
90102
Configurable<std::vector<float>> calibrationFactorNeg{"calibrationFactorNeg", {50.4011, 50.4764, 50.186, 49.2955, 48.8222, 49.4273, 49.9292, 50.0556}, "negative calibration factors"};
91103
Configurable<std::vector<float>> calibrationFactorPos{"calibrationFactorPos", {50.5157, 50.6359, 50.3198, 49.3345, 48.9197, 49.4931, 50.0188, 50.1406}, "positive calibration factors"};
92104
ConfigurableAxis binP{"binP", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, ""};
@@ -113,7 +125,8 @@ struct DedxAnalysis {
113125

114126
void init(InitContext const&)
115127
{
116-
AxisSpec dedxAxis{100, 0.0, 100.0, "dE/dx MIP (a. u.)"};
128+
AxisSpec dedxAxis{100, 0.0, 100.0, "dE/dx (a. u.)"};
129+
AxisSpec ptAxis = {binP, "pT (GeV/c)"};
117130
AxisSpec etaAxis{8, -0.8, 0.8, "#eta"};
118131
AxisSpec pAxis = {binP, "#it{p}/Z (GeV/c)"};
119132
if (calibrationMode) {
@@ -167,8 +180,16 @@ struct DedxAnalysis {
167180
"hdEdx_vs_eta_vs_p_Pos_calibrated_TOF", "dE/dx", HistType::kTH3F,
168181
{{etaAxis}, {dedxAxis}, {pAxis}});
169182

183+
// pt vs p
184+
registryDeDx.add(
185+
"hp_vs_pt_all_Neg", "p_vs_pT", HistType::kTH2F,
186+
{{ptAxis}, {pAxis}});
187+
registryDeDx.add(
188+
"hp_vs_pt_all_Pos", "p_vs_pT", HistType::kTH2F,
189+
{{ptAxis}, {pAxis}});
190+
170191
// De/Dx for ch and v0 particles
171-
for (int i = 0; i < 4; ++i) {
192+
for (int i = 0; i < kParticlesType; ++i) {
172193
registryDeDx.add(kDedxvsMomentumPos[i].data(), "dE/dx", HistType::kTH3F,
173194
{{pAxis}, {dedxAxis}, {etaAxis}});
174195
registryDeDx.add(kDedxvsMomentumNeg[i].data(), "dE/dx", HistType::kTH3F,
@@ -235,14 +256,14 @@ struct DedxAnalysis {
235256
if (!passedSingleTrackSelection(ntrack, collision))
236257
return false;
237258

238-
if (ptrack.tpcInnerParam() > 0.6) {
259+
if (ptrack.tpcInnerParam() > tpcCut) {
239260
if (!ptrack.hasTOF())
240261
return false;
241262
if (std::abs(ptrack.tofNSigmaPi()) > nsigmaTOFmax)
242263
return false;
243264
}
244265

245-
if (ntrack.tpcInnerParam() > 0.6) {
266+
if (ntrack.tpcInnerParam() > tpcCut) {
246267
if (!ntrack.hasTOF())
247268
return false;
248269
if (std::abs(ntrack.tofNSigmaPi()) > nsigmaTOFmax)
@@ -267,14 +288,14 @@ struct DedxAnalysis {
267288
if (!passedSingleTrackSelection(ntrack, collision))
268289
return false;
269290

270-
if (ptrack.tpcInnerParam() > 0.6) {
291+
if (ptrack.tpcInnerParam() > tpcCut) {
271292
if (!ptrack.hasTOF())
272293
return false;
273294
if (std::abs(ptrack.tofNSigmaPr()) > nsigmaTOFmax)
274295
return false;
275296
}
276297

277-
if (ntrack.tpcInnerParam() > 0.6) {
298+
if (ntrack.tpcInnerParam() > tpcCut) {
278299
if (!ntrack.hasTOF())
279300
return false;
280301
if (std::abs(ntrack.tofNSigmaPi()) > nsigmaTOFmax)
@@ -300,14 +321,14 @@ struct DedxAnalysis {
300321
if (!passedSingleTrackSelection(ntrack, collision))
301322
return false;
302323

303-
if (ptrack.tpcInnerParam() > 0.6) {
324+
if (ptrack.tpcInnerParam() > tpcCut) {
304325
if (!ptrack.hasTOF())
305326
return false;
306327
if (std::abs(ptrack.tofNSigmaPi()) > nsigmaTOFmax)
307328
return false;
308329
}
309330

310-
if (ntrack.tpcInnerParam() > 0.6) {
331+
if (ntrack.tpcInnerParam() > tpcCut) {
311332
if (!ntrack.hasTOF())
312333
return false;
313334
if (std::abs(ntrack.tofNSigmaPr()) > nsigmaTOFmax)
@@ -332,14 +353,14 @@ struct DedxAnalysis {
332353
if (!passedSingleTrackSelection(ntrack, collision))
333354
return false;
334355

335-
if (ptrack.tpcInnerParam() > 0.6) {
356+
if (ptrack.tpcInnerParam() > tpcCut) {
336357
if (!ptrack.hasTOF())
337358
return false;
338359
if (std::abs(ptrack.tofNSigmaEl()) > nsigmaTOFmax)
339360
return false;
340361
}
341362

342-
if (ntrack.tpcInnerParam() > 0.6) {
363+
if (ntrack.tpcInnerParam() > tpcCut) {
343364
if (!ntrack.hasTOF())
344365
return false;
345366
if (std::abs(ntrack.tofNSigmaEl()) > nsigmaTOFmax)
@@ -366,7 +387,7 @@ struct DedxAnalysis {
366387

367388
// Centrality
368389
float centrality = collision.centFT0C();
369-
if (centrality < 0.0 || centrality > 100.0)
390+
if (centrality < centMin || centrality > centMax)
370391
centrality = 1.0;
371392

372393
// Kaons
@@ -382,7 +403,7 @@ struct DedxAnalysis {
382403
float signedP = trk.sign() * trk.tpcInnerParam();
383404

384405
// MIP calibration for pions
385-
if (trk.tpcInnerParam() >= 0.35 && trk.tpcInnerParam() <= 0.45) {
406+
if (trk.tpcInnerParam() >= pionMin && trk.tpcInnerParam() <= pionMax) {
386407
if (calibrationMode) {
387408
if (signedP < 0) {
388409
registryDeDx.fill(HIST("hdEdx_vs_eta_Neg_Pi"), trk.eta(), trk.tpcSignal());
@@ -391,7 +412,7 @@ struct DedxAnalysis {
391412
}
392413

393414
} else {
394-
for (int i = 0; i < 8; ++i) {
415+
for (int i = 0; i < kEtaIntervals; ++i) {
395416
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
396417
if (signedP < 0) {
397418
registryDeDx.fill(HIST("hdEdx_vs_eta_Neg_calibrated_Pi"), trk.eta(), trk.tpcSignal() * 50 / calibrationFactorNeg->at(i));
@@ -409,15 +430,15 @@ struct DedxAnalysis {
409430
registryDeDx.fill(HIST("hbeta_vs_p_Pos"), signedP, trk.beta());
410431
}
411432
// Electrons from TOF
412-
if (std::abs(trk.beta() - 1) < 0.1) { // beta cut
433+
if (std::abs(trk.beta() - 1) < elTofCut) { // beta cut
413434
if (calibrationMode) {
414435
if (signedP < 0) {
415436
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Neg_El"), trk.eta(), trk.tpcSignal(), std::abs(signedP));
416437
} else {
417438
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Pos_El"), trk.eta(), trk.tpcSignal(), signedP);
418439
}
419440
} else {
420-
for (int i = 0; i < 8; ++i) {
441+
for (int i = 0; i < kEtaIntervals; ++i) {
421442
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
422443
if (signedP < 0) {
423444
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Neg_calibrated_El"), trk.eta(), trk.tpcSignal() * 50 / calibrationFactorNeg->at(i), std::abs(signedP));
@@ -429,15 +450,15 @@ struct DedxAnalysis {
429450
}
430451
}
431452
// pions from TOF
432-
if (trk.beta() > 1. && trk.beta() < 1.05) { // beta cut
453+
if (trk.beta() > pionTofCut && trk.beta() < pionTofCut + 0.05) { // beta cut
433454
if (calibrationMode) {
434455
if (signedP < 0) {
435456
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Neg_TOF"), trk.eta(), trk.tpcSignal(), std::abs(signedP));
436457
} else {
437458
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Pos_TOF"), trk.eta(), trk.tpcSignal(), signedP);
438459
}
439460
} else {
440-
for (int i = 0; i < 8; ++i) {
461+
for (int i = 0; i < kEtaIntervals; ++i) {
441462
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
442463
if (signedP < 0) {
443464
registryDeDx.fill(HIST("hdEdx_vs_eta_vs_p_Neg_calibrated_TOF"), trk.eta(), trk.tpcSignal() * 50 / calibrationFactorNeg->at(i), std::abs(signedP));
@@ -452,12 +473,14 @@ struct DedxAnalysis {
452473
registryDeDx.fill(HIST("hdEdx_vs_phi"), trk.phi(), trk.tpcSignal());
453474

454475
if (!calibrationMode) {
455-
for (int i = 0; i < 8; ++i) {
476+
for (int i = 0; i < kEtaIntervals; ++i) {
456477
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
457478
if (signedP > 0) {
458479
registryDeDx.fill(HIST(kDedxvsMomentumPos[0]), signedP, trk.tpcSignal() * 50 / calibrationFactorPos->at(i), trk.eta());
480+
registryDeDx.fill(HIST("hp_vs_pt_all_Pos"), trk.pt(), signedP);
459481
} else {
460482
registryDeDx.fill(HIST(kDedxvsMomentumNeg[0]), std::abs(signedP), trk.tpcSignal() * 50 / calibrationFactorNeg->at(i), trk.eta());
483+
registryDeDx.fill(HIST("hp_vs_pt_all_Neg"), trk.pt(), std::abs(signedP));
461484
}
462485
}
463486
}
@@ -506,11 +529,11 @@ struct DedxAnalysis {
506529

507530
float invMass = std::sqrt((eNegPi + ePosPi) * (eNegPi + ePosPi) - ((pxNeg + pxPos) * (pxNeg + pxPos) + (pyNeg + pyPos) * (pyNeg + pyPos) + (pzNeg + pzPos) * (pzNeg + pzPos)));
508531

509-
if (std::abs(invMass - MassK0Short) > 0.01) {
532+
if (std::abs(invMass - MassK0Short) > invMassCut) {
510533
continue;
511534
}
512535

513-
for (int i = 0; i < 8; ++i) {
536+
for (int i = 0; i < kEtaIntervals; ++i) {
514537
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
515538
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactorNeg->at(i), negTrack.eta());
516539
}
@@ -528,11 +551,11 @@ struct DedxAnalysis {
528551

529552
float invMass = std::sqrt((eNegPi + ePosPr) * (eNegPi + ePosPr) - ((pxNeg + pxPos) * (pxNeg + pxPos) + (pyNeg + pyPos) * (pyNeg + pyPos) + (pzNeg + pzPos) * (pzNeg + pzPos)));
530553

531-
if (std::abs(invMass - MassLambda) > 0.01) {
554+
if (std::abs(invMass - MassLambda) > invMassCut) {
532555
continue;
533556
}
534557

535-
for (int i = 0; i < 8; ++i) {
558+
for (int i = 0; i < kEtaIntervals; ++i) {
536559
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
537560
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactorNeg->at(i), negTrack.eta());
538561
}
@@ -550,11 +573,11 @@ struct DedxAnalysis {
550573

551574
float invMass = std::sqrt((eNegPr + ePosPi) * (eNegPr + ePosPi) - ((pxNeg + pxPos) * (pxNeg + pxPos) + (pyNeg + pyPos) * (pyNeg + pyPos) + (pzNeg + pzPos) * (pzNeg + pzPos)));
552575

553-
if (std::abs(invMass - MassLambda) > 0.01) {
576+
if (std::abs(invMass - MassLambda) > invMassCut) {
554577
continue;
555578
}
556579

557-
for (int i = 0; i < 8; ++i) {
580+
for (int i = 0; i < kEtaIntervals; ++i) {
558581
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
559582
registryDeDx.fill(HIST(kDedxvsMomentumNeg[2]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactorNeg->at(i), negTrack.eta());
560583
}
@@ -572,11 +595,11 @@ struct DedxAnalysis {
572595

573596
float invMass = std::sqrt((eNegEl + ePosEl) * (eNegEl + ePosEl) - ((pxNeg + pxPos) * (pxNeg + pxPos) + (pyNeg + pyPos) * (pyNeg + pyPos) + (pzNeg + pzPos) * (pzNeg + pzPos)));
574597

575-
if (std::abs(invMass - gammaMass) > 0.0015) {
598+
if (std::abs(invMass - gammaMass) > invMassCutGamma) {
576599
continue;
577600
}
578601

579-
for (int i = 0; i < 8; ++i) {
602+
for (int i = 0; i < kEtaIntervals; ++i) {
580603
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
581604
registryDeDx.fill(HIST(kDedxvsMomentumNeg[3]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactorNeg->at(i), negTrack.eta());
582605
}

0 commit comments

Comments
 (0)