Skip to content

Commit 323853b

Browse files
fmazzascFrancesco Mazzaschi
andauthored
Add TOF PID + LS background (#11853)
Co-authored-by: Francesco Mazzaschi <fmazzasc@alipap1.cern.ch>
1 parent 6908c33 commit 323853b

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

PWGLF/Tasks/Resonances/lambda1405analysis.cxx

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "PWGLF/DataModel/LFKinkDecayTables.h"
1717

18+
#include "Common/Core/PID/PIDTOF.h"
1819
#include "Common/DataModel/EventSelection.h"
1920
#include "Common/DataModel/PIDResponse.h"
2021

@@ -26,7 +27,7 @@ using namespace o2;
2627
using namespace o2::framework;
2728
using namespace o2::framework::expressions;
2829

29-
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi>;
30+
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi, aod::pidTOFFullPi>;
3031
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSel>;
3132
using CollisionsFullMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels>;
3233

@@ -39,6 +40,7 @@ struct lambda1405candidate {
3940
float sigmaPt = -1; // pT of the Sigma daughter
4041
float piPt = -1; // pT of the pion daughter
4142
float nSigmaTPCPi = -1; // Number of sigmas for the pion candidate
43+
float nSigmaTOFPi = -1; // Number of sigmas for the pion candidate using TOF
4244
int piFromSigmaID = 0; // ID of the pion from Sigma decay in MC
4345
int sigmaID = 0; // ID of the Sigma candidate in MC
4446
int piID = 0; // ID of the pion candidate in MC
@@ -61,14 +63,18 @@ struct lambda1405analysis {
6163
Configurable<float> cutNITSClusPi{"cutNITSClusPi", 5, "Minimum number of ITS clusters for pion candidate"};
6264
Configurable<float> cutNTPCClusPi{"cutNTPCClusPi", 90, "Minimum number of TPC clusters for pion candidate"};
6365
Configurable<float> cutNSigmaPi{"cutNSigmaPi", 3, "NSigmaTPCPion"};
66+
Configurable<float> cutNSigmaPiTOF{"cutNSigmaPiTOF", 3, "NSigmaTOFPion"};
67+
68+
Configurable<bool> doLSBkg{"doLikeSignBkg", false, "Use like-sign background"};
69+
Configurable<bool> useTOF{"useTOF", false, "Use TOF for PID for pion candidates"};
6470

6571
Preslice<aod::KinkCands> mKinkPerCol = aod::track::collisionId;
6672
Preslice<aod::TracksIU> mPerColTracks = aod::track::collisionId;
6773

6874
void init(InitContext const&)
6975
{
7076
// Axes
71-
const AxisSpec ptAxis{50, -5, 5, "#it{p}_{T} (GeV/#it{c})"};
77+
const AxisSpec ptAxis{100, -10, 10, "#it{p}_{T} (GeV/#it{c})"};
7278
const AxisSpec ptPiAxis{50, -2, 2, "#it{p}_{T}^{#pi} (GeV/#it{c})"};
7379
const AxisSpec ptResolutionAxis{100, -0.5, 0.5, "#it{p}_{T}^{rec} - #it{p}_{T}^{gen} (GeV/#it{c})"};
7480
const AxisSpec massAxis{100, 1.3, 1.5, "m (GeV/#it{c}^{2})"};
@@ -82,6 +88,7 @@ struct lambda1405analysis {
8288
rLambda1405.add("h2PtMassSigma", "h2PtMassSigma", {HistType::kTH2F, {ptAxis, sigmaMassAxis}});
8389
rLambda1405.add("h2SigmaMassVsMass", "h2SigmaMassVsMass", {HistType::kTH2F, {massAxis, sigmaMassAxis}});
8490
rLambda1405.add("h2PtPiNSigma", "h2PtPiNSigma", {HistType::kTH2F, {ptPiAxis, nSigmaPiAxis}});
91+
rLambda1405.add("h2PtPiNSigmaTOF", "h2PtPiNSigmaTOF", {HistType::kTH2F, {ptPiAxis, nSigmaPiAxis}});
8592

8693
if (doprocessMC) {
8794
// Add MC histograms if needed
@@ -97,10 +104,23 @@ struct lambda1405analysis {
97104
if (std::abs(candidate.tpcNSigmaPi()) > cutNSigmaPi || candidate.tpcNClsFound() < cutNTPCClusPi || std::abs(candidate.eta()) > cutEtaDaught) {
98105
return false;
99106
}
100-
if (!piFromSigma && candidate.itsNCls() < cutNITSClusPi) {
107+
if (piFromSigma) {
108+
return true;
109+
}
110+
111+
if (candidate.itsNCls() < cutNITSClusPi) {
112+
return false;
113+
}
114+
115+
if (useTOF && !candidate.hasTOF()) {
101116
return false;
102117
}
103-
return true;
118+
119+
if (useTOF && std::abs(candidate.tofNSigmaPi()) > cutNSigmaPiTOF) {
120+
return false;
121+
}
122+
123+
return true; // Track is selected
104124
}
105125

106126
bool selectCandidate(aod::KinkCands::iterator const& sigmaCand, TracksFull const& tracks)
@@ -118,8 +138,17 @@ struct lambda1405analysis {
118138
}
119139
rLambda1405.fill(HIST("h2PtMassSigmaBeforeCuts"), sigmaCand.mothSign() * sigmaCand.ptMoth(), sigmaCand.mSigmaMinus());
120140
for (const auto& piTrack : tracks) {
121-
if (piTrack.sign() == sigmaCand.mothSign() || !selectPiTrack(piTrack, false)) {
122-
continue; // Skip if the pion has the same sign as the Sigma or does not pass selection
141+
if (!doLSBkg) {
142+
if (piTrack.sign() == sigmaCand.mothSign()) {
143+
continue;
144+
}
145+
} else {
146+
if (piTrack.sign() != sigmaCand.mothSign()) {
147+
continue;
148+
}
149+
}
150+
if (!selectPiTrack(piTrack, false)) {
151+
continue;
123152
}
124153
auto sigmaMom = std::array{sigmaCand.pxMoth(), sigmaCand.pyMoth(), sigmaCand.pzMoth()};
125154
auto piMom = std::array{piTrack.px(), piTrack.py(), piTrack.pz()};
@@ -138,6 +167,11 @@ struct lambda1405analysis {
138167
lambda1405Cand.sigmaPt = sigmaCand.ptMoth();
139168
lambda1405Cand.piPt = piTrack.pt();
140169
lambda1405Cand.nSigmaTPCPi = piTrack.tpcNSigmaPi();
170+
if (useTOF) {
171+
lambda1405Cand.nSigmaTOFPi = piTrack.tofNSigmaPi();
172+
} else {
173+
lambda1405Cand.nSigmaTOFPi = -999; // Not used if TOF is not enabled
174+
}
141175
return true; // Candidate is selected
142176
}
143177
return false; // No valid pion track found
@@ -154,7 +188,8 @@ struct lambda1405analysis {
154188
rLambda1405.fill(HIST("h2PtMass"), lambda1405Cand.sigmaSign * lambda1405Cand.pt, lambda1405Cand.mass);
155189
rLambda1405.fill(HIST("h2PtMassSigma"), lambda1405Cand.sigmaSign * lambda1405Cand.sigmaPt, lambda1405Cand.sigmaMass);
156190
rLambda1405.fill(HIST("h2SigmaMassVsMass"), lambda1405Cand.mass, lambda1405Cand.sigmaMass);
157-
rLambda1405.fill(HIST("h2PtPiNSigma"), lambda1405Cand.piPt, lambda1405Cand.nSigmaTPCPi);
191+
rLambda1405.fill(HIST("h2PtPiNSigma"), lambda1405Cand.sigmaSign * lambda1405Cand.piPt, lambda1405Cand.nSigmaTPCPi);
192+
rLambda1405.fill(HIST("h2PtPiNSigmaTOF"), lambda1405Cand.sigmaSign * lambda1405Cand.piPt, lambda1405Cand.nSigmaTOFPi);
158193
}
159194
}
160195
}

0 commit comments

Comments
 (0)