From 34b7f3e41d4a91b2fbcfafdc4a1f4439d19b1ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:28:29 +0100 Subject: [PATCH 1/8] Add further processes --- include/SimCore/Event/SimParticle.h | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) 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! }; From 9c6c391846ee6ac833853127d85fcb80beaacaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:28:41 +0100 Subject: [PATCH 2/8] Set process as primary if parent is 0 --- src/SimCore/TrackMap.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 From 7556923576a23ac93adc822446ac671726696c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:28:58 +0100 Subject: [PATCH 3/8] Add muon nuclear as an interaction type --- src/SimCore/Event/SimParticle.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index 8960659..b025bc6 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- From 356ca6d93ebf56a71f787a06dfd5c28d3b531e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:29:13 +0100 Subject: [PATCH 4/8] Inelastic neutron interactions --- src/SimCore/Event/SimParticle.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index b025bc6..eb6fc7b 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -36,6 +36,11 @@ 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; // Decay procMap["Decay"] = ProcessType::Decay; return procMap; From 6718a263b2172b08af8da6ad9ebddb559808e1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:29:22 +0100 Subject: [PATCH 5/8] Inelastic kaon interactions --- src/SimCore/Event/SimParticle.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index eb6fc7b..b7c170d 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -41,6 +41,11 @@ ClassImp(ldmx::SimParticle) 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; // Decay procMap["Decay"] = ProcessType::Decay; return procMap; From 3106130fcc00cf8a89bae25c19ace635cf686b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:29:35 +0100 Subject: [PATCH 6/8] Inelastic pion interactions --- src/SimCore/Event/SimParticle.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index b7c170d..bb56d3e 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -46,6 +46,9 @@ ClassImp(ldmx::SimParticle) 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; // Decay procMap["Decay"] = ProcessType::Decay; return procMap; From 371a3fdd12fbd041e63fed45ae58e4f9f08cec6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:29:44 +0100 Subject: [PATCH 7/8] Same for protons --- src/SimCore/Event/SimParticle.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index bb56d3e..821106a 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -49,6 +49,8 @@ ClassImp(ldmx::SimParticle) /// pi + Z -> X procMap["pion-Inelastic"] = ProcessType::pionInelastic; procMap["pion+Inelastic"] = ProcessType::pionInelastic; + /// p + Z -> X + procMap["protonInelastic"] = ProcessType::protonInelastic; // Decay procMap["Decay"] = ProcessType::Decay; return procMap; From 86e2055aecc121d645b387ca2aa34a633a6e03eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 21 Nov 2023 15:29:53 +0100 Subject: [PATCH 8/8] New primary category --- src/SimCore/Event/SimParticle.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SimCore/Event/SimParticle.cxx b/src/SimCore/Event/SimParticle.cxx index 821106a..c0903d4 100644 --- a/src/SimCore/Event/SimParticle.cxx +++ b/src/SimCore/Event/SimParticle.cxx @@ -51,6 +51,10 @@ ClassImp(ldmx::SimParticle) 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;