Skip to content

Commit

Permalink
Implemented particle conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
pandreetto committed Apr 24, 2024
1 parent 79faf0b commit b474315
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/Helpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,37 @@ EVENT::LCCollection* getCollection(EVENT::LCEvent* evt,

Acts::ParticleHypothesis convertParticle(const EVENT::MCParticle* mcParticle)
{
// TODO implement
switch (mcParticle->getPDG()) {
case 11:
return Acts::ParticleHypothesis {Acts::PdgParticle::eElectron};
case -11:
return Acts::ParticleHypothesis {Acts::PdgParticle::ePositron};
case 13:
return Acts::ParticleHypothesis {Acts::PdgParticle::eMuon};
case -13:
return Acts::ParticleHypothesis {Acts::PdgParticle::eAntiMuon};
case 15:
return Acts::ParticleHypothesis {Acts::PdgParticle::eTau};
case -15:
return Acts::ParticleHypothesis {Acts::PdgParticle::eAntiTau};
case 22:
return Acts::ParticleHypothesis {Acts::PdgParticle::eGamma};
case 111:
return Acts::ParticleHypothesis {Acts::PdgParticle::ePionZero};
case 211:
return Acts::ParticleHypothesis {Acts::PdgParticle::ePionPlus};
case -211:
return Acts::ParticleHypothesis {Acts::PdgParticle::ePionMinus};
case 2112:
return Acts::ParticleHypothesis {Acts::PdgParticle::eNeutron};
case -2112:
return Acts::ParticleHypothesis {Acts::PdgParticle::eAntiNeutron};
case 2212:
return Acts::ParticleHypothesis {Acts::PdgParticle::eProton};
case -2212:
return Acts::ParticleHypothesis {Acts::PdgParticle::eAntiProton};
}

Acts::PdgParticle pdg = Acts::PdgParticle::eInvalid;
float mass = 0.0f;
Acts::AnyCharge charge_type { 0.0f };
Expand Down

0 comments on commit b474315

Please sign in to comment.