BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSProcessMap.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSPROCESSMAP_H
19#define BDSPROCESSMAP_H
20
21#include "globals.hh" // geant4 types / globals
22
23#include <unordered_map>
24
32{
33public:
35 static BDSProcessMap* Instance();
36
38
40 G4String operator()(const G4int& type, const G4int& subType = -1) const;
41
43 G4String GetProcessName(const G4int& type, const G4int& subType = -1) const
44 {return operator()(type, subType);}
45
46private:
49
52
54 typedef std::unordered_map<G4int, G4String> processMap;
55
58
62 std::unordered_map<G4int, processMap> subProcesses;
63};
64
65#endif
Map of all process names to IDs.
static BDSProcessMap * Instance()
Singleton accessor.
std::unordered_map< G4int, processMap > subProcesses
std::unordered_map< G4int, G4String > processMap
Typedef to make syntax more readable.
static BDSProcessMap * instance
Singleton instance.
processMap processes
Map of main process categories.
BDSProcessMap()
Private default constructor as singleton pattern.
G4String operator()(const G4int &type, const G4int &subType=-1) const
Main access method for getting the name of processes.
G4String GetProcessName(const G4int &type, const G4int &subType=-1) const
Despatched function to operator() for getting the name of processes.