Skip to content
36 changes: 19 additions & 17 deletions PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -918,9 +918,24 @@
histomc.fill(HIST("hSpectramc"), particleAnti, collision.centFT0C(), ptReco, ptTOF);

// Basic track histograms
histos.fill(HIST("dcaXY"), ptReco, track.dcaXY());
histos.fill(HIST("dcaZ"), ptReco, track.dcaZ());
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
if (decayType == 0) {
histos.fill(HIST("dcaXY"), ptReco, track.dcaXY());
histos.fill(HIST("dcaZ"), ptReco, track.dcaZ());
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
}
// Delta Pt histograms
float ptGen = matchedMCParticle.pt();
float deltaPt = ptReco - ptGen;

if (pdg == -particlePdgCodes.at(i) && decayType == 0) { // Anti-particle
histomc.fill(HIST("histDeltaPtVsPtGenanti"), ptReco, deltaPt);
histomc.fill(HIST("histPIDtrackanti"), ptReco, track.pidForTracking());
}

if (pdg == particlePdgCodes.at(i) && decayType == 0) { // Particle
histomc.fill(HIST("histDeltaPtVsPtGen"), ptReco, deltaPt);
histomc.fill(HIST("histPIDtrack"), ptReco, track.pidForTracking());
}

// Fill mass²/z² for MC - separate for particles and anti-particles
if (track.hasTOF()) {
Expand All @@ -940,7 +955,7 @@
}
}

if (!skipHe4) {
if (!skipHe4 && decayType == 0) {
if (pdg > 0) {
histomc.fill(HIST("hMassVsPtMC"), ptReco, massSquareOverChargeSquare, collision.centFT0C());
} else {
Expand All @@ -949,19 +964,6 @@
}
}
}

// Delta Pt histograms
float ptGen = matchedMCParticle.pt();
float deltaPt = ptReco - ptGen;

if (pdg == -particlePdgCodes.at(i)) { // Anti-particle
histomc.fill(HIST("histDeltaPtVsPtGenanti"), ptReco, deltaPt);
histomc.fill(HIST("histPIDtrackanti"), ptReco, track.pidForTracking());
}
if (pdg == particlePdgCodes.at(i)) { // Particle
histomc.fill(HIST("histDeltaPtVsPtGen"), ptReco, deltaPt);
histomc.fill(HIST("histPIDtrack"), ptReco, track.pidForTracking());
}
}
}
break; // Found the matching collision, break out of collision loop
Expand Down Expand Up @@ -1131,7 +1133,7 @@
// ---- Primary particles ----
decayType = 0;
if (matchedMCParticle.has_mothers()) {
for (auto& motherparticle : matchedMCParticle.mothers_as<aod::McParticles>()) {

Check failure on line 1136 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (std::find(hfMothCodes.begin(), hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
decayType = 1;
break;
Expand All @@ -1146,7 +1148,7 @@
decayType = 1;

// Check if it's from HF decay
for (auto& motherparticle : matchedMCParticle.mothers_as<aod::McParticles>()) {

Check failure on line 1151 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (std::find(hfMothCodes.begin(), hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
break;
}
Expand All @@ -1169,7 +1171,7 @@
if (matchedMCParticle.isPhysicalPrimary()) {
histomc.fill(HIST("DCAxy_vs_pT_primary"), ptDCA, track.dcaXY(), collision.centFT0C());
}
if (decayType == 2) { // Transport/Material

Check failure on line 1174 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
histomc.fill(HIST("DCAxy_vs_pT_transport"), ptDCA, track.dcaXY(), collision.centFT0C());
} else if (decayType == 1) { // Weak decay (including HF)
histomc.fill(HIST("DCAxy_vs_pT_weakdecay"), ptDCA, track.dcaXY(), collision.centFT0C());
Expand Down
Loading