19#include "BDSBeamPipeFactoryBase.hh"
20#include "BDSBeamPipeFactoryClicPCL.hh"
21#include "BDSBeamPipe.hh"
23#include "BDSExtent.hh"
26#include "G4EllipticalTube.hh"
27#include "G4CutTubs.hh"
28#include "G4IntersectionSolid.hh"
29#include "G4SubtractionSolid.hh"
30#include "G4ThreeVector.hh"
35BDSBeamPipeFactoryClicPCL::BDSBeamPipeFactoryClicPCL():
40void BDSBeamPipeFactoryClicPCL::GenerateClicPCL(std::vector<G4TwoVector>& vec,
48 G4double a1 = aper1 + margin;
49 G4double a2 = aper2 + margin;
50 G4double a3 = aper3 + margin;
53 G4int nPoints = 0.5*pointsPerTwoPi;
55 AppendPoint(vec, a1, a4);
57 AppendPoint(vec, -a1, 0);
64 G4double beamPipeThickness,
68 G4double bpOutMargin = bpInMargin + beamPipeThickness;
71 GenerateClicPCL(
vacuumEdge, aper1, aper2, aper3, aper4, pointsPerTwoPi);
72 GenerateClicPCL(
beamPipeInnerEdge, aper1, aper2, aper3, aper4, pointsPerTwoPi, bpInMargin);
73 GenerateClicPCL(
beamPipeOuterEdge, aper1, aper2, aper3, aper4, pointsPerTwoPi, bpOutMargin);
74 GenerateClicPCL(
containerEdge, aper1, aper2, aper3, aper4, pointsPerTwoPi, cont1Margin);
86 G4double beamPipeThickness)
88 G4double bottom = std::max(std::abs(aper3), aper1);
89 G4double top = std::max(aper1, aper2);
90 G4double hyp = std::hypot(aper1, aper4);
92 G4double result = std::max(std::max(bottom, top), hyp) + beamPipeThickness;
110 G4Material* vacuumMaterialIn,
111 G4Material* beamPipeMaterialIn,
115 beamPipeMaterialIn, lengthIn);
120 -lengthIn*0.5,lengthIn*0.5);
void CommonConstruction(const G4String &nameIn, G4Material *vacuumMaterialIn, G4Material *beamPipeMaterialIn, G4double length)
finalise beampipe construction
BDSBeamPipe * BuildBeamPipeAndRegisterVolumes(BDSExtent extent, G4double containerRadius, G4bool containerIsCircular=false)
build beampipe and register logical volumes
virtual BDSBeamPipe * CommonFinalConstruction(const G4String &nameIn, G4Material *vacuumMaterialIn, G4Material *beamPipeMaterialIn, G4double lengthIn)
Overloads BDSBeamPipeFactoryPoints to make asymmetric extents, otherwise the same.
virtual void GeneratePoints(G4double aper1, G4double aper2, G4double aper3, G4double aper4, G4double beamPipeThickness, G4int pointsPerTwoPi=40)
G4double extentYLow
Cache of extent to pass around.
virtual void CleanUp()
Clear member vectors and run base class clean up to clear pointers between runs.
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.
G4double extentYHigh
Cache of extent to pass around.
void CleanUpClicPCL()
Clear member vectors - used for both initialisation and virtual CleanUp.
std::vector< G4TwoVector > containerSubtractionEdge
Vector of x,y coordinates for the container subtraction volume.
std::vector< G4TwoVector > beamPipeInnerEdge
Vector of x,y coordinates for beam pipe inner edge.
virtual void CleanUp()
Clear member vectors and run base class clean up to clear pointers between runs.
G4double extentX
Extents prepared by GeneratePoints function as only it knows the extents.
std::vector< G4TwoVector > vacuumEdge
Vector of x,y coordinates for vacuum extruded solid edge.
std::vector< G4TwoVector > containerEdge
Vector of x,y coordinates for the container volume.
std::vector< G4TwoVector > beamPipeOuterEdge
Vector of x,y coordinates for beam pipe outer edge.
void AppendAngleEllipse(std::vector< G4TwoVector > &vec, G4double startAngle, G4double finishAngle, G4double radiusA, G4double radiusB, G4int nPoints=10, G4double xOffset=0, G4double yOffset=0)
Generate 2-vector points (and append them) about an ellipse.
A holder class for a piece of beam pipe geometry.
Holder for +- extents in 3 dimensions.
G4double MaximumAbsTransverse() const
Return the maximum absolute value considering only x,y.
G4double lengthSafetyLarge
Cache of global constants variable.