diff --git a/DDG4/lcio/LCIOEventReader.cpp b/DDG4/lcio/LCIOEventReader.cpp index edf45ff62b1fdc5dc231532a00e695adce7b6de2..faa6e23b4e9bde0435f2a48dd960702e4535f136 100644 --- a/DDG4/lcio/LCIOEventReader.cpp +++ b/DDG4/lcio/LCIOEventReader.cpp @@ -149,6 +149,14 @@ LCIOEventReader::readParticles(int event_number, haveVertex = false ; } + if ( p->parents.size() == 0 ) { + PropertyMask status(p->status); + if ( status.isSet(G4PARTICLE_GEN_EMPTY) || status.isSet(G4PARTICLE_GEN_DOCUMENTATION) ) + vtx->in.insert(p->id); // Beam particles and primary quarks etc. + else + vtx->out.insert(p->id); // Stuff, to be given to Geant4 together with daughters + } + if ( mcp->isCreatedInSimulation() ) status.set(G4PARTICLE_SIM_CREATED); if ( mcp->isBackscatter() ) status.set(G4PARTICLE_SIM_BACKSCATTER); if ( mcp->vertexIsNotEndpointOfParent() ) status.set(G4PARTICLE_SIM_PARENT_RADIATED);