Skip to content

Commit c16afd7

Browse files
DanielSamitzsawenzel
authored andcommitted
updated importParticles() and added getter for mEntries
1 parent 13767c9 commit c16afd7

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ class GeneratorCocktail_class : public Generator
3333
int nPart = mParticles.size();
3434
g->importParticles();
3535
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);
4436
mParticles.push_back(p);
37+
auto& pEdit = mParticles.back();
38+
if (pEdit.GetFirstMother() > -1)
39+
pEdit.SetFirstMother(pEdit.GetFirstMother() + nPart);
40+
if (pEdit.GetSecondMother() > -1)
41+
pEdit.SetLastMother(pEdit.GetSecondMother() + nPart);
42+
if (pEdit.GetFirstDaughter() > -1)
43+
pEdit.SetFirstDaughter(pEdit.GetFirstDaughter() + nPart);
44+
if (pEdit.GetLastDaughter() > -1)
45+
pEdit.SetLastDaughter(pEdit.GetLastDaughter() + nPart);
4546
}
4647
g->clearParticles();
4748
}
@@ -55,6 +56,11 @@ class GeneratorCocktail_class : public Generator
5556
return;
5657
};
5758

59+
std::vector<Generator*>* getGenerators()
60+
{
61+
return mEntries;
62+
};
63+
5864
private:
5965
///
6066
std::vector<Generator*>* mEntries = new std::vector<Generator*>(); // vector of Generator

0 commit comments

Comments
 (0)