Skip to content

Commit 1fc5843

Browse files
committed
Optimized PID selection
1 parent 88b072c commit 1fc5843

File tree

1 file changed

+131
-11
lines changed

1 file changed

+131
-11
lines changed

PWGLF/Tasks/Resonances/doublephimeson.cxx

Lines changed: 131 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ struct doublephimeson {
5050
Configurable<float> cutMinNsigmaTPC{"cutMinNsigmaTPC", -2.5, "nsigma cut TPC"};
5151
Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 3.0, "nsigma cut TPC"};
5252
Configurable<float> cutNsigmaTOF{"cutNsigmaTOF", 3.0, "nsigma cut TOF"};
53+
Configurable<float> momTOFCut{"momTOFCut", 1.8, "minimum pT cut for madnatory TOF"};
54+
Configurable<float> maxKaonPt{"maxKaonPt", 4.0, "maximum kaon pt cut"};
5355
// Event Mixing
54-
Configurable<int> nEvtMixing{"nEvtMixing", 10, "Number of events to mix"};
56+
Configurable<int> nEvtMixing{"nEvtMixing", 1, "Number of events to mix"};
5557
ConfigurableAxis CfgVtxBins{"CfgVtxBins", {10, -10, 10}, "Mixing bins - z-vertex"};
5658
ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0, 20.0, 40.0, 60.0, 80.0, 500.0}, "Mixing bins - number of contributor"};
5759

@@ -71,6 +73,7 @@ struct doublephimeson {
7173
// register histograms
7274
histos.add("hnsigmaTPCKaonPlus", "hnsigmaTPCKaonPlus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
7375
histos.add("hnsigmaTPCKaonMinus", "hnsigmaTPCKaonMinus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
76+
histos.add("hnsigmaTPCTOFKaon", "hnsigmaTPCTOFKaon", kTH3F, {{500, -3.0, 3.0f}, {500, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
7477
histos.add("hPhiMass", "hPhiMass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
7578

7679
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
@@ -81,7 +84,7 @@ struct doublephimeson {
8184
const AxisSpec thnAxisNumPhi{configThnAxisNumPhi, "Number of phi meson"};
8285

8386
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
84-
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
87+
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi});
8588
}
8689

8790
// get kstar
@@ -149,18 +152,35 @@ struct doublephimeson {
149152
}
150153
if (ptcand >= 0.5) {
151154
if (TOFHit != 1) {
152-
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
155+
if (ptcand >= 0.5 && ptcand < 0.6 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
156+
return true;
157+
}
158+
if (ptcand >= 0.6 && ptcand < 0.7 && nsigmaTPC > -1.0 && nsigmaTPC < cutNsigmaTPC) {
159+
return true;
160+
}
161+
if (ptcand >= 0.7 && ptcand < 0.8 && nsigmaTPC > -0.4 && nsigmaTPC < cutNsigmaTPC) {
162+
return true;
163+
}
164+
if (ptcand >= 0.8 && ptcand < 1.0 && nsigmaTPC > -0.0 && nsigmaTPC < cutNsigmaTPC) {
165+
return true;
166+
}
167+
if (ptcand >= 1.0 && ptcand < 1.8 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
168+
return true;
169+
}
170+
if (ptcand >= 1.8 && ptcand < 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.5) {
171+
return true;
172+
}
173+
if (ptcand >= 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.0) {
153174
return true;
154175
}
155176
}
156177
if (TOFHit == 1) {
157-
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
178+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
158179
return true;
159180
}
160181
}
161182
}
162183
}
163-
164184
if (PIDStrategy == 1) {
165185
if (ptcand < 0.5) {
166186
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
@@ -175,6 +195,62 @@ struct doublephimeson {
175195
}
176196
}
177197
}
198+
if (PIDStrategy == 2) {
199+
if (ptcand < 0.5) {
200+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
201+
return true;
202+
}
203+
}
204+
if (ptcand >= 0.5) {
205+
if (TOFHit != 1 && ptcand < momTOFCut) {
206+
if (ptcand >= 0.5 && ptcand < 0.6 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
207+
return true;
208+
}
209+
if (ptcand >= 0.6 && ptcand < 0.7 && nsigmaTPC > -1.0 && nsigmaTPC < cutNsigmaTPC) {
210+
return true;
211+
}
212+
if (ptcand >= 0.7 && ptcand < 0.8 && nsigmaTPC > -0.4 && nsigmaTPC < cutNsigmaTPC) {
213+
return true;
214+
}
215+
if (ptcand >= 0.8 && ptcand < 1.0 && nsigmaTPC > -0.0 && nsigmaTPC < cutNsigmaTPC) {
216+
return true;
217+
}
218+
if (ptcand >= 1.0 && ptcand < 1.8 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
219+
return true;
220+
}
221+
if (ptcand >= 1.8 && ptcand < 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.5) {
222+
return true;
223+
}
224+
if (ptcand >= 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.0) {
225+
return true;
226+
}
227+
}
228+
if (TOFHit == 1) {
229+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
230+
return true;
231+
}
232+
}
233+
}
234+
}
235+
if (PIDStrategy == 3) {
236+
if (ptcand < 0.5) {
237+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
238+
return true;
239+
}
240+
}
241+
if (ptcand >= 0.5) {
242+
if (TOFHit != 1) {
243+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
244+
return true;
245+
}
246+
}
247+
if (TOFHit == 1) {
248+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
249+
return true;
250+
}
251+
}
252+
}
253+
}
178254
return false;
179255
}
180256

@@ -186,24 +262,51 @@ struct doublephimeson {
186262
if (additionalEvsel && (collision.numPos() < 2 || collision.numNeg() < 2)) {
187263
return;
188264
}
189-
auto phimult = phitracks.size();
265+
int phimult = 0;
190266
for (auto phitrackd1 : phitracks) {
191267
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
192268
continue;
193269
}
194270
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());
195271
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
272+
if (kaonplusd1pt > maxKaonPt) {
273+
continue;
274+
}
275+
if (kaonminusd1pt > maxKaonPt) {
276+
continue;
277+
}
196278
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
197279
continue;
198280
}
199281
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
200282
continue;
201283
}
202-
auto phid1id = phitrackd1.index();
203-
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
284+
phimult = phimult + 1;
285+
}
286+
for (auto phitrackd1 : phitracks) {
287+
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
288+
continue;
289+
}
290+
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());
291+
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
292+
if (kaonplusd1pt > maxKaonPt) {
293+
continue;
294+
}
295+
if (kaonminusd1pt > maxKaonPt) {
296+
continue;
297+
}
298+
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
299+
continue;
300+
}
301+
histos.fill(HIST("hnsigmaTPCTOFKaon"), phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), kaonplusd1pt);
204302
histos.fill(HIST("hnsigmaTPCKaonPlus"), phitrackd1.phid1TPC(), kaonplusd1pt);
303+
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
304+
continue;
305+
}
205306
histos.fill(HIST("hnsigmaTPCKaonMinus"), phitrackd1.phid2TPC(), kaonminusd1pt);
206307
histos.fill(HIST("hPhiMass"), Phid1.M(), Phid1.Pt());
308+
auto phid1id = phitrackd1.index();
309+
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
207310
for (auto phitrackd2 : phitracks) {
208311
auto phid2id = phitrackd2.index();
209312
if (phid2id <= phid1id) {
@@ -214,6 +317,12 @@ struct doublephimeson {
214317
}
215318
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
216319
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
320+
if (kaonplusd2pt > maxKaonPt) {
321+
continue;
322+
}
323+
if (kaonminusd2pt > maxKaonPt) {
324+
continue;
325+
}
217326
if (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID2, kaonplusd2pt)) {
218327
continue;
219328
}
@@ -254,7 +363,6 @@ struct doublephimeson {
254363
if (collision1.index() == collision2.index()) {
255364
continue;
256365
}
257-
auto phimult = tracks1.size();
258366
for (auto& [phitrackd1, phitrackd2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
259367
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
260368
continue;
@@ -266,6 +374,18 @@ struct doublephimeson {
266374
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
267375
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
268376
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
377+
if (kaonplusd1pt > maxKaonPt) {
378+
continue;
379+
}
380+
if (kaonminusd1pt > maxKaonPt) {
381+
continue;
382+
}
383+
if (kaonplusd2pt > maxKaonPt) {
384+
continue;
385+
}
386+
if (kaonminusd2pt > maxKaonPt) {
387+
continue;
388+
}
269389
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
270390
continue;
271391
}
@@ -284,10 +404,10 @@ struct doublephimeson {
284404
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
285405
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
286406
if (!isDeep) {
287-
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
407+
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M());
288408
}
289409
if (isDeep) {
290-
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), Phid1.M(), Phid2.M(), phimult);
410+
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), Phid1.M(), Phid2.M());
291411
}
292412
}
293413
}

0 commit comments

Comments
 (0)