Skip to content

Commit 539046d

Browse files
committed
Added qt cuts in dataProcess to reduce size of slimkinkcands table for slim derived data usage. Added fake cluster analysis for findable tracks
1 parent 9d233ed commit 539046d

File tree

1 file changed

+73
-15
lines changed

1 file changed

+73
-15
lines changed

PWGLF/TableProducer/Strangeness/sigmaminustask.cxx

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ struct sigmaminustask {
4747
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
4848
Configurable<float> cutNSigmaPi{"cutNSigmaPi", 4, "NSigmaTPCPion"};
4949
Configurable<float> cutRapMotherMC{"cutRapMotherMC", 1.0f, "Rapidity cut for mother Sigma in MC"};
50+
Configurable<float> cutMinQtAP{"cutMinQtAP", 0.15f, "Minimum Qt for Armenteros-Podolanski cut"};
51+
Configurable<float> cutMaxQtAP{"cutMaxQtAP", 0.20f, "Maximum Qt for Armenteros-Podolanski cut"};
5052

5153
Configurable<bool> fillOutputTree{"fillOutputTree", true, "If true, fill the output tree with Kink candidates"};
54+
5255
// Configurables for findable tracks (see kinkBuilder.cxx)
5356
Configurable<float> KBminPtMoth{"KBminPtMoth", 0.5, "Minimum pT of the mother"};
5457
Configurable<float> KBmaxPhiDiff{"KBmaxPhiDiff", 100, "Max phi difference between the kink daughter and the mother"};
5558
Configurable<float> KBetaMax{"KBetaMax", 1., "Max eta for both mother and daughter"};
5659
Configurable<float> KBnTPCClusMinDaug{"KBnTPCClusMinDaug", 80, "Min daug NTPC clusters"};
5760
Configurable<float> KBradiusCut{"KBradiusCut", 19.6213f, "Min reconstructed decay radius of the mother"};
61+
Configurable<float> KBdcaMothPv{"KBdcaMothPv", 0.1f, "Max DCA of the mother to PV"};
62+
Configurable<float> KBdcaDaugPv{"KBdcaDaugPv", 0.1f, "Max DCA of the daughter to PV"};
5863

5964
Preslice<aod::KinkCands> mPerCol = aod::track::collisionId;
6065

@@ -81,6 +86,7 @@ struct sigmaminustask {
8186

8287
const AxisSpec boolAxis{2, -0.5, 1.5, "Boolean value"};
8388
const AxisSpec filtersAxis{10, -0.5, 9.5, "Filter index"};
89+
const AxisSpec fakeITSAxis{9, -2.5, 6.5, "Fake ITS cluster layer"};
8490

8591
// Event selection
8692
rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}});
@@ -114,6 +120,7 @@ struct sigmaminustask {
114120
std::vector<std::string> filterLabels = {"Initial", "ITS/TPC present", "Moth ITS", "Moth p_{T}", "Daug ITS+TPC", "#eta", "#Delta#phi", "Radius", "Collision", "Daug TOF"};
115121

116122
// Add findable Sigma histograms
123+
rFindable.add("hfakeITSfindable", "hfakeITSfindable", {HistType::kTH1F, {fakeITSAxis}});
117124
rFindable.add("hFilterIndex", "hFilterIndex", {HistType::kTH1F, {filtersAxis}});
118125
rFindable.add("h2MCRadiusFilterIndex", "h2MCRadiusFilterIndex", {HistType::kTH2F, {filtersAxis, radiusAxis}});
119126
rFindable.add("h2RecRadiusFilterIndex", "h2RecRadiusFilterIndex", {HistType::kTH2F, {filtersAxis, radiusAxis}});
@@ -134,9 +141,30 @@ struct sigmaminustask {
134141
rFindable.add("h2PtFilter_plus_protonkink", "h2PtFilter_plus_protonkink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
135142
rFindable.add("h2PtFilter_plus_pikink", "h2PtFilter_plus_pikink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
136143
rFindable.add("h2PtFilter_minus_pikink", "h2PtFilter_minus_pikink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
144+
145+
rFindable.add("h2PtDaugFilter_plus_protonkink", "h2PtDaugFilter_plus_protonkink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
146+
rFindable.add("h2PtDaugFilter_plus_pikink", "h2PtDaugFilter_plus_pikink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
147+
rFindable.add("h2PtDaugFilter_minus_pikink", "h2PtDaugFilter_minus_pikink", {HistType::kTH2F, {filtersAxis, ptUnsignedAxis}});
148+
137149
}
138150
}
139151

152+
float alphaAP(const std::array<float, 3>& momMother, const std::array<float, 3>& momKink)
153+
{
154+
std::array<float, 3> momMissing = {momMother[0] - momKink[0], momMother[1] - momKink[1], momMother[2] - momKink[2]};
155+
float lQlP = std::inner_product(momMother.begin(), momMother.end(), momKink.begin(), 0.f);
156+
float lQlN = std::inner_product(momMother.begin(), momMother.end(), momMissing.begin(), 0.f);
157+
return (lQlP - lQlN) / (lQlP + lQlN);
158+
}
159+
160+
float qtAP(const std::array<float, 3>& momMother, const std::array<float, 3>& momKink)
161+
{
162+
float dp = std::inner_product(momMother.begin(), momMother.end(), momKink.begin(), 0.f);
163+
float p2V0 = std::inner_product(momMother.begin(), momMother.end(), momMother.begin(), 0.f);
164+
float p2A = std::inner_product(momKink.begin(), momKink.end(), momKink.begin(), 0.f);
165+
return std::sqrt(p2A - dp * dp / p2V0);
166+
}
167+
140168
void processData(CollisionsFull::iterator const& collision, aod::KinkCands const& KinkCands, TracksFull const&)
141169
{
142170
if (std::abs(collision.posZ()) > cutzvertex || !collision.sel8()) {
@@ -151,6 +179,11 @@ struct sigmaminustask {
151179
continue;
152180
}
153181

182+
float qt = qtAP(std::array{kinkCand.pxMoth(), kinkCand.pyMoth(), kinkCand.pzMoth()}, std::array{kinkCand.pxDaug(), kinkCand.pyDaug(), kinkCand.pzDaug()});
183+
if (qt < cutMinQtAP || qt > cutMaxQtAP) {
184+
continue;
185+
}
186+
154187
rSigmaMinus.fill(HIST("h2MassSigmaMinusPt"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus());
155188
rSigmaMinus.fill(HIST("h2SigmaMassVsXiMass"), kinkCand.mXiMinus(), kinkCand.mSigmaMinus());
156189
rSigmaMinus.fill(HIST("h2NSigmaPiPt"), kinkCand.mothSign() * kinkCand.ptMoth(), dauTrack.tpcNSigmaPi());
@@ -316,29 +349,34 @@ struct sigmaminustask {
316349

317350
PROCESS_SWITCH(sigmaminustask, processMC, "MC processing", false);
318351

319-
void fillFindableHistograms(int filterIndex, float mcRadius, float recRadius, float pt, bool isSigmaMinus, bool isPiDaughter) {
352+
void fillFindableHistograms(int filterIndex, float mcRadius, float recRadius, float ptMoth, float ptDaug, bool isSigmaMinus, bool isPiDaughter)
353+
{
320354
rFindable.fill(HIST("hFilterIndex"), filterIndex);
321355
rFindable.fill(HIST("h2MCRadiusFilterIndex"), filterIndex, mcRadius);
322356
rFindable.fill(HIST("h2RecRadiusFilterIndex"), filterIndex, recRadius);
323357

324358
if (isPiDaughter) {
325359
if (isSigmaMinus) {
326360
rFindable.fill(HIST("h2MCRadiusFilter_minus_pikink"), filterIndex, mcRadius);
327-
rFindable.fill(HIST("h2PtFilter_minus_pikink"), filterIndex, pt);
361+
rFindable.fill(HIST("h2PtFilter_minus_pikink"), filterIndex, ptMoth);
362+
rFindable.fill(HIST("h2PtDaugFilter_minus_pikink"), filterIndex, ptDaug);
328363
} else {
329364
rFindable.fill(HIST("h2MCRadiusFilter_plus_pikink"), filterIndex, mcRadius);
330-
rFindable.fill(HIST("h2PtFilter_plus_pikink"), filterIndex, pt);
365+
rFindable.fill(HIST("h2PtFilter_plus_pikink"), filterIndex, ptMoth);
366+
rFindable.fill(HIST("h2PtDaugFilter_plus_pikink"), filterIndex, ptDaug);
331367
}
332368
} else {
333369
if (!isSigmaMinus) {
334370
rFindable.fill(HIST("h2MCRadiusFilter_plus_protonkink"), filterIndex, mcRadius);
335-
rFindable.fill(HIST("h2PtFilter_plus_protonkink"), filterIndex, pt);
371+
rFindable.fill(HIST("h2PtFilter_plus_protonkink"), filterIndex, ptMoth);
372+
rFindable.fill(HIST("h2PtDaugFilter_plus_protonkink"), filterIndex, ptDaug);
336373
}
337374
}
338375
}
339376

340377
void processFindable(aod::KinkCands const& kinkCands, aod::McTrackLabels const& trackLabelsMC,
341-
TracksFull const& tracks, aod::McParticles const&, CollisionsFullMC const&){
378+
TracksFull const& tracks, aod::McParticles const&, CollisionsFullMC const&)
379+
{
342380
// A - generated findable track pairs map: mcMother.globalIndex() -> (motherTrack.globalIndex(), daughterTrack.globalIndex())
343381
std::unordered_map<int64_t, std::pair<int64_t, int64_t>> allCandsIndices;
344382

@@ -434,15 +472,28 @@ struct sigmaminustask {
434472
float recPtDaughter = daughterTrack.pt();
435473
float recPtMother = motherTrack.pt();
436474

475+
// Check for detector mismatches in ITS mother tracks
476+
auto mask_value = mcLabMoth.mcMask();
477+
int mismatchITS_index = -1;
478+
479+
for (int i = 0; i < 7; ++i) { // ITS has layers 0-6, bit ON means mismatch
480+
if ((mask_value & (1 << i)) != 0) {
481+
mismatchITS_index = i;
482+
break;
483+
}
484+
}
485+
437486
// Define filter index and progressively apply kinkbuilder cuts to track pairs
438487
int filterIndex = 0;
439-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
488+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
440489

441490
// 1 - tracks with right ITS, TPC, TOF signals
442491
if (motherTrack.has_collision() && motherTrack.hasITS() && !motherTrack.hasTPC() && !motherTrack.hasTOF() &&
443492
daughterTrack.hasITS() && daughterTrack.hasTPC()) {
444493
filterIndex += 1;
445-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
494+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
495+
rFindable.fill(HIST("hfakeITSfindable"), mismatchITS_index);
496+
446497
} else {
447498
continue;
448499
}
@@ -451,14 +502,14 @@ struct sigmaminustask {
451502
if (motherTrack.itsNCls() < 6 &&
452503
motherTrack.itsNClsInnerBarrel() == 3 && motherTrack.itsChi2NCl() < 36) {
453504
filterIndex += 1;
454-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
505+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
455506
} else {
456507
continue;
457508
}
458509

459510
if (motherTrack.pt() > KBminPtMoth) {
460511
filterIndex += 1;
461-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
512+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
462513
} else {
463514
continue;
464515
}
@@ -467,31 +518,31 @@ struct sigmaminustask {
467518
if (daughterTrack.itsNClsInnerBarrel() == 0 && daughterTrack.itsNCls() < 4 &&
468519
daughterTrack.tpcNClsCrossedRows() > 0.8 * daughterTrack.tpcNClsFindable() && daughterTrack.tpcNClsFound() > KBnTPCClusMinDaug) {
469520
filterIndex += 1;
470-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
521+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
471522
} else {
472523
continue;
473524
}
474525

475526
// 5 - geometric cuts: eta
476527
if (std::abs(motherTrack.eta()) < KBetaMax && std::abs(daughterTrack.eta()) < KBetaMax) {
477528
filterIndex += 1;
478-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
529+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
479530
} else {
480531
continue;
481532
}
482533

483534
// 6 - geometric cuts: phi difference
484535
if (std::abs(motherTrack.phi() - daughterTrack.phi()) * radToDeg < KBmaxPhiDiff) {
485536
filterIndex += 1;
486-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
537+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
487538
} else {
488539
continue;
489540
}
490541

491542
// 7 - radius cut
492543
if (recRadius > KBradiusCut) {
493544
filterIndex += 1;
494-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
545+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
495546
} else {
496547
continue;
497548
}
@@ -500,15 +551,15 @@ struct sigmaminustask {
500551
auto collision = motherTrack.template collision_as<CollisionsFullMC>();
501552
if (!(std::abs(collision.posZ()) > cutzvertex || !collision.sel8())) {
502553
filterIndex += 1;
503-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
554+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
504555
} else {
505556
continue;
506557
}
507558

508559
// 9 - TOF daughter presence
509560
if (daughterTrack.hasTOF()) {
510561
filterIndex += 1;
511-
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, isSigmaMinus, isPiDaughter);
562+
fillFindableHistograms(filterIndex, mcRadius, recRadius, recPtMother, recPtDaughter, isSigmaMinus, isPiDaughter);
512563
}
513564
}
514565
}
@@ -521,3 +572,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
521572
return WorkflowSpec{
522573
adaptAnalysisTask<sigmaminustask>(cfgc)};
523574
}
575+
576+
// TO DO:
577+
// 2) Histogram of fake its tracks of mothers among findable not found candidates
578+
// 2.1) -1 index for not fake, 0,1,2,3 etc. for fake ITS tracks, with index as layer of fake cluster
579+
// 3) Add DCA mother and daughter to PV using track propagation from hyperhelium or hypertriton tasks
580+
// 3.1) Do it for each findable, add cuts on DCA to the filterIndex histos to understand what's the most effective cut
581+
// 4) Open PR

0 commit comments

Comments
 (0)