Skip to content

Commit 5cfa046

Browse files
committed
Added processFindable function to determine generated particles that are findable by the kinkbuilder
1 parent 88109a0 commit 5cfa046

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

PWGLF/TableProducer/Strangeness/sigmaminustask.cxx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ struct sigmaminustask {
8989
rSigmaMinus.add("h2BCId_comp1", "(BC == McBC) vs (BC == EvSelBC)", {HistType::kTH2F, {boolAxis, boolAxis}});
9090
rSigmaMinus.add("h2BCId_comp2", "(McBC == EvSelBC) vs (BC == EvSelBC)", {HistType::kTH2F, {boolAxis, boolAxis}});
9191
}
92+
93+
if (doprocessFindable) {
94+
// Add findable Sigma histograms
95+
rSigmaMinus.add("h2MassPtFindable", "h2MassPtFindable", {HistType::kTH2F, {ptAxis, sigmaMassAxis}});
96+
}
9297
}
9398

9499
void processData(CollisionsFull::iterator const& collision, aod::KinkCands const& KinkCands, TracksFull const&)
@@ -263,6 +268,65 @@ struct sigmaminustask {
263268
}
264269

265270
PROCESS_SWITCH(sigmaminustask, processMC, "MC processing", false);
271+
272+
void processFindable(TracksFull const& tracks, aod::McTrackLabels const& trackLabelsMC, aod::McParticles const&)
273+
{
274+
for (const auto& motherTrack : tracks) {
275+
276+
// Filter: ITS but no TPC (mother candidates)
277+
if (!motherTrack.hasITS() || motherTrack.hasTPC()) {
278+
continue;
279+
}
280+
281+
// Check if mother is Sigma in MC
282+
auto mcLabelMother = trackLabelsMC.rawIteratorAt(motherTrack.globalIndex());
283+
if (!mcLabelMother.has_mcParticle()) {
284+
continue;
285+
}
286+
auto mcMother = mcLabelMother.mcParticle_as<aod::McParticles>();
287+
if (std::abs(mcMother.pdgCode()) != 3112 && std::abs(mcMother.pdgCode()) != 3222) {
288+
continue;
289+
}
290+
291+
for (const auto& daughterTrack : tracks) {
292+
// Filter: ITS and TPC (daughter candidates)
293+
if (!daughterTrack.hasITS() || !daughterTrack.hasTPC()) {
294+
continue;
295+
}
296+
297+
auto mcLabelDaughter = trackLabelsMC.rawIteratorAt(daughterTrack.globalIndex());
298+
if (!mcLabelDaughter.has_mcParticle()) {
299+
continue;
300+
}
301+
302+
// Check if daughter is pi/proton
303+
auto mcDaughter = mcLabelDaughter.mcParticle_as<aod::McParticles>();
304+
if (std::abs(mcDaughter.pdgCode()) != 211 && std::abs(mcDaughter.pdgCode()) != 2212) {
305+
continue;
306+
}
307+
308+
// Verify the MC mother-daughter relationship
309+
bool isValidPair = false;
310+
if (mcDaughter.has_mothers()) {
311+
for (const auto& mother : mcDaughter.mothers_as<aod::McParticles>()) {
312+
if (mother.globalIndex() == mcMother.globalIndex()) {
313+
isValidPair = true;
314+
break;
315+
}
316+
}
317+
}
318+
319+
if (isValidPair) {
320+
// All requirements satisfied: fill histogram
321+
float mcMass = std::sqrt(mcMother.e() * mcMother.e() - mcMother.p() * mcMother.p());
322+
int sigmaSign = mcMother.pdgCode() > 0 ? 1 : -1;
323+
rSigmaMinus.fill(HIST("h2MassPtFindable"), sigmaSign * mcMother.pt(), mcMass);
324+
}
325+
}
326+
}
327+
}
328+
329+
PROCESS_SWITCH(sigmaminustask, processFindable, "Findable Sigma processing", false);
266330
};
267331

268332
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)