Skip to content

Commit

Permalink
create tracks only from charged genParticles
Browse files Browse the repository at this point in the history
  • Loading branch information
Archil Durglishvili committed Nov 25, 2024
1 parent 4dad0b5 commit 84b06ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tracking/components/TracksFromGenParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ std::tuple<edm4hep::TrackCollection, edm4hep::TrackMCParticleLinkCollection> 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};
Expand All @@ -66,10 +69,10 @@ std::tuple<edm4hep::TrackCollection, edm4hep::TrackMCParticleLinkCollection> 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;
Expand Down

0 comments on commit 84b06ee

Please sign in to comment.