BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSTiltOffset.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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 BDSTILTOFFSET_H
20#define BDSTILTOFFSET_H
21
22#include "globals.hh" // geant4 types / globals
23#include "G4ThreeVector.hh"
24#include "G4Transform3D.hh"
25
26#include <ostream>
27
41{
42public:
44
45 BDSTiltOffset(G4double xOffset,
46 G4double yOffset,
47 G4double tiltIn);
48
50 inline G4double GetXOffset() const {return dx;}
51 inline G4double GetYOffset() const {return dy;}
52 inline G4double GetTilt() const {return tilt;}
54
56 G4ThreeVector GetOffset() const {return G4ThreeVector(dx, dy, 0);}
57
59 G4Transform3D Transform3D() const;
60
62 G4bool HasFiniteOffset() const;
63 G4bool HasFiniteTilt() const;
65
67 friend std::ostream& operator<< (std::ostream &out, BDSTiltOffset const &to);
68
69private:
71 G4double dx;
73 G4double dy;
75 G4double tilt;
76};
77
78#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.