BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSMagnetOuter.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 BDSMAGNETOUTER_H
19#define BDSMAGNETOUTER_H
20
21#include "BDSGeometryComponent.hh"
22
23#include "globals.hh"
24#include "G4ThreeVector.hh"
25
28class G4LogicalVolume;
29class G4VSolid;
30
45{
46public:
47 BDSMagnetOuter(G4VSolid* containerSolidIn,
48 G4LogicalVolume* containerLVIn,
49 const BDSExtent& extent,
50 BDSGeometryComponent* magnetContainerIn,
51 const G4ThreeVector& placementOffset = G4ThreeVector(0,0,0),
52 BDSSimpleComponent* endPieceBeforeIn = nullptr,
53 BDSSimpleComponent* endPieceAfterIn = nullptr,
54 const G4ThreeVector& inputFaceNormalIn = G4ThreeVector(0,0,-1),
55 const G4ThreeVector& outputFaceNormalIn = G4ThreeVector(0,0, 1));
57 BDSGeometryComponent* magnetContainerIn,
58 BDSSimpleComponent* endPieceBeforeIn = nullptr,
59 BDSSimpleComponent* endPieceAfterIn = nullptr,
60 const G4ThreeVector& inputFaceNormalIn = G4ThreeVector(0,0,-1),
61 const G4ThreeVector& outputFaceNormalIn = G4ThreeVector(0,0, 1));
63 BDSGeometryComponent* magnetContainerIn);
64 virtual ~BDSMagnetOuter();
65
70 BDSGeometryComponent* GetMagnetContainer() const {return magnetContainer;}
71
73 BDSSimpleComponent* EndPieceBefore() const {return endPieceBefore;}
74 BDSSimpleComponent* EndPieceAfter() const {return endPieceAfter;}
76
77 void SetEndPieceBefore(BDSSimpleComponent* endPieceIn) {endPieceBefore = endPieceIn;}
78 void SetEndPieceAfter(BDSSimpleComponent* endPieceIn) {endPieceAfter = endPieceIn;}
79
82
84 void ClearEndPieces();
85
87 inline G4ThreeVector InputFaceNormal() const {return inputFaceNormal;}
88 inline G4ThreeVector OutputFaceNormal() const {return outputFaceNormal;}
90
92 void SetInputFaceNormal(const G4ThreeVector& input);
93 void SetOutputFaceNormal(const G4ThreeVector& output);
95
98 BDSGeometryExternal* ExternalGeometry() const {return externalGeometry;}
99
100protected:
101 BDSGeometryComponent* magnetContainer;
102 BDSSimpleComponent* endPieceBefore;
103 BDSSimpleComponent* endPieceAfter;
104 G4ThreeVector inputFaceNormal;
105 G4ThreeVector outputFaceNormal;
106 BDSGeometryExternal* externalGeometry;
107};
108
109#endif
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
A generic geometry component for a bdsim model.
A loaded piece of externally provided geometry.
An object for both the returned magnet outer body but also a tight fitting container for the whole ma...
BDSGeometryComponent * GetMagnetContainer() const
void ClearMagnetContainer()
Clear the memory of the now unneeded magnet container object.
void ClearEndPieces()
Clear the memory of the possibly unneeded end piece objects.
void SetInputFaceNormal(const G4ThreeVector &input)
Setter for face normals.
G4ThreeVector InputFaceNormal() const
Accessor.
BDSSimpleComponent * EndPieceAfter() const
Access the end piece.
BDSGeometryExternal * ExternalGeometry() const
G4ThreeVector OutputFaceNormal() const
Accessor.
void SetOutputFaceNormal(const G4ThreeVector &output)
Setter for face normals.
BDSSimpleComponent * EndPieceBefore() const
Access the end piece.
A BDSAcceleratorComponent wrapper for BDSGeometryComponent.