BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBendBuilder.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 BDSBENDBUILDER_H
19#define BDSBENDBUILDER_H
20
21#include "globals.hh" // geant4 globals / types
22#include "G4String.hh"
23#include "BDSFieldType.hh"
24#include "BDSIntegratorSetType.hh"
25#include "BDSIntegratorType.hh"
26
28class BDSFieldInfo;
30class BDSLine;
31class BDSMagnet;
34
35namespace GMAD
36{
37 struct Element;
38}
39
40namespace BDS
41{
49 BDSAcceleratorComponent* BuildSBendLine(const G4String& elementName,
50 const GMAD::Element* element,
52 G4double brho,
53 const BDSIntegratorSet* integratorSet,
54 G4double incomingFaceAngle,
55 G4double outgoingFaceAngle,
56 G4bool buildFringeFields,
57 const GMAD::Element* prevElement,
58 const GMAD::Element* nextElement,
59 BDSModulatorInfo* fieldModulator = nullptr);
60
64 BDSLine* BuildRBendLine(const G4String& elementName,
65 const GMAD::Element* element,
66 const GMAD::Element* prevElement,
67 const GMAD::Element* nextElement,
68 G4double brho,
70 const BDSIntegratorSet* integratorSet,
71 G4double incomingFaceAngle,
72 G4double outgoingFaceAngle,
73 G4bool buildFringeFields,
74 BDSModulatorInfo* fieldModulator = nullptr);
75
78 G4int CalculateNSBendSegments(G4double length,
79 G4double angle,
80 G4double incomingFaceAngle = 0,
81 G4double outgoingFaceAngle = 0,
82 G4double aperturePrecision = 1.0);
83
87 G4double angleIn,
88 G4double angleOut,
89 const G4String& name,
91 G4double brho,
92 const BDSIntegratorSet* integratorSet,
93 BDSFieldType dipoleFieldType,
94 BDSModulatorInfo* fieldModulator = nullptr);
95
98 const G4String& name,
99 G4double arcLength,
100 G4double angle,
101 G4double angleIn,
102 G4double angleOut,
103 const BDSMagnetStrength* strength,
104 G4double brho,
105 const BDSIntegratorSet* integratorSet,
106 G4bool yokeOnLeft,
107 const BDSFieldInfo* outerFieldIn,
108 BDSModulatorInfo* fieldModulator = nullptr);
109
110 void UpdateSegmentAngles(G4int index,
111 G4int nSBends,
112 G4double semiAngle,
113 G4double incomingFaceAngle,
114 G4double outgoingFaceAngle,
115 G4double& segmentAngleIn,
116 G4double& segmentAngleOut);
117
118 BDSMagnetStrength* GetFringeMagnetStrength(const GMAD::Element* element,
119 const BDSMagnetStrength* st,
120 G4double fringeAngle,
121 G4double e1,
122 G4double e2,
123 G4double fintx,
124 G4bool entranceOrExit);
125
129 const GMAD::Element* element);
130
132 G4bool ZeroStrengthDipole(const BDSMagnetStrength* st);
133}
134
135#endif
Abstract class that represents a component of an accelerator.
All info required to build complete field of any type.
Which integrator to use for each type of magnet / field object.
A class that hold multiple accelerator components.
Definition BDSLine.hh:37
Efficient storage of magnet strengths.
Abstract base class that implements features common to all magnets.
Definition BDSMagnet.hh:44
Holder class for all information required to describe a modulator.
Return either G4Tubs or G4CutTubs depending on flat face.
G4bool ZeroStrengthDipole(const BDSMagnetStrength *st)
Return whether finite angle or field for a dipole.
G4int CalculateNSBendSegments(G4double length, G4double angle, G4double incomingFaceAngle=0, G4double outgoingFaceAngle=0, G4double aperturePrecision=1.0)
BDSMagnet * BuildSingleSBend(const GMAD::Element *element, const G4String &name, G4double arcLength, G4double angle, G4double angleIn, G4double angleOut, const BDSMagnetStrength *strength, G4double brho, const BDSIntegratorSet *integratorSet, G4bool yokeOnLeft, const BDSFieldInfo *outerFieldIn, BDSModulatorInfo *fieldModulator=nullptr)
Function to return a single sector bend section.
BDSMagnet * BuildDipoleFringe(const GMAD::Element *element, G4double angleIn, G4double angleOut, const G4String &name, BDSMagnetStrength *st, G4double brho, const BDSIntegratorSet *integratorSet, BDSFieldType dipoleFieldType, BDSModulatorInfo *fieldModulator=nullptr)
BDSLine * BuildRBendLine(const G4String &elementName, const GMAD::Element *element, const GMAD::Element *prevElement, const GMAD::Element *nextElement, G4double brho, BDSMagnetStrength *st, const BDSIntegratorSet *integratorSet, G4double incomingFaceAngle, G4double outgoingFaceAngle, G4bool buildFringeFields, BDSModulatorInfo *fieldModulator=nullptr)
BDSIntegratorType GetDipoleIntegratorType(const BDSIntegratorSet *integratorSet, const GMAD::Element *element)
BDSAcceleratorComponent * BuildSBendLine(const G4String &elementName, const GMAD::Element *element, BDSMagnetStrength *st, G4double brho, const BDSIntegratorSet *integratorSet, G4double incomingFaceAngle, G4double outgoingFaceAngle, G4bool buildFringeFields, const GMAD::Element *prevElement, const GMAD::Element *nextElement, BDSModulatorInfo *fieldModulator=nullptr)
Parser namespace for GMAD language. Combination of Geant4 and MAD.
Element class.
Definition element.h:47