Skip to content

Commit 472a37f

Browse files
committed
Keep track of resonance intermediate state in coalescence
1 parent 061b420 commit 472a37f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

MC/config/PWGHF/external/generator/generator_pythia8_embed_charmnuclei.C

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ class GeneratorPythia8HFEmbedCharmNuclei : public o2::eventgen::GeneratorPythia8
170170
mPythiaGun.moreDecays();
171171
std::array<int, 2> dausToCoal = {-1, -1};
172172
std::vector<int> pdgShortLivedResos = {313, 2224, 102134};
173-
bool isResoFound{false};
173+
std::map<int, int> statusResoDecay = {{313, 95}, {2224, 96}, {102134, 97}}; // do not use 94, it is used by default for no resonances
174+
int whichReso{0};
174175
int idxCharmNucleus{-1};
175176
for (int iPart{0}; iPart<mPythiaGun.event.size(); ++iPart) {
176177
auto part = mPythiaGun.event[iPart];
@@ -180,17 +181,18 @@ class GeneratorPythia8HFEmbedCharmNuclei : public o2::eventgen::GeneratorPythia8
180181
}
181182
auto mother = part.mother1();
182183
// if we find a resonance, we remove it, otherwise we prevent the coalescence of daughters from resonances and daughters from charmed nucleus directly
183-
if (std::find(pdgShortLivedResos.begin(), pdgShortLivedResos.end(), absPdg) != pdgShortLivedResos.end() && mother >= idxCharmNucleus) {
184+
auto resoIt = std::find(pdgShortLivedResos.begin(), pdgShortLivedResos.end(), absPdg);
185+
if (resoIt != pdgShortLivedResos.end() && mother >= idxCharmNucleus) {
184186
// we need to change the indices of the daughter particles to point to the charmed nucleus
185187
auto dauList = part.daughterList();
186188
for (auto const& dau : dauList) {
187189
mPythiaGun.event[dau].mother1(idxCharmNucleus);
188190
}
189191
mPythiaGun.event.remove(iPart, iPart, true);
190-
isResoFound=true;
192+
whichReso=*resoIt;
191193
}
192194
}
193-
if (isResoFound) { // we have to reset all the particles as daughters of the charm nucleus
195+
if (whichReso > 0) { // we have to reset all the particles as daughters of the charm nucleus
194196
std::vector<int> idxDausCharmNucleus{};
195197
for (int iPart{0}; iPart<mPythiaGun.event.size(); ++iPart) {
196198
auto mother = mPythiaGun.event[iPart].mother1();
@@ -242,6 +244,9 @@ class GeneratorPythia8HFEmbedCharmNuclei : public o2::eventgen::GeneratorPythia8
242244

243245
// we try the coalescence here, if successful we copy particles in the pythia event and we move to the next charm nucleus
244246
isCoalSuccess = CoalescencePythia8(mPythiaGun.event, std::vector<unsigned int>{1000010020}, mTrivialCoal, mCoalMomentum, dausToCoal[0], dausToCoal[1], 10.);
247+
if (whichReso > 0) {
248+
mPythiaGun.event[idxCharmNucleus].status(statusResoDecay[whichReso]);
249+
}
245250
if (isCoalSuccess) {
246251
restoreEnergyConservation(mPythiaGun.event, idxCharmNucleus);
247252
int offset = mPythia.event.size(); // we need to rescale the indices of mothers and daughters, accounting for the particles that are already appended to the event

0 commit comments

Comments
 (0)