Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 4b6c819

Browse files
authored
Merge pull request #109 from LDMX-Software/107-increase-the-number-of-processes-in-the-process-map
107 increase the number of processes in the process map
2 parents 5398819 + 86e2055 commit 4b6c819

3 files changed

Lines changed: 46 additions & 13 deletions

File tree

include/SimCore/Event/SimParticle.h

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,25 @@ class SimParticle {
2727
*/
2828
enum ProcessType {
2929
unknown = 0,
30-
annihil,
31-
compt,
32-
conv,
33-
electronNuclear,
34-
eBrem,
35-
eIoni,
36-
msc,
37-
phot,
38-
photonNuclear,
39-
GammaToMuPair,
40-
eDarkBrem,
41-
Decay,
30+
annihil = 1,
31+
compt = 2,
32+
conv = 3,
33+
electronNuclear = 4,
34+
eBrem = 5,
35+
eIoni = 6,
36+
msc = 7,
37+
phot = 8,
38+
photonNuclear = 9,
39+
GammaToMuPair = 10,
40+
eDarkBrem = 11,
41+
Decay = 12,
42+
Primary = 13,
43+
muonNuclear = 14,
44+
neutronInelastic = 15,
45+
neutronCapture = 16,
46+
kaonInelastic = 17,
47+
pionInelastic = 18,
48+
protonInelastic = 19,
4249
// Only add additional processes to the end of this list!
4350
};
4451

src/SimCore/Event/SimParticle.cxx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ClassImp(ldmx::SimParticle)
1010
namespace ldmx {
1111
SimParticle::ProcessTypeMap SimParticle::createProcessTypeMap() {
1212
ProcessTypeMap procMap;
13+
/// Electromagnetic interactions
1314
/// e Z --> e Z gamma
1415
procMap["eBrem"] = ProcessType::eBrem;
1516
/// gamma --> e+ e-
@@ -26,13 +27,34 @@ ClassImp(ldmx::SimParticle)
2627
procMap["msc"] = ProcessType::msc;
2728
/// gamma Z --> Z + X
2829
procMap["photonNuclear"] = ProcessType::photonNuclear;
30+
/// mu Z --> Z + X
31+
procMap["muonNuclear"] = ProcessType::muonNuclear;
2932
/// e Z --> e Z + X
3033
procMap["electronNuclear"] = ProcessType::electronNuclear;
3134
/// gamma --> mu+ mu-
3235
procMap["GammaToMuPair"] = ProcessType::GammaToMuPair;
3336
/// e- Z --> e- Z A'
3437
procMap["DarkBrem"] = ProcessType::eDarkBrem;
3538

39+
// Inelastic interactions
40+
/// n + Z -> X
41+
procMap["neutronInelastic"] = ProcessType::neutronInelastic;
42+
/// n + Z -> Z*
43+
procMap["neutronCapture"] = ProcessType::neutronCapture;
44+
/// K + Z -> X
45+
procMap["kaon-Inelastic"] = ProcessType::kaonInelastic;
46+
procMap["kaon+Inelastic"] = ProcessType::kaonInelastic;
47+
procMap["kaon0LInelastic"] = ProcessType::kaonInelastic;
48+
procMap["kaon0SInelastic"] = ProcessType::kaonInelastic;
49+
/// pi + Z -> X
50+
procMap["pion-Inelastic"] = ProcessType::pionInelastic;
51+
procMap["pion+Inelastic"] = ProcessType::pionInelastic;
52+
/// p + Z -> X
53+
procMap["protonInelastic"] = ProcessType::protonInelastic;
54+
55+
/// Other
56+
/// Primary particle
57+
procMap["Primary"] = ProcessType::Primary;
3658
// Decay
3759
procMap["Decay"] = ProcessType::Decay;
3860
return procMap;

src/SimCore/TrackMap.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ void TrackMap::save(const G4Track* track) {
7070
const G4String& name{process->GetProcessName()};
7171
particle.setProcessType(ldmx::SimParticle::findProcessType(name));
7272
} else {
73-
particle.setProcessType(ldmx::SimParticle::ProcessType::unknown);
73+
if (track->GetParentID() == 0) {
74+
particle.setProcessType(ldmx::SimParticle::ProcessType::Primary);
75+
} else {
76+
particle.setProcessType(ldmx::SimParticle::ProcessType::unknown);
77+
}
7478
}
7579

7680
// track's current kinematics is its end point kinematics

0 commit comments

Comments
 (0)