Skip to content

Commit

Permalink
Merge pull request #4477 from civanch/mctruth_process_num
Browse files Browse the repository at this point in the history
Added forgotten NeutronKiller process, cleanup comments
  • Loading branch information
davidlange6 committed Jul 1, 2014
2 parents fec1618 + 0496aae commit 566ca50
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 9 deletions.
2 changes: 2 additions & 0 deletions SimG4Core/Physics/interface/G4ProcessTypeEnumerator.h
Expand Up @@ -25,6 +25,8 @@ class G4ProcessTypeEnumerator {

std::string processG4Name(int);

int processId(const std::string& name);

};
#endif

71 changes: 62 additions & 9 deletions SimG4Core/Physics/src/G4ProcessTypeEnumerator.cc
@@ -1,24 +1,66 @@
#include "SimG4Core/Physics/interface/G4ProcessTypeEnumerator.h"

static const int nprocesses = 46;
static const int nprocesses = 47;
static const std::string g4processes[nprocesses] = {
"Transportation", "CoupleTrans", "CoulombScat", "Ionisation", "Brems",
"PairProdCharged", "Annih", "AnnihToMuMu", "AnnihToHad", "NuclearStopp",
"Msc", "Rayleigh", "PhotoElectric", "Compton", "Conv",
"ConvToMuMu", "Cerenkov", "Scintillation", "SynchRad", "TransRad",
"OpAbsorp", "OpBoundary", "OpRayleigh", "OpWLS", "OpMieHG",
"DNAElastic", "DNAExcit", "DNAIonisation", "DNAVibExcit", "DNAAttachment",
"DNAChargeDec", "DNAChargeInc", "HadElastic", "HadInElastic", "HadCaptue",
"DNAChargeDec", "DNAChargeInc", "HadElastic", "HadInelastic", "HadCapture",
"HadFission", "HadAtRest", "HadCEX", "Decay", "DecayWSpin",
"DecayPiWSpin", "DecayRadio", "DecayUnKnown", "DecayExt", "StepLimiter",
"UsrSpecCuts" };
"UsrSpecCuts", "NeutronKiller"};
static const int g4subtype[nprocesses] = {
91, 92, 1, 2, 3, 4, 5, 6, 7, 8,
10, 11, 12, 13, 14, 15, 21, 22, 23, 24,
31, 32, 33, 34, 35, 51, 52, 53, 54, 55,
56, 57, 111, 121, 131, 141, 151, 161, 201, 202,
203, 210, 211, 231, 401, 402 };

91, // Transportation
92, // CoupleTrans
1, // CoulombScat
2, // Ionisation
3, // Brems
4, // PairProdCharged
5, // Annih
6, // AnnihToMuMu
7, // AnnihToHad
8, // NuclearStopp
10, // Msc
11, //
12, // PhotoElectric
13, // Compton
14, // Conv
15, // ConvToMuMu
21,
22,
23,
24,
31,
32,
33,
34,
35,
51,
52,
53,
54,
55,
56,
57,
111, // HadElastic
121, // HadInelastic
131, // HadCapture
141, // HadFission
151, // HadAtRest
161,
201, // Decay
202, // DecayWSpin
203, // DecayPiWSpin
210, // DecayRadio
211, // DecayUnKnown
231, // DecayExt
401, // StepLimiter
402,
403 // NeutronKiller
};

G4ProcessTypeEnumerator::G4ProcessTypeEnumerator()
{}
Expand All @@ -38,3 +80,14 @@ std::string G4ProcessTypeEnumerator::processG4Name(int idx)
return res;
}

int G4ProcessTypeEnumerator::processId(const std::string& name)
{
int idx = 0;
for(int i=0; i<nprocesses; ++i) {
if(name == g4processes[i]) {
idx = g4subtype[i];
break;
}
}
return idx;
}

0 comments on commit 566ca50

Please sign in to comment.