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
87 changes: 79 additions & 8 deletions PWGJE/Tasks/nucleiInJets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +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 @@ -495,6 +496,9 @@
jetHist.add<TH3>("recInc/pt/PtParticleTypeTPCTOF", "Pt vs ParticleType vs Centrality (TPC+TOF)", HistType::kTH3F, {{100, 0.f, 10.f}, {14, -7, 7}, {100, 0, 100}});
jetHist.add<TH3>("recInc/pt/PtParticleTypeTPCTOFVeto", "Pt vs ParticleType vs Centrality (TPC+TOF Veto)", HistType::kTH3F, {{100, 0.f, 10.f}, {14, -7, 7}, {100, 0, 100}});
jetHist.add<TH3>("genInc/pt/PtParticleType", "Pt vs ParticleType vs Centrality (gen)", HistType::kTH3F, {{100, 0.f, 10.f}, {14, -7, 7}, {100, 0, 100}});

jetHist.add<TH3>("recInc/eff/tpcTrack3D", "Pt vs ParticleType vs Centrality (tpc)", HistType::kTH3F, {{100, 0.f, 10.f}, {14, -7, 7}, {100, 0, 100}});
jetHist.add<TH3>("recInc/eff/tpcTofTrack3D", "Pt vs ParticleType vs Centrality (tpc-tof)", HistType::kTH3F, {{100, 0.f, 10.f}, {14, -7, 7}, {100, 0, 100}});
// inside jet
jetHist.add<TH3>("tracks/mc/proton/h3PtVsProtonNSigmaTPCVsPtJet_jet", "pT(p) vs NSigmaTPC (p) vs jet pT; #it{p}_{T} (GeV/#it{c}; NSigmaTPC; p^{jet}_{T}", HistType::kTH3F, {{PtAxis}, {200, -10, 10}, {PtJetAxis}});
jetHist.add<TH3>("tracks/mc/antiProton/h3PtVsantiProtonNSigmaTPCVsPtJet_jet", "pT(#bar{p}) vs NSigmaTPC (#bar{p}) vs jet pT; #it{p}_{T} (GeV/#it{c}; NSigmaTPC; p^{jet}_{T}", HistType::kTH3F, {{PtAxis}, {200, -10, 10}, {PtJetAxis}});
Expand Down Expand Up @@ -1248,7 +1252,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)

Check failure on line 1255 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 @@ -1299,7 +1303,7 @@
}
jetHist.fill(HIST("hNEvents"), 1.5);
}
if (std::abs(collision.posZ()) > 10)

Check failure on line 1306 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 @@ -1331,7 +1335,7 @@
if (isWithJetEvents && nJets == 0)
return;
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
for (auto& track : tracks) {

Check failure on line 1338 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 Down Expand Up @@ -1570,7 +1574,7 @@
int nJets = 0;
std::vector<float> leadingJetWithPtEtaPhi(3);
float leadingJetPt = -1.0f;
for (auto& mcdjet : mcdjets) {

Check failure on line 1577 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 @@ -1981,6 +1985,7 @@
centrality = -999;
}
jetHist.fill(HIST("recInc/vertexZ"), coll.posZ(), centrality);

for (const auto& track : tracks) {
if (!isTrackSelected(track)) {
continue;
Expand All @@ -1989,20 +1994,85 @@
continue;
if (std::fabs(track.eta()) > cfgtrkMaxEta)
continue;

auto mcTrack = track.mcParticle_as<o2::aod::JMcParticles>();
if (!mcTrack.isPhysicalPrimary())
continue;
bool isTOFAndTPCPreSel(track.hasTOF() &&
(std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPrTOF || std::abs(track.tpcNSigmaDe()) < cfgnTPCPIDDeTOF));

if (mapPDGToValue(mcTrack.pdgCode()) != 0) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPC"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
auto mass = TDatabasePDG::Instance()->GetParticle(abs(mcTrack.pdgCode()))->Mass();

Check failure on line 2002 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 2002 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 (isTOFAndTPCPreSel) {
if (rapidity > cfgtrkMaxRap)
continue;
// Proton
if (std::abs(mcTrack.pdgCode()) == 2212) { // Proton

Check failure on line 2008 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);
if (std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPr) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPC"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}
// Deuteron
if (std::abs(mcTrack.pdgCode()) == Pdg::kDeuteron) { // Deuteron
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);
if (std::abs(track.tpcNSigmaDe()) < cfgnTPCPIDDe) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPC"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}
// Helium
if (std::abs(mcTrack.pdgCode()) == Pdg::kHelium3) { // Helium-3
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);
if (std::abs(track.tpcNSigmaHe()) < cfgnTPCPIDHe) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPC"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}

// TPCTOF and TPCTOFVeto histograms
// Proton
if (std::abs(track.tpcNSigmaPr()) < cfgnTPCPIDPr && track.hasTOF()) {
if (std::abs(mcTrack.pdgCode()) == 2212) {

Check failure on line 2038 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);
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
} else {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), 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 2045 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);
}
}
}
// Deuteron
if (std::abs(track.tpcNSigmaDe()) < cfgnTPCPIDDe && track.hasTOF()) {
if (std::abs(mcTrack.pdgCode()) == Pdg::kDeuteron) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOF"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
if (std::abs(track.tofNSigmaDe()) < cfgnTPCPIDDeTOF)
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
} else {
if (std::abs(track.tpcNSigmaDe()) < cfgnTPCPIDDe) {
if (std::abs(mcTrack.pdgCode()) == Pdg::kDeuteron) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}
}
// Helium
if (std::abs(track.tpcNSigmaHe()) < cfgnTPCPIDHe && track.hasTOF()) {
if (std::abs(mcTrack.pdgCode()) == Pdg::kHelium3) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOF"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
if (std::abs(track.tofNSigmaHe()) < cfgnTPCPIDHeTOF)
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
} else {
if (std::abs(track.tpcNSigmaHe()) < cfgnTPCPIDHe) {
if (std::abs(mcTrack.pdgCode()) == Pdg::kHelium3) {
jetHist.fill(HIST("recInc/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), mapPDGToValue(mcTrack.pdgCode()), centrality);
}
}
}
} // track
Expand All @@ -2016,6 +2086,7 @@
continue;
if (std::fabs(mcParticle.y()) > cfgtrkMaxRap)
continue;

if (mapPDGToValue(mcParticle.pdgCode()) != 0) {
jetHist.fill(HIST("genInc/pt/PtParticleType"), mcParticle.pt(), mapPDGToValue(mcParticle.pdgCode()), centrality);
}
Expand Down
Loading