BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLinkOpaqueBox.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 BDSLINKOPAQUEBOX_H
20#define BDSLINKOPAQUEBOX_H
21#include "BDSAcceleratorComponent.hh"
22#include "BDSUtilities.hh"
23
24#include "G4ThreeVector.hh"
25#include "G4Transform3D.hh"
26#include "G4Types.hh"
27
28#include "BDSGeometryComponent.hh"
29
32
40{
41public:
42 BDSLinkOpaqueBox(BDSAcceleratorComponent* acceleratorComponentIn,
43 BDSTiltOffset* tiltOffsetIn,
44 G4double outputSamplerRadiusIn);
45 virtual ~BDSLinkOpaqueBox();
46
48 BDSLinkOpaqueBox() = delete;
49
51 BDSLinkOpaqueBox(const BDSLinkOpaqueBox &other) = delete;
54
55 inline const G4ThreeVector& OffsetToStart() const {return offsetToStart;}
56 inline const G4Transform3D& TransformToStart() const {return transformToStart;}
57
59 G4int PlaceOutputSampler();
60
62 G4double ArcLength() const {return component ? component->GetArcLength() : 0.0;}
63 G4double ChordLength() const {return component ? component->GetChordLength() : 0.0;}
64 G4bool Angled() const {return component ? BDS::IsFinite(component->GetAngle()) : false;}
65 G4String LinkName() const {return component ? component->GetName() : "unknown";}
67
68private:
69 BDSAcceleratorComponent* component;
70 G4double outputSamplerRadius;
71 G4ThreeVector offsetToStart;
72 G4Transform3D transformToStart;
73 BDSSamplerCustom* sampler;
74};
75
76#endif
Abstract class that represents a component of an accelerator.
virtual G4String GetName() const
The name of the component without modification.
virtual G4double GetChordLength() const
virtual G4double GetArcLength() const
A generic geometry component for a bdsim model.
Wrapper box for an accelerator component.
BDSLinkOpaqueBox()=delete
Default constructor.
BDSLinkOpaqueBox & operator=(const BDSLinkOpaqueBox &other)=delete
Copy assignment operator.
G4bool Angled() const
Accessor.
G4String LinkName() const
Accessor.
BDSLinkOpaqueBox(const BDSLinkOpaqueBox &other)=delete
Copy constructor.
G4double ChordLength() const
Accessor.
G4int PlaceOutputSampler()
Place the output sampler.
G4double ArcLength() const
Accessor.
Custom shaped sampler with fixed thickness.
A holder for any placement offsets and rotations for a BDSAcceleratorComponent.
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())