BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSMagnetOuterInfo.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 BDSMAGNETOUTERINFO_H
19#define BDSMAGNETOUTERINFO_H
20#include "BDSMagnetGeometryType.hh"
21
22#include "globals.hh"
23
24#include <cmath>
25
26class G4Colour;
27class G4Material;
28
40{
41public:
44
46 BDSMagnetOuterInfo(const G4String& nameIn,
47 BDSMagnetGeometryType geometryTypeIn,
48 G4double horizontalWidthIn,
49 G4Material* outerMaterialIn,
50 G4double innerRadiusIn,
51 G4double vhRatioIn = 1,
52 G4double angleInIn = 0,
53 G4double angleOutIn = 0,
54 G4bool yokeOnLeft = false,
55 G4bool hStyle = false,
56 G4bool buildEndPiecesIn = true,
57 G4double coilWidthFractionIn = 0.65,
58 G4double coilHeightFractionIn = 0.8,
59 const G4String& geometryTypeAndPathIn = "",
60 G4Colour* colourIn = nullptr,
61 G4bool autoColour = true);
62
63 G4String name;
64 BDSMagnetGeometryType geometryType;
65 G4double horizontalWidth;
66 G4Material* outerMaterial;
67 G4double innerRadius;
68 G4double vhRatio;
69 G4double angleIn;
70 G4double angleOut;
71 G4bool yokeOnLeft;
72 G4bool hStyle;
73 G4bool buildEndPieces;
74 G4double coilWidthFraction;
75 G4double coilHeightFraction;
76 G4String geometryTypeAndPath;
77 G4Colour* colour;
78 G4bool autoColour;
79
80 inline G4double MinimumIntersectionRadiusRequired() const {return std::hypot(0.5*horizontalWidth, 0.5*horizontalWidth*vhRatio);}
81};
82
83#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