Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create tracks only from charged genParticles in TracksFromGenParticles #39

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading