We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f9f9f2 commit 7f81952Copy full SHA for 7f81952
PWGLF/Tasks/Nuspex/antinucleiInJets.cxx
@@ -505,12 +505,23 @@ struct AntinucleiInJets {
505
{
506
auto current = particle;
507
508
+ // If already physical primary, return it
509
+ if (current.isPhysicalPrimary())
510
+ return current;
511
+
512
while (current.has_mothers()) {
513
auto motherId = current.mothersIds()[0];
514
515
+ // Stop if motherId is invalid
516
if (motherId < 0 || motherId >= mcParticles.size()) {
517
break;
518
}
519
520
+ // Move up the chain
521
current = mcParticles.iteratorAt(motherId);
522
523
524
+ break;
525
526
527
return current;
0 commit comments