Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Generators/src/GeneratorHybrid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ bool GeneratorHybrid::importParticles()
mMCEventHeader.clearInfo();
if (mCocktailMode) {
// in cocktail mode we need to merge the particles from the different generators
bool baseGen = true; // first generator of the cocktail is used as reference to update the event header information
for (auto subIndex : subGenIndex) {
LOG(info) << "Importing particles for task " << subIndex;
auto subParticles = gens[subIndex]->getParticles();
Expand All @@ -441,8 +442,10 @@ bool GeneratorHybrid::importParticles()
}

mParticles.insert(mParticles.end(), subParticles.begin(), subParticles.end());
// fetch the event Header information from the underlying generator
gens[subIndex]->updateHeader(&mMCEventHeader);
if (baseGen) {
gens[subIndex]->updateHeader(&mMCEventHeader);
baseGen = false;
}
mInputTaskQueue.push(subIndex);
mTasksStarted++;
}
Expand Down Expand Up @@ -481,7 +484,9 @@ bool GeneratorHybrid::importParticles()
void GeneratorHybrid::updateHeader(o2::dataformats::MCEventHeader* eventHeader)
{
if (eventHeader) {
// we forward the original header information if any
// Forward the base class fields from FairMCEventHeader
static_cast<FairMCEventHeader&>(*eventHeader) = static_cast<FairMCEventHeader&>(mMCEventHeader);
// Copy the key-value store info
eventHeader->copyInfoFrom(mMCEventHeader);

// put additional information about
Expand Down