Skip to content

Commit 3fc160a

Browse files
author
Preet Pati
committed
Addition of nsigma particle count histograms
1 parent a540747 commit 3fc160a

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,17 @@ struct PidDiHadron {
515515
histos.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}});
516516
}
517517
if (doprocessMC) {
518+
histos.add("hNsigmaPionTruePositives", "hNsigmaPionTruePositives", {HistType::kTH1D, {axisPt}}); // Fraction of particles that are pions and selected as pions
519+
histos.add("hNsigmaKaonTruePositives", "hNsigmaKaonTruePositives", {HistType::kTH1D, {axisPt}}); // Fraction of particles that are kaons and selected as kaons
520+
histos.add("hNsigmaProtonTruePositives", "hNsigmaProtonTruePositives", {HistType::kTH1D, {axisPt}}); // Fraction of particles that are protons and selected as protons
521+
518522
histos.add("hNsigmaPionSelected", "hNsigmaPionSelected", {HistType::kTH1D, {axisPt}});
519523
histos.add("hNsigmaKaonSelected", "hNsigmaKaonSelected", {HistType::kTH1D, {axisPt}});
520524
histos.add("hNsigmaProtonSelected", "hNsigmaProtonSelected", {HistType::kTH1D, {axisPt}});
521525

522-
histos.add("hNsigmaPionTrue", "hNsigmaPionTrue", {HistType::kTH1D, {axisPt}});
523-
histos.add("hNsigmaKaonTrue", "hNsigmaKaonTrue", {HistType::kTH1D, {axisPt}});
524-
histos.add("hNsigmaProtonTrue", "hNsigmaProtonTrue", {HistType::kTH1D, {axisPt}});
526+
histos.add("hNsigmaPionTrue", "hNsigmaPionTrue", {HistType::kTH1D, {axisPt}}); // All true pions from MC
527+
histos.add("hNsigmaKaonTrue", "hNsigmaKaonTrue", {HistType::kTH1D, {axisPt}}); // All true kaons from MC
528+
histos.add("hNsigmaProtonTrue", "hNsigmaProtonTrue", {HistType::kTH1D, {axisPt}}); // All true protons from MC
525529
}
526530

527531
histos.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event
@@ -1502,28 +1506,36 @@ struct PidDiHadron {
15021506

15031507
int pidIndex = getNsigmaPID(track);
15041508

1509+
// Fill Counts for selection through Nsigma cuts
1510+
if (pidIndex == kPions)
1511+
histos.fill(HIST("hNsigmaPionSelected"), track.pt());
1512+
if (pidIndex == kKaons)
1513+
histos.fill(HIST("hNsigmaKaonSelected"), track.pt());
1514+
if (pidIndex == kProtons)
1515+
histos.fill(HIST("hNsigmaProtonSelected"), track.pt());
1516+
15051517
// Check the PDG code for the particles (MC truth) and match with analysed Nsigma PID
15061518
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) {
15071519
histos.fill(HIST("hNsigmaPionTrue"), track.pt());
15081520

15091521
if (pidIndex == kPions) {
1510-
histos.fill(HIST("hNsigmaPionSelected"), track.pt());
1522+
histos.fill(HIST("hNsigmaPionTruePositives"), track.pt());
15111523
}
15121524
} // Pion condition
15131525

15141526
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) {
15151527
histos.fill(HIST("hNsigmaKaonTrue"), track.pt());
15161528

15171529
if (pidIndex == kKaons) {
1518-
histos.fill(HIST("hNsigmaKaonSelected"), track.pt());
1530+
histos.fill(HIST("hNsigmaKaonTruePositives"), track.pt());
15191531
}
15201532
} // Kaon condition
15211533

15221534
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) {
15231535
histos.fill(HIST("hNsigmaProtonTrue"), track.pt());
15241536

15251537
if (pidIndex == kProtons) {
1526-
histos.fill(HIST("hNsigmaProtonSelected"), track.pt());
1538+
histos.fill(HIST("hNsigmaProtonTruePositives"), track.pt());
15271539
}
15281540
} // Proton condition
15291541

0 commit comments

Comments
 (0)