Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions PWGLF/Tasks/Nuspex/pccMcSpectra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <cstdlib>
#include <vector>

// #include "Framework/Logger.h"

using namespace o2;
using namespace o2::framework;

Expand Down Expand Up @@ -60,6 +62,10 @@ struct pccMcSpectra {
"multiplicity distribution;Nch;Events",
kTH1D, {multAxis});

histos.add("spectra/charged",
"Charged particle spectra;Nch;pT",
kTH2D, {multAxis, ptAxis});

histos.add("spectra/pion",
"Pion spectra;Nch;pT",
kTH2D, {multAxis, ptAxis});
Expand Down Expand Up @@ -87,6 +93,10 @@ struct pccMcSpectra {
histos.add("spectra/omega",
"Omega spectra;Nch;pT",
kTH2D, {multAxis, ptAxis});

histos.add("spectra/rest",
"Rest spectra;Nch;pT",
kTH2D, {multAxis, ptAxis});
}

void process(aod::McCollisions::iterator const&,
Expand Down Expand Up @@ -140,23 +150,38 @@ struct pccMcSpectra {
int absPDG = std::abs(particle.pdgCode());
float pt = particle.pt();

auto pdgParticle = pdg->GetParticle(particle.pdgCode());
auto isCharged = pdgParticle && pdgParticle->Charge() != 0.;

// if particle is charged, fill the charged-particle spectra
if (isCharged) {
histos.fill(HIST("spectra/charged"), nch, pt);
}

// pi, K, p and Sigma are excluded from the "rest" spectrum
bool isPiKpSigma = false;

switch (absPDG) {

case 211: // Pion
histos.fill(HIST("spectra/pion"), nch, pt);
isPiKpSigma = true;
break;

case 321: // Kaon
histos.fill(HIST("spectra/kaon"), nch, pt);
isPiKpSigma = true;
break;

case 2212: // Proton
histos.fill(HIST("spectra/proton"), nch, pt);
isPiKpSigma = true;
break;

case 3222: // Sigma+
case 3112: // Sigma-
histos.fill(HIST("spectra/sigma"), nch, pt);
isPiKpSigma = true;
break;

case 3122: // Lambda
Expand All @@ -174,6 +199,12 @@ struct pccMcSpectra {
default:
break;
}

// "rest": charged particles that are not pi, K, p or Sigma
if (isCharged && !isPiKpSigma) {
histos.fill(HIST("spectra/rest"), nch, pt);
// LOGP(info, "Filling Rest Particle with PDG: {}", particle.pdgCode());
}
}
}
};
Expand Down
Loading