diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx index 322d8255909c6d43284cf8990faa7b61b3990599..6672d035f77898ea14c8f68d13487b07e938702f 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx @@ -9,6 +9,7 @@ // GeneratorObjectsAthenaPool includes #include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h" +#include "GeneratorObjects/McEventCollection.h" /////////////////////////////////////////////////////////////////// /// Public methods: @@ -24,7 +25,13 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj, MsgStream &/*msg*/ ) { EBC_EVCOLL evColl = EBC_MAINEVCOLL; - if (persObj->m_mcEvtIndex>0) evColl = EBC_FIRSTPUEVCOLL; // HACK + if (persObj->m_mcEvtIndex>0) { + // HACK + const CLID clid = ClassID_traits<McEventCollection>::ID(); + if (SG::CurrentEventStore::store()->proxy (clid, "TruthEvent_PU") != nullptr) { + evColl = EBC_FIRSTPUEVCOLL; + } + } transObj->setExtendedBarCode ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, persObj->m_mcEvtIndex,