From 84b06eeb5504785a150418a4c86ab0431d7d77fa Mon Sep 17 00:00:00 2001 From: Archil Durglishvili Date: Mon, 25 Nov 2024 11:08:37 +0100 Subject: [PATCH] create tracks only from charged genParticles --- Tracking/components/TracksFromGenParticles.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tracking/components/TracksFromGenParticles.cpp b/Tracking/components/TracksFromGenParticles.cpp index dab2af0..64036fd 100644 --- a/Tracking/components/TracksFromGenParticles.cpp +++ b/Tracking/components/TracksFromGenParticles.cpp @@ -45,6 +45,9 @@ std::tuple ope debug() << "Particle decayed in tracker: " << genParticle.isDecayedInTracker() << endmsg; debug() << genParticle << endmsg; + // consider only charged particles + if(genParticle.getCharge() == 0) continue; + // Building an helix out of MCParticle properties and B field auto helixFromGenParticle = HelixClass_double(); double genParticleVertex[] = {genParticle.getVertex().x, genParticle.getVertex().y, genParticle.getVertex().z}; @@ -66,10 +69,10 @@ std::tuple ope trackState_AtFirstHit.location = edm4hep::TrackState::AtFirstHit; trackFromGen.addToTrackStates(trackState_AtFirstHit); auto trackState_AtLastHit = edm4hep::TrackState(trackState_IP); - trackState_AtFirstHit.location = edm4hep::TrackState::AtLastHit; + trackState_AtLastHit.location = edm4hep::TrackState::AtLastHit; trackFromGen.addToTrackStates(trackState_AtLastHit); auto trackState_AtCalorimeter = edm4hep::TrackState(trackState_IP); - trackState_AtFirstHit.location = edm4hep::TrackState::AtCalorimeter; + trackState_AtCalorimeter.location = edm4hep::TrackState::AtCalorimeter; trackFromGen.addToTrackStates(trackState_AtCalorimeter); //debug() << trackFromGen << endmsg;