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

#include "TDatabasePDG.h"

Check failure on line 42 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 @@ -178,6 +178,7 @@
Configurable<std::string> cfgSkim{"cfgSkim", "fHighFt0Mult", "Configurable for skimming"};
Configurable<bool> sel8Coll{"sel8Coll", true, "sel8Coll for collisions"};
Configurable<bool> selNoSameBunchPileup{"selNoSameBunchPileup", false, "selNoSameBunchPileup for collisions"};
Configurable<double> cfgMaxZVertex{"cfgMaxZVertex", 10.0, "Maximum Z vertex selection in cm"};
Configurable<bool> selIsGoodZvtxFT0vsPV{"selIsGoodZvtxFT0vsPV", false, "selIsGoodZvtxFT0vsPV for collisions"};

// using EventTable = soa::Join<aod::JetCollisions, aod::EvSels, aod::CentFT0Ms, aod::CentFV0As, aod::CentFT0Cs>;
Expand Down Expand Up @@ -537,6 +538,14 @@
jetHist.add<TH2>("tracks/helium/h2TofNsigmaHeliumVsPt", "h2TofNsigmaHeliumVsPt; TofNsigma; #it{p}_{T}/z (GeV)", HistType::kTH2F, {{100, -5, 5}, {50, 0., 5.}});
jetHist.add<TH2>("tracks/antiHelium/h2TofNsigmaantiHeliumVsPt", "h2TofNsigmaantiHeliumVsPt; TofNsigma; #it{p}_{T}/z (GeV)", HistType::kTH2F, {{100, -5, 5}, {50, 0., 5.}});

// tracksInc/dcaxy/rec histograms for each particle type
std::vector<std::string> particles = {"proton", "antiProton", "deuteron", "antiDeuteron", "triton", "antiTriton", "helium", "antiHelium"};
for (const auto& particle : particles) {
jetHist.add<TH3>(("tracksInc/dcaxy/rec/" + particle + "/tpcPtVsDcaxy3D").c_str(), "pT vs Dcaxy vs Centrality", HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0, 100}, dcaxyAxis});
jetHist.add<TH3>(("tracksInc/dcaxy/rec/" + particle + "/tpcPtVsDcaxy3DPIDVeto").c_str(), "pT vs Dcaxy vs Centrality (PID Veto)", HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0, 100}, dcaxyAxis});
jetHist.add<TH3>(("tracksInc/dcaxy/rec/" + particle + "/tpcPtVsDcaxy3DPIDTOF").c_str(), "pT vs Dcaxy vs Centrality (PID TOF)", HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0, 100}, dcaxyAxis});
}

if (isMC) {
// inc
jetHist.add<TH1>("recInc/eventStat", "Event statistics (inclusive)", HistType::kTH1F, {{6, 0.f, 6.f}});
Expand Down Expand Up @@ -1478,7 +1487,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)
if (std::abs(collision.posZ()) > cfgMaxZVertex)
return;
jetHist.fill(HIST("hNEvents"), 2.5);
if (!jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::initialiseEventSelectionBits("sel8")))
Expand Down Expand Up @@ -1542,7 +1551,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)
if (std::abs(collision.posZ()) > cfgMaxZVertex)
return;
jetHist.fill(HIST("hNEvents"), 2.5);

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

Check failure on line 1600 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, backgroundRho);
}
Expand All @@ -1606,7 +1615,7 @@
return;
jetHist.fill(HIST("hNEventsInc"), 1.5);

if (std::abs(coll.posZ()) > 10) // bad vertex

Check failure on line 1618 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("hNEventsInc"), 2.5);
if (selNoSameBunchPileup && !isSelNoSameBunchPileup)
Expand Down Expand Up @@ -1637,7 +1646,7 @@
jetHist.fill(HIST("hNEventsIncVsCent"), coll.posZ(), centrality);
for (const auto& track : tracks) {
auto trk = track.track_as<TrackCandidates>();
if (!isTrackSelected(trk)) {
if (!isTrackSelectedWithoutDcaxy(trk)) {
continue;
}

Expand All @@ -1651,6 +1660,117 @@

if (std::fabs(trk.eta()) > cfgtrkMaxEta)
continue;

bool hasTOF = trk.hasTOF();

if (trk.sign() > 0) { // particles

if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/proton/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/proton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/proton/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/proton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // proton

if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/deuteron/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/deuteron/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/deuteron/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/deuteron/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Deuteron

if (std::abs(trk.tpcNSigmaTr()) < cfgnTPCPIDTr) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/triton/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaTr()) < cfgnTPCPIDTrTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/triton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/triton/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/triton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Triton

if (std::abs(trk.tpcNSigmaHe()) < cfgnTPCPIDHe) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/helium/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaHe()) < cfgnTPCPIDHeTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/helium/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/helium/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/helium/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Helium

} else { // antiparticles

if (std::abs(trk.tpcNSigmaPr()) < cfgnTPCPIDPr) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiProton/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiProton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiProton/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiProton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // proton

if (std::abs(trk.tpcNSigmaDe()) < cfgnTPCPIDDe) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiDeuteron/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaDe()) < cfgnTPCPIDDeTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiDeuteron/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiDeuteron/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiDeuteron/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Deuteron

if (std::abs(trk.tpcNSigmaTr()) < cfgnTPCPIDTr) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiTriton/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaTr()) < cfgnTPCPIDTrTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiTriton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiTriton/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiTriton/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Triton

if (std::abs(trk.tpcNSigmaHe()) < cfgnTPCPIDHe) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiHelium/tpcPtVsDcaxy3D"), trk.pt(), centrality, trk.dcaXY());
if (useTOFVeto && hasTOF) {
if (std::abs(trk.tofNSigmaHe()) < cfgnTPCPIDHeTOF) {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiHelium/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiHelium/tpcPtVsDcaxy3DPIDTOF"), trk.pt(), centrality, trk.dcaXY());
}
} else {
jetHist.fill(HIST("tracksInc/dcaxy/rec/antiHelium/tpcPtVsDcaxy3DPIDVeto"), trk.pt(), centrality, trk.dcaXY());
}
} // Helium

} // antiparticles

// DCAxy selection for rest of the analysis
if (std::fabs(trk.dcaXY()) > cfgMaxDCArToPVcut && !useDcaxyPtDepCut)
continue;
if (std::fabs(trk.dcaXY()) > dcaXYPtDepCut(trk.pt()) && useDcaxyPtDepCut)
continue;

if (trk.sign() > 0) { // particle info
if (useTOFNsigmaPreSel && trk.hasTOF()) {
if (std::abs(trk.tofNSigmaPr()) < cfgnTPCPIDPrTOF && (!useRapidityCutForPID || prRapidityWithinRange)) {
Expand Down Expand Up @@ -1786,7 +1906,7 @@
jetHist.fill(HIST("mcpJet/eventStat"), 0.5);
jetHist.fill(HIST("mcpJet/eventStat"), 1.5);

if (std::abs(collision.posZ()) > 10) // bad vertex
if (std::abs(collision.posZ()) > cfgMaxZVertex) // bad vertex
return;

jetHist.fill(HIST("mcpJet/eventStat"), 2.5);
Expand Down Expand Up @@ -1841,7 +1961,7 @@
// bool jetFlag = kFALSE;
jetHist.fill(HIST("mcdJet/eventStat"), 1.5);

if (std::abs(collisionJet.posZ()) > 10)

Check failure on line 1964 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("mcdJet/eventStat"), 2.5);
Expand All @@ -1849,7 +1969,7 @@
int nJets = 0;
std::vector<float> leadingJetWithPtEtaPhi(3);
float leadingJetPt = -1.0f;
for (auto& mcdjet : mcdjets) {

Check failure on line 1972 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 @@ -1915,7 +2035,7 @@
soa::Join<aod::JetTracks, aod::JTrackPIs, aod::JMcTrackLbs> const& tracks,
JetMCPartTable const&, TrackCandidatesMC const&, aod::JetParticles const& particleTracks, aod::JMcCollisions const&)
{
if (std::abs(collision.posZ()) > 10)
if (std::abs(collision.posZ()) > cfgMaxZVertex)
return;
if (!jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::initialiseEventSelectionBits("sel8")))
return;
Expand Down Expand Up @@ -1969,7 +2089,7 @@
LOGP(fatal, "Error: Index {} is out of range for vectors!", indexJet);
}
if (useMcC) {
if (randUniform.Uniform(0, 1) < 0.5)

Check failure on line 2092 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.
jetHist.fill(HIST("recmatched/h2ResponseMatrixLeadingJet"), mcdJetPt.at(indexJet), mcpJetPt.at(indexJet));
else
jetHist.fill(HIST("recmatched/mcC/h2ResponseMatrixLeadingJet"), mcdJetPt.at(indexJet), mcpJetPt.at(indexJet));
Expand Down Expand Up @@ -2037,7 +2157,7 @@
bool isTpcPassed(true); // why is this always true?
jetHist.fill(HIST("eff/recmatched/pt/PtParticleType"), mcTrack.pt(), jetFlag, mapPDGToValue(mcTrack.pdgCode()));
if (useMcC) {
if (randUniform.Uniform(0, 1) < 0.5)

Check failure on line 2160 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.
jetHist.fill(HIST("eff/recmatched/mcC/pt/PtParticleType"), track.pt(), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()));
else
jetHist.fill(HIST("eff/recmatched/mcCSpectra/pt/PtParticleType"), track.pt(), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()));
Expand Down Expand Up @@ -2137,7 +2257,7 @@
if (!jetderiveddatautilities::selectCollision(recocoll, jetderiveddatautilities::initialiseEventSelectionBits("sel8")))
return;
}
if (std::abs(collision.posZ()) > 10)
if (std::abs(collision.posZ()) > cfgMaxZVertex)
return;
jetHist.fill(HIST("genmatched/vertexZ"), collision.posZ());

Expand Down Expand Up @@ -2321,7 +2441,7 @@
if (std::abs(rapidity) > cfgtrkMaxRap)
continue;
// Proton
if (std::abs(mcTrack.pdgCode()) == 2212) { // Proton

Check failure on line 2444 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 @@ -2351,14 +2471,14 @@
// TPCTOF and TPCTOFVeto histograms
// Proton
if (std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPr && track.hasTOF()) {
if (std::abs(mcTrack.pdgCode()) == 2212) {

Check failure on line 2474 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 2481 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
Loading