diff --git a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp index 0c687f82701832b673c49e2a744566aa1d76b061..1262806828aff4092c032c914cb711024a2dd996 100644 --- a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp +++ b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp @@ -81,6 +81,14 @@ Edm4hepWriterAnaElemTool::BeginOfEventAction(const G4Event* anEvent) { newparticle.setMomentumAtEndpoint(mcGenParticle.getMomentumAtEndpoint()); newparticle.setSpin (mcGenParticle.getSpin()); newparticle.setColorFlow (mcGenParticle.getColorFlow()); + + // Add parent-daughter relation + for(auto imc = 0; imc<mcGenParticle.parents_size(); imc++){ + newparticle.addToParents(mcGenParticle.getParents(imc)); + } + for(auto imc = 0; imc<mcGenParticle.daughters_size(); imc++){ + newparticle.addToDaughters(mcGenParticle.getDaughters(imc)); + } } msg() << "mcCol size (original) : " << mcCol->size() << endmsg;