diff --git a/include/SimCore/Event/SimParticle.h b/include/SimCore/Event/SimParticle.h index f014bbd..c23fae9 100644 --- a/include/SimCore/Event/SimParticle.h +++ b/include/SimCore/Event/SimParticle.h @@ -27,18 +27,25 @@ class SimParticle { */ enum ProcessType { unknown = 0, - annihil, - compt, - conv, - electronNuclear, - eBrem, - eIoni, - msc, - phot, - photonNuclear, - GammaToMuPair, - eDarkBrem, - Decay, + annihil = 1, + compt = 2, + conv = 3, + electronNuclear = 4, + eBrem = 5, + eIoni = 6, + msc = 7, + phot = 8, + photonNuclear = 9, + GammaToMuPair = 10, + eDarkBrem = 11, + Decay = 12, + Primary = 13, + muonNuclear = 14, + neutronInelastic = 15, + neutronCapture = 16, + kaonInelastic = 17, + pionInelastic = 18, + protonInelastic = 19, // Only add additional processes to the end of this list! }; diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index 8960659..c0903d4 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -10,6 +10,7 @@ ClassImp(ldmx::SimParticle) namespace ldmx { SimParticle::ProcessTypeMap SimParticle::createProcessTypeMap() { ProcessTypeMap procMap; + /// Electromagnetic interactions /// e Z --> e Z gamma procMap["eBrem"] = ProcessType::eBrem; /// gamma --> e+ e- @@ -26,6 +27,8 @@ ClassImp(ldmx::SimParticle) procMap["msc"] = ProcessType::msc; /// gamma Z --> Z + X procMap["photonNuclear"] = ProcessType::photonNuclear; + /// mu Z --> Z + X + procMap["muonNuclear"] = ProcessType::muonNuclear; /// e Z --> e Z + X procMap["electronNuclear"] = ProcessType::electronNuclear; /// gamma --> mu+ mu- @@ -33,6 +36,25 @@ ClassImp(ldmx::SimParticle) /// e- Z --> e- Z A' procMap["DarkBrem"] = ProcessType::eDarkBrem; + // Inelastic interactions + /// n + Z -> X + procMap["neutronInelastic"] = ProcessType::neutronInelastic; + /// n + Z -> Z* + procMap["neutronCapture"] = ProcessType::neutronCapture; + /// K + Z -> X + procMap["kaon-Inelastic"] = ProcessType::kaonInelastic; + procMap["kaon+Inelastic"] = ProcessType::kaonInelastic; + procMap["kaon0LInelastic"] = ProcessType::kaonInelastic; + procMap["kaon0SInelastic"] = ProcessType::kaonInelastic; + /// pi + Z -> X + procMap["pion-Inelastic"] = ProcessType::pionInelastic; + procMap["pion+Inelastic"] = ProcessType::pionInelastic; + /// p + Z -> X + procMap["protonInelastic"] = ProcessType::protonInelastic; + + /// Other + /// Primary particle + procMap["Primary"] = ProcessType::Primary; // Decay procMap["Decay"] = ProcessType::Decay; return procMap; diff --git a/src/SimCore/TrackMap.cxx b/src/SimCore/TrackMap.cxx index 4a834aa..cd25c54 100644 --- a/src/SimCore/TrackMap.cxx +++ b/src/SimCore/TrackMap.cxx @@ -70,7 +70,11 @@ void TrackMap::save(const G4Track* track) { const G4String& name{process->GetProcessName()}; particle.setProcessType(ldmx::SimParticle::findProcessType(name)); } else { - particle.setProcessType(ldmx::SimParticle::ProcessType::unknown); + if (track->GetParentID() == 0) { + particle.setProcessType(ldmx::SimParticle::ProcessType::Primary); + } else { + particle.setProcessType(ldmx::SimParticle::ProcessType::unknown); + } } // track's current kinematics is its end point kinematics