Skip to content

Commit 5315c1b

Browse files
authored
Add mass²/z² plots for MC
Added mass²/z² 3D plots for MC particles and anti-particles.
1 parent 898812d commit 5315c1b

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ struct NucleitpcPbPb {
337337
histomc.add("histDeltaPtVsPtGen", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10}, {1000, -0.5, 0.5, "p_{T}(reco) - p_{T}(gen);p_{T}(reco)"}});
338338
histomc.add("histPIDtrack", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10, "p_{T}(reco)"}, {9, -0.5, 8.5, "p_{T}(reco) - p_{T}(gen)"}});
339339
histomc.add("histPIDtrackanti", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10, "p_{T}(reco)"}, {9, -0.5, 8.5, "p_{T}(reco) - p_{T}(gen)"}});
340+
341+
// Mass²/z² 3D plots for MC (pT, mass²/z², centrality) - separate for particles and anti-particles
342+
histomc.add("hMassVsPtMC", "mass^{2}/z^{2} vs p_{T} (MC Particles);p_{T} (GeV/c);mass^{2}/z^{2};Centrality",
343+
{HistType::kTH3F, {ptAxis, axismassnsigma, axisCent}});
344+
histomc.add("hMassVsPtAntiMC", "mass^{2}/z^{2} vs p_{T} (MC Anti-particles);p_{T} (GeV/c);mass^{2}/z^{2};Centrality",
345+
{HistType::kTH3F, {ptAxis, axismassnsigma, axisCent}});
340346
}
341347

342348
if (doprocessDCA) {
@@ -916,6 +922,34 @@ struct NucleitpcPbPb {
916922
histos.fill(HIST("dcaZ"), ptReco, track.dcaZ());
917923
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
918924

925+
// Fill mass²/z² for MC - separate for particles and anti-particles
926+
if (track.hasTOF()) {
927+
float beta = o2::pid::tof::Beta::GetBeta(track);
928+
const float eps = 1e-6f;
929+
if (beta >= eps && beta <= 1.0f - eps) {
930+
float charge = (i == he3 || i == he4) ? 2.f : 1.f;
931+
float p = getRigidity(track);
932+
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);
933+
float massSquareOverChargeSquare = (massTOF * massTOF) / (charge * charge);
934+
935+
// Apply He4 rejection if needed (to match data selection)
936+
bool skipHe4 = false;
937+
if (std::abs(pdg) == particlePdgCodes.at(5)) { // He4
938+
if (cfghe3massrejreq && (massTOF * massTOF > cfgminmassrejection && massTOF * massTOF < cfgmaxmassrejection)) {
939+
skipHe4 = true;
940+
}
941+
}
942+
943+
if (!skipHe4) {
944+
if (pdg > 0) {
945+
histomc.fill(HIST("hMassVsPtMC"), ptReco, massSquareOverChargeSquare, collision.centFT0C());
946+
} else {
947+
histomc.fill(HIST("hMassVsPtAntiMC"), ptReco, massSquareOverChargeSquare, collision.centFT0C());
948+
}
949+
}
950+
}
951+
}
952+
919953
// Delta Pt histograms
920954
float ptGen = matchedMCParticle.pt();
921955
float deltaPt = ptReco - ptGen;
@@ -1042,9 +1076,9 @@ struct NucleitpcPbPb {
10421076

10431077
int param = -1;
10441078
if (i == he3) {
1045-
param = (-particlePdgCodes.at(4) > 0) ? 0 : 1;
1079+
param = (pdg > 0) ? 0 : 1;
10461080
} else if (i == he4) {
1047-
param = (-particlePdgCodes.at(4) > 0) ? 2 : 3;
1081+
param = (pdg > 0) ? 2 : 3;
10481082
}
10491083

10501084
if (param >= 0) {

0 commit comments

Comments
 (0)