Skip to content

Commit 76cb914

Browse files
authored
[PWGLF] Optimized PID selection for doublephi analysis (#10940)
1 parent 2185485 commit 76cb914

File tree

1 file changed

+140
-14
lines changed

1 file changed

+140
-14
lines changed

PWGLF/Tasks/Resonances/doublephimeson.cxx

Lines changed: 140 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ 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

5860
// THnsparse bining
5961
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {1500, 2.0, 3.5}, "#it{M} (GeV/#it{c}^{2})"};
6062
ConfigurableAxis configThnAxisInvMassPhi{"configThnAxisInvMassPhi", {20, 1.01, 1.03}, "#it{M} (GeV/#it{c}^{2})"};
63+
ConfigurableAxis configThnAxisInvMassDeltaPhi{"configThnAxisInvMassDeltaPhi", {80, 0.0, 0.08}, "#it{M} (GeV/#it{c}^{2})"};
6164
ConfigurableAxis configThnAxisDaugherPt{"configThnAxisDaugherPt", {25, 0.0, 50.}, "#it{p}_{T} (GeV/#it{c})"};
6265
ConfigurableAxis configThnAxisPt{"configThnAxisPt", {40, 0.0, 20.}, "#it{p}_{T} (GeV/#it{c})"};
6366
ConfigurableAxis configThnAxisKstar{"configThnAxisKstar", {200, 0.0, 2.0}, "#it{k}^{*} (GeV/#it{c})"};
@@ -71,17 +74,20 @@ struct doublephimeson {
7174
// register histograms
7275
histos.add("hnsigmaTPCKaonPlus", "hnsigmaTPCKaonPlus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
7376
histos.add("hnsigmaTPCKaonMinus", "hnsigmaTPCKaonMinus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
77+
histos.add("hnsigmaTPCTOFKaon", "hnsigmaTPCTOFKaon", kTH3F, {{500, -3.0, 3.0f}, {500, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
7478
histos.add("hPhiMass", "hPhiMass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
79+
histos.add("hPhiMass2", "hPhiMass2", kTH2F, {{40, 1.0, 1.04f}, {40, 1.0f, 1.04f}});
7580

7681
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
7782
const AxisSpec thnAxisInvMassPhi{configThnAxisInvMassPhi, "#it{M} (GeV/#it{c}^{2})"};
83+
const AxisSpec thnAxisInvMassDeltaPhi{configThnAxisInvMassDeltaPhi, "#it{M} (GeV/#it{c}^{2})"};
7884
const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"};
7985
const AxisSpec thnAxisDeltaR{configThnAxisDeltaR, "#Delta R)"};
8086
const AxisSpec thnAxisCosTheta{configThnAxisCosTheta, "cos #theta"};
8187
const AxisSpec thnAxisNumPhi{configThnAxisNumPhi, "Number of phi meson"};
8288

83-
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});
89+
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassDeltaPhi, thnAxisNumPhi});
90+
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassDeltaPhi});
8591
}
8692

8793
// get kstar
@@ -149,18 +155,35 @@ struct doublephimeson {
149155
}
150156
if (ptcand >= 0.5) {
151157
if (TOFHit != 1) {
152-
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
158+
if (ptcand >= 0.5 && ptcand < 0.6 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
159+
return true;
160+
}
161+
if (ptcand >= 0.6 && ptcand < 0.7 && nsigmaTPC > -1.0 && nsigmaTPC < cutNsigmaTPC) {
162+
return true;
163+
}
164+
if (ptcand >= 0.7 && ptcand < 0.8 && nsigmaTPC > -0.4 && nsigmaTPC < cutNsigmaTPC) {
165+
return true;
166+
}
167+
if (ptcand >= 0.8 && ptcand < 1.0 && nsigmaTPC > -0.0 && nsigmaTPC < cutNsigmaTPC) {
168+
return true;
169+
}
170+
if (ptcand >= 1.0 && ptcand < 1.8 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
171+
return true;
172+
}
173+
if (ptcand >= 1.8 && ptcand < 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.5) {
174+
return true;
175+
}
176+
if (ptcand >= 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.0) {
153177
return true;
154178
}
155179
}
156180
if (TOFHit == 1) {
157-
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
181+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
158182
return true;
159183
}
160184
}
161185
}
162186
}
163-
164187
if (PIDStrategy == 1) {
165188
if (ptcand < 0.5) {
166189
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
@@ -175,6 +198,62 @@ struct doublephimeson {
175198
}
176199
}
177200
}
201+
if (PIDStrategy == 2) {
202+
if (ptcand < 0.5) {
203+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
204+
return true;
205+
}
206+
}
207+
if (ptcand >= 0.5) {
208+
if (TOFHit != 1 && ptcand < momTOFCut) {
209+
if (ptcand >= 0.5 && ptcand < 0.6 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
210+
return true;
211+
}
212+
if (ptcand >= 0.6 && ptcand < 0.7 && nsigmaTPC > -1.0 && nsigmaTPC < cutNsigmaTPC) {
213+
return true;
214+
}
215+
if (ptcand >= 0.7 && ptcand < 0.8 && nsigmaTPC > -0.4 && nsigmaTPC < cutNsigmaTPC) {
216+
return true;
217+
}
218+
if (ptcand >= 0.8 && ptcand < 1.0 && nsigmaTPC > -0.0 && nsigmaTPC < cutNsigmaTPC) {
219+
return true;
220+
}
221+
if (ptcand >= 1.0 && ptcand < 1.8 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
222+
return true;
223+
}
224+
if (ptcand >= 1.8 && ptcand < 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.5) {
225+
return true;
226+
}
227+
if (ptcand >= 2.0 && nsigmaTPC > -2.0 && nsigmaTPC < 1.0) {
228+
return true;
229+
}
230+
}
231+
if (TOFHit == 1) {
232+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
233+
return true;
234+
}
235+
}
236+
}
237+
}
238+
if (PIDStrategy == 3) {
239+
if (ptcand < 0.5) {
240+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
241+
return true;
242+
}
243+
}
244+
if (ptcand >= 0.5) {
245+
if (TOFHit != 1) {
246+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
247+
return true;
248+
}
249+
}
250+
if (TOFHit == 1) {
251+
if (TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2.0) < cutNsigmaTOF) {
252+
return true;
253+
}
254+
}
255+
}
256+
}
178257
return false;
179258
}
180259

@@ -186,24 +265,51 @@ struct doublephimeson {
186265
if (additionalEvsel && (collision.numPos() < 2 || collision.numNeg() < 2)) {
187266
return;
188267
}
189-
auto phimult = phitracks.size();
268+
int phimult = 0;
190269
for (auto phitrackd1 : phitracks) {
191270
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
192271
continue;
193272
}
194273
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());
195274
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
275+
if (kaonplusd1pt > maxKaonPt) {
276+
continue;
277+
}
278+
if (kaonminusd1pt > maxKaonPt) {
279+
continue;
280+
}
196281
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
197282
continue;
198283
}
199284
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
200285
continue;
201286
}
202-
auto phid1id = phitrackd1.index();
203-
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
287+
phimult = phimult + 1;
288+
}
289+
for (auto phitrackd1 : phitracks) {
290+
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
291+
continue;
292+
}
293+
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());
294+
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
295+
if (kaonplusd1pt > maxKaonPt) {
296+
continue;
297+
}
298+
if (kaonminusd1pt > maxKaonPt) {
299+
continue;
300+
}
301+
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
302+
continue;
303+
}
304+
histos.fill(HIST("hnsigmaTPCTOFKaon"), phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), kaonplusd1pt);
204305
histos.fill(HIST("hnsigmaTPCKaonPlus"), phitrackd1.phid1TPC(), kaonplusd1pt);
306+
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
307+
continue;
308+
}
205309
histos.fill(HIST("hnsigmaTPCKaonMinus"), phitrackd1.phid2TPC(), kaonminusd1pt);
206310
histos.fill(HIST("hPhiMass"), Phid1.M(), Phid1.Pt());
311+
auto phid1id = phitrackd1.index();
312+
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
207313
for (auto phitrackd2 : phitracks) {
208314
auto phid2id = phitrackd2.index();
209315
if (phid2id <= phid1id) {
@@ -214,6 +320,12 @@ struct doublephimeson {
214320
}
215321
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
216322
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
323+
if (kaonplusd2pt > maxKaonPt) {
324+
continue;
325+
}
326+
if (kaonminusd2pt > maxKaonPt) {
327+
continue;
328+
}
217329
if (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID2, kaonplusd2pt)) {
218330
continue;
219331
}
@@ -232,11 +344,13 @@ struct doublephimeson {
232344
// auto kstar = getkstar(Phid1, Phid2);
233345
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
234346
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
347+
auto deltam = TMath::Sqrt(TMath::Power(Phid1.M() - 1.0192, 2.0) + TMath::Power(Phid2.M() - 1.0192, 2.0));
348+
histos.fill(HIST("hPhiMass2"), Phid1.M(), Phid2.M());
235349
if (!isDeep) {
236-
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
350+
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, deltam, phimult);
237351
}
238352
if (isDeep) {
239-
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), Phid1.M(), Phid2.M(), phimult);
353+
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), deltam, phimult);
240354
}
241355
}
242356
}
@@ -254,7 +368,6 @@ struct doublephimeson {
254368
if (collision1.index() == collision2.index()) {
255369
continue;
256370
}
257-
auto phimult = tracks1.size();
258371
for (auto& [phitrackd1, phitrackd2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
259372
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
260373
continue;
@@ -266,6 +379,18 @@ struct doublephimeson {
266379
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
267380
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
268381
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
382+
if (kaonplusd1pt > maxKaonPt) {
383+
continue;
384+
}
385+
if (kaonminusd1pt > maxKaonPt) {
386+
continue;
387+
}
388+
if (kaonplusd2pt > maxKaonPt) {
389+
continue;
390+
}
391+
if (kaonminusd2pt > maxKaonPt) {
392+
continue;
393+
}
269394
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
270395
continue;
271396
}
@@ -283,11 +408,12 @@ struct doublephimeson {
283408
exotic = Phid1 + Phid2;
284409
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
285410
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
411+
auto deltam = TMath::Sqrt(TMath::Power(Phid1.M() - 1.0192, 2.0) + TMath::Power(Phid2.M() - 1.0192, 2.0));
286412
if (!isDeep) {
287-
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
413+
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, deltam);
288414
}
289415
if (isDeep) {
290-
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), Phid1.M(), Phid2.M(), phimult);
416+
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, deepangle(Phid1, Phid2), deltam);
291417
}
292418
}
293419
}

0 commit comments

Comments
 (0)