BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSCurvilinearBuilder.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 BDSCURVILINEARBUILDER_H
19#define BDSCURVILINEARBUILDER_H
20
21#include "BDSBeamlineElement.hh"
22#include "BDSUtilities.hh"
23
24#include "globals.hh"
25
26class BDSBeamline;
29
40{
41public:
44
47 const G4bool circular);
48
51
52private:
54 BDSCurvilinearBuilder& operator=(const BDSCurvilinearBuilder&) = delete;
55
59 G4double CurvilinearRadius(const BDSBeamlineElement* el) const;
60
67 BDSBeamlineElement* CreateCurvilinearElement(const G4String& elementName,
68 BDSBeamline::const_iterator startElement,
69 BDSBeamline::const_iterator finishElement,
70 G4int index,
71 G4double crRadius);
72
75 BDSBeamline::const_iterator startElement,
76 BDSBeamline::const_iterator finishElement,
77 G4int index);
78
79
84
95 G4int& numberOfUniqueComponents,
96 const G4int beamlineIndex,
97 G4double crRadius);
98
104 const BDSBeamlineElement*& previous,
105 const BDSBeamlineElement*& next) const;
106
110
114 G4int& numberOfUniqueComponents);
115
118 G4int& numberOfUniqueComponents,
119 G4double suggestedRadius);
120
125 BDSBeamline::const_iterator nextElement,
127 const G4int beamlineIndex);
128
130 inline G4bool Angled(BDSBeamlineElement const* const element) const;
131
133 inline G4bool TooShort(BDSBeamlineElement const* const element) const;
134
137 G4double defaultBridgeLength;
139 G4double radiusTolerance;
141
144};
145
146inline G4bool BDSCurvilinearBuilder::Angled(BDSBeamlineElement const* const element) const
147{return BDS::IsFinite(element->GetAngle());}
148
149#endif
Abstract class that represents a component of an accelerator.
A class that holds a fully constructed BDSAcceleratorComponent as well as any information relevant to...
G4double GetAngle() const
Accessor.
A vector of BDSBeamlineElement instances - a beamline.
BeamlineVector::const_iterator const_iterator
Iterator mechanics.
Factory for simple parallel geometry for curvilinear coordinates.
BDSBeamlineElement * CreateElementFromComponent(BDSSimpleComponent *component, BDSBeamline::const_iterator startElement, BDSBeamline::const_iterator finishElement, G4int index)
Create the BDSBeamlineElement by wrapping a BDSSimpleComponent.
BDSBeamlineElement * CreateBridgeSection(BDSAcceleratorComponent *defaultBridge, BDSBeamline::const_iterator element, BDSBeamline::const_iterator nextElement, BDSBeamline::const_iterator end, G4int &numberOfUniqueComponents, const G4int beamlineIndex, G4double crRadius)
BDSAcceleratorComponent * CreateStraightBridgeComponent(G4double width, G4int &numberOfUniqueComponents)
BDSBeamlineElement * CreateBridgeElementFromComponent(BDSAcceleratorComponent *component, BDSBeamline::const_iterator element, BDSBeamline::const_iterator nextElement, BDSBeamline::const_iterator end, const G4int beamlineIndex)
G4double curvilinearRadius
Radius for curvilinear geometry.
G4double paddingLength
Length that was used for padding on the beam line we're building with respesct to.
void PreviousAndNext(BDSBeamline::const_iterator it, BDSBeamline::const_iterator startIt, BDSBeamline::const_iterator endIt, const BDSBeamlineElement *&previous, const BDSBeamlineElement *&next) const
G4double CurvilinearRadius(const BDSBeamlineElement *el) const
G4bool TooShort(BDSBeamlineElement const *const element) const
Whether an element is too short for its own curvilinear volume.
BDSBeamline * BuildCurvilinearBeamLine1To1(BDSBeamline const *const beamline, const G4bool circular)
Build a beam line of curvilinear geometry based on another beam line.
BDSAcceleratorComponent * CreateAngledBridgeComponent(BDSBeamline::const_iterator element, G4int &numberOfUniqueComponents, G4double suggestedRadius)
Create a unique accelerator component for an element with angled faces.
G4bool Angled(BDSBeamlineElement const *const element) const
Simple interrogation function to determine if an element has a finite angle or not.
BDSBeamline * BuildCurvilinearBridgeBeamLine(BDSBeamline const *const beamline)
Build bridging volumes to join the curvilinear ones.
BDSCurvilinearFactory * factory
Factory to build curvilinear geometry.
BDSBeamlineElement * CreateBonusSectionStart(BDSBeamline const *const beamline)
Create a small section to extend a linear beam line.
BDSAcceleratorComponent * CreateDefaultBridgeComponent()
G4double bonusChordLength
Length of any possible bonus section added to beginning and end.
BDSBeamlineElement * CreateBonusSectionEnd(BDSBeamline const *const beamline)
Create a small section to extend a linear beam line.
BDSBeamlineElement * CreateCurvilinearElement(const G4String &elementName, BDSBeamline::const_iterator startElement, BDSBeamline::const_iterator finishElement, G4int index, G4double crRadius)
Factory to create curvilinear geometry for parallel world.
A BDSAcceleratorComponent wrapper for BDSGeometryComponent.
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())