Skip to content

Commit 38ef137

Browse files
authored
[PWGLF] Add new process function to analyze pair table and modify PID selection (#17157)
1 parent fd04b9c commit 38ef137

2 files changed

Lines changed: 94 additions & 14 deletions

File tree

PWGLF/TableProducer/Resonances/doublephitable.cxx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ struct doublephitable {
202202
template <typename T>
203203
bool selectionTrack(const T& candidate)
204204
{
205-
if (useGlobalTrack && !(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsCrossedRows() > cfgTPCcluster)) {
205+
// if (useGlobalTrack && !(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsCrossedRows() > cfgTPCcluster)) {
206+
if (useGlobalTrack && !(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.tpcNClsCrossedRows() > cfgTPCcluster)) {
206207
return false;
207208
}
208209
return true;
@@ -272,7 +273,7 @@ struct doublephitable {
272273
if (!selectionPID(track1)) {
273274
continue;
274275
}
275-
if (!(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) > -2.0 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) < 3.0)) {
276+
if (!(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) > -3.0 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) < 3.0)) {
276277
continue;
277278
}
278279
Npostrack = Npostrack + 1;
@@ -294,7 +295,7 @@ struct doublephitable {
294295
if (!selectionPID(track2)) {
295296
continue;
296297
}
297-
if (!(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) > -2.0 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) < 3.0)) {
298+
if (!(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) > -3.0 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) < 3.0)) {
298299
continue;
299300
}
300301
if (Npostrack == 1) {
@@ -442,7 +443,7 @@ struct doublephitable {
442443
bool selectionITSKaon(const T& candidate, float& nSigmaITS)
443444
{
444445
nSigmaITS = o2::aod::ITSResponse::nSigmaITS<o2::track::PID::Kaon>(candidate);
445-
if (!(nSigmaITS > -2.0f && nSigmaITS < 3.0f)) {
446+
if (!(nSigmaITS > -3.0f && nSigmaITS < 3.0f)) {
446447
return false;
447448
}
448449

@@ -642,12 +643,6 @@ struct doublephitable {
642643
}
643644
}
644645

645-
const int nPosTrack = static_cast<int>(selectedPos.size());
646-
const int nNegTrack = static_cast<int>(selectedNeg.size());
647-
if (nPosTrack < 2 || nNegTrack < 2) {
648-
return;
649-
}
650-
651646
std::vector<PhiCandidateVtx> phiCandidates;
652647
phiCandidates.reserve(selectedPos.size() * selectedNeg.size());
653648
for (size_t iPos = 0; iPos < selectedPos.size(); ++iPos) {
@@ -657,7 +652,7 @@ struct doublephitable {
657652
ROOT::Math::PxPyPzMVector kaonPlus(trackPlus.px(), trackPlus.py(), trackPlus.pz(), massKa);
658653
ROOT::Math::PxPyPzMVector kaonMinus(trackMinus.px(), trackMinus.py(), trackMinus.pz(), massKa);
659654
const auto phi = kaonPlus + kaonMinus;
660-
if (phi.M() <= minPhiMass || phi.M() >= maxPhiMass) {
655+
if (phi.M() < minPhiMass || phi.M() > maxPhiMass) {
661656
continue;
662657
}
663658

@@ -669,7 +664,11 @@ struct doublephitable {
669664
if (phiCandidates.size() < 2) {
670665
return;
671666
}
672-
667+
const int nPosTrack = static_cast<int>(selectedPos.size());
668+
const int nNegTrack = static_cast<int>(selectedNeg.size());
669+
if (nPosTrack < 2 || nNegTrack < 2) {
670+
return;
671+
}
673672
const auto primaryVertex = getPrimaryVertex(collision);
674673
const auto covPV = primaryVertex.getCov();
675674
std::vector<PhiPhiPairPayload> acceptedPairs;
@@ -682,6 +681,7 @@ struct doublephitable {
682681
const int64_t id3 = phi2.kPlus.globalIndex();
683682
const int64_t id4 = phi2.kMinus.globalIndex();
684683
if (id1 == id2 || id1 == id3 || id1 == id4 || id2 == id3 || id2 == id4 || id3 == id4) {
684+
// LOGF(info, "same track: %d %d %d %d", id1, id2, id3, id4);
685685
continue;
686686
}
687687
auto trackPar1 = getTrackParCov(phi1.kPlus);
@@ -700,6 +700,7 @@ struct doublephitable {
700700
}
701701

702702
if (nFitCandidates == 0) {
703+
// LOG(info) << "Four-kaon DCAFitterN failed with an unknown exception";
703704
continue;
704705
}
705706

PWGLF/Tasks/Resonances/doublephimeson.cxx

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct doublephimeson {
146146

147147
// THnsparse bining
148148
ConfigurableAxis configThnAxisPtCorr{"configThnAxisPtCorr", {1000, 0.0, 100}, "#it{M} (GeV/#it{c}^{2})"};
149-
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {300, 2.4, 3.0}, "#it{M} (GeV/#it{c}^{2})"};
149+
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {400, 2.5, 2.9}, "#it{M} (GeV/#it{c}^{2})"};
150150
ConfigurableAxis configThnAxisInvMassPhi{"configThnAxisInvMassPhi", {20, 1.01, 1.03}, "#it{M} (GeV/#it{c}^{2})"};
151151
ConfigurableAxis configThnAxisInvMassDeltaPhi{"configThnAxisInvMassDeltaPhi", {80, 0.0, 0.08}, "#it{M} (GeV/#it{c}^{2})"};
152152
ConfigurableAxis configThnAxisInvMassDeltaPhiSigma{"configThnAxisInvMassDeltaPhiSigma", {100, 0.0, 10}, "#it{M} (GeV/#it{c}^{2}) sigma"};
@@ -163,7 +163,10 @@ struct doublephimeson {
163163
ConfigurableAxis configThnAxisDeltaRPhi{"configThnAxisDeltaRPhi", {120, 0.0, 6.0}, "ΔR(φ,φ)"};
164164
ConfigurableAxis configThnAxisZ{"configThnAxisZ", {100, 0.0, 1.0}, "z"};
165165
ConfigurableAxis configThnAxisA{"configThnAxisA", {100, 0.0, 1.0}, "A"};
166-
166+
ConfigurableAxis configThnAxisPhiPtVertex{"configThnAxisPhiPtVertex", {100, 0.0, 100.0}, "phi pT (GeV/c)"};
167+
ConfigurableAxis configThnAxisDecayLength{"configThnAxisDecayLength", {200, 0.0, 1.0}, "3D decay length (cm)"};
168+
ConfigurableAxis configThnAxisFitChi2Ndf{"configThnAxisFitChi2Ndf", {200, 0.0, 100.0}, "four-kaon fit chi2/NDF"};
169+
ConfigurableAxis configThnAxisRmsDcaSig{"configThnAxisRmsDcaSig", {300, 0.0, 15.0}, "RMS DCA significance"};
167170
// Initialize the ananlysis task
168171
void init(o2::framework::InitContext&)
169172
{
@@ -198,6 +201,11 @@ struct doublephimeson {
198201
const AxisSpec thnAxisDeltaRPhi{configThnAxisDeltaRPhi, "#Delta R(#phi,#phi)"};
199202
const AxisSpec thnAxisZ{configThnAxisZ, "z = p_{T1}/(p_{T1}+p_{T2})"};
200203
const AxisSpec thnAxisA{configThnAxisA, "A = |p_{T1}-p_{T2}|/(p_{T1}+p_{T2})"};
204+
205+
const AxisSpec thnAxisDecayLength{configThnAxisDecayLength, "#it{L}_{3D} (cm)"};
206+
const AxisSpec thnAxisFitChi2Ndf{configThnAxisFitChi2Ndf, "#chi^{2}/NDF"};
207+
const AxisSpec thnAxisRmsDcaSig{configThnAxisRmsDcaSig, "RMS DCA significance"};
208+
201209
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisDeltaR, thnAxisPt, thnAxisDeltaR, thnAxisInvMassDeltaPhi, thnAxisPtCorr});
202210
// histos.add("SEMassLike", "SEMassLike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
203211
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisDeltaR, thnAxisPt, thnAxisDeltaR, thnAxisInvMassDeltaPhi, thnAxisPtCorr});
@@ -226,6 +234,8 @@ struct doublephimeson {
226234
thnAxisInvMassDeltaPhi, // DeltaM_phi
227235
thnAxisPtCorr,
228236
thnAxisNumPhi}); // pT correlation variable
237+
238+
histos.add("SEMassUnlike_VertexVars", "SEMassUnlike_VertexVars", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisInvMassDeltaPhi, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisDecayLength, thnAxisFitChi2Ndf, thnAxisRmsDcaSig});
229239
}
230240

231241
// get kstar
@@ -343,6 +353,23 @@ struct doublephimeson {
343353
}
344354
}
345355

356+
if (PIDStrategy == 1004) {
357+
if (ptcand < 0.5 && TOFHit != 1 && nsigmaTPC > -3.0 && nsigmaTPC < 3.0) {
358+
return true;
359+
}
360+
if (ptcand < 0.5 && TOFHit == 1 && std::sqrt(nsigmaTOF * nsigmaTOF + nsigmaTPC * nsigmaTPC) < 2.5) {
361+
return true;
362+
}
363+
if (ptcand >= 0.5) {
364+
if (TOFHit != 1 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
365+
return true;
366+
}
367+
if (TOFHit == 1 && std::sqrt(nsigmaTOF * nsigmaTOF + nsigmaTPC * nsigmaTPC) < 2.5) {
368+
return true;
369+
}
370+
}
371+
}
372+
346373
if (PIDStrategy == 1008) {
347374
if (ptcand < 0.5 && TOFHit != 1 && nsigmaTPC > -2.0 && nsigmaTPC < 2.0) {
348375
return true;
@@ -1798,6 +1825,58 @@ struct doublephimeson {
17981825
}
17991826
PROCESS_SWITCH(doublephimeson, processopti5, "Process Optimized same event with all variables", true);
18001827

1828+
void processPairOpti6(aod::PhiPhiPairs const& pairs)
1829+
{
1830+
constexpr double mPhiPDG = o2::constants::physics::MassPhi;
1831+
constexpr double mKPDG = o2::constants::physics::MassKPlus;
1832+
1833+
for (auto const& pair : pairs) {
1834+
if (pair.k1Index() == pair.k2Index() || pair.k1Index() == pair.k3Index() || pair.k1Index() == pair.k4Index() || pair.k2Index() == pair.k3Index() || pair.k2Index() == pair.k4Index() || pair.k3Index() == pair.k4Index()) {
1835+
continue;
1836+
}
1837+
if (std::abs(pair.k1DcaXY()) >= 0.02f || std::abs(pair.k1DcaZ()) >= 0.02f || std::abs(pair.k2DcaXY()) >= 0.02f || std::abs(pair.k2DcaZ()) >= 0.02f || std::abs(pair.k3DcaXY()) >= 0.02f || std::abs(pair.k3DcaZ()) >= 0.02f || std::abs(pair.k4DcaXY()) >= 0.02f || std::abs(pair.k4DcaZ()) >= 0.02f) {
1838+
continue;
1839+
}
1840+
const double pairPt = std::hypot(pair.pairPx(), pair.pairPy());
1841+
if (pairPt <= minExoticPt || pair.pairMass() < minExoticMass || pair.pairMass() > maxExoticMass) {
1842+
continue;
1843+
}
1844+
1845+
const double pt1 = std::hypot(pair.phi1Px(), pair.phi1Py());
1846+
const double pt2 = std::hypot(pair.phi2Px(), pair.phi2Py());
1847+
if (pt1 < minPhiPt || pt1 > maxPhiPt || pt2 < minPhiPt || pt2 > maxPhiPt) {
1848+
continue;
1849+
}
1850+
1851+
const ROOT::Math::PxPyPzMVector k1(pair.k1Px(), pair.k1Py(), pair.k1Pz(), mKPDG);
1852+
const ROOT::Math::PxPyPzMVector k2(pair.k2Px(), pair.k2Py(), pair.k2Pz(), mKPDG);
1853+
const ROOT::Math::PxPyPzMVector k3(pair.k3Px(), pair.k3Py(), pair.k3Pz(), mKPDG);
1854+
const ROOT::Math::PxPyPzMVector k4(pair.k4Px(), pair.k4Py(), pair.k4Pz(), mKPDG);
1855+
1856+
const double mCross14 = (k1 + k4).M();
1857+
const double mCross32 = (k3 + k2).M();
1858+
if ((mCross14 > cfgCrossPhiLow && mCross14 < cfgCrossPhiHigh) || (mCross32 > cfgCrossPhiLow && mCross32 < cfgCrossPhiHigh)) {
1859+
continue;
1860+
}
1861+
1862+
double deltaM = std::hypot(pair.phi1Mass() - mPhiPDG, pair.phi2Mass() - mPhiPDG);
1863+
if (useParametrized) {
1864+
deltaM = getDeltaMPhi(pair.phi1Mass(), pt1, pair.phi2Mass(), pt2);
1865+
}
1866+
1867+
const double decayLength = pair.vertexL3DSig();
1868+
const double fitChi2Ndf = pair.fitChi2Ndf();
1869+
const double rmsDcaSig = pair.rmsDcaSig();
1870+
1871+
if (!std::isfinite(pair.pairMass()) || !std::isfinite(deltaM) || !std::isfinite(pt1) || !std::isfinite(pt2) || !std::isfinite(decayLength) || !std::isfinite(fitChi2Ndf) || !std::isfinite(rmsDcaSig)) {
1872+
continue;
1873+
}
1874+
1875+
histos.fill(HIST("SEMassUnlike_VertexVars"), pair.pairMass(), pairPt, deltaM, pair.phi1Mass(), pair.phi2Mass(), decayLength, fitChi2Ndf, rmsDcaSig);
1876+
}
1877+
}
1878+
PROCESS_SWITCH(doublephimeson, processPairOpti6, "Process fitted phi-phi pairs with vertex variables", false);
1879+
18011880
SliceCache cache;
18021881
using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::collision::NumContrib>;
18031882

0 commit comments

Comments
 (0)