BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSBeamPipeFactoryOctagonal.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 BDSBEAMPIPEFACTORYOCTAGONAL_H
20#define BDSBEAMPIPEFACTORYOCTAGONAL_H
21
22#include "BDSBeamPipeFactoryPoints.hh"
23
24namespace BDS
25{
27 {
28 G4double aper1;
29 G4double aper2;
30 G4double aper3;
31 G4double aper4;
32 };
33}
34
52{
53public:
56
57private:
60 virtual void GeneratePoints(G4double aper1,
61 G4double aper2,
62 G4double aper3,
63 G4double aper4,
64 G4double beamPipeThickness,
65 G4int pointsPerTwoPi = 40);
66
68 virtual G4double CalculateIntersectionRadius(G4double aper1,
69 G4double aper2,
70 G4double aper3,
71 G4double aper4,
72 G4double beamPipeThickness);
73
75 void GenerateOctagonal(std::vector<G4TwoVector>& vec,
76 G4double x1,
77 G4double y1,
78 G4double x2,
79 G4double y2);
80
85 BDS::FourPoints ExpandOctagon(G4double aper1,
86 G4double aper2,
87 G4double aper3,
88 G4double aper4,
89 G4double distance);
90};
91
92#endif
Factory for octagonal aperture model beampipes.
virtual void GeneratePoints(G4double aper1, G4double aper2, G4double aper3, G4double aper4, G4double beamPipeThickness, G4int pointsPerTwoPi=40)
virtual G4double CalculateIntersectionRadius(G4double aper1, G4double aper2, G4double aper3, G4double aper4, G4double beamPipeThickness)
Calculate the radius of the solid used for intersection for angled faces.
void GenerateOctagonal(std::vector< G4TwoVector > &vec, G4double x1, G4double y1, G4double x2, G4double y2)
Append 2D points on an octagon in a clockwise direction into the vector argument.
BDS::FourPoints ExpandOctagon(G4double aper1, G4double aper2, G4double aper3, G4double aper4, G4double distance)
Factory for beam pipes defined by a series of x,y points that are extruded.
Return either G4Tubs or G4CutTubs depending on flat face.