Skip to content

Commit af0ed8a

Browse files
committed
Use the step length to set fast simulation flag
1 parent 3c1af7d commit af0ed8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

DDG4/edm4hep/Geant4Output2EDM4hep.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,15 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
684684
sCaloHitCont.setTime( c.time/CLHEP::ns );
685685
sCaloHitCont.setParticle( mcp );
686686

687+
#if EDM4HEP_BUILD_VERSION > EDM4HEP_VERSION(1, 0, 0)
688+
// In case this contribution has been created via a fast simulation
689+
// method, the step length has been set to -1 at its creation. All
690+
// contributions that have gone through "normal" simulation will have a
691+
// step length >= 0 by definition.
692+
if (c.length < 0) {
693+
mcp.setHandledByFastSim(true);
694+
}
695+
#endif
687696
if ( hit_creation_mode == Geant4Sensitive::DETAILED_MODE ) {
688697
edm4hep::Vector3f p(c.x/CLHEP::mm, c.y/CLHEP::mm, c.z/CLHEP::mm);
689698
sCaloHitCont.setPDG( c.pdgID );

0 commit comments

Comments
 (0)