BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSMagnetOuterInfo.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 BDSMAGNETOUTERINFO_H
20#define BDSMAGNETOUTERINFO_H
21#include "BDSMagnetGeometryType.hh"
22
23#include "globals.hh"
24
25#include <cmath>
26
27class G4Colour;
28class G4Material;
29
41{
42public:
45
47 BDSMagnetOuterInfo(const G4String& nameIn,
48 BDSMagnetGeometryType geometryTypeIn,
49 G4double horizontalWidthIn,
50 G4Material* outerMaterialIn,
51 G4double innerRadiusIn,
52 G4double vhRatioIn = 1,
53 G4double angleInIn = 0,
54 G4double angleOutIn = 0,
55 G4bool yokeOnLeft = false,
56 G4bool hStyle = false,
57 G4bool buildEndPiecesIn = true,
58 G4double coilWidthFractionIn = 0.65,
59 G4double coilHeightFractionIn = 0.8,
60 const G4String& geometryTypeAndPathIn = "",
61 G4Colour* colourIn = nullptr,
62 G4bool autoColour = true);
63
64 G4String name;
65 BDSMagnetGeometryType geometryType;
66 G4double horizontalWidth;
67 G4Material* outerMaterial;
68 G4double innerRadius;
69 G4double vhRatio;
70 G4double angleIn;
71 G4double angleOut;
72 G4bool yokeOnLeft;
73 G4bool hStyle;
74 G4bool buildEndPieces;
75 G4double coilWidthFraction;
76 G4double coilHeightFraction;
77 G4String geometryTypeAndPath;
78 G4Colour* colour;
79 G4bool autoColour;
80
81 inline G4double MinimumIntersectionRadiusRequired() const {return std::hypot(0.5*horizontalWidth, 0.5*horizontalWidth*vhRatio);}
82};
83
84#endif
Holder struct of all information required to create the outer geometry of a magnet.
G4bool hStyle
H Style for dipoles. If not, it's assumed C style.
BDSMagnetOuterInfo()
default constructor