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
83 changes: 52 additions & 31 deletions PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
// Configurables for track selection (not necessarily common for trigger and the two associated particles)
struct : ConfigurableGroup {
Configurable<float> cfgCutCharge{"cfgCutCharge", 0.0f, "Cut on charge"};
Configurable<bool> cfgPrimaryTrack{"cfgPrimaryTrack", false, "Primary track selection"};
Configurable<bool> cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"};
Configurable<bool> cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"};
Configurable<float> cMinKaonPtcut{"cMinKaonPtcut", 0.15f, "Track minimum pt cut"};
Expand All @@ -115,9 +114,9 @@
Configurable<float> nSigmaCutCombinedKa{"nSigmaCutCombinedKa", 3.0f, "Value of the TOF Nsigma cut for Kaons"};

Configurable<float> nSigmaCutTPCPion{"nSigmaCutTPCPion", 4.0f, "Value of the TPC Nsigma cut for Pions"};
Configurable<float> cMinPionPtcut{"cMinPionPtcut", 0.3f, "Track minimum pt cut"};
Configurable<float> cMinPionPtcut{"cMinPionPtcut", 0.2f, "Track minimum pt cut"};
Configurable<int> minTPCnClsFound{"minTPCnClsFound", 70, "min number of found TPC clusters"};
Configurable<int> minNCrossedRowsTPC{"minNCrossedRowsTPC", 80, "min number of TPC crossed rows"};
Configurable<int> minNCrossedRowsTPC{"minNCrossedRowsTPC", 70, "min number of TPC crossed rows"};
Configurable<float> maxChi2TPC{"maxChi2TPC", 4.0f, "max chi2 per cluster TPC"};
Configurable<int> minITSnCls{"minITSnCls", 4, "min number of ITS clusters"};
Configurable<float> maxChi2ITS{"maxChi2ITS", 36.0f, "max chi2 per cluster ITS"};
Expand Down Expand Up @@ -724,10 +723,8 @@

// Topological track selection
template <bool isMC, typename T>
bool selectionTrackResonance(const T& track, bool isQA)
bool selectionTrackResonance(const T& track, bool doQA)
{
if (trackConfigs.cfgPrimaryTrack && !track.isPrimaryTrack())
return false;
if (trackConfigs.cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA())
return false;
if (trackConfigs.cfgPVContributor && !track.isPVContributor())
Expand All @@ -738,10 +735,8 @@

if (track.pt() < trackConfigs.cMinKaonPtcut)
return false;
if (std::abs(track.eta()) > trackConfigs.etaMax)
return false;

if (isQA) {
if (doQA) {
if constexpr (!isMC) {
dataPhiHist.fill(HIST("h2DauTracksPhiDCAxyPreCutData"), track.pt(), track.dcaXY());
dataPhiHist.fill(HIST("h2DauTracksPhiDCAzPreCutData"), track.pt(), track.dcaZ());
Expand All @@ -752,7 +747,7 @@
}
if (std::abs(track.dcaXY()) > trackConfigs.cMaxDCArToPV1Phi + (trackConfigs.cMaxDCArToPV2Phi / std::pow(track.pt(), trackConfigs.cMaxDCArToPV3Phi)))
return false;
if (isQA) {
if (doQA) {
if constexpr (!isMC) {
dataPhiHist.fill(HIST("h2DauTracksPhiDCAxyPostCutData"), track.pt(), track.dcaXY());
dataPhiHist.fill(HIST("h2DauTracksPhiDCAzPostCutData"), track.pt(), track.dcaZ());
Expand Down Expand Up @@ -802,35 +797,25 @@

// Topological selection for pions
template <bool isTOFChecked, bool isMC, typename T>
bool selectionPion(const T& track, bool isQA)
bool selectionPion(const T& track, bool doQA)
{
if (!track.hasITS())
return false;
if (track.itsNCls() < trackConfigs.minITSnCls)
return false;
if (track.itsChi2NCl() > trackConfigs.maxChi2ITS)
if (!track.isGlobalTrackWoDCA())
return false;

if (!track.hasTPC())
if (track.itsNCls() < trackConfigs.minITSnCls)
return false;
if (track.tpcNClsFound() < trackConfigs.minTPCnClsFound)
return false;
if (track.tpcNClsCrossedRows() < trackConfigs.minNCrossedRowsTPC)
return false;
if (track.tpcChi2NCl() > trackConfigs.maxChi2TPC)
return false;

if (track.pt() < trackConfigs.cMinPionPtcut)
return false;
if (std::abs(track.eta()) > trackConfigs.etaMax)
return false;

if constexpr (isTOFChecked) {
if (track.pt() >= trackConfigs.pTToUseTOF && !track.hasTOF())
return false;
}

if (isQA) {
if (doQA) {
if constexpr (!isMC) {
dataPionHist.fill(HIST("h2TracksPiDCAxyPreCutData"), track.pt(), track.dcaXY());
dataPionHist.fill(HIST("h2TracksPiDCAzPreCutData"), track.pt(), track.dcaZ());
Expand All @@ -841,7 +826,7 @@
}
if (std::abs(track.dcaXY()) > trackConfigs.cMaxDCArToPV1Pion + (trackConfigs.cMaxDCArToPV2Pion / std::pow(track.pt(), trackConfigs.cMaxDCArToPV3Pion)))
return false;
if (isQA) {
if (doQA) {
if constexpr (!isMC) {
dataPionHist.fill(HIST("h2TracksPiDCAxyPostCutData"), track.pt(), track.dcaXY());
dataPionHist.fill(HIST("h2TracksPiDCAzPostCutData"), track.pt(), track.dcaZ());
Expand Down Expand Up @@ -1636,7 +1621,7 @@
if (mcTrack.isPhysicalPrimary()) {
mcPionHist.fill(HIST("h3RecMCDCAxyPrimPi"), track.pt(), track.dcaXY());
} else {
if (mcTrack.getProcess() == 4) { // Selection of secondary pions from weak decay

Check failure on line 1624 in PWGLF/Tasks/Strangeness/phik0shortanalysis.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.
mcPionHist.fill(HIST("h3RecMCDCAxySecWeakDecayPi"), track.pt(), track.dcaXY());
} else { // Selection of secondary pions from material interactions
mcPionHist.fill(HIST("h3RecMCDCAxySecMaterialPi"), track.pt(), track.dcaXY());
Expand Down Expand Up @@ -2109,7 +2094,7 @@
if (mcParticle1.pdgCode() != o2::constants::physics::Pdg::kPhi)
continue;
auto kDaughters = mcParticle1.daughters_as<aod::McParticles>();
if (kDaughters.size() != 2)

Check failure on line 2097 in PWGLF/Tasks/Strangeness/phik0shortanalysis.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;
bool isPosKaon = false, isNegKaon = false;
for (const auto& kDaughter : kDaughters) {
Expand Down Expand Up @@ -2246,7 +2231,7 @@
continue;
if (cfgisGenMCForClosure) {
auto kDaughters = mcParticle2.daughters_as<aod::McParticles>();
if (kDaughters.size() != 2)

Check failure on line 2234 in PWGLF/Tasks/Strangeness/phik0shortanalysis.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;
bool isPosKaon = false, isNegKaon = false;
for (const auto& kDaughter : kDaughters) {
Expand Down Expand Up @@ -2323,7 +2308,7 @@
continue;
if (cfgisGenMCForClosure) {
auto kDaughters = mcParticle2.daughters_as<aod::McParticles>();
if (kDaughters.size() != 2)

Check failure on line 2311 in PWGLF/Tasks/Strangeness/phik0shortanalysis.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;
bool isPosKaon = false, isNegKaon = false;
for (const auto& kDaughter : kDaughters) {
Expand Down Expand Up @@ -2515,7 +2500,13 @@
isCountedPhi = true;
}

float weightPhi = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity())) : 1.0f;
float efficiencyPhi = 1.0f;
if (applyEfficiency) {
efficiencyPhi = effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity());
if (efficiencyPhi == 0)
efficiencyPhi = 1.0f;
}
float weightPhi = applyEfficiency ? 1.0f / efficiencyPhi : 1.0f;
dataPhiHist.fill(HIST("h3PhiDataNewProc"), multiplicity, recPhi.Pt(), recPhi.M(), weightPhi);

// V0 already reconstructed by the builder
Expand Down Expand Up @@ -2543,7 +2534,13 @@
if (std::abs(v0.yK0Short()) > cfgYAcceptance)
continue;

float weightPhiK0S = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapK0S->Interpolate(multiplicity, v0.pt(), v0.yK0Short())) : 1.0f;
float efficiencyPhiK0S = 1.0f;
if (applyEfficiency) {
efficiencyPhiK0S = effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapK0S->Interpolate(multiplicity, v0.pt(), v0.yK0Short());
if (efficiencyPhiK0S == 0)
efficiencyPhiK0S = 1.0f;
}
float weightPhiK0S = applyEfficiency ? 1.0f / efficiencyPhiK0S : 1.0f;
dataPhiK0SHist.fill(HIST("h5PhiK0SDataNewProc"), v0.yK0Short() - recPhi.Rapidity(), multiplicity, v0.pt(), v0.mK0Short(), recPhi.M(), weightPhiK0S);
}

Expand All @@ -2559,7 +2556,13 @@

float nSigmaTOFPi = (track.hasTOF() ? track.tofNSigmaPi() : -999);

float weightPhiPion = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapPion->Interpolate(multiplicity, track.pt(), track.rapidity(massPi))) : 1.0f;
float efficiencyPhiPion = 1.0f;
if (applyEfficiency) {
efficiencyPhiPion = effMapPhi->Interpolate(multiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapPion->Interpolate(multiplicity, track.pt(), track.rapidity(massPi));
if (efficiencyPhiPion == 0)
efficiencyPhiPion = 1.0f;
}
float weightPhiPion = applyEfficiency ? 1.0f / efficiencyPhiPion : 1.0f;
dataPhiPionHist.fill(HIST("h6PhiPiDataNewProc"), track.rapidity(massPi) - recPhi.Rapidity(), multiplicity, track.pt(), track.tpcNSigmaPi(), nSigmaTOFPi, recPhi.M(), weightPhiPion);
}
}
Expand Down Expand Up @@ -2615,7 +2618,13 @@
isCountedPhi = true;
}

float weightPhi = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity())) : 1.0f;
float efficiencyPhi = 1.0f;
if (applyEfficiency) {
efficiencyPhi = effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity());
if (efficiencyPhi == 0)
efficiencyPhi = 1.0f;
}
float weightPhi = applyEfficiency ? 1.0f / efficiencyPhi : 1.0f;
closureMCPhiHist.fill(HIST("h3PhiMCClosureNewProc"), genmultiplicity, recPhi.Pt(), recPhi.M(), weightPhi);

// V0 already reconstructed by the builder
Expand All @@ -2639,7 +2648,13 @@
if (std::abs(v0.yK0Short()) > cfgYAcceptance)
continue;

float weightPhiK0S = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapK0S->Interpolate(genmultiplicity, v0.pt(), v0.yK0Short())) : 1.0f;
float efficiencyPhiK0S = 1.0f;
if (applyEfficiency) {
efficiencyPhiK0S = effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapK0S->Interpolate(genmultiplicity, v0.pt(), v0.yK0Short());
if (efficiencyPhiK0S == 0)
efficiencyPhiK0S = 1.0f;
}
float weightPhiK0S = applyEfficiency ? 1.0f / efficiencyPhiK0S : 1.0f;
closureMCPhiK0SHist.fill(HIST("h5PhiK0SMCClosureNewProc"), v0.yK0Short() - recPhi.Rapidity(), genmultiplicity, v0.pt(), v0.mK0Short(), recPhi.M(), weightPhiK0S);
}

Expand All @@ -2661,7 +2676,13 @@

float nSigmaTOFPi = (track.hasTOF() ? track.tofNSigmaPi() : -999);

float weightPhiPion = applyEfficiency ? 1.0f / (effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapPion->Interpolate(genmultiplicity, track.pt(), track.rapidity(massPi))) : 1.0f;
float efficiencyPhiPion = 1.0f;
if (applyEfficiency) {
efficiencyPhiPion = effMapPhi->Interpolate(genmultiplicity, recPhi.Pt(), recPhi.Rapidity()) * effMapPion->Interpolate(genmultiplicity, track.pt(), track.rapidity(massPi));
if (efficiencyPhiPion == 0)
efficiencyPhiPion = 1.0f;
}
float weightPhiPion = applyEfficiency ? 1.0f / efficiencyPhiPion : 1.0f;
closureMCPhiPionHist.fill(HIST("h6PhiPiMCClosureNewProc"), track.rapidity(massPi) - recPhi.Rapidity(), genmultiplicity, track.pt(), track.tpcNSigmaPi(), nSigmaTOFPi, recPhi.M(), weightPhiPion);
}
}
Expand Down Expand Up @@ -2785,7 +2806,7 @@
if (mcTrack.isPhysicalPrimary()) {
mcPionHist.fill(HIST("h3RecMCDCAxyPrimPi"), track.pt(), track.dcaXY());
} else {
if (mcTrack.getProcess() == 4) { // Selection of secondary pions from weak decay

Check failure on line 2809 in PWGLF/Tasks/Strangeness/phik0shortanalysis.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.
mcPionHist.fill(HIST("h3RecMCDCAxySecWeakDecayPi"), track.pt(), track.dcaXY());
} else { // Selection of secondary pions from material interactions
mcPionHist.fill(HIST("h3RecMCDCAxySecMaterialPi"), track.pt(), track.dcaXY());
Expand Down
Loading