Skip to content
Closed
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
18 changes: 18 additions & 0 deletions PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
struct hadronnucleicorrelation {

// PDG codes and masses used in this analysis
static constexpr int pdgProton = 2212;

Check failure on line 58 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.
static constexpr int pdgDeuteron = 1000010020;

Check failure on line 59 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.

Configurable<int> mode{"mode", 0, "0: antid-antip, 1: d-p, 2: antid-p, 3: d-antip, 4: antip-p, 5: antip-antip, 6: p-p"};

Expand Down Expand Up @@ -158,6 +158,9 @@
std::map<std::pair<int, float>, std::vector<colType>> mixbinsPID_antidantip;
std::map<float, std::vector<MCcolType>> mixbinsMC_antidantip;
std::map<float, std::vector<MCcolType>> mixbinsMC_dp;
std::map<float, std::vector<MCcolType>> mixbinsMC_antipantip;
std::map<float, std::vector<MCcolType>> mixbinsMC_pp;
std::map<float, std::vector<MCcolType>> mixbinsMC_antipp;

std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkType>> Pair = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkType>>();
std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkTypeMC>> PairMC = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkTypeMC>>();
Expand Down Expand Up @@ -376,6 +379,9 @@
registry.add("hReco_Pt_Proton", "Reco (anti)protons in reco collisions", {HistType::kTH1F, {pTAxis_small}});
registry.add("hReco_Pt_Deuteron", "Reco (anti)deuterons in reco collisions", {HistType::kTH1F, {pTAxis_small}});

registry.add("hGen_EtaPhiPt_Proton", "Gen (anti)protons in gen collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});
registry.add("hGen_EtaPhiPt_Deuteron", "Gen (anti)deuteron in gen collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});

registry.add("hSec_EtaPhiPt_Proton", "Secondary (anti)protons", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});
registry.add("hPrimSec_EtaPhiPt_Proton", "Primary + Secondary (anti)protons", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});

Expand Down Expand Up @@ -814,7 +820,7 @@

void processData(FilteredCollisions const& collisions, FilteredTracks const& tracks)
{
for (auto track : tracks) {

Check failure on line 823 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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::abs(track.template singleCollSel_as<FilteredCollisions>().posZ()) > cutzvertex)
continue;

Expand Down Expand Up @@ -915,7 +921,7 @@
}
}

for (auto collision : collisions) {

Check failure on line 924 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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::abs(collision.posZ()) > cutzvertex)
continue;
Expand Down Expand Up @@ -1190,22 +1196,22 @@
(i->second).clear();
selectedtracks_d.clear();

for (auto& pair : mixbins_antid) {

Check failure on line 1199 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.
pair.second.clear(); // Clear the vector associated with the key
}
mixbins_antid.clear(); // Then clear the map itself

for (auto& pair : mixbins_d) {

Check failure on line 1204 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.
pair.second.clear(); // Clear the vector associated with the key
}
mixbins_d.clear(); // Then clear the map itself

for (auto& pair : mixbins_antip) {

Check failure on line 1209 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.
pair.second.clear(); // Clear the vector associated with the key
}
mixbins_antip.clear(); // Then clear the map itself

for (auto& pair : mixbins_p) {

Check failure on line 1214 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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.
pair.second.clear(); // Clear the vector associated with the key
}
mixbins_p.clear(); // Then clear the map itself
Expand All @@ -1214,7 +1220,7 @@

void processMC(FilteredCollisions const& collisions, FilteredTracksMC const& tracks)
{
for (auto track : tracks) {

Check failure on line 1223 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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::abs(track.template singleCollSel_as<FilteredCollisions>().posZ()) > cutzvertex)
continue;

Expand Down Expand Up @@ -1609,7 +1615,7 @@
return;
}

for (auto collision : collisions) {

Check failure on line 1618 in PWGLF/Tasks/Nuspex/hadronnucleicorrelation.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::abs(collision.posZ()) > cutzvertex)
continue;
registry.fill(HIST("hNEvents"), 0.5);
Expand Down Expand Up @@ -1739,8 +1745,12 @@
void processGen(SimCollisions const& mcCollisions,
SimParticles const& mcParticles)
{

for (auto particle : mcParticles) {

if (std::abs(particle.template mcCollision_as<aod::McCollisions>().posZ()) > cutzvertex)
continue;

if (particle.pdgCode() == pdgProton) {
registry.fill(HIST("Generated/hQAProtons"), 0.5);
}
Expand Down Expand Up @@ -1776,15 +1786,19 @@
}

if (particle.pdgCode() == pdgDeuteron) {
registry.fill(HIST("hGen_EtaPhiPt_Deuteron"), particle.eta(), particle.phi(), particle.pt());
selectedparticlesMC_d[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
}
if (particle.pdgCode() == -pdgDeuteron) {
registry.fill(HIST("hGen_EtaPhiPt_Deuteron"), particle.eta(), particle.phi(), -1. * particle.pt());
selectedparticlesMC_antid[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
}
if (particle.pdgCode() == pdgProton) {
registry.fill(HIST("hGen_EtaPhiPt_Proton"), particle.eta(), particle.phi(), particle.pt());
selectedparticlesMC_p[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
}
if (particle.pdgCode() == -pdgProton) {
registry.fill(HIST("hGen_EtaPhiPt_Proton"), particle.eta(), particle.phi(), -1. * particle.pt());
selectedparticlesMC_antip[particle.mcCollisionId()].push_back(std::make_shared<decltype(particle)>(particle));
}
}
Expand All @@ -1793,6 +1807,10 @@

registry.fill(HIST("Generated/hNEventsMC"), 0.5);

if (std::abs(collision1.posZ()) > cutzvertex) {
continue;
}

// anti-d - anti-p correlation
if (selectedparticlesMC_antid.find(collision1.globalIndex()) != selectedparticlesMC_antid.end()) {
if (selectedparticlesMC_antip.find(collision1.globalIndex()) != selectedparticlesMC_antip.end()) {
Expand Down
Loading