BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTiltOffset.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 BDSTILTOFFSET_H
19#define BDSTILTOFFSET_H
20
21#include "globals.hh" // geant4 types / globals
22#include "G4ThreeVector.hh"
23#include "G4Transform3D.hh"
24
25#include <ostream>
26
40{
41public:
43
44 BDSTiltOffset(G4double xOffset,
45 G4double yOffset,
46 G4double tiltIn);
47
49 inline G4double GetXOffset() const {return dx;}
50 inline G4double GetYOffset() const {return dy;}
51 inline G4double GetTilt() const {return tilt;}
53
55 G4ThreeVector GetOffset() const {return G4ThreeVector(dx, dy, 0);}
56
58 G4Transform3D Transform3D() const;
59
61 G4bool HasFiniteOffset() const;
62 G4bool HasFiniteTilt() const;
64
66 friend std::ostream& operator<< (std::ostream &out, BDSTiltOffset const &to);
67
68private:
70 G4double dx;
72 G4double dy;
74 G4double tilt;
75};
76
77#endif
A holder for any placement offsets and rotations for a BDSAcceleratorComponent.
G4double dx
Horizontal displacement (mm) - note right handed coordinate system.
G4double tilt
Tilt angle (rad) - rotation angle about Z axis.
G4double GetYOffset() const
Accessor.
G4double GetXOffset() const
Accessor.
G4bool HasFiniteTilt() const
Inspector.
G4double GetTilt() const
Accessor.
G4double dy
Vertical displacement (mm)
G4bool HasFiniteOffset() const
Inspector.
friend std::ostream & operator<<(std::ostream &out, BDSTiltOffset const &to)
Output stream.
G4Transform3D Transform3D() const
Get a transform to represent this tilt offset.
G4ThreeVector GetOffset() const
More advance accessor for offset - only in x,y.