diff --git a/PWGLF/Tasks/Nuspex/pccMcSpectra.cxx b/PWGLF/Tasks/Nuspex/pccMcSpectra.cxx index d47b430b2f4..0d172387541 100644 --- a/PWGLF/Tasks/Nuspex/pccMcSpectra.cxx +++ b/PWGLF/Tasks/Nuspex/pccMcSpectra.cxx @@ -28,6 +28,8 @@ #include #include +// #include "Framework/Logger.h" + using namespace o2; using namespace o2::framework; @@ -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}); @@ -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&, @@ -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 @@ -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()); + } } } };