Skip to content
Merged
Changes from 1 commit
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: 33 additions & 33 deletions PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <Math/Vector4D.h>
#include <TFile.h>
#include <TH2D.h>
#include <TLorentzVector.h>

Check failure on line 59 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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 @@ -516,21 +516,21 @@
BITSET(maskTrackProperties, selPosGoodTPCTrack);
BITSET(maskTrackProperties, selPosGoodITSTrack);
// TPC signal is available: ask for positive track PID
if (v0Selections.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut

Check failure on line 519 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskK0ShortSpecific, selTPCPIDPositivePion);
BITSET(maskLambdaSpecific, selTPCPIDPositiveProton);
BITSET(maskAntiLambdaSpecific, selTPCPIDPositivePion);
}
// TOF PID
if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut

Check failure on line 525 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskK0ShortSpecific, selTOFNSigmaPositivePionK0Short);
BITSET(maskK0ShortSpecific, selTOFDeltaTPositivePionK0Short);
}
if (v0Selections.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut

Check failure on line 529 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskLambdaSpecific, selTOFNSigmaPositiveProtonLambda);
BITSET(maskLambdaSpecific, selTOFDeltaTPositiveProtonLambda);
}
if (v0Selections.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut

Check failure on line 533 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskAntiLambdaSpecific, selTOFNSigmaPositivePionLambda);
BITSET(maskAntiLambdaSpecific, selTOFDeltaTPositivePionLambda);
}
Expand All @@ -542,21 +542,21 @@
BITSET(maskTrackProperties, selNegGoodTPCTrack);
BITSET(maskTrackProperties, selNegGoodITSTrack);
// TPC signal is available: ask for negative track PID
if (v0Selections.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut

Check failure on line 545 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskK0ShortSpecific, selTPCPIDNegativePion);
BITSET(maskLambdaSpecific, selTPCPIDNegativePion);
BITSET(maskAntiLambdaSpecific, selTPCPIDNegativeProton);
}
// TOF PID
if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut

Check failure on line 551 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskK0ShortSpecific, selTOFNSigmaNegativePionK0Short);
BITSET(maskK0ShortSpecific, selTOFDeltaTNegativePionK0Short);
}
if (v0Selections.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut

Check failure on line 555 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskLambdaSpecific, selTOFNSigmaNegativePionLambda);
BITSET(maskLambdaSpecific, selTOFDeltaTNegativePionLambda);
}
if (v0Selections.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut

Check failure on line 559 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
BITSET(maskAntiLambdaSpecific, selTOFNSigmaNegativeProtonLambda);
BITSET(maskAntiLambdaSpecific, selTOFDeltaTNegativeProtonLambda);
}
Expand Down Expand Up @@ -671,7 +671,7 @@
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(19, "Below min IR");
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(20, "Above max IR");
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(21, "RCT flags");

Check failure on line 674 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
histos.add("hCentralityVsNGlobal", "hCentralityVsNGlobal", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisNch});
histos.add("hEventCentVsMultFT0M", "hEventCentVsMultFT0M", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisMultFT0M});
histos.add("hEventCentVsMultFT0C", "hEventCentVsMultFT0C", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisMultFT0C});
Expand Down Expand Up @@ -707,7 +707,7 @@
// for QA and test purposes
auto hRawCentrality = histos.add<TH1>("hRawCentrality", "hRawCentrality", kTH1D, {axisConfigurations.axisRawCentrality});

for (int ii = 1; ii < 101; ii++) {

Check failure on line 710 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.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.
float value = 100.5f - static_cast<float>(ii);
hRawCentrality->SetBinContent(ii, value);
}
Expand Down Expand Up @@ -1186,14 +1186,14 @@
// Calculation taken from CF: https://github.com/AliceO2Group/O2Physics/blob/376392cb87349886a300c75fa2492b50b7f46725/PWGCF/Flow/Tasks/flowAnalysisGF.cxx#L470
{
if (magField < 0) // for negative polarity field
phi = TMath::TwoPi() - phi;
phi = o2::constants::math::TwoPI - phi;
if (sign < 0) // for negative charge
phi = TMath::TwoPi() - phi;
phi = o2::constants::math::TwoPI - phi;
if (phi < 0)
LOGF(warning, "phi < 0: %g", phi);

phi += TMath::Pi() / 18.0; // to center gap in the middle
return fmod(phi, TMath::Pi() / 9.0);
phi += o2::constants::math::PI / 18.0; // to center gap in the middle
Comment thread
romainschotter marked this conversation as resolved.
return fmod(phi, o2::constants::math::PI / 9.0);
}

bool isTrackFarFromTPCBoundary(double trackPt, double trackPhi, int sign)
Expand Down Expand Up @@ -1339,22 +1339,22 @@
// precalculate this information so that a check is one mask operation, not many
{
uint64_t bitMap = 0;
bool isPositiveProton = v0.pdgCodePositive() == 2212;
bool isPositivePion = v0.pdgCodePositive() == 211 || (doTreatPiToMuon && v0.pdgCodePositive() == -13);
bool isNegativeProton = v0.pdgCodeNegative() == -2212;
bool isNegativePion = v0.pdgCodeNegative() == -211 || (doTreatPiToMuon && v0.pdgCodeNegative() == 13);
bool isPositiveProton = v0.pdgCodePositive() == PDG_t::kProton;
bool isPositivePion = v0.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && v0.pdgCodePositive() == PDG_t::kMuonPlus);
bool isNegativeProton = v0.pdgCodeNegative() == PDG_t::kProtonBar;
bool isNegativePion = v0.pdgCodeNegative() == PDG_t::kPiMinus || (doTreatPiToMuon && v0.pdgCodeNegative() == PDG_t::kMuonMinus);

if (v0.pdgCode() == 310 && isPositivePion && isNegativePion) {
if (v0.pdgCode() == PDG_t::kK0Short && isPositivePion && isNegativePion) {
BITSET(bitMap, selConsiderK0Short);
if (v0.isPhysicalPrimary())
BITSET(bitMap, selPhysPrimK0Short);
}
if (v0.pdgCode() == 3122 && isPositiveProton && isNegativePion) {
if (v0.pdgCode() == PDG_t::kLambda0 && isPositiveProton && isNegativePion) {
BITSET(bitMap, selConsiderLambda);
if (v0.isPhysicalPrimary())
BITSET(bitMap, selPhysPrimLambda);
}
if (v0.pdgCode() == -3122 && isPositivePion && isNegativeProton) {
if (v0.pdgCode() == PDG_t::kLambda0Bar && isPositivePion && isNegativeProton) {
BITSET(bitMap, selConsiderAntiLambda);
if (v0.isPhysicalPrimary())
BITSET(bitMap, selPhysPrimAntiLambda);
Expand Down Expand Up @@ -1942,11 +1942,11 @@

// __________________________________________
if (verifyMask(selMap, secondaryMaskSelectionLambda) && analyseLambda) {
if (v0mother.pdgCode() == 3312 && v0mother.isPhysicalPrimary())
if (v0mother.pdgCode() == PDG_t::kXiMinus && v0mother.isPhysicalPrimary())
histos.fill(HIST("h3dLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
if (verifyMask(selMap, secondaryMaskSelectionAntiLambda) && analyseAntiLambda) {
if (v0mother.pdgCode() == -3312 && v0mother.isPhysicalPrimary())
if (v0mother.pdgCode() == PDG_t::kXiPlus && v0mother.isPhysicalPrimary())
histos.fill(HIST("h3dAntiLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
}
Expand Down Expand Up @@ -2586,9 +2586,9 @@

float ptmc = RecoDecay::sqrtSumOfSquares(v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC());
float ymc = 1e-3;
if (v0MC.pdgCode() == 310)
if (v0MC.pdgCode() == PDG_t::kK0Short)
ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassKaonNeutral);
else if (std::abs(v0MC.pdgCode()) == 3122)
else if (std::abs(v0MC.pdgCode()) == PDG_t::kLambda0)
ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassLambda);

uint64_t selMap = computeReconstructionBitmap(v0, collision, ymc, ymc, ptmc);
Expand Down Expand Up @@ -2653,9 +2653,9 @@

float ptmc = v0MC.ptMC();
float ymc = 1e3;
if (v0MC.pdgCode() == 310)
if (v0MC.pdgCode() == PDG_t::kK0Short)
ymc = v0MC.rapidityMC(0);
else if (std::abs(v0MC.pdgCode()) == 3122)
else if (std::abs(v0MC.pdgCode()) == PDG_t::kLambda0)
ymc = v0MC.rapidityMC(1);

if (std::abs(ymc) > v0Selections.rapidityCut)
Expand Down Expand Up @@ -2684,26 +2684,26 @@
centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets() : collision.centRun2V0M();
}

if (v0MC.pdgCode() == 310) {
if (v0MC.pdgCode() == PDG_t::kK0Short) {
histos.fill(HIST("h2dGenK0ShortVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (v0MC.pdgCode() == 3122) {
if (v0MC.pdgCode() == PDG_t::kLambda0) {
histos.fill(HIST("h2dGenLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (v0MC.pdgCode() == -3122) {
if (v0MC.pdgCode() == PDG_t::kLambda0Bar) {
histos.fill(HIST("h2dGenAntiLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
}

if (v0MC.pdgCode() == 310) {
if (v0MC.pdgCode() == PDG_t::kK0Short) {
histos.fill(HIST("h2dGenK0Short"), centrality, ptmc);
histos.fill(HIST("h2dGenK0ShortVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (v0MC.pdgCode() == 3122) {
if (v0MC.pdgCode() == PDG_t::kLambda0) {
histos.fill(HIST("h2dGenLambda"), centrality, ptmc);
histos.fill(HIST("h2dGenLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (v0MC.pdgCode() == -3122) {
if (v0MC.pdgCode() == PDG_t::kLambda0Bar) {
histos.fill(HIST("h2dGenAntiLambda"), centrality, ptmc);
histos.fill(HIST("h2dGenAntiLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
Expand All @@ -2718,9 +2718,9 @@

float ptmc = cascMC.ptMC();
float ymc = 1e3;
if (std::abs(cascMC.pdgCode()) == 3312)
if (std::abs(cascMC.pdgCode()) == PDG_t::kXiMinus)
ymc = cascMC.rapidityMC(0);
else if (std::abs(cascMC.pdgCode()) == 3334)
else if (std::abs(cascMC.pdgCode()) == PDG_t::kOmegaMinus)
ymc = cascMC.rapidityMC(2);

if (std::abs(ymc) > v0Selections.rapidityCut)
Expand Down Expand Up @@ -2749,33 +2749,33 @@
centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets() : collision.centRun2V0M();
}

if (cascMC.pdgCode() == 3312) {
if (cascMC.pdgCode() == PDG_t::kXiMinus) {
histos.fill(HIST("h2dGenXiMinusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == -3312) {
if (cascMC.pdgCode() == PDG_t::kXiPlus) {
histos.fill(HIST("h2dGenXiPlusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == 3334) {
if (cascMC.pdgCode() == PDG_t::kOmegaMinus) {
histos.fill(HIST("h2dGenOmegaMinusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == -3334) {
if (cascMC.pdgCode() == PDG_t::kOmegaPlus) {
histos.fill(HIST("h2dGenOmegaPlusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
}

if (cascMC.pdgCode() == 3312) {
if (cascMC.pdgCode() == PDG_t::kXiMinus) {
histos.fill(HIST("h2dGenXiMinus"), centrality, ptmc);
histos.fill(HIST("h2dGenXiMinusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == -3312) {
if (cascMC.pdgCode() == PDG_t::kXiPlus) {
histos.fill(HIST("h2dGenXiPlus"), centrality, ptmc);
histos.fill(HIST("h2dGenXiPlusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == 3334) {
if (cascMC.pdgCode() == PDG_t::kOmegaMinus) {
histos.fill(HIST("h2dGenOmegaMinus"), centrality, ptmc);
histos.fill(HIST("h2dGenOmegaMinusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
if (cascMC.pdgCode() == -3334) {
if (cascMC.pdgCode() == PDG_t::kOmegaPlus) {
histos.fill(HIST("h2dGenOmegaPlus"), centrality, ptmc);
histos.fill(HIST("h2dGenOmegaPlusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
Expand Down
Loading