Skip to content

Commit 5a9966c

Browse files
authored
[PWGLF] Added more distributions (#13912)
1 parent d0b09fe commit 5a9966c

File tree

1 file changed

+102
-42
lines changed

1 file changed

+102
-42
lines changed

PWGLF/Tasks/Nuspex/piKpRAA.cxx

Lines changed: 102 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ using namespace o2::framework::expressions;
6969
using ColEvSels = soa::Join<aod::Collisions, aod::EvSels, aod::FT0MultZeqs, o2::aod::CentFT0Cs, o2::aod::CentFT0Ms, aod::TPCMults, o2::aod::BarrelMults>;
7070
using BCsRun3 = soa::Join<aod::BCsWithTimestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
7171

72-
using ColEvSelsMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, o2::aod::CentFT0Cs, o2::aod::CentFT0Ms>;
72+
using ColEvSelsMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, o2::aod::CentFT0Cs, o2::aod::CentFT0Ms, o2::aod::CentFT0Ms, o2::aod::BarrelMults>;
7373

7474
using TracksFull = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelectionExtension, aod::TracksDCA, aod::TrackSelection, aod::TracksCovIU, aod::pidTPCPi, aod::pidTPCPr, aod::pidTOFPr, aod::pidTPCEl, aod::pidTOFFlags, aod::pidTOFbeta, aod::TOFSignal, aod::pidTOFFullPi, aod::pidTOFFullEl>;
7575

@@ -198,7 +198,7 @@ struct PiKpRAA {
198198
Configurable<bool> isCentSel{"isCentSel", true, "Centrality selection?"};
199199
Configurable<bool> isT0Ccent{"isT0Ccent", true, "Use T0C-based centrality?"};
200200
Configurable<bool> isZvtxPosSel{"isZvtxPosSel", true, "Zvtx position selection?"};
201-
201+
Configurable<bool> isINELgt0{"isINELgt0", true, "Apply INEL > 0?"};
202202
Configurable<bool> isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "T0C Occu cut"};
203203
Configurable<bool> applyNchSel{"applyNchSel", false, "Use mid-rapidity-based Nch selection"};
204204
Configurable<bool> skipRecoColGTOne{"skipRecoColGTOne", true, "Remove collisions if reconstructed more than once"};
@@ -217,8 +217,9 @@ struct PiKpRAA {
217217
ConfigurableAxis binsPtNcl{"binsPtNcl", {VARIABLE_WIDTH, 0.0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 7.0, 9.0, 12.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0}, "pT"};
218218
ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12}, "pT binning"};
219219
ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0C binning"};
220-
ConfigurableAxis axisEta{"axisEta", {50, -1.0, 1.0}, "Eta axix"};
221-
ConfigurableAxis axisY{"axisY", {50, -1.0, 1.0}, "rapidity axix"};
220+
ConfigurableAxis binsZpos{"binsZpos", {60, -30.0, 30.0}, "Z pos axis"};
221+
ConfigurableAxis axisEta{"axisEta", {50, -1.0, 1.0}, "Eta axis"};
222+
ConfigurableAxis axisY{"axisY", {50, -1.0, 1.0}, "rapidity axis"};
222223
ConfigurableAxis axisArmAlpha{"axisArmAlpha", {200, -1.0, 1.0}, "Armenteros alpha"};
223224
ConfigurableAxis axisArmqT{"axisArmqT", {600, 0.0f, 0.3f}, "Armenteros qT"};
224225
ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, "Mass K0Short"};
@@ -257,7 +258,8 @@ struct PiKpRAA {
257258
OccuCut,
258259
Centrality,
259260
VtxZ,
260-
NchSel
261+
NchSel,
262+
INELgt0
261263
};
262264

263265
enum TrkSelLabel {
@@ -345,21 +347,19 @@ struct PiKpRAA {
345347

346348
// define axes you want to use
347349
const std::string titlePorPt{v0Selections.usePinPhiSelection ? "#it{p} (GeV/#it{c})" : "#it{p}_{T} (GeV/#it{c})"};
348-
const AxisSpec axisZpos{80, -20., 20., "Vtx_{z} (cm)"};
349-
const AxisSpec axisEvent{15, 0.5, 15.5, ""};
350+
const AxisSpec axisZpos{binsZpos, "Vtx_{z} (cm)"};
351+
const AxisSpec axisEvent{17, 0.5, 17.5, ""};
350352
const AxisSpec axisNcl{161, -0.5, 160.5, "#it{N}_{cl} TPC"};
351353
const AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"};
352354
const AxisSpec axisPtV0s{binsPtV0s, "#it{p}_{T} (GeV/#it{c})"};
353355
const AxisSpec axisPtNcl{binsPtNcl, Form("%s", titlePorPt.data())};
354356
const AxisSpec axisXPhiCut{binsPtPhiCut, Form("%s", titlePorPt.data())};
355357
const AxisSpec axisCent{binsCent, "Centrality Perc."};
356-
// const char* endingEta[kNEtaHists] = {"02", "24", "46", "68"};
357-
// const char* latexEta[kNEtaHists] = {"0<|#eta|<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"};
358358
const char* endingEta[kNEtaHists] = {"86", "64", "42", "20", "02", "24", "46", "68"};
359359
const char* latexEta[kNEtaHists] = {"-0.8<#eta<-0.6", "-0.6<#eta<-0.4", "-0.4<#eta<-0.2", "-0.2<#eta<0", "0<#eta<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"};
360360

361361
registry.add("EventCounter", ";;Events", kTH1F, {axisEvent});
362-
registry.add("zPos", ";;Entries;", kTH1F, {axisZpos});
362+
registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos});
363363
registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent});
364364
registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}});
365365
registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta});
@@ -382,6 +382,7 @@ struct PiKpRAA {
382382
x->SetBinLabel(12, "Cent. Sel.");
383383
x->SetBinLabel(13, "VtxZ Sel.");
384384
x->SetBinLabel(14, "Nch Sel.");
385+
x->SetBinLabel(15, "INEL > 0");
385386

386387
if (doprocessCalibrationAndV0s) {
387388
registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}});
@@ -491,7 +492,7 @@ struct PiKpRAA {
491492
}
492493

493494
if (doprocessMC || doprocessSim) {
494-
registry.add("zPosMC", ";Gen. Coll. With at least One Ass. Rec. Coll.;Entries;", kTH1F, {axisZpos});
495+
registry.add("zPosMC", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries;", kTH1F, {axisZpos});
495496
registry.add("dcaVsPtPiDec", "Secondary pions from decays;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent});
496497
registry.add("dcaVsPtPrDec", "Secondary protons from decays;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent});
497498
registry.add("dcaVsPtPiMat", "Secondary pions from material interactions;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent});
@@ -513,8 +514,12 @@ struct PiKpRAA {
513514
}
514515

515516
if (doprocessSim) {
517+
516518
registry.add("NumberOfRecoCollisions", "Number of times Gen. Coll.are reconstructed;N;Entries", kTH1F, {{10, -0.5, 9.5}});
517519

520+
// Pt resolution
521+
registry.add("PtResolution", "p_{T} resolution;;(pt_{rec} - pt_{gen})/pt_{gen};", kTH2F, {axisPt, {100, -1.0, 1.0}});
522+
518523
// Needed to calculate the numerator of the Acceptance X Efficiency
519524
registry.add("PtPiVsCent_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;;", kTH2F, {axisPt, axisCent});
520525
registry.add("PtKaVsCent_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;;", kTH2F, {axisPt, axisCent});
@@ -533,7 +538,8 @@ struct PiKpRAA {
533538
registry.add("NchMC_AllGen", "Generated Nch of All Gen. Evts.;Gen. Nch;Entries", kTH1F, {{nBinsNch, minNch, maxNch}});
534539

535540
// Needed to measure Event Splitting
536-
registry.add("Centrality_WithRecoEvt", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries", kTH1F, {axisCent});
541+
registry.add("Centrality_WRecoEvt", "Generated Events With at least One Rec. Collision And NO Sel. criteria;;Entries", kTH1F, {axisCent});
542+
registry.add("Centrality_WRecoEvtWSelCri", "Generated Events With at least One Rec. Collision + Sel. criteria;;Entries", kTH1F, {axisCent});
537543
registry.add("Centrality_AllRecoEvt", "Generated Events Irrespective of the number of times it was reconstructed + Evt. Selections;;Entries", kTH1F, {axisCent});
538544

539545
// Needed to calculate the numerator of the Signal Loss correction
@@ -549,6 +555,7 @@ struct PiKpRAA {
549555

550556
LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value;
551557
LOG(info) << "\tapplyNchSel=" << applyNchSel.value;
558+
LOG(info) << "\tisINELgt0=" << isINELgt0.value;
552559
LOG(info) << "\tdetector4Calibration=" << detector4Calibration.value;
553560
LOG(info) << "\tv0TypeSelection=" << static_cast<int>(v0Selections.v0TypeSelection);
554561
LOG(info) << "\tselElecFromGammas=" << v0Selections.selElecFromGammas;
@@ -1362,6 +1369,41 @@ struct PiKpRAA {
13621369
void processSim(aod::McCollisions::iterator const& mccollision, soa::SmallGroups<ColEvSelsMC> const& collisions, BCsRun3 const& /*bcs*/, aod::FT0s const& /*ft0s*/, aod::McParticles const& mcParticles, TracksMC const& tracksMC)
13631370
{
13641371

1372+
// Only INEL > 0 generated collisions
1373+
// By counting number of primary charged particles in |eta| < 1
1374+
if (isINELgt0) {
1375+
int nChMC{0};
1376+
for (const auto& particle : mcParticles) {
1377+
1378+
if (std::abs(particle.eta()) > kOne)
1379+
continue;
1380+
1381+
auto charge{0.};
1382+
// Get the MC particle
1383+
const auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1384+
if (pdgParticle != nullptr) {
1385+
charge = pdgParticle->Charge();
1386+
} else {
1387+
continue;
1388+
}
1389+
1390+
// Is it a charged particle?
1391+
if (std::abs(charge) < kMinCharge)
1392+
continue;
1393+
1394+
// Is it a primary particle?
1395+
if (!particle.isPhysicalPrimary())
1396+
continue;
1397+
1398+
nChMC++;
1399+
}
1400+
1401+
// Only INEL > 0 generated events
1402+
if (!(nChMC > kZeroInt)) {
1403+
return;
1404+
}
1405+
}
1406+
13651407
const auto& nRecColls{collisions.size()};
13661408

13671409
registry.fill(HIST("NumberOfRecoCollisions"), nRecColls);
@@ -1421,11 +1463,12 @@ struct PiKpRAA {
14211463

14221464
auto charge{0.};
14231465
// Get the MC particle
1424-
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1425-
if (pdgParticle != nullptr)
1466+
const auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1467+
if (pdgParticle != nullptr) {
14261468
charge = pdgParticle->Charge();
1427-
else
1469+
} else {
14281470
continue;
1471+
}
14291472

14301473
// Is it a charged particle?
14311474
if (std::abs(charge) < kMinCharge)
@@ -1438,9 +1481,9 @@ struct PiKpRAA {
14381481
nChMC++;
14391482
}
14401483

1441-
registry.fill(HIST("zPosMC"), mccollision.posZ());
1442-
14431484
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
1485+
registry.fill(HIST("Centrality_WRecoEvt"), centrality);
1486+
registry.fill(HIST("zPosMC"), mccollision.posZ());
14441487

14451488
//---------------------------
14461489
// All Generated events with at least one associated reconstructed collision
@@ -1456,10 +1499,11 @@ struct PiKpRAA {
14561499
auto charge{0.};
14571500
// Get the MC particle
14581501
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1459-
if (pdgParticle != nullptr)
1502+
if (pdgParticle != nullptr) {
14601503
charge = pdgParticle->Charge();
1461-
else
1504+
} else {
14621505
continue;
1506+
}
14631507

14641508
// Is it a charged particle?
14651509
if (std::abs(charge) < kMinCharge)
@@ -1495,7 +1539,7 @@ struct PiKpRAA {
14951539
continue;
14961540
}
14971541

1498-
registry.fill(HIST("Centrality_WithRecoEvt"), centrality);
1542+
registry.fill(HIST("Centrality_WRecoEvtWSelCri"), centrality);
14991543
registry.fill(HIST("NchMCVsCent"), centrality, nChMC);
15001544
registry.fill(HIST("NchMC_WithRecoEvt"), nChMC);
15011545
registry.fill(HIST("T0Ccent"), centrality);
@@ -1522,10 +1566,11 @@ struct PiKpRAA {
15221566
const auto& particle{track.mcParticle()};
15231567
auto charge{0.};
15241568
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1525-
if (pdgParticle != nullptr)
1569+
if (pdgParticle != nullptr) {
15261570
charge = pdgParticle->Charge();
1527-
else
1571+
} else {
15281572
continue;
1573+
}
15291574

15301575
// Is it a charged particle?
15311576
if (std::abs(charge) < kMinCharge)
@@ -1549,21 +1594,23 @@ struct PiKpRAA {
15491594
bool isPrimary{false};
15501595
bool isDecay{false};
15511596
bool isMaterial{false};
1552-
if (particle.isPhysicalPrimary())
1597+
if (particle.isPhysicalPrimary()) {
15531598
isPrimary = true;
1554-
else if (particle.getProcess() == TMCProcess::kPDecay)
1599+
} else if (particle.getProcess() == TMCProcess::kPDecay) {
15551600
isDecay = true;
1556-
else
1601+
} else {
15571602
isMaterial = true;
1603+
}
15581604

15591605
bool isPi{false};
15601606
bool isPr{false};
1561-
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus)
1607+
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
15621608
isPi = true;
1563-
else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar)
1609+
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
15641610
isPr = true;
1565-
else
1611+
} else {
15661612
continue;
1613+
}
15671614

15681615
if (isPrimary && !isDecay && !isMaterial) {
15691616
if (isPi && !isPr)
@@ -1607,10 +1654,11 @@ struct PiKpRAA {
16071654
const auto& particle{track.mcParticle()};
16081655
auto charge{0.};
16091656
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1610-
if (pdgParticle != nullptr)
1657+
if (pdgParticle != nullptr) {
16111658
charge = pdgParticle->Charge();
1612-
else
1659+
} else {
16131660
continue;
1661+
}
16141662

16151663
// Is it a charged particle?
16161664
if (std::abs(charge) < kMinCharge)
@@ -1658,14 +1706,15 @@ struct PiKpRAA {
16581706
bool isKa{false};
16591707
bool isPr{false};
16601708

1661-
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus)
1709+
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
16621710
isPi = true;
1663-
else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus)
1711+
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
16641712
isKa = true;
1665-
else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar)
1713+
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
16661714
isPr = true;
1667-
else
1715+
} else {
16681716
continue;
1717+
}
16691718

16701719
if (isPi && !isKa && !isPr)
16711720
registry.fill(HIST("PtPiVsCent_WithRecoEvt"), track.pt(), centrality);
@@ -1674,6 +1723,7 @@ struct PiKpRAA {
16741723
if (isPr && !isPi && !isKa)
16751724
registry.fill(HIST("PtPrVsCent_WithRecoEvt"), track.pt(), centrality);
16761725

1726+
registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt());
16771727
} // Loop over reconstructed tracks
16781728
} // Loop over Reco. Collisions: These collisions are not required to pass the event selection
16791729
} // If condition: Only simulated evets with at least one reconstrued collision
@@ -1695,10 +1745,11 @@ struct PiKpRAA {
16951745
auto charge{0.};
16961746
// Get the MC particle
16971747
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1698-
if (pdgParticle != nullptr)
1748+
if (pdgParticle != nullptr) {
16991749
charge = pdgParticle->Charge();
1700-
else
1750+
} else {
17011751
continue;
1752+
}
17021753

17031754
// Is it a charged particle?
17041755
if (std::abs(charge) < kMinCharge)
@@ -1721,10 +1772,11 @@ struct PiKpRAA {
17211772
auto charge{0.};
17221773
// Get the MC particle
17231774
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1724-
if (pdgParticle != nullptr)
1775+
if (pdgParticle != nullptr) {
17251776
charge = pdgParticle->Charge();
1726-
else
1777+
} else {
17271778
continue;
1779+
}
17281780

17291781
// Is it a charged particle?
17301782
if (std::abs(charge) < kMinCharge)
@@ -1736,14 +1788,15 @@ struct PiKpRAA {
17361788
isPrimary = false;
17371789

17381790
if (isPrimary) {
1739-
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) // pion
1791+
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
17401792
registry.fill(HIST("PtPiVsNchMC_AllGen"), particle.pt(), nChMC);
1741-
else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) // kaon
1793+
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
17421794
registry.fill(HIST("PtKaVsNchMC_AllGen"), particle.pt(), nChMC);
1743-
else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) // proton
1795+
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
17441796
registry.fill(HIST("PtPrVsNchMC_AllGen"), particle.pt(), nChMC);
1745-
else
1797+
} else {
17461798
continue;
1799+
}
17471800
}
17481801
} // Loop over Generated Particles
17491802
registry.fill(HIST("NchMC_AllGen"), nChMC);
@@ -2127,6 +2180,13 @@ struct PiKpRAA {
21272180
registry.fill(HIST("EventCounter"), EvCutLabel::VtxZ);
21282181
}
21292182

2183+
if (isINELgt0) {
2184+
if (!col.isInelGt0()) {
2185+
return false;
2186+
}
2187+
registry.fill(HIST("EventCounter"), EvCutLabel::INELgt0);
2188+
}
2189+
21302190
return true;
21312191
}
21322192

0 commit comments

Comments
 (0)