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) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSPROCESSMAP_H
20#define BDSPROCESSMAP_H
21
22#include "globals.hh" // geant4 types / globals
23
24#include <unordered_map>
25
33{
34public:
36 static BDSProcessMap* Instance();
37
39
41 G4String operator()(const G4int& type, const G4int& subType = -1) const;
42
44 G4String GetProcessName(const G4int& type, const G4int& subType = -1) const
45 {return operator()(type, subType);}
46
47private:
50
53
55 typedef std::unordered_map<G4int, G4String> processMap;
56
59
63 std::unordered_map<G4int, processMap> subProcesses;
64};
65
66#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.