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
29 changes: 25 additions & 4 deletions PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
struct hadronnucleicorrelation {

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

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.
static constexpr int pdgDeuteron = 1000010020;

Check failure on line 60 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, 7: p-antip"};

Expand Down Expand Up @@ -893,7 +893,7 @@

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

Check failure on line 896 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 @@ -950,11 +950,18 @@
isAntiDe = 0;
}

float corr = 1.;

// Deuterons Fill & QA
if (isAntiDe) {
selectedtracks_antid[track.singleCollSelId()].push_back(std::make_shared<decltype(track)>(track));

if (mode == 0 || mode == 2) {
registry.fill(HIST("hNtrig_total"), track.pt(), hEffpTEta_antideuteron->Interpolate(track.pt(), track.eta()));

if (docorrection && hEffpTEta_antideuteron->Interpolate(track.pt(), track.eta()) > 0) {
corr = 1. / hEffpTEta_antideuteron->Interpolate(track.pt(), track.eta());
}
registry.fill(HIST("hNtrig_total"), track.pt(), corr);
}

if (doQA) {
Expand All @@ -968,7 +975,12 @@
selectedtracks_d[track.singleCollSelId()].push_back(std::make_shared<decltype(track)>(track));

if (mode == 1 || mode == 3) {
registry.fill(HIST("hNtrig_total"), track.pt(), hEffpTEta_deuteron->Interpolate(track.pt(), track.eta()));

corr = 1.;
if (docorrection && hEffpTEta_deuteron->Interpolate(track.pt(), track.eta()) > 0) {
corr = 1. / hEffpTEta_deuteron->Interpolate(track.pt(), track.eta());
}
registry.fill(HIST("hNtrig_total"), track.pt(), corr);
}

if (doQA) {
Expand All @@ -984,7 +996,12 @@
selectedtracks_p[track.singleCollSelId()].push_back(std::make_shared<decltype(track)>(track));

if (mode == 6 || mode == 7) {
registry.fill(HIST("hNtrig_total"), track.pt(), hEffpTEta_proton->Interpolate(track.pt(), track.eta()));

corr = 1.;
if (docorrection && hEffpTEta_proton->Interpolate(track.pt(), track.eta()) > 0) {
corr = 1. / hEffpTEta_proton->Interpolate(track.pt(), track.eta());
}
registry.fill(HIST("hNtrig_total"), track.pt(), corr);
}

if (doQA) {
Expand All @@ -997,7 +1014,11 @@
selectedtracks_antip[track.singleCollSelId()].push_back(std::make_shared<decltype(track)>(track));

if (mode == 4 || mode == 5) {
registry.fill(HIST("hNtrig_total"), track.pt(), hEffpTEta_antiproton->Interpolate(track.pt(), track.eta()));
corr = 1.;
if (docorrection && hEffpTEta_antiproton->Interpolate(track.pt(), track.eta()) > 0) {
corr = 1. / hEffpTEta_antiproton->Interpolate(track.pt(), track.eta());
}
registry.fill(HIST("hNtrig_total"), track.pt(), corr);
}

if (doQA) {
Expand All @@ -1009,7 +1030,7 @@
}
}

for (auto collision : collisions) {

Check failure on line 1033 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 @@ -1316,22 +1337,22 @@
(i->second).clear();
selectedtracks_d.clear();

for (auto& pair : mixbins_antid) {

Check failure on line 1340 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 1345 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 1350 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 1355 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 @@ -1340,7 +1361,7 @@

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

Check failure on line 1364 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 @@ -1709,7 +1730,7 @@
void processGen(SimCollisions const& mcCollisions,
SimParticles const& mcParticles)
{
for (auto particle : mcParticles) {

Check failure on line 1733 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(particle.template mcCollision_as<aod::McCollisions>().posZ()) > cutzvertex)
continue;
Expand Down
Loading