diff --git a/DDG4/include/DDG4/Geant4ParticleHandler.h b/DDG4/include/DDG4/Geant4ParticleHandler.h index 646c3e17bba4b50371df5002513d42dcaabefbb5..35fbf5a70aa370c6ce1d500c724da0467281768e 100644 --- a/DDG4/include/DDG4/Geant4ParticleHandler.h +++ b/DDG4/include/DDG4/Geant4ParticleHandler.h @@ -92,6 +92,8 @@ namespace DD4hep { bool m_ownsParticles; /// Property: Energy cut below which particles are not collected, but assigned to the parent double m_kinEnergyCut; + /// Property: Minimal distance after which the vertexIsNotEndpointOfParent flag is set + double m_minDistToParentVertex; /// Property: All the processes of which the decay products will be explicitly stored Processes m_processNames; diff --git a/DDG4/src/Geant4ParticleHandler.cpp b/DDG4/src/Geant4ParticleHandler.cpp index 657b6612921724dd9d0dd20f7e3a3db794bed2c8..29c18dc7ada5ebad6d3ca22d65ac21b24a7e081a 100644 --- a/DDG4/src/Geant4ParticleHandler.cpp +++ b/DDG4/src/Geant4ParticleHandler.cpp @@ -79,6 +79,7 @@ Geant4ParticleHandler::Geant4ParticleHandler(Geant4Context* ctxt, const string& declareProperty("KeepAllParticles", m_keepAll = false); declareProperty("SaveProcesses", m_processNames); declareProperty("MinimalKineticEnergy",m_kinEnergyCut = 100e0*CLHEP::MeV); + declareProperty("MinDistToParentVertex",m_minDistToParentVertex = 2.2e-14*CLHEP::mm);//default tolerance for g4ThreeVector isNear m_needsControl = true; } @@ -676,7 +677,7 @@ void Geant4ParticleHandler::setVertexEndpointBit() { const double X( parent->vex - p->vex ); const double Y( parent->vey - p->vey ); const double Z( parent->vez - p->vez ); - if( sqrt(X*X + Y*Y + Z*Z) > 2.2e-14 ){ //default tolerance for g4ThreeVector isNear + if( sqrt(X*X + Y*Y + Z*Z) > m_minDistToParentVertex ){ PropertyMask(p->status).set(G4PARTICLE_SIM_PARENT_RADIATED); } }