#include <TROOT.h>
#include "AliLog.h"
+#include "AliStack.h"
#include "AliVEvent.h"
#include "AliMCEvent.h"
#include "AliRsnEvent.h"
for (i0 = 0; i0 < nTracks[0]; i0++)
{
+ // skip not physical primaries
+ if (!ev0->GetRefMC()->Stack()->IsPhysicalPrimary(i0)) continue;
+
// assign first track
ev0->SetDaughterMC(daughter0, i0);
// if looking same event, skip the case when the two indexes are equal
if (ev0 == ev1 && i0 == i1) continue;
+ // skip not physical primaries
+ if (!ev1->GetRefMC()->Stack()->IsPhysicalPrimary(i1)) continue;
+
// assign second track
ev1->SetDaughterMC(daughter1, i1);