Skip to content

Commit 13767c9

Browse files
DanielSamitzsawenzel
authored andcommitted
fixed mother/daughter tracks when joining lists of particles
1 parent d2d6447 commit 13767c9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

MC/config/PWGDQ/external/generator/GeneratorCocktail.C

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ class GeneratorCocktail_class : public Generator
3030
bool importParticles() override
3131
{
3232
for (auto& g : *mEntries) {
33+
int nPart = mParticles.size();
3334
g->importParticles();
34-
for (auto& p : g->getParticles())
35+
for (auto p : g->getParticles()) {
36+
if (p.GetFirstMother() > -1)
37+
p.SetFirstMother(p.GetFirstMother() + nPart);
38+
if (p.GetSecondMother() > -1)
39+
p.SetLastMother(p.GetSecondMother() + nPart);
40+
if (p.GetFirstDaughter() > -1)
41+
p.SetFirstDaughter(p.GetFirstDaughter() + nPart);
42+
if (p.GetLastDaughter() > -1)
43+
p.SetLastDaughter(p.GetLastDaughter() + nPart);
3544
mParticles.push_back(p);
45+
}
3646
g->clearParticles();
3747
}
3848
return true;

0 commit comments

Comments
 (0)