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
105 changes: 56 additions & 49 deletions PWGLF/Tasks/Strangeness/cascadecorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <TFile.h>
#include <TH2F.h>
#include <TList.h>
#include <TLorentzVector.h>

Check failure on line 43 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TPDGCode.h>
#include <TProfile.h>

Expand Down Expand Up @@ -86,6 +86,7 @@

struct CascadeSelector {
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::framework::O2DatabasePDG> pdgDB;

Produces<aod::CascadeFlags> cascflags;

Expand All @@ -99,6 +100,8 @@
Configurable<int> INEL{"INEL", 0, "Number of charged tracks within |eta| < 1 has to be greater than value"};
Configurable<double> maxVertexZ{"maxVertexZ", 10., "Maximum value of z coordinate of PV"};
Configurable<float> etaCascades{"etaCascades", 0.8, "min/max of eta for cascades"};
Configurable<bool> doCompetingMassCut{"doCompetingMassCut", true, "Switch to apply a competing mass cut for the Omega's"};
Configurable<float> competingMassWindow{"competingMassWindow", 0.01, "Mass window for the competing mass cut"};

// Tracklevel
Configurable<float> tpcNsigmaBachelor{"tpcNsigmaBachelor", 3, "TPC NSigma bachelor"};
Expand Down Expand Up @@ -302,7 +305,7 @@
if (!gen.isPhysicalPrimary())
return;
int genpdg = gen.pdgCode();
if ((flag < 3 && TMath::Abs(genpdg) == 3312) || (flag > 1 && TMath::Abs(genpdg) == 3334)) {
if ((flag < 3 && std::abs(genpdg) == 3312) || (flag > 1 && std::abs(genpdg) == 3334)) {

Check failure on line 308 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// if casc is consistent with Xi and has matched gen Xi OR cand is consistent with Omega and has matched gen omega
// have to do this in case we reco true Xi with only Omega hypothesis (or vice versa) (very unlikely)
registry.fill(HIST("truerec/hV0Radius"), rec.v0radius());
Expand Down Expand Up @@ -413,18 +416,18 @@
casc.v0cosPA(pvx, pvy, pvz) < v0setting_cospa ||
casc.casccosPA(pvx, pvy, pvz) < cascadesetting_cospa ||
casc.dcav0topv(pvx, pvy, pvz) < cascadesetting_mindcav0topv ||
TMath::Abs(casc.mLambda() - 1.115683) > cascadesetting_v0masswindow)
std::abs(casc.mLambda() - 1.115683) > cascadesetting_v0masswindow)

Check failure on line 419 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
return 0; // It failed at least one topo selection

registry.fill(HIST("hSelectionStatus"), 4); // passes topo
// registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt());

if (TMath::Abs(posTrack.eta()) > etaTracks || TMath::Abs(negTrack.eta()) > etaTracks || TMath::Abs(bachTrack.eta()) > etaTracks)
if (std::abs(posTrack.eta()) > etaTracks || std::abs(negTrack.eta()) > etaTracks || std::abs(bachTrack.eta()) > etaTracks)
return 0;

registry.fill(HIST("hSelectionStatus"), 5); // passes track eta

if (TMath::Abs(casc.eta()) > etaCascades)
if (std::abs(casc.eta()) > etaCascades)
return 0;

registry.fill(HIST("hSelectionStatus"), 6); // passes candidate eta
Expand All @@ -435,56 +438,60 @@
// Lambda check
if (casc.sign() < 0) {
// Proton check:
if (TMath::Abs(posTrack.tpcNSigmaPr()) > tpcNsigmaProton)
if (std::abs(posTrack.tpcNSigmaPr()) > tpcNsigmaProton)
return 0;
// Pion check:
if (TMath::Abs(negTrack.tpcNSigmaPi()) > tpcNsigmaPion)
if (std::abs(negTrack.tpcNSigmaPi()) > tpcNsigmaPion)
return 0;
} else {
// Proton check:
if (TMath::Abs(negTrack.tpcNSigmaPr()) > tpcNsigmaProton)
if (std::abs(negTrack.tpcNSigmaPr()) > tpcNsigmaProton)
return 0;
// Pion check:
if (TMath::Abs(posTrack.tpcNSigmaPi()) > tpcNsigmaPion)
if (std::abs(posTrack.tpcNSigmaPi()) > tpcNsigmaPion)
return 0;
}
registry.fill(HIST("hSelectionStatus"), 7); // passes V0 daughters PID
// registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt());

// Bachelor check
if (TMath::Abs(bachTrack.tpcNSigmaPi()) < tpcNsigmaBachelor) {
if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) {
// consistent with both!
// setting selection flag based on bachelor PID (and competing mass cut for omega's)
int flag = 0;
if (std::abs(bachTrack.tpcNSigmaPi()) < tpcNsigmaBachelor)
flag = 1;
if (std::abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor && (!doCompetingMassCut || std::abs(pdgDB->Mass(3312) - casc.mXi()) > competingMassWindow))

Check failure on line 461 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/known-mass]

Use o2::constants::physics::Mass... instead of calling a database method for a known PDG code.

Check failure on line 461 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
flag = 3 - flag; // 3 if only consistent with omega, 2 if consistent with both

switch (flag) {
case 1: // only Xi
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
if (casc.sign() < 0) {
registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi());
} else {
registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi());
}
break;
case 2: // Xi or Omega
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
// registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt());
if (casc.sign() < 0) {
registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi());
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega());
} else {
registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi());
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega());
}
return 2;
}
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
// registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt());
if (casc.sign() < 0) {
registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi());
} else {
registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi());
}
return 1;
} else if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) {
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
if (casc.sign() < 0) {
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega());
} else {
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega());
}
return 3;
break;
case 3: // only Omega
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
if (casc.sign() < 0) {
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega());
} else {
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega());
}
break;
}
// if we reach here, the bachelor was neither pion nor kaon
return 0;

return flag;

} // processCandidate

void processGenMC(aod::McCollision const&, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisions>> const& collisions, aod::McParticles const& mcParticles)
Expand All @@ -495,7 +502,7 @@
for (auto const& mcPart : mcParticles) {
if (!mcPart.isPhysicalPrimary())
continue;
if (TMath::Abs(mcPart.eta()) > etaCascades)
if (std::abs(mcPart.eta()) > etaCascades)
continue;

switch (mcPart.pdgCode()) {
Expand Down Expand Up @@ -532,7 +539,7 @@
for (auto const& mcPart : mcParticles) {
if (!mcPart.isPhysicalPrimary())
continue;
if (TMath::Abs(mcPart.eta()) > etaCascades)
if (std::abs(mcPart.eta()) > etaCascades)
continue;

switch (mcPart.pdgCode()) {
Expand Down Expand Up @@ -666,8 +673,8 @@
bool autoCorrelation(std::array<int, 3> triggerTracks, std::array<int, 3> assocTracks)
{
// function that loops over 2 arrays of track indices, checking for common elements
for (int triggerTrack : triggerTracks) {

Check failure on line 676 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (int assocTrack : assocTracks) {

Check failure on line 677 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (triggerTrack == assocTrack)
return true;
}
Expand Down Expand Up @@ -830,7 +837,7 @@
registry.fill(HIST("hEta"), casc.eta());
} // casc loop

for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables

Check failure on line 840 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them
auto* triggerAddress = &c0;
auto* assocAddress = &c1;
Expand All @@ -857,30 +864,30 @@
double weightTrigg = 1.;
double weightAssoc = 1.;

if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi
if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi
if (doEfficiencyCorrection)
weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt());
if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt());
registry.fill(HIST("hXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc);
}
if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt());
registry.fill(HIST("hXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc);
}
}
if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega
if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega
if (doEfficiencyCorrection)
weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt());
if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt());
// if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs)
registry.fill(HIST("hXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc);
}
if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt());
registry.fill(HIST("hOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc);
Expand All @@ -904,7 +911,7 @@
for (auto const& [col1, cascades1, col2, cascades2] : pair) {
if (!col1.sel8() || !col2.sel8())
continue;
if (TMath::Abs(col1.posZ()) > zVertexCut || TMath::Abs(col2.posZ()) > zVertexCut)
if (std::abs(col1.posZ()) > zVertexCut || std::abs(col2.posZ()) > zVertexCut)
continue;
if (col1.globalIndex() == col2.globalIndex()) {
registry.fill(HIST("hMEQA"), 0.5);
Expand All @@ -913,7 +920,7 @@
registry.fill(HIST("MixedEvents/hMEVz1"), col1.posZ());
registry.fill(HIST("MixedEvents/hMEVz2"), col2.posZ());

for (auto& [casc1, casc2] : combinations(CombinationsFullIndexPolicy(cascades1, cascades2))) {

Check failure on line 923 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// specify FullIndexPolicy since the cascades are from different collisions
auto* triggerAddress = &casc1;
auto* assocAddress = &casc2;
Expand Down Expand Up @@ -943,30 +950,30 @@
double weightTrigg = 1.;
double weightAssoc = 1.;

if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi
if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi
if (doEfficiencyCorrection)
weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt());
if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt());
registry.fill(HIST("MixedEvents/hMEXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc);
}
if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt());
registry.fill(HIST("MixedEvents/hMEXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc);
}
}
if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega
if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega
if (doEfficiencyCorrection)
weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt());
if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt());
// if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs)
registry.fill(HIST("MixedEvents/hMEXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc);
}
if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega
if (doEfficiencyCorrection)
weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt());
registry.fill(HIST("MixedEvents/hMEOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc);
Expand All @@ -984,7 +991,7 @@
} // process mixed events

Configurable<float> etaGenCascades{"etaGenCascades", 0.8, "min/max of eta for generated cascades"};
Filter genCascadesFilter = nabs(aod::mcparticle::pdgCode) == 3312;

Check failure on line 994 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.

void processMC(aod::McCollision const&, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisionsMult>> const& collisions, soa::Filtered<aod::McParticles> const& genCascades, aod::McParticles const& mcParticles)
{
Expand Down Expand Up @@ -1028,7 +1035,7 @@

if (!trigger.isPhysicalPrimary() || !assoc.isPhysicalPrimary())
continue; // require the cascades to be primaries
if (TMath::Abs(trigger.eta()) > etaGenCascades)
if (std::abs(trigger.eta()) > etaGenCascades)
continue; // only apply eta cut to trigger - trigger normalization still valid without introducing 2-particle-acceptance effects

double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf);
Expand Down
Loading