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) 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 BDSBLMREGISTRY_H
19#define BDSBLMREGISTRY_H
20
21#include "globals.hh" // geant4 types / globals
22
23#include <set>
24#include <vector>
25
26class BDSBLM;
27
35{
36public:
38 static BDSBLMRegistry* Instance();
39
41
42 G4int RegisterBLM(G4String name,
43 BDSBLM* blm,
44 G4double SIn = -1000);
45
46 inline size_t size() const {return (size_t)numberOfEntries;}
47 inline G4int NBLMs() const {return numberOfEntries;}
48 inline const std::set<BDSBLM*>& BLMs() const {return blms;}
49
50private:
53
56
60
62 std::set<BDSBLM*> blms;
63
64 std::vector<BDSBLM*> blmsVector;
65 std::vector<G4String> names;
66 std::vector<G4double> S;
67};
68
69#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:41