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) 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 BDSLINKOPAQUEBOX_H
19#define BDSLINKOPAQUEBOX_H
20#include "BDSAcceleratorComponent.hh"
21#include "BDSUtilities.hh"
22
23#include "G4ThreeVector.hh"
24#include "G4Transform3D.hh"
25#include "G4Types.hh"
26
27#include "BDSGeometryComponent.hh"
28
31
39{
40public:
41 BDSLinkOpaqueBox(BDSAcceleratorComponent* acceleratorComponentIn,
42 BDSTiltOffset* tiltOffsetIn,
43 G4double outputSamplerRadiusIn);
44 virtual ~BDSLinkOpaqueBox();
45
47 BDSLinkOpaqueBox() = delete;
48
50 BDSLinkOpaqueBox(const BDSLinkOpaqueBox &other) = delete;
53
54 inline const G4ThreeVector& OffsetToStart() const {return offsetToStart;}
55 inline const G4Transform3D& TransformToStart() const {return transformToStart;}
56
58 G4int PlaceOutputSampler();
59
61 G4double ArcLength() const {return component ? component->GetArcLength() : 0.0;}
62 G4double ChordLength() const {return component ? component->GetChordLength() : 0.0;}
63 G4bool Angled() const {return component ? BDS::IsFinite(component->GetAngle()) : false;}
64 G4String LinkName() const {return component ? component->GetName() : "unknown";}
66
67private:
68 BDSAcceleratorComponent* component;
69 G4double outputSamplerRadius;
70 G4ThreeVector offsetToStart;
71 G4Transform3D transformToStart;
72 BDSSamplerCustom* sampler;
73};
74
75#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())