Skip to content

Commit b57a1fd

Browse files
authored
[PWGLF] Exchange Cent. for Nch in MC closure (#14135)
1 parent c6a8a6d commit b57a1fd

File tree

1 file changed

+13
-51
lines changed

1 file changed

+13
-51
lines changed

PWGLF/Tasks/Nuspex/piKpRAA.cxx

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ struct PiKpRAA {
556556
registry.add("MCclosure_PtMCKaVsNchMC", "All Generated Events 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
557557
registry.add("MCclosure_PtMCPrVsNchMC", "All Generated Events 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
558558

559-
registry.add("MCclosure_PtPiVsCent", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {axisPt, axisCent});
560-
registry.add("MCclosure_PtKaVsCent", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {axisPt, axisCent});
561-
registry.add("MCclosure_PtPrVsCent", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {axisPt, axisCent});
559+
registry.add("MCclosure_PtPiVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
560+
registry.add("MCclosure_PtKaVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
561+
registry.add("MCclosure_PtPrVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
562562
}
563563

564564
LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value;
@@ -1508,8 +1508,8 @@ struct PiKpRAA {
15081508

15091509
if (isPrimary) {
15101510
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
1511-
registry.fill(HIST("PtPiVsCentMC_WithRecoEvt"), particle.pt(), centrality);
1512-
registry.fill(HIST("PtPiVsNchMC_WithRecoEvt"), particle.pt(), nChMC);
1511+
registry.fill(HIST("PtPiVsCentMC_WithRecoEvt"), particle.pt(), centrality); // Denominator of tracking efficiency
1512+
registry.fill(HIST("PtPiVsNchMC_WithRecoEvt"), particle.pt(), nChMC); // Numerator of signal loss
15131513
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
15141514
registry.fill(HIST("PtKaVsCentMC_WithRecoEvt"), particle.pt(), centrality);
15151515
registry.fill(HIST("PtKaVsNchMC_WithRecoEvt"), particle.pt(), nChMC);
@@ -1716,16 +1716,16 @@ struct PiKpRAA {
17161716
}
17171717

17181718
if (isPi && !isKa && !isPr) {
1719-
registry.fill(HIST("PtPiVsCent_WithRecoEvt"), track.pt(), centrality);
1720-
registry.fill(HIST("MCclosure_PtPiVsCent"), track.pt(), centrality);
1719+
registry.fill(HIST("PtPiVsCent_WithRecoEvt"), track.pt(), centrality); // Numerator of tracking efficiency
1720+
registry.fill(HIST("MCclosure_PtPiVsNchMC"), track.pt(), nChMC);
17211721
}
17221722
if (isKa && !isPi && !isPr) {
17231723
registry.fill(HIST("PtKaVsCent_WithRecoEvt"), track.pt(), centrality);
1724-
registry.fill(HIST("MCclosure_PtKaVsCent"), track.pt(), centrality);
1724+
registry.fill(HIST("MCclosure_PtKaVsNchMC"), track.pt(), nChMC);
17251725
}
17261726
if (isPr && !isPi && !isKa) {
17271727
registry.fill(HIST("PtPrVsCent_WithRecoEvt"), track.pt(), centrality);
1728-
registry.fill(HIST("MCclosure_PtPrVsCent"), track.pt(), centrality);
1728+
registry.fill(HIST("MCclosure_PtPrVsNchMC"), track.pt(), nChMC);
17291729
}
17301730
registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt());
17311731
} // Loop over reconstructed tracks
@@ -1738,52 +1738,11 @@ struct PiKpRAA {
17381738
// Therefore it is expressed as a function of the generated pT and the generated Nch in ∣eta∣ < 0.8
17391739
//---------------------------
17401740

1741-
//---------------------------
1742-
// To perform MC closure
1743-
// True Pt vs Generated Nch
1744-
//---------------------------
1745-
for (const auto& particle : mcParticles) {
1746-
if (particle.eta() < v0Selections.minEtaDaughter || particle.eta() > v0Selections.maxEtaDaughter)
1747-
continue;
1748-
1749-
if (particle.pt() < v0Selections.minPt || particle.pt() > v0Selections.maxPt)
1750-
continue;
1751-
1752-
auto charge{0.};
1753-
// Get the MC particle
1754-
auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
1755-
if (pdgParticle != nullptr) {
1756-
charge = pdgParticle->Charge();
1757-
} else {
1758-
continue;
1759-
}
1760-
1761-
// Is it a charged particle?
1762-
if (std::abs(charge) < kMinCharge)
1763-
continue;
1764-
1765-
// Is it a primary particle?
1766-
bool isPrimary{true};
1767-
if (!particle.isPhysicalPrimary())
1768-
isPrimary = false;
1769-
1770-
if (isPrimary) {
1771-
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
1772-
registry.fill(HIST("MCclosure_PtMCPiVsNchMC"), particle.pt(), nChMC);
1773-
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
1774-
registry.fill(HIST("MCclosure_PtMCKaVsNchMC"), particle.pt(), nChMC);
1775-
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
1776-
registry.fill(HIST("MCclosure_PtMCPrVsNchMC"), particle.pt(), nChMC);
1777-
} else {
1778-
continue;
1779-
}
1780-
}
1781-
} // Loop over generated particles per Gen Event 4 MC closure
1782-
17831741
//---------------------------
17841742
// Generated Pt spectra of all INEL > 0 Generated evets
17851743
// irrespective of whether there is a reconstructed collision
17861744
// This is used for the denominator of the signal loss correction
1745+
// Also for MC closure: True Pt vs Generated Nch
17871746
//---------------------------
17881747
for (const auto& particle : mcParticles) {
17891748
if (particle.eta() < v0Selections.minEtaDaughter || particle.eta() > v0Selections.maxEtaDaughter)
@@ -1813,10 +1772,13 @@ struct PiKpRAA {
18131772
if (isPrimary) {
18141773
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
18151774
registry.fill(HIST("PtPiVsNchMC_AllGen"), particle.pt(), nChMC);
1775+
registry.fill(HIST("MCclosure_PtMCPiVsNchMC"), particle.pt(), nChMC);
18161776
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
18171777
registry.fill(HIST("PtKaVsNchMC_AllGen"), particle.pt(), nChMC);
1778+
registry.fill(HIST("MCclosure_PtMCKaVsNchMC"), particle.pt(), nChMC);
18181779
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
18191780
registry.fill(HIST("PtPrVsNchMC_AllGen"), particle.pt(), nChMC);
1781+
registry.fill(HIST("MCclosure_PtMCPrVsNchMC"), particle.pt(), nChMC);
18201782
} else {
18211783
continue;
18221784
}

0 commit comments

Comments
 (0)