File indexing completed on 2024-04-06 12:30:27
0001 #include "SimG4Core/Physics/interface/G4ProcessTypeEnumerator.h"
0002
0003 static const int nprocesses = 49;
0004 static const std::string g4processes[nprocesses] = {
0005 "Primary", "Transportation", "CoupleTrans", "CoulombScat", "Ionisation", "Brems",
0006 "PairProdCharged", "Annih", "AnnihToMuMu", "AnnihToHad", "NuclearStopp", "Msc",
0007 "Rayleigh", "PhotoElectric", "Compton", "Conv", "ConvToMuMu", "Cerenkov",
0008 "Scintillation", "SynchRad", "TransRad", "OpAbsorp", "OpBoundary", "OpRayleigh",
0009 "OpWLS", "OpMieHG", "MuDBrem", "MuMuonPairProd", "DNAIonisation", "DNAVibExcit",
0010 "DNAAttachment", "DNAChargeDec", "DNAChargeInc", "HadElastic", "HadInelastic", "HadCapture",
0011 "HadFission", "HadAtRest", "HadCEX", "Decay", "DecayWSpin", "DecayPiWSpin",
0012 "DecayRadio", "DecayUnKnown", "DecayExt", "GFlash", "StepLimiter", "UsrSpecCuts",
0013 "NeutronKiller"};
0014 static const int g4subtype[nprocesses] = {
0015 0,
0016 91,
0017 92,
0018 1,
0019 2,
0020 3,
0021 4,
0022 5,
0023 6,
0024 7,
0025 8,
0026 10,
0027 11,
0028 12,
0029 13,
0030 14,
0031 15,
0032 21, 22, 23, 24, 31, 32, 33, 34, 35,
0033 40,
0034 49,
0035 53, 54, 55, 56, 57,
0036 111,
0037 121,
0038 131,
0039 141,
0040 151,
0041 161,
0042 201,
0043 202,
0044 203,
0045 210,
0046 211,
0047 231,
0048 301,
0049 401,
0050 402,
0051 403
0052 };
0053
0054 G4ProcessTypeEnumerator::G4ProcessTypeEnumerator() {}
0055
0056 std::string G4ProcessTypeEnumerator::processG4Name(int idx) const {
0057 std::string res = "";
0058 for (int i = 0; i < nprocesses; ++i) {
0059 if (idx == g4subtype[i]) {
0060 res = g4processes[i];
0061 break;
0062 }
0063 }
0064 return res;
0065 }
0066
0067 int G4ProcessTypeEnumerator::processId(const std::string& name) const {
0068 int idx = 0;
0069 for (int i = 0; i < nprocesses; ++i) {
0070 if (name == g4processes[i]) {
0071 idx = g4subtype[i];
0072 break;
0073 }
0074 }
0075 return idx;
0076 }