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
66 changes: 66 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 @@ -298,6 +298,11 @@
}
}

registry.add("hPrDCAxy", "DCAxy p", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hAntiPrDCAxy", "DCAxy #bar{p}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hDeDCAxy", "DCAxy d", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hAntiDeDCAxy", "DCAxy #bar{d}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});

if (doQA) {
// Track QA
QA.add("QA/hVtxZ_trk", "#it{z}_{vtx}", {HistType::kTH1D, {{150, -15.f, 15.f, "#it{z}_{vtx} (cm)"}}});
Expand Down Expand Up @@ -332,6 +337,19 @@
}

if (isMC) {
registry.add("hPrimPrDCAxy", "DCAxy p", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hPrimAntiPrDCAxy", "DCAxy #bar{p}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hPrimDeDCAxy", "DCAxy d", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hPrimAntiDeDCAxy", "DCAxy #bar{d}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecMatPrDCAxy", "DCAxy p", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecMatAntiPrDCAxy", "DCAxy #bar{p}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecMatDeDCAxy", "DCAxy d", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecMatAntiDeDCAxy", "DCAxy #bar{d}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecWeakPrDCAxy", "DCAxy p", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecWeakAntiPrDCAxy", "DCAxy #bar{p}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecWeakDeDCAxy", "DCAxy d", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});
registry.add("hSecWeakAntiDeDCAxy", "DCAxy #bar{d}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}});

registry.add("hReco_EtaPhiPt_Proton", "Gen (anti)protons in reco collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});
registry.add("hReco_EtaPhiPt_Deuteron", "Gen (anti)deuteron in reco collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});
registry.add("hReco_PID_EtaPhiPt_Proton", "Gen (anti)protons + PID in reco collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}});
Expand Down Expand Up @@ -556,8 +574,8 @@
template <int ME, bool doMC, typename Type>
void mixTracks(Type const& tracks1, Type const& tracks2, bool isIdentical, bool isMCPID)
{ // last value: 0 -- SE; 1 -- ME
for (auto it1 : tracks1) {

Check failure on line 577 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.
for (auto it2 : tracks2) {

Check failure on line 578 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.

// Calculate Delta-eta Delta-phi (reco)
float deltaEta = it2->eta() - it1->eta();
Expand Down Expand Up @@ -652,8 +670,8 @@
template <int ME, typename Type>
void mixMCParticles(Type const& particles1, Type const& particles2)
{
for (auto it1 : particles1) {

Check failure on line 673 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.
for (auto it2 : particles2) {

Check failure on line 674 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.
// Calculate Delta-eta Delta-phi (gen)
float deltaEtaGen = it2->eta() - it1->eta();
float deltaPhiGen = RecoDecay::constrainAngle(it2->phi() - it1->phi(), -1 * o2::constants::math::PIHalf);
Expand All @@ -676,8 +694,8 @@
template <int ME, typename Type>
void mixMCParticlesIdentical(Type const& particles1, Type const& particles2)
{
for (auto it1 : particles1) {

Check failure on line 697 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.
for (auto it2 : particles2) {

Check failure on line 698 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.
// Calculate Delta-eta Delta-phi (gen)
float deltaEtaGen = it2->eta() - it1->eta();
float deltaPhiGen = RecoDecay::constrainAngle(it2->phi() - it1->phi(), -1 * o2::constants::math::PIHalf);
Expand Down Expand Up @@ -736,7 +754,7 @@

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

Check failure on line 757 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 All @@ -744,6 +762,16 @@
continue;
if (track.itsNCls() < min_itsNCls)
continue;

if (IsProton(track, +1))
registry.fill(HIST("hPrDCAxy"), track.dcaXY(), track.pt());
if (IsProton(track, -1))
registry.fill(HIST("hAntiPrDCAxy"), track.dcaXY(), track.pt());
if (IsDeuteron(track, +1))
registry.fill(HIST("hDeDCAxy"), track.dcaXY(), track.pt());
if (IsDeuteron(track, -1))
registry.fill(HIST("hAntiDeDCAxy"), track.dcaXY(), track.pt());

if (!applyDCAcut(track))
continue;

Expand Down Expand Up @@ -826,7 +854,7 @@
}
}

for (auto collision : collisions) {

Check failure on line 857 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 @@ -1130,6 +1158,44 @@
continue;
if (track.itsNCls() < min_itsNCls)
continue;

if (IsProton(track, +1) && track.pdgCode() == pdgProton) {
registry.fill(HIST("hPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 0)
registry.fill(HIST("hPrimPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 1)
registry.fill(HIST("hSecWeakPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 2)
registry.fill(HIST("hSecMatPrDCAxy"), track.dcaXY(), track.pt());
}
if (IsProton(track, -1) && track.pdgCode() == -pdgProton) {
registry.fill(HIST("hAntiPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 0)
registry.fill(HIST("hPrimAntiPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 1)
registry.fill(HIST("hSecWeakAntiPrDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 2)
registry.fill(HIST("hSecMatAntiPrDCAxy"), track.dcaXY(), track.pt());
}
if (IsDeuteron(track, +1) && track.pdgCode() == pdgDeuteron) {
registry.fill(HIST("hDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 0)
registry.fill(HIST("hPrimDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 1)
registry.fill(HIST("hSecWeakDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 2)
registry.fill(HIST("hSecMatDeDCAxy"), track.dcaXY(), track.pt());
}
if (IsDeuteron(track, -1) && track.pdgCode() == -pdgDeuteron) {
registry.fill(HIST("hAntiDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 0)
registry.fill(HIST("hPrimAntiDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 1)
registry.fill(HIST("hSecWeakAntiDeDCAxy"), track.dcaXY(), track.pt());
if (track.origin() == 2)
registry.fill(HIST("hSecMatAntiDeDCAxy"), track.dcaXY(), track.pt());
}

if (!applyDCAcut(track))
continue;

Expand Down
Loading