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