BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBLMRegistry.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 BDSBLMREGISTRY_H
20#define BDSBLMREGISTRY_H
21
22#include "globals.hh" // geant4 types / globals
23
24#include <set>
25#include <vector>
26
27class BDSBLM;
28
36{
37public:
39 static BDSBLMRegistry* Instance();
40
42
43 G4int RegisterBLM(G4String name,
44 BDSBLM* blm,
45 G4double SIn = -1000);
46
47 inline size_t size() const {return (size_t)numberOfEntries;}
48 inline G4int NBLMs() const {return numberOfEntries;}
49 inline const std::set<BDSBLM*>& BLMs() const {return blms;}
50
51private:
54
57
61
63 std::set<BDSBLM*> blms;
64
65 std::vector<BDSBLM*> blmsVector;
66 std::vector<G4String> names;
67 std::vector<G4double> S;
68};
69
70#endif
Registry of all BLMs so we know each one uniquely.
static BDSBLMRegistry * Instance()
Accessor for registry.
static BDSBLMRegistry * instance
Singleton instance.
BDSBLMRegistry()
Private constructor to enforce singleton pattern.
std::set< BDSBLM * > blms
Cache of unique sampler objects for memory management.
A beam loss monitor.
Definition: BDSBLM.hh:42