BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLinkRegistry.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 BDSLINKREGISTRY_H
20#define BDSLINKREGISTRY_H
21#include "G4Transform3D.hh"
22#include "G4Types.hh"
23
24#include <map>
25#include <string>
26
28
36{
37public:
40
41 G4int Register(BDSLinkOpaqueBox* componentIn,
42 const G4Transform3D& globalToInputIn);
43
44 const G4Transform3D& Transform(const std::string& name) const;
45 const G4Transform3D& Transform(G4int ID) const;
46
47 const G4Transform3D& TransformInverse(const std::string& name) const;
48 const G4Transform3D& TransformInverse(G4int ID) const;
49
50 G4bool NoRotation(const std::string& name) const;
51 G4bool NoRotation(G4int ID) const;
52
53private:
54
55 struct LinkEntry
56 {
57 G4bool noRotation; // true if component straight and no rotation is required
58 BDSLinkOpaqueBox* component;
59 G4Transform3D transform;
60 G4Transform3D transformInverse;
61 G4int id;
62 };
63
64 std::map<std::string, LinkEntry> byName;
65 std::map<G4int, LinkEntry> byID;
66};
67
68#endif
Wrapper box for an accelerator component.
Registry / map of components for tracker linkage.