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
133 changes: 83 additions & 50 deletions PWGJE/Tasks/nucleiInJets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <Framework/OutputObjHeader.h>
#include <Framework/runDataProcessing.h>

#include "TDatabasePDG.h"

Check failure on line 41 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include <TH1.h>
#include <TH2.h>
#include <TH3.h>
Expand Down Expand Up @@ -117,6 +117,7 @@
Configurable<int> centralityType{"centralityType", 0, "0: FT0M, 1: FT0C, 2: FV0A"};
Configurable<std::vector<int>> cfgOccupancyRange{"cfgOccupancyRange", {0, 1000}, "Occupancy selection"};
Configurable<bool> useOccupancy{"useOccupancy", true, "Events with custom occupancy selection"};
Configurable<bool> useEtaSelForEffDen{"useEtaSelForEffDen", false, "eta selection for gen particles"};

Configurable<double> cfgtrkMinPt{"cfgtrkMinPt", 0.15, "set track min pT"};
Configurable<double> cfgtrkMaxEta{"cfgtrkMaxEta", 0.8, "set track max Eta"};
Expand Down Expand Up @@ -158,6 +159,7 @@
Configurable<bool> useTOFVeto{"useTOFVeto", false, "true: use TOF veto, false: no TOF veto"};
Configurable<bool> isRequireHitsInITSLayers{"isRequireHitsInITSLayers", true, "true: at least one hit in the its inner layes"};
Configurable<bool> useMcC{"useMcC", true, "use mcC"};
Configurable<bool> useRapidityCutForPID{"useRapidityCutForPID", false, "true: use rapidity cut for PID, false: no rapidity cut for PID"};

Configurable<bool> addpik{"addpik", true, "add pion and kaon hist"};
ConfigurableAxis binsDCA{"binsDCA", {400, -1.f, 1.f}, ""};
Expand Down Expand Up @@ -1286,7 +1288,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)

Check failure on line 1291 in PWGJE/Tasks/nucleiInJets.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.
return;
jetHist.fill(HIST("hNEvents"), 2.5);
if (!jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::initialiseEventSelectionBits("sel8")))
Expand Down Expand Up @@ -1337,7 +1339,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)

Check failure on line 1342 in PWGJE/Tasks/nucleiInJets.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.
return;
jetHist.fill(HIST("hNEvents"), 2.5);

Expand Down Expand Up @@ -1369,7 +1371,7 @@
if (isWithJetEvents && nJets == 0)
return;
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
for (auto& track : tracks) {

Check failure on line 1374 in PWGJE/Tasks/nucleiInJets.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.
auto trk = track.track_as<TrackCandidatesLfPid>();
fillTrackInfo<false>(trk, chargedjets, leadingJetWithPtEtaPhi);
}
Expand All @@ -1380,8 +1382,8 @@
jetHist.fill(HIST("hNEventsInc"), 0.5);

bool isSel8 = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("sel8"));
bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("selNoSameBunchPileup"));
bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("selIsGoodZvtxFT0vsPV"));
bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("NoSameBunchPileup"));
bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("IsGoodZvtxFT0vsPV"));

if (sel8Coll && !isSel8)
return;
Expand Down Expand Up @@ -1421,113 +1423,137 @@
if (!isTrackSelected(trk)) {
continue;
}

auto rapidityData = [&](float m2z) {
const float rap = trk.rapidity(m2z);
return rap > std::abs(cfgtrkMaxRap);
};

auto prRapidityWithinRange = rapidityData(o2::constants::physics::MassProton);
auto deRapidityWithinRange = rapidityData(o2::constants::physics::MassDeuteron);

if (std::fabs(trk.eta()) > cfgtrkMaxEta)
continue;
if (trk.sign() > 0) { // particle info
if (useTOFNsigmaPreSel && trk.hasTOF()) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF)
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF && (!useRapidityCutForPID || prRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF)
}
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF && (!useRapidityCutForPID || deRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
} else if (!useTOFNsigmaPreSel && !useTOFVeto) {
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);

if (!useRapidityCutForPID || prRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
}
if (!useRapidityCutForPID || deRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
} else if (!useTOFNsigmaPreSel && useTOFVeto) {
if (trk.hasTOF()) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF) {
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (!useRapidityCutForPID || prRapidityWithinRange)
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
}
} else {
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (!useRapidityCutForPID || prRapidityWithinRange)
jetHist.fill(HIST("tracksInc/proton/h3PtVsProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
}
if (trk.hasTOF()) {
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF) {
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
if (!useRapidityCutForPID || deRapidityWithinRange)
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
} else {
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
if (!useRapidityCutForPID || deRapidityWithinRange)
jetHist.fill(HIST("tracksInc/deuteron/h3PtVsDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
}
if (addTOFplots && trk.hasTOF()) {
float massTOF = trk.p() * std::sqrt(1.f / (trk.beta() * trk.beta()) - 1.f);
if (!useTPCpreSel) {
jetHist.fill(HIST("tracksInc/proton/h2TOFmassProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TofNsigmaProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);

jetHist.fill(HIST("tracksInc/deuteron/h2TOFmassDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TofNsigmaDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
if (!useRapidityCutForPID || prRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/proton/h2TOFmassProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TofNsigmaProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);
}
if (!useRapidityCutForPID || deRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/deuteron/h2TOFmassDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TofNsigmaDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
}
} else {
if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr) {
if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr && (!useRapidityCutForPID || prRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/proton/h2TOFmassProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/h2TofNsigmaProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);
}
if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe) {
if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe && (!useRapidityCutForPID || deRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/deuteron/h2TOFmassDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/h2TofNsigmaDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
}
}
}

if (cEnableProtonQA && std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr) {
if (cEnableProtonQA && std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr && (!useRapidityCutForPID || prRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/proton/dca/after/hDCAxyVsPtProton"), trk.dcaXY(), trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/proton/dca/after/hDCAzVsPtProton"), trk.dcaZ(), trk.pt(), centrality);
}
if (cEnableDeuteronQA && std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe) {
if (cEnableDeuteronQA && std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe && (!useRapidityCutForPID || deRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/deuteron/dca/after/hDCAxyVsPtDeuteron"), trk.dcaXY(), trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/deuteron/dca/after/hDCAzVsPtDeuteron"), trk.dcaZ(), trk.pt(), centrality);
}

} else { // anti-particle info
if (useTOFNsigmaPreSel && trk.hasTOF()) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF)
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF && (!useRapidityCutForPID || prRapidityWithinRange))
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF)
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF && (!useRapidityCutForPID || deRapidityWithinRange))
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
} else if (!useTOFNsigmaPreSel && !useTOFVeto) {
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
if (!useRapidityCutForPID || prRapidityWithinRange)
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (!useRapidityCutForPID || deRapidityWithinRange)
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
} else if (!useTOFNsigmaPreSel && useTOFVeto) {
if (trk.hasTOF()) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF && (!useRapidityCutForPID || prRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
}
} else {
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
if (!useRapidityCutForPID || prRapidityWithinRange)
jetHist.fill(HIST("tracksInc/antiProton/h3PtVsantiProtonNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaPr(), centrality);
}
if (trk.hasTOF()) {
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF) {
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF && (!useRapidityCutForPID || deRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
} else {
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
if (!useRapidityCutForPID || deRapidityWithinRange)
jetHist.fill(HIST("tracksInc/antiDeuteron/h3PtVsantiDeuteronNSigmaTPCVsPt"), trk.pt(), trk.tpcNSigmaDe(), centrality);
}
}
if (addTOFplots && trk.hasTOF()) {
float massTOF = trk.p() * std::sqrt(1.f / (trk.beta() * trk.beta()) - 1.f);
if (!useTPCpreSel) {
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmassantiProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TofNsigmaantiProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);

jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmassantiDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TofNsigmaantiDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
} else {
if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr) {
if (!useRapidityCutForPID || prRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmassantiProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TofNsigmaantiProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);
}
if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe) {
if (!useRapidityCutForPID || deRapidityWithinRange) {
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmassantiDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TofNsigmaantiDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
} else {
}
} else {
if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr && (!useRapidityCutForPID || prRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmassantiProtonVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProton * MassProton, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiProton/h2TofNsigmaantiProtonVsPt"), trk.tofNSigmaPr(), trk.pt(), centrality);
}
if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe && (!useRapidityCutForPID || deRapidityWithinRange)) {
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmassantiDeuteronVsPt"), massTOF, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt(), centrality);
jetHist.fill(HIST("tracksInc/antiDeuteron/h2TofNsigmaantiDeuteronVsPt"), trk.tofNSigmaDe(), trk.pt(), centrality);
Expand Down Expand Up @@ -1621,7 +1647,7 @@
int nJets = 0;
std::vector<float> leadingJetWithPtEtaPhi(3);
float leadingJetPt = -1.0f;
for (auto& mcdjet : mcdjets) {

Check failure on line 1650 in PWGJE/Tasks/nucleiInJets.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.
jetHist.fill(HIST("mcdJet/hJetPt"), mcdjet.pt());
jetHist.fill(HIST("mcdJet/hJetEta"), mcdjet.eta());
jetHist.fill(HIST("mcdJet/hJetPhi"), mcdjet.phi());
Expand Down Expand Up @@ -2011,8 +2037,8 @@
jetHist.fill(HIST("recInc/eventStat"), 0.5);

bool isSel8 = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("sel8"));
bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("selNoSameBunchPileup"));
bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("selIsGoodZvtxFT0vsPV"));
bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("NoSameBunchPileup"));
bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("IsGoodZvtxFT0vsPV"));

if (sel8Coll && !isSel8)
return;
Expand Down Expand Up @@ -2065,13 +2091,20 @@
// require mc getProcess to get Decay and Material secondaries
int particleOriginType = 0;
auto isMcPrimary = false;
// auto isMcTransport = false; // auto isMcSecondaryFromMaterial = false; auto isMcSecondaryFromWeakDecay = false;
if (mcTrack.isPhysicalPrimary()) {
isMcPrimary = true;
auto isProdByGen = false;
auto isFromWeakDecay = false;

isMcPrimary = mcTrack.isPhysicalPrimary();
isProdByGen = mcTrack.producedByGenerator();
isFromWeakDecay = mcTrack.getProcess() == TMCProcess::kPDecay;

if (isMcPrimary) {
particleOriginType = 1;
} else if (mcTrack.getGenStatusCode() == -1) {
// isMcTransport = true;
particleOriginType = 2;
} else if (!isProdByGen) {
particleOriginType = 2; // from transport
if (isFromWeakDecay) {
particleOriginType = 3; // from weak decay
}
}

// Fill DCAxy histograms
Expand All @@ -2088,13 +2121,13 @@
if (std::fabs(track.dcaXY()) > dcaXYPtDepCut(track.pt()) && useDcaxyPtDepCut)
continue;

auto mass = TDatabasePDG::Instance()->GetParticle(abs(mcTrack.pdgCode()))->Mass();

Check failure on line 2124 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

Check failure on line 2124 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
auto rapidity = RecoDecay::y(std::array{track.px(), track.py(), track.pz()}, mass);

if (std::abs(rapidity) > cfgtrkMaxRap)
continue;
// Proton
if (std::abs(mcTrack.pdgCode()) == 2212) { // Proton

Check failure on line 2130 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
jetHist.fill(HIST("recInc/eff/tpcTrack3D"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
if (track.hasTOF())
jetHist.fill(HIST("recInc/eff/tpcTofTrack3D"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
Expand Down Expand Up @@ -2124,14 +2157,14 @@
// TPCTOF and TPCTOFVeto histograms
// Proton
if (std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPr && track.hasTOF()) {
if (std::abs(mcTrack.pdgCode()) == 2212) {

Check failure on line 2160 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOF"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
if (std::abs(track.tofNSigmaPr()) < cfgnTPCPIDPrTOF)
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
} else {
if (std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPr) {
if (std::abs(mcTrack.pdgCode()) == 2212) {

Check failure on line 2167 in PWGJE/Tasks/nucleiInJets.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}
Expand Down Expand Up @@ -2171,7 +2204,7 @@
for (const auto& mcParticle : mcParticles_per_coll) {
if (!mcParticle.isPhysicalPrimary())
continue;
if (std::fabs(mcParticle.eta()) > cfgtrkMaxEta)
if (std::fabs(mcParticle.eta()) > cfgtrkMaxEta && useEtaSelForEffDen)
continue;
if (std::fabs(mcParticle.y()) > cfgtrkMaxRap)
continue;
Expand Down
Loading