Skip to content

Commit 8d34811

Browse files
authored
[PWGLF] Add new variable in THnSparse (#10850)
1 parent 87a7a91 commit 8d34811

File tree

1 file changed

+40
-126
lines changed

1 file changed

+40
-126
lines changed

PWGLF/Tasks/Resonances/doublephimeson.cxx

Lines changed: 40 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ using namespace o2::soa;
4141

4242
struct doublephimeson {
4343
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
44-
Configurable<bool> fillDeltaMass{"fillDeltaMass", 1, "Fill Delta Mass"};
45-
Configurable<bool> fillRotation{"fillRotation", 1, "Fill rotation"};
4644
Configurable<int> strategyPID1{"strategyPID1", 0, "PID strategy 1"};
4745
Configurable<int> strategyPID2{"strategyPID2", 0, "PID strategy 2"};
4846
Configurable<float> minPhiMass{"minPhiMass", 1.01, "Minimum phi mass"};
4947
Configurable<float> maxPhiMass{"maxPhiMass", 1.03, "Maximum phi mass"};
5048
Configurable<bool> additionalEvsel{"additionalEvsel", false, "Additional event selection"};
51-
Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 2.5, "nsigma cut TPC"};
49+
Configurable<float> cutMinNsigmaTPC{"cutMinNsigmaTPC", -2.5, "nsigma cut TPC"};
50+
Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 3.0, "nsigma cut TPC"};
5251
Configurable<float> cutNsigmaTOF{"cutNsigmaTOF", 3.0, "nsigma cut TOF"};
5352
// Event Mixing
5453
Configurable<int> nEvtMixing{"nEvtMixing", 10, "Number of events to mix"};
@@ -62,30 +61,26 @@ struct doublephimeson {
6261
ConfigurableAxis configThnAxisPt{"configThnAxisPt", {40, 0.0, 20.}, "#it{p}_{T} (GeV/#it{c})"};
6362
ConfigurableAxis configThnAxisKstar{"configThnAxisKstar", {200, 0.0, 2.0}, "#it{k}^{*} (GeV/#it{c})"};
6463
ConfigurableAxis configThnAxisDeltaR{"configThnAxisDeltaR", {200, 0.0, 2.0}, "#it{k}^{*} (GeV/#it{c})"};
65-
ConfigurableAxis configThnAxisCosTheta{"configThnAxisCosTheta", {5, 0.0, 1.0}, "cos #theta{*}"};
66-
// ConfigurableAxis configThnAxisPhiMult{"configThnAxisPhiMult", {10, 0.5, 10.5}, "#Phi Multiplicity"};
64+
ConfigurableAxis configThnAxisCosTheta{"configThnAxisCosTheta", {100, -1.0, 1.0}, "cos #theta{*}"};
65+
ConfigurableAxis configThnAxisNumPhi{"configThnAxisNumPhi", {101, -0.5, 100.5}, "cos #theta{*}"};
6766

6867
// Initialize the ananlysis task
6968
void init(o2::framework::InitContext&)
7069
{
7170
// register histograms
7271
histos.add("hnsigmaTPCKaonPlus", "hnsigmaTPCKaonPlus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
7372
histos.add("hnsigmaTPCKaonMinus", "hnsigmaTPCKaonMinus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
74-
histos.add("hPhid1Mass", "hPhid1Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
75-
histos.add("hPhid2Mass", "hPhid2Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
73+
histos.add("hPhiMass", "hPhiMass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
7674

7775
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
7876
const AxisSpec thnAxisInvMassPhi{configThnAxisInvMassPhi, "#it{M} (GeV/#it{c}^{2})"};
79-
const AxisSpec thnAxisDaughterPt{configThnAxisDaugherPt, "#it{p}_{T} (GeV/#it{c})"};
8077
const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"};
81-
const AxisSpec thnAxisKstar{configThnAxisKstar, "#it{k}^{*} (GeV/#it{c})"};
8278
const AxisSpec thnAxisDeltaR{configThnAxisDeltaR, "#Delta R)"};
83-
const AxisSpec thnAxisCosTheta{configThnAxisCosTheta, "cos #theta{*}"};
84-
// const AxisSpec thnAxisPhiMult{configThnAxisPhiMult, "#Phi Multiplicity)"};
85-
histos.add("SEMass", "SEMass", HistType::kTHnSparseF, {thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisDaughterPt, thnAxisDaughterPt});
86-
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
87-
histos.add("SEMassRot", "SEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
88-
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
79+
const AxisSpec thnAxisCosTheta{configThnAxisCosTheta, "cos #theta"};
80+
const AxisSpec thnAxisNumPhi{configThnAxisNumPhi, "Number of phi meson"};
81+
82+
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
83+
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
8984
}
9085

9186
// get kstar
@@ -132,111 +127,68 @@ struct doublephimeson {
132127
bool selectionPID(float nsigmaTPC, float nsigmaTOF, int TOFHit, int PIDStrategy, float ptcand)
133128
{
134129
if (PIDStrategy == 0) {
135-
if (TOFHit != 1) {
136-
if (TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
137-
return true;
138-
}
139-
}
140-
if (TOFHit == 1) {
141-
if (TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
142-
return true;
143-
}
144-
}
145-
}
146-
if (PIDStrategy == 1) {
147130
if (ptcand < 0.5) {
148-
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
149-
return true;
150-
}
151-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
131+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
152132
return true;
153133
}
154134
}
155135
if (ptcand >= 0.5) {
156-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
157-
return true;
158-
}
159-
}
160-
}
161-
if (PIDStrategy == 2) {
162-
if (ptcand < 0.5) {
163-
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
164-
return true;
165-
}
166-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
167-
return true;
168-
}
169-
}
170-
if (ptcand >= 0.5 && ptcand < 1.2) {
171-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
172-
return true;
173-
}
174-
if (TOFHit != 1 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
175-
return true;
176-
}
177-
}
178-
if (ptcand >= 1.2) {
179-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
180-
return true;
136+
if (TOFHit != 1) {
137+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
138+
return true;
139+
}
181140
}
182-
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
183-
return true;
141+
if (TOFHit == 1) {
142+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
143+
return true;
144+
}
184145
}
185146
}
186147
}
187-
if (PIDStrategy == 3) {
148+
149+
if (PIDStrategy == 1) {
188150
if (ptcand < 0.5) {
189-
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
190-
return true;
191-
}
192-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
151+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
193152
return true;
194153
}
195154
}
196-
if (ptcand >= 0.5 && ptcand < 1.2) {
197-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
198-
return true;
199-
}
200-
}
201-
if (ptcand >= 1.2) {
202-
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
203-
return true;
204-
}
205-
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
206-
return true;
155+
if (ptcand >= 0.5) {
156+
if (TOFHit == 1) {
157+
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
158+
return true;
159+
}
207160
}
208161
}
209162
}
210163
return false;
211164
}
212165

213166
TLorentzVector exotic, Phid1, Phid2;
214-
TLorentzVector exoticRot, Phid1Rot;
167+
// TLorentzVector exoticRot, Phid1Rot;
168+
215169
void process(aod::RedPhiEvents::iterator const& collision, aod::PhiTracks const& phitracks)
216170
{
217171
if (additionalEvsel && (collision.numPos() < 2 || collision.numNeg() < 2)) {
218172
return;
219173
}
174+
auto phimult = phitracks.size();
220175
for (auto phitrackd1 : phitracks) {
221176
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
222177
continue;
223178
}
224-
225179
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());
226180
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
227-
228181
if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
229182
continue;
230183
}
231184
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
232185
continue;
233186
}
234-
// LOGF(info, "pass TOF hit: (%d, %d)", phitrackd1.phid1TOFHit(), phitrackd1.phid2TOFHit());
187+
auto phid1id = phitrackd1.index();
188+
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
235189
histos.fill(HIST("hnsigmaTPCKaonPlus"), phitrackd1.phid1TPC(), kaonplusd1pt);
236190
histos.fill(HIST("hnsigmaTPCKaonMinus"), phitrackd1.phid2TPC(), kaonminusd1pt);
237-
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
238-
histos.fill(HIST("hPhid1Mass"), Phid1.M(), Phid1.Pt());
239-
auto phid1id = phitrackd1.index();
191+
histos.fill(HIST("hPhiMass"), Phid1.M(), Phid1.Pt());
240192
for (auto phitrackd2 : phitracks) {
241193
auto phid2id = phitrackd2.index();
242194
if (phid2id <= phid1id) {
@@ -247,7 +199,6 @@ struct doublephimeson {
247199
}
248200
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
249201
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
250-
251202
if (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID2, kaonplusd2pt)) {
252203
continue;
253204
}
@@ -262,37 +213,11 @@ struct doublephimeson {
262213
}
263214
Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass());
264215
exotic = Phid1 + Phid2;
265-
auto cosThetaStar = getCosTheta(exotic, Phid1);
266-
auto kstar = getkstar(Phid1, Phid2);
216+
// auto cosThetaStar = getCosTheta(exotic, Phid1);
217+
// auto kstar = getkstar(Phid1, Phid2);
267218
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
268-
if (!fillDeltaMass) {
269-
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
270-
}
271-
if (fillDeltaMass) {
272-
histos.fill(HIST("SEMassUnlike"), exotic.M() - Phid1.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
273-
}
274-
histos.fill(HIST("SEMass"), Phid1.M(), Phid2.M(), Phid1.Pt(), Phid2.Pt());
275-
if (fillRotation) {
276-
for (int nrotbkg = 0; nrotbkg < 5; nrotbkg++) {
277-
auto anglestart = 5.0 * TMath::Pi() / 6.0;
278-
auto angleend = 7.0 * TMath::Pi() / 6.0;
279-
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
280-
auto rotangle = anglestart + nrotbkg * anglestep;
281-
auto rotd1px = Phid1.Px() * std::cos(rotangle) - Phid1.Py() * std::sin(rotangle);
282-
auto rotd1py = Phid1.Px() * std::sin(rotangle) + Phid1.Py() * std::cos(rotangle);
283-
Phid1Rot.SetXYZM(rotd1px, rotd1py, Phid1.Pz(), Phid1.M());
284-
exoticRot = Phid1Rot + Phid2;
285-
auto cosThetaStar_rot = getCosTheta(exoticRot, Phid1Rot);
286-
auto kstar_rot = getkstar(Phid1Rot, Phid2);
287-
auto deltaR_rot = TMath::Sqrt(TMath::Power(Phid1Rot.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1Rot.Eta() - Phid2.Eta(), 2.0));
288-
if (!fillDeltaMass) {
289-
histos.fill(HIST("SEMassRot"), exoticRot.M(), exoticRot.Pt(), kstar_rot, cosThetaStar_rot, deltaR_rot);
290-
}
291-
if (fillDeltaMass) {
292-
histos.fill(HIST("SEMassRot"), exoticRot.M() - Phid1Rot.M(), exoticRot.Pt(), kstar_rot, cosThetaStar_rot, deltaR_rot);
293-
}
294-
}
295-
}
219+
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
220+
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
296221
}
297222
}
298223
}
@@ -309,12 +234,7 @@ struct doublephimeson {
309234
if (collision1.index() == collision2.index()) {
310235
continue;
311236
}
312-
if (additionalEvsel && (collision1.numPos() < 2 || collision1.numNeg() < 2)) {
313-
continue;
314-
}
315-
if (additionalEvsel && (collision2.numPos() < 2 || collision2.numNeg() < 2)) {
316-
continue;
317-
}
237+
auto phimult = tracks1.size();
318238
for (auto& [phitrackd1, phitrackd2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
319239
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
320240
continue;
@@ -341,15 +261,9 @@ struct doublephimeson {
341261
}
342262
Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass());
343263
exotic = Phid1 + Phid2;
344-
auto cosThetaStar = getCosTheta(exotic, Phid1);
345-
auto kstar = getkstar(Phid1, Phid2);
346264
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
347-
if (!fillDeltaMass) {
348-
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
349-
}
350-
if (fillDeltaMass) {
351-
histos.fill(HIST("MEMassUnlike"), exotic.M() - Phid1.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
352-
}
265+
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
266+
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
353267
}
354268
}
355269
}

0 commit comments

Comments
 (0)