@@ -420,6 +420,7 @@ bool GeneratorHybrid::importParticles()
420420 mMCEventHeader .clearInfo ();
421421 if (mCocktailMode ) {
422422 // in cocktail mode we need to merge the particles from the different generators
423+ bool baseGen = true ; // first generator of the cocktail is used as reference to update the event header information
423424 for (auto subIndex : subGenIndex) {
424425 LOG (info) << " Importing particles for task " << subIndex;
425426 auto subParticles = gens[subIndex]->getParticles ();
@@ -441,8 +442,10 @@ bool GeneratorHybrid::importParticles()
441442 }
442443
443444 mParticles .insert (mParticles .end (), subParticles.begin (), subParticles.end ());
444- // fetch the event Header information from the underlying generator
445- gens[subIndex]->updateHeader (&mMCEventHeader );
445+ if (baseGen) {
446+ gens[subIndex]->updateHeader (&mMCEventHeader );
447+ baseGen = false ;
448+ }
446449 mInputTaskQueue .push (subIndex);
447450 mTasksStarted ++;
448451 }
@@ -481,7 +484,9 @@ bool GeneratorHybrid::importParticles()
481484void GeneratorHybrid::updateHeader (o2::dataformats::MCEventHeader* eventHeader)
482485{
483486 if (eventHeader) {
484- // we forward the original header information if any
487+ // Forward the base class fields from FairMCEventHeader
488+ static_cast <FairMCEventHeader&>(*eventHeader) = static_cast <FairMCEventHeader&>(mMCEventHeader );
489+ // Copy the key-value store info
485490 eventHeader->copyInfoFrom (mMCEventHeader );
486491
487492 // put additional information about
0 commit comments