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

Commit

Permalink
Merge pull request #109 from LDMX-Software/107-increase-the-number-of…
Browse files Browse the repository at this point in the history
…-processes-in-the-process-map

107 increase the number of processes in the process map
  • Loading branch information
EinarElen committed Nov 22, 2023
2 parents 5398819 + 86e2055 commit 4b6c819
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
31 changes: 19 additions & 12 deletions include/SimCore/Event/SimParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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!
};

Expand Down
22 changes: 22 additions & 0 deletions src/SimCore/Event/SimParticle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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-
Expand All @@ -26,13 +27,34 @@ 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-
procMap["GammaToMuPair"] = ProcessType::GammaToMuPair;
/// 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;
Expand Down
6 changes: 5 additions & 1 deletion src/SimCore/TrackMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b6c819

Please sign in to comment.