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
59 changes: 45 additions & 14 deletions PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
#include <TFile.h>
#include <TH2F.h>
#include <TProfile.h>
#include <TLorentzVector.h>

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

// constants
const float ctauxiPDG = 4.91; // from PDG

Check failure on line 56 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
const float ctauomegaPDG = 2.461; // from PDG

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

using namespace o2;
using namespace o2::framework;
Expand All @@ -76,6 +76,7 @@
ConfigurableAxis axisIR{"axisIR", {510, -1, 50}, "Binning for the interaction rate (kHz)"};

Configurable<bool> isXi{"isXi", 1, "Apply cuts for Xi identification"};
Configurable<bool> ispO{"ispO", 0, "Analyse p--O collisions"};
Configurable<bool> useCentralityFT0M{"useCentralityFT0M", 0, "If true, use centFT0M"};
Configurable<bool> useCentralityFT0A{"useCentralityFT0A", 0, "If true, use centFT0A"};
Configurable<bool> useCentralityFT0Cvar1{"useCentralityFT0Cvar1", 0, "If true, use centFT0FT0Cvar1"};
Expand Down Expand Up @@ -119,6 +120,18 @@
Configurable<int> maxOccupancy{"maxOccupancy", -1, "Maximal occupancy"};
Configurable<float> minOccupancyFT0{"minOccupancyFT0", -1, "Minimal occupancy"};
Configurable<float> maxOccupancyFT0{"maxOccupancyFT0", -1, "Maximal occupancy"};
Configurable<float> globalTracksCorrelpar0Low{"globalTracksCorrelpar0Low", 81, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> globalTracksCorrelpar1Low{"globalTracksCorrelpar1Low", -0.0431016, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> globalTracksCorrelpar2Low{"globalTracksCorrelpar2Low", -6, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> globalTracksCorrelpar0High{"globalTracksCorrelpar0High", 226, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> globalTracksCorrelpar1High{"globalTracksCorrelpar1High", -0.0181686, "[0]*exp([1]*centrality)+[2], mean plus 3*sigma"};
Configurable<float> globalTracksCorrelpar2High{"globalTracksCorrelpar2High", -22, "[0]*exp([1]*centrality)+[2], mean plus 3*sigma"};
Configurable<float> pvContribCorrelpar0Low{"pvContribCorrelpar0Low", 152, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> pvContribCorrelpar1Low{"pvContribCorrelpar1Low", -0.0431016, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> pvContribCorrelpar2Low{"pvContribCorrelpar2Low", -15.3776, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> pvContribCorrelpar0High{"pvContribCorrelpar0High", 384.861, "[0]*exp([1]*centrality)+[2], mean minus 3*sigma"};
Configurable<float> pvContribCorrelpar1High{"pvContribCorrelpar1High", -0.0181686, "[0]*exp([1]*centrality)+[2], mean plus 3*sigma"};
Configurable<float> pvContribCorrelpar2High{"pvContribCorrelpar2High", -39, "[0]*exp([1]*centrality)+[2], mean plus 3*sigma"};
} eventSelectionRun3Flags;

struct : ConfigurableGroup {
Expand Down Expand Up @@ -219,6 +232,8 @@
Configurable<float> rejcomp{"rejcomp", 0.008, "Competing Cascade rejection"};
Configurable<float> masswin{"masswin", 0.05, "Mass window limit"};
Configurable<float> rapCut{"rapCut", 0.5, "Rapidity acceptance"};
Configurable<float> minRapCut{"minRapCut", -0.845, "minimal rapidity acceptance in case of p--o"};
Configurable<float> maxRapCut{"maxRapCut", 0.155, "maximal rapidity acceptance in case of p--o"};
Configurable<float> etaDauCut{"etaDauCut", 0.8, "Pseudorapidity acceptance of the cascade daughters"};
Configurable<int> minITSclusters{"minITSclusters", 3, "minimal number of ITS hits for the daughter tracks"};
} candidateSelectionValues;
Expand Down Expand Up @@ -302,6 +317,10 @@
histos.add("hNCrossedRowsPositive", "", kTH1F, {{400, -200, 200}});
histos.add("hNCrossedRowsBachelor", "", kTH1F, {{400, -200, 200}});

histos.add("hPseudorapPosDaughter", "", kTH1F, {{50, -1, 1}});
histos.add("hPseudorapNegDaughter", "", kTH1F, {{50, -1, 1}});
histos.add("hPseudorapBachelor", "", kTH1F, {{50, -1, 1}});

histos.add("hEventNchCorrelationAfCuts", "hEventNchCorrelationAfCuts", kTH2F, {{5000, 0, 5000}, {5000, 0, 2500}});
histos.add("hEventPVcontributorsVsCentrality", "hEventPVcontributorsVsCentrality", kTH2F, {{100, 0, 100}, {5000, 0, 5000}});
histos.add("hEventGlobalTracksVsCentrality", "hEventGlobalTracksVsCentrality", kTH2F, {{100, 0, 100}, {2500, 0, 2500}});
Expand Down Expand Up @@ -541,9 +560,9 @@
ptdepCut = candidateSelectionValues.cosPApar0 + candidateSelectionValues.cosPApar1 * casc.pt();
else
ptdepCut = candidateSelectionValues.cosPApar0 + candidateSelectionValues.cosPApar1 * casc.pt();
if (ptdepCut > 0.3 && casc.pt() < 0.5)

Check failure on line 563 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
ptdepCut = 0.3;
if (ptdepCut < 0.012)

Check failure on line 565 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
ptdepCut = 0.012;
if (isCascPa)
histos.fill(HIST("hCutValue"), 15, std::cos(ptdepCut));
Expand Down Expand Up @@ -660,9 +679,9 @@
histos.fill(HIST("hEventSelection"), 11.5 /* Not at TF border */);

if (eventSelectionRun3Flags.doMultiplicityCorrCut) {
if (coll.multNTracksGlobal() < (1343.3 * std::exp(-0.0443259 * centrality) - 50) || coll.multNTracksGlobal() > (2098.9 * std::exp(-0.0332444 * centrality)))
if (coll.multNTracksGlobal() < (eventSelectionRun3Flags.globalTracksCorrelpar0Low * std::exp(eventSelectionRun3Flags.globalTracksCorrelpar1Low * centrality) + eventSelectionRun3Flags.globalTracksCorrelpar2Low) || coll.multNTracksGlobal() > (eventSelectionRun3Flags.globalTracksCorrelpar0High * std::exp(eventSelectionRun3Flags.globalTracksCorrelpar1High * centrality) + eventSelectionRun3Flags.globalTracksCorrelpar2High))
return false;
if (coll.multNTracksPVeta1() < (3703 * std::exp(-0.0455483 * centrality) - 150) || coll.multNTracksPVeta1() > (4937.33 * std::exp(-0.0372668 * centrality) + 20))
if (coll.multNTracksPVeta1() < (eventSelectionRun3Flags.pvContribCorrelpar0Low * std::exp(eventSelectionRun3Flags.pvContribCorrelpar1Low * centrality) + eventSelectionRun3Flags.pvContribCorrelpar2Low) || coll.multNTracksPVeta1() > (eventSelectionRun3Flags.pvContribCorrelpar0High * std::exp(eventSelectionRun3Flags.pvContribCorrelpar1High * centrality) + eventSelectionRun3Flags.pvContribCorrelpar2High))
return false;
}
if (fillHists)
Expand Down Expand Up @@ -826,21 +845,27 @@
float cut = candidateSelectionValues.masswin;
histos.fill(HIST("hCutValue"), 1, cut);
cut = candidateSelectionValues.rapCut;
if (ispO)
cut = candidateSelectionValues.maxRapCut;
histos.fill(HIST("hCutValue"), 2, cut);
if (isXi) {
if (std::abs(casc.mXi() - o2::constants::physics::MassXiMinus) > candidateSelectionValues.masswin) {
return false;
}
histos.fill(HIST("hCandidate"), ++counter);
if (std::abs(casc.yXi()) > candidateSelectionValues.rapCut)
if (ispO && (casc.yXi() < candidateSelectionValues.minRapCut || casc.yXi() > candidateSelectionValues.maxRapCut))
return false;
else if (std::abs(casc.yXi()) > candidateSelectionValues.rapCut)
return false;
histos.fill(HIST("hCandidate"), ++counter);
} else {
if (std::abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > candidateSelectionValues.masswin) {
return false;
}
histos.fill(HIST("hCandidate"), ++counter);
if (std::abs(casc.yOmega()) > candidateSelectionValues.rapCut)
if (ispO && (casc.yOmega() < candidateSelectionValues.minRapCut || casc.yOmega() > candidateSelectionValues.maxRapCut))
return false;
else if (std::abs(casc.yOmega()) > candidateSelectionValues.rapCut)
return false;
histos.fill(HIST("hCandidate"), ++counter);
}
Expand All @@ -848,9 +873,9 @@
if (candidateSelectionFlags.doDCACascadeDauCut) {
if (candidateSelectionFlags.doPtDepDCAcascDauCut) {
float ptDepCut = candidateSelectionValues.dcaCacsDauPar0;
if (casc.pt() > 1 && casc.pt() < 4)

Check failure on line 876 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
ptDepCut = candidateSelectionValues.dcaCacsDauPar1;
else if (casc.pt() > 4)

Check failure on line 878 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
ptDepCut = candidateSelectionValues.dcaCacsDauPar2;
histos.fill(HIST("hCutValue"), 3, ptDepCut);
if (casc.dcacascdaughters() > ptDepCut)
Expand Down Expand Up @@ -1120,11 +1145,11 @@
auto cascMC = casc.template cascMCCore_as<soa::Join<aod::CascMCCores, aod::CascMCCollRefs>>();
ptmc = RecoDecay::sqrtSumOfSquares(cascMC.pxMC(), cascMC.pyMC());

if (cascMC.isPhysicalPrimary() && ((isXi && std::abs(cascMC.pdgCode()) == 3312) || (!isXi && std::abs(cascMC.pdgCode()) == 3334)))
if (cascMC.isPhysicalPrimary() && ((isXi && std::abs(cascMC.pdgCode()) == PDG_t::kXiMinus) || (!isXi && std::abs(cascMC.pdgCode()) == PDG_t::kOmegaMinus)))
isTrueMCCascade = true;
if (isTrueMCCascade && ((isPositive && cascMC.pdgCodePositive() == 211 && cascMC.pdgCodeNegative() == -2212) || (isNegative && cascMC.pdgCodePositive() == 2212 && cascMC.pdgCodeNegative() == -211)))
if (isTrueMCCascade && ((isPositive && cascMC.pdgCodePositive() == PDG_t::kPiPlus && cascMC.pdgCodeNegative() == PDG_t::kProtonBar) || (isNegative && cascMC.pdgCodePositive() == PDG_t::kProton && cascMC.pdgCodeNegative() == PDG_t::kPiMinus)))
isCorrectLambdaDecay = true;
if (isTrueMCCascade && isCorrectLambdaDecay && ((isXi && std::abs(cascMC.pdgCodeBachelor()) == 211) || (!isXi && std::abs(cascMC.pdgCodeBachelor()) == 321)))
if (isTrueMCCascade && isCorrectLambdaDecay && ((isXi && std::abs(cascMC.pdgCodeBachelor()) == PDG_t::kPiPlus) || (!isXi && std::abs(cascMC.pdgCodeBachelor()) == PDG_t::kKPlus)))
isTrueMCCascadeDecay = true;

if (qaFlags.doBefSelCheck && isTrueMCCascade) {
Expand Down Expand Up @@ -1161,6 +1186,10 @@
continue;
histos.fill(HIST("hCandidate"), ++counter);

histos.fill(HIST("hPseudorapPosDaughter"), poseta);
histos.fill(HIST("hPseudorapNegDaughter"), negeta);
histos.fill(HIST("hPseudorapBachelor"), bacheta);

if (candidateSelectionFlags.doCascadeCosPaCut) {
if (!isCosPAAccepted(casc, coll.posX(), coll.posY(), coll.posZ(), candidateSelectionFlags.doPtDepCosPaCut, true))
continue;
Expand Down Expand Up @@ -1267,7 +1296,7 @@
if (!kHasTOF && !kHasITS)
continue;
histos.fill(HIST("hCandidate"), ++counter);
} else if (candidateSelectionFlags.dooobrej == 2) {

Check failure on line 1299 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
if (!kHasTOF && (casc.pt() > candidateSelectionValues.ptthrtof))
continue;
histos.fill(HIST("hCandidate"), ++counter);
Expand All @@ -1286,7 +1315,7 @@

if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() < 0) {
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, centrality);
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullMomentumPosDaugh > 0.6)

Check failure on line 1318 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
continue;
}
if (candidateSelectionFlags.doNTOFSigmaV0PionCut && casc.sign() > 0) {
Expand All @@ -1300,7 +1329,7 @@

if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() > 0) {
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, centrality);
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullmomentumNegDaugh > 0.6)

Check failure on line 1332 in PWGLF/Tasks/Strangeness/derivedcascadeanalysis.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.
continue;
}
if (candidateSelectionFlags.doNTOFSigmaV0PionCut && casc.sign() < 0) {
Expand Down Expand Up @@ -1429,12 +1458,14 @@

float ptmc = RecoDecay::sqrtSumOfSquares(cascMC.pxMC(), cascMC.pyMC());
float ymc = 1e3;
if (std::abs(cascMC.pdgCode()) == 3312)
if (std::abs(cascMC.pdgCode()) == PDG_t::kXiMinus)
ymc = RecoDecay::y(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}, o2::constants::physics::MassXiMinus);
else if (std::abs(cascMC.pdgCode()) == 3334)
else if (std::abs(cascMC.pdgCode()) == PDG_t::kOmegaMinus)
ymc = RecoDecay::y(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}, o2::constants::physics::MassOmegaMinus);

if (std::abs(ymc) > candidateSelectionValues.rapCut)
if (ispO && (ymc > candidateSelectionValues.maxRapCut || ymc < candidateSelectionValues.minRapCut))
continue;
else if (std::abs(ymc) > candidateSelectionValues.rapCut)
continue;

auto mcCollision = cascMC.template straMCCollision_as<soa::Join<aod::StraMCCollisions, aod::StraMCCollMults>>();
Expand Down Expand Up @@ -1471,7 +1502,7 @@
nChEta1 = collision.multNTracksPVeta1();
}

if (cascMC.pdgCode() == 3312 && isXi) {
if (cascMC.pdgCode() == PDG_t::kXiMinus && isXi) {
histos.fill(HIST("h2dGenXiMinus"), centrality, ptmc);
histos.fill(HIST("h2dGenXiMinusVsNch"), nChEta1, ptmc);
histos.fill(HIST("h2dGenXiMinusEta"), RecoDecay::eta(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}));
Expand All @@ -1484,7 +1515,7 @@
histos.fill(HIST("h2dGenXiMinusVsCentIR"), ptmc, centrality, intRate);
histos.fill(HIST("h2dGenXiMinusVsNchVsOccupancy"), ptmc, nChEta1, occupancy);
}
if (cascMC.pdgCode() == -3312 && isXi) {
if (cascMC.pdgCode() == PDG_t::kXiPlusBar && isXi) {
histos.fill(HIST("h2dGenXiPlus"), centrality, ptmc);
histos.fill(HIST("h2dGenXiPlusVsNch"), nChEta1, ptmc);
histos.fill(HIST("h2dGenXiPlusVsMultMCVsCentrality"), mcCollision.multMCNParticlesEta05(), centrality, ptmc);
Expand All @@ -1493,7 +1524,7 @@
histos.fill(HIST("h2dGenXiPlusVsNchVsOccupancy"), ptmc, nChEta1, occupancy);
histos.fill(HIST("h2dGenXiPlusVsCentIR"), ptmc, centrality, intRate);
}
if (cascMC.pdgCode() == 3334 && !isXi) {
if (cascMC.pdgCode() == PDG_t::kOmegaMinus && !isXi) {
histos.fill(HIST("h2dGenOmegaMinus"), centrality, ptmc);
histos.fill(HIST("h2dGenOmegaMinusVsNch"), nChEta1, ptmc);
histos.fill(HIST("h2dGenOmegaMinusEta"), RecoDecay::eta(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}));
Expand All @@ -1506,7 +1537,7 @@
histos.fill(HIST("h2dGenOmegaMinusVsNchVsOccupancy"), ptmc, nChEta1, occupancy);
histos.fill(HIST("h2dGenOmegaMinusVsCentIR"), ptmc, centrality, intRate);
}
if (cascMC.pdgCode() == -3334 && !isXi) {
if (cascMC.pdgCode() == PDG_t::kOmegaPlusBar && !isXi) {
histos.fill(HIST("h2dGenOmegaPlus"), centrality, ptmc);
histos.fill(HIST("h2dGenOmegaPlusVsNch"), nChEta1, ptmc);
histos.fill(HIST("h2dGenOmegaPlusVsMultMCVsCentrality"), mcCollision.multMCNParticlesEta05(), centrality, ptmc);
Expand Down
Loading