Back to home page

Project CMSSW displayed by LXR

 
 

    


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,   // Primary generator
0016     91,  // Transportation
0017     92,  // CoupleTrans
0018     1,   // CoulombScat
0019     2,   // Ionisation
0020     3,   // Brems
0021     4,   // PairProdCharged
0022     5,   // Annih
0023     6,   // AnnihToMuMu
0024     7,   // AnnihToHad
0025     8,   // NuclearStopp
0026     10,  // Msc
0027     11,  // Rayleigh
0028     12,  // PhotoElectric
0029     13,  // Compton
0030     14,  // Conv
0031     15,  // ConvToMuMu
0032     21,  22, 23, 24, 31, 32, 33, 34, 35,
0033     40,  // muDBrem
0034     49,  // MuMuonPairProd
0035     53,  54, 55, 56, 57,
0036     111,  // HadElastic
0037     121,  // HadInelastic
0038     131,  // HadCapture
0039     141,  // HadFission
0040     151,  // HadAtRest
0041     161,
0042     201,  // Decay
0043     202,  // DecayWSpin
0044     203,  // DecayPiWSpin
0045     210,  // DecayRadio
0046     211,  // DecayUnKnown
0047     231,  // DecayExt
0048     301,  // GFlash
0049     401,  // StepLimiter
0050     402,
0051     403  // NeutronKiller
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 }