BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Member Functions | Protected Attributes
BDSMagnetOuterFactoryPolesBase Class Reference

Factory class for outer volume of magnets. Produces magnets with 2N-poles around the beampipe with a yoke of various shapes. More...

#include <BDSMagnetOuterFactoryPolesBase.hh>

Inheritance diagram for BDSMagnetOuterFactoryPolesBase:
Inheritance graph
Collaboration diagram for BDSMagnetOuterFactoryPolesBase:
Collaboration graph

Public Member Functions

 BDSMagnetOuterFactoryPolesBase (G4double poleStopFactorIn)
 
virtual BDSMagnetOuterCreateSectorBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 sector bend outer volume More...
 
virtual BDSMagnetOuterCreateRectangularBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 rectangular bend outer volume More...
 
virtual BDSMagnetOuterCreateQuadrupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 quadrupole outer volume More...
 
virtual BDSMagnetOuterCreateSextupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 sextupole outer volume More...
 
virtual BDSMagnetOuterCreateOctupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 octupole outer volume More...
 
virtual BDSMagnetOuterCreateDecapole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 decapole outer volume More...
 
virtual BDSMagnetOuterCreateSolenoid (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 solenoid outer volume More...
 
virtual BDSMagnetOuterCreateMultipole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 general multipole outer volume - could be any 2N order multipole More...
 
virtual BDSMagnetOuterCreateRfCavity (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 RF cavity outer volume. More...
 
virtual BDSMagnetOuterCreateMuonSpoiler (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)
 muon spoiler outer volume More...
 
virtual BDSMagnetOuterCreateKicker (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool vertical)
 horizontal and vertical kicker outer volume More...
 
- Public Member Functions inherited from BDSMagnetOuterFactoryBase
virtual BDSMagnetOuterCreateSectorBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 sector bend outer volume More...
 
virtual BDSMagnetOuterCreateRectangularBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 rectangular bend outer volume More...
 
virtual BDSMagnetOuterCreateQuadrupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 quadrupole outer volume More...
 
virtual BDSMagnetOuterCreateSextupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 sextupole outer volume More...
 
virtual BDSMagnetOuterCreateOctupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 octupole outer volume More...
 
virtual BDSMagnetOuterCreateDecapole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 decapole outer volume More...
 
virtual BDSMagnetOuterCreateSolenoid (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 solenoid outer volume More...
 
virtual BDSMagnetOuterCreateMultipole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 general multipole outer volume - could be any 2N order multipole More...
 
virtual BDSMagnetOuterCreateRfCavity (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 RF cavity outer volume. More...
 
virtual BDSMagnetOuterCreateMuonSpoiler (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0
 muon spoiler outer volume More...
 
virtual BDSMagnetOuterCreateKicker (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool vertical)=0
 horizontal and vertical kicker outer volume More...
 
virtual void CleanUp ()
 Empty containers for next use - factories are never deleted so can't rely on scope. More...
 
void CleanUpBase ()
 Non-virtual clean up that can be used in the constructor. More...
 
virtual ~BDSMagnetOuterFactoryBase ()
 Virtual base destructor. More...
 
- Public Member Functions inherited from BDSFactoryBase
virtual void FactoryBaseCleanUp ()
 Empty containers for next use - factories are never deleted so can't rely on scope. More...
 

Protected Member Functions

virtual void CleanUp ()
 Empty containers for next use - this class is never deleted so can't rely on scope. More...
 
void CleanUpPolesBase ()
 Non-virtual clean up to be used in constructor. More...
 
virtual BDSMagnetOuterCommonConstructor (const G4String &name, G4double length, BDSBeamPipe *beamPipe, G4int order, G4double magnetContainerLength, const BDSMagnetOuterInfo *recipe)
 Common construction tasks to all methods - assemble yoke and poles in container. More...
 
virtual void CalculatePoleAndYoke (G4double horizontalWidth, BDSBeamPipe *beamPipe, G4int order)
 
virtual void CreatePoleSolid (const G4String &name, G4double length, G4int order)
 
virtual void CreateCoilSolids (const G4String &name, G4double length)
 Create the coil solids corresponding to the pole solid. More...
 
virtual void CreateCoilPoints ()
 Create all the points that make up the extruded solid of the pole. More...
 
virtual void CreateYokeAndContainerSolid (const G4String &name, G4double length, G4int order, G4double magnetContainerLength, G4double magnetContainerRadiusIn)
 
virtual void IntersectPoleWithYoke (const G4String &name, G4double length, G4int order)
 Chop off the top of the pole to match the appropriate yoke geometry. More...
 
virtual void CreateLogicalVolumes (const G4String &name, G4Colour *colour, G4Material *outerMaterial)
 
virtual void CreateLogicalVolumesCoil (const G4String &name)
 
virtual void CreateEndPiece (const G4String &name)
 
virtual void PlaceComponents (const G4String &name, G4int order)
 Place the poles and yoke in the container volume. More...
 
virtual void PlaceComponentsCoils (const G4String &name, G4int order)
 If we're building coils, place two coils for each pole. More...
 
void TestCoilFractions (G4double &coilWidthFraction, G4double &coilHeightFraction)
 
void DipoleCommonPreConstruction (const G4String &name, G4double angleIn, G4double angleOut, G4double length, G4double &horizontalWidth, G4Material *&material, G4double &vhRatio)
 
void DipoleCalculations (G4bool hStyle, G4bool buildVertically, const BDSBeamPipe *beamPipe, G4double length, G4double horizontalWidth, G4double angleIn, G4double angleOut, G4double yokeThicknessFraction, G4double vhRatio, G4double coilWidthFraction, G4double coilHeightFraction, G4double &cShapeOuterEdge, G4double &poleHalfGap, G4double &poleWidth, G4double &poleHeight, G4double &yokeWidth, G4double &yokeHalfHeight, G4double &yokeThickness, G4double &yokeOverHang, G4double &coilWidth, G4double &coilHeightIn, G4double &coilToYokeGap, G4double &coilToPoleGap, G4double &sLength, G4double &containerSLength, G4double &intersectionRadius)
 
std::vector< G4ThreeVector > CalculateCoilDisplacements (G4double poleHalfWidthIn, G4double poleHalfGapIn, G4double coilWidthIn, G4double coilHeightIn, G4double cDY, G4double &coilDY)
 
BDSMagnetOuterCreateDipoleC (const G4String &name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool buildVertically)
 
BDSMagnetOuterCreateDipoleH (const G4String &name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool buildVertically)
 Routine to construct an H shaped dipole magnet and can optionally be built vertically. More...
 
BDSMagnetOuterDipoleCommonConstruction (const G4String &name, G4double horizontalWidth, G4bool buildEndPiece, G4double coilWidth, G4double length, G4double containerLength, G4double sLength, G4double angleIn, G4double angleOut, G4Colour *colour, G4Material *material, std::vector< G4ThreeVector > &coilDisps, G4bool buildVertically, BDSExtent &ext, G4double poleHalfWidth, G4double poleHalfGap, G4double cDY, G4double coilDY, G4double intersectionRadius)
 
- Protected Member Functions inherited from BDSMagnetOuterFactoryBase
virtual void CreateLogicalVolumes (const G4String &name, G4Colour *colour, G4Material *outerMaterial)
 
virtual void SetUserLimits ()
 Attach default user limits to all logical volumes. More...
 
void BuildMagnetContainerSolidAngled (const G4String &name, G4double magnetContainerLength, G4double magnetContainerRadius, G4bool flatFaces=false)
 
void BuildMagnetContainerSolidStraight (const G4String &name, G4double magnetContainerLength, G4double magnetContainerRadius)
 
void CreateMagnetContainerComponent ()
 
void SetFaceNormals (BDSMagnetOuter *outer)
 Copy face normals from members to an instance of outer. More...
 

Protected Attributes

const G4double poleFraction
 
const G4double poleAngularFraction
 Fraction of 2pi/Npoles that the pole will occupy - always < 1. More...
 
const G4double poleTipFraction
 
const G4double poleAnnulusFraction
 
const G4double bendHeightFraction
 
const G4double poleStopFactor
 
G4double yokeStartRadius
 Start radius of yoke geometry from magnet cetnre. More...
 
G4double yokeFinishRadius
 Finish radius of yoke geometry from magnet centre - less than horizontalWidth. More...
 
G4double magnetContainerRadius
 Radius of the container solid for the outer geometry. More...
 
G4bool buildPole
 Whether or not to build poles (and therefore coils). More...
 
G4double poleStartRadius
 Start radius of the pole from magnet centre. More...
 
G4double poleFinishRadius
 Finish radius of the pole from magnet centre. More...
 
G4double poleSquareWidth
 Full width of pole in constant width section. More...
 
G4double poleSquareStartRadius
 Radius from magnet centre that constant width section starts. More...
 
G4double segmentAngle
 2PI / # of poles - angle per segment allocated for each pole. More...
 
G4double poleAngle
 The angle allowed for the pole to occupy - less than segmentAngle. More...
 
G4ThreeVector poleTranslation
 Offste of pole for placement from magnet centre. More...
 
G4double coilHeight
 Height along y for coil for coil beside 1 upgright pole aligned with y axis. More...
 
G4double coilCentreRadius
 Radius from magnet centre that the centre of the coils exist at. More...
 
G4double endPieceLength
 Length of the coil end piece along what will be curvilinear S. More...
 
G4double endPieceInnerR
 Inner radius for end piece container. More...
 
G4double endPieceOuterR
 Outer radius for end piece container. More...
 
G4VSolid * poleIntersectionSolid
 Solid used to chop off pole. More...
 
G4VSolid * coilLeftSolid
 Left coil solid for one pole built upright along y axis. More...
 
G4VSolid * coilRightSolid
 Right coil solid. More...
 
G4VSolid * endPieceContainerSolid
 End piece container solid. More...
 
G4LogicalVolume * coilLeftLV
 Logical volume for left coil. More...
 
G4LogicalVolume * coilRightLV
 Logical volume for right coil. More...
 
G4LogicalVolume * endPieceCoilLV
 Logical volume for end piece single coil piece. More...
 
G4LogicalVolume * endPieceContainerLV
 Logical volume for end piece container. More...
 
BDSSimpleComponentendPiece
 Fully constructed end piece. More...
 
std::vector< G4TwoVector > leftPoints
 Vector of 2D points for left coil. More...
 
std::vector< G4TwoVector > rightPoints
 Vector of 2D points for right coil. More...
 
std::vector< G4TwoVector > endPiecePoints
 Vector of 2D points for end piece looking from above down z. More...
 
BDSMagnetOuterFactoryBasecylindrical
 Default factory to fall back to. More...
 
- Protected Attributes inherited from BDSMagnetOuterFactoryBase
G4VSolid * poleSolid
 Solid for an individual pole that will be placed multiple times. More...
 
G4VSolid * yokeSolid
 Solid for outer part that connects all poles. More...
 
G4VSolid * containerSolid
 
G4VSolid * magnetContainerSolid
 
G4LogicalVolume * poleLV
 
G4LogicalVolume * yokeLV
 
G4LogicalVolume * containerLV
 
G4LogicalVolume * magnetContainerLV
 
G4VPhysicalVolume * yokePV
 
G4VisAttributes * outerVisAttributes
 
BDSExtent magContExtent
 
BDSGeometryComponentmagnetContainer
 
G4ThreeVector inputFaceNormal
 
G4ThreeVector outputFaceNormal
 
G4bool sensitiveOuter
 Cache of global constants variable. More...
 
- Protected Attributes inherited from BDSFactoryBase
std::set< G4LogicalVolume * > allLogicalVolumes
 
std::set< G4VPhysicalVolume * > allPhysicalVolumes
 
std::set< G4RotationMatrix * > allRotationMatrices
 
std::set< G4UserLimits * > allUserLimits
 
std::set< G4VSolid * > allSolids
 
std::set< G4VisAttributes * > allVisAttributes
 
G4double lengthSafety
 Cache of global constants variable. More...
 
G4double lengthSafetyLarge
 Cache of global constants variable. More...
 
G4bool checkOverlaps
 Cache of global constants variable. More...
 
G4bool visDebug
 Cache of global constants variable. More...
 
G4double nSegmentsPerCircle
 Cache of global constants variable. More...
 
G4VisAttributes * containerVisAttr
 Cache of global constants variable. More...
 
G4UserLimits * defaultUserLimits
 Cache of global constants variable. More...
 

Detailed Description

Factory class for outer volume of magnets. Produces magnets with 2N-poles around the beampipe with a yoke of various shapes.

Most magnets are 2N poles, but sector and r-bends as well as muon spoilers, and h/v kickers are unique.

NOTE this is a base class in that there are derived classes with different outer shapes - all have poles, but the return yoke can for example, circular, square or faceted (with 4N facets)

Author
Laurie Nevay

Definition at line 49 of file BDSMagnetOuterFactoryPolesBase.hh.

Constructor & Destructor Documentation

◆ BDSMagnetOuterFactoryPolesBase() [1/2]

BDSMagnetOuterFactoryPolesBase::BDSMagnetOuterFactoryPolesBase ( )

Definition at line 58 of file BDSMagnetOuterFactoryPolesBase.cc.

◆ BDSMagnetOuterFactoryPolesBase() [2/2]

BDSMagnetOuterFactoryPolesBase::BDSMagnetOuterFactoryPolesBase ( G4double  poleStopFactorIn)
explicit

Definition at line 70 of file BDSMagnetOuterFactoryPolesBase.cc.

◆ ~BDSMagnetOuterFactoryPolesBase()

BDSMagnetOuterFactoryPolesBase::~BDSMagnetOuterFactoryPolesBase ( )
virtual

Definition at line 65 of file BDSMagnetOuterFactoryPolesBase.cc.

Member Function Documentation

◆ CalculateCoilDisplacements()

std::vector< G4ThreeVector > BDSMagnetOuterFactoryPolesBase::CalculateCoilDisplacements ( G4double  poleHalfWidthIn,
G4double  poleHalfGapIn,
G4double  coilWidthIn,
G4double  coilHeightIn,
G4double  cDY,
G4double &  coilDY 
)
protected

Calculate the placement offsets for each of the four coil placements. Common to both dipole construction routines.

Definition at line 956 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSFactoryBase::lengthSafetyLarge.

Referenced by CreateDipoleC(), and CreateDipoleH().

Here is the caller graph for this function:

◆ CalculatePoleAndYoke()

void BDSMagnetOuterFactoryPolesBase::CalculatePoleAndYoke ( G4double  horizontalWidth,
BDSBeamPipe beamPipe,
G4int  order 
)
protectedvirtual

Calculate the length of the pole and yoke radii based on the design. This is only responsible for calculating the gross proportions of the yoke and pole, not all the geometrical parameters that may be required for the final geometry.

Definition at line 302 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, BDSBeamPipe::GetContainerRadius(), BDSFactoryBase::lengthSafety, BDSFactoryBase::lengthSafetyLarge, magnetContainerRadius, poleAngle, poleAngularFraction, poleFinishRadius, poleFraction, poleSquareWidth, poleStartRadius, segmentAngle, yokeFinishRadius, and yokeStartRadius.

Referenced by CommonConstructor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUp()

void BDSMagnetOuterFactoryPolesBase::CleanUp ( )
protectedvirtual

Empty containers for next use - this class is never deleted so can't rely on scope.

Reimplemented from BDSMagnetOuterFactoryBase.

Reimplemented in BDSMagnetOuterFactoryPolesSquare.

Definition at line 85 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CleanUp(), and CleanUpPolesBase().

Referenced by BDSMagnetOuterFactoryPolesSquare::CleanUp(), CommonConstructor(), and DipoleCommonPreConstruction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUpPolesBase()

void BDSMagnetOuterFactoryPolesBase::CleanUpPolesBase ( )
protected

◆ CommonConstructor()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CommonConstructor ( const G4String &  name,
G4double  length,
BDSBeamPipe beamPipe,
G4int  order,
G4double  magnetContainerLength,
const BDSMagnetOuterInfo recipe 
)
protectedvirtual

◆ CreateCoilPoints()

void BDSMagnetOuterFactoryPolesBase::CreateCoilPoints ( )
protectedvirtual

Create all the points that make up the extruded solid of the pole.

Definition at line 443 of file BDSMagnetOuterFactoryPolesBase.cc.

References coilCentreRadius, coilHeight, endPieceInnerR, endPieceLength, endPieceOuterR, endPiecePoints, leftPoints, BDSFactoryBase::lengthSafetyLarge, poleFinishRadius, poleSquareStartRadius, poleSquareWidth, rightPoints, segmentAngle, and yokeStartRadius.

Referenced by CreateCoilSolids().

Here is the caller graph for this function:

◆ CreateCoilSolids()

void BDSMagnetOuterFactoryPolesBase::CreateCoilSolids ( const G4String &  name,
G4double  length 
)
protectedvirtual

Create the coil solids corresponding to the pole solid.

Definition at line 416 of file BDSMagnetOuterFactoryPolesBase.cc.

References coilLeftSolid, coilRightSolid, CreateCoilPoints(), leftPoints, BDSFactoryBase::lengthSafety, and rightPoints.

Referenced by CommonConstructor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateDecapole()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateDecapole ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

decapole outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 174 of file BDSMagnetOuterFactoryPolesBase.cc.

References CommonConstructor().

Here is the call graph for this function:

◆ CreateDipoleC()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateDipoleC ( const G4String &  name,
G4double  length,
const BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe,
G4bool  buildVertically 
)
protected

Routine to construct a C shaped dipole magnet with the yoke either to the left or right and can optionally be built vertically.

Definition at line 979 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, CalculateCoilDisplacements(), coilHeight, DipoleCalculations(), DipoleCommonPreConstruction(), BDSFactoryBase::lengthSafety, BDSFactoryBase::lengthSafetyLarge, BDS::Rotate(), TestCoilFractions(), and BDSMagnetOuterFactoryBase::yokeSolid.

Referenced by CreateKicker(), CreateRectangularBend(), and CreateSectorBend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateDipoleH()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateDipoleH ( const G4String &  name,
G4double  length,
const BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe,
G4bool  buildVertically 
)
protected

Routine to construct an H shaped dipole magnet and can optionally be built vertically.

Definition at line 1217 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, CalculateCoilDisplacements(), coilHeight, DipoleCalculations(), DipoleCommonPreConstruction(), BDSFactoryBase::lengthSafetyLarge, BDS::Rotate(), TestCoilFractions(), and BDSMagnetOuterFactoryBase::yokeSolid.

Referenced by CreateKicker(), CreateRectangularBend(), and CreateSectorBend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateEndPiece()

void BDSMagnetOuterFactoryPolesBase::CreateEndPiece ( const G4String &  name)
protectedvirtual

◆ CreateKicker()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateKicker ( G4String  name,
G4double  length,
const BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe,
G4bool  vertical 
)
virtual

horizontal and vertical kicker outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 219 of file BDSMagnetOuterFactoryPolesBase.cc.

References CreateDipoleC(), CreateDipoleH(), and BDSMagnetOuterInfo::hStyle.

Here is the call graph for this function:

◆ CreateLogicalVolumes()

void BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumes ( const G4String &  name,
G4Colour *  colour,
G4Material *  outerMaterial 
)
protectedvirtual

Create logical volumes for yoke, container and magnet container - derived classes can override to extend as they need.

Reimplemented from BDSMagnetOuterFactoryBase.

Reimplemented in BDSMagnetOuterFactoryPolesSquare.

Definition at line 552 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CreateLogicalVolumes(), and CreateLogicalVolumesCoil().

Referenced by CommonConstructor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateLogicalVolumesCoil()

void BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumesCoil ( const G4String &  name)
protectedvirtual

Discretise the coil logical volumes as even though derived factories from this one may complete override CreateLogicalVolumes as the poles can be individually unique, the coils will be the same and this allows reuse of code and lack of duplication.

Definition at line 560 of file BDSMagnetOuterFactoryPolesBase.cc.

References coilLeftLV, coilLeftSolid, coilRightLV, coilRightSolid, BDSFactoryBase::defaultUserLimits, BDSColours::GetColour(), BDSMaterials::GetMaterial(), BDSColours::Instance(), and BDSMaterials::Instance().

Referenced by CreateLogicalVolumes(), and BDSMagnetOuterFactoryPolesSquare::CreateLogicalVolumes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMultipole()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateMultipole ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

general multipole outer volume - could be any 2N order multipole

Implements BDSMagnetOuterFactoryBase.

Definition at line 192 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CreateMultipole(), and cylindrical.

Here is the call graph for this function:

◆ CreateMuonSpoiler()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateMuonSpoiler ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

muon spoiler outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 210 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CreateMuonSpoiler(), and cylindrical.

Here is the call graph for this function:

◆ CreateOctupole()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateOctupole ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

octupole outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 165 of file BDSMagnetOuterFactoryPolesBase.cc.

References CommonConstructor().

Here is the call graph for this function:

◆ CreatePoleSolid()

void BDSMagnetOuterFactoryPolesBase::CreatePoleSolid ( const G4String &  name,
G4double  length,
G4int  order 
)
protectedvirtual

Create pole for magnet of order N where npoles = Nx2. This contains some calcultion of geometrical parameters pertinent to the exact geometry being required. NOTE the poles are not joined (boolean union) to the outer yoke - there is a gap of length safety. This won't affect physics results and speeds up tracking as the solid is not a boolean of order Npoles + 1.

Definition at line 341 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSFactoryBase::lengthSafety, poleAngle, poleFinishRadius, BDSMagnetOuterFactoryBase::poleSolid, poleSquareStartRadius, poleSquareWidth, poleStartRadius, poleStopFactor, and poleTipFraction.

Referenced by CommonConstructor().

Here is the caller graph for this function:

◆ CreateQuadrupole()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateQuadrupole ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

quadrupole outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 147 of file BDSMagnetOuterFactoryPolesBase.cc.

References CommonConstructor().

Here is the call graph for this function:

◆ CreateRectangularBend()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateRectangularBend ( G4String  name,
G4double  length,
const BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

rectangular bend outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 135 of file BDSMagnetOuterFactoryPolesBase.cc.

References CreateDipoleC(), CreateDipoleH(), and BDSMagnetOuterInfo::hStyle.

Here is the call graph for this function:

◆ CreateRfCavity()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateRfCavity ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

RF cavity outer volume.

Implements BDSMagnetOuterFactoryBase.

Definition at line 201 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CreateRfCavity(), and cylindrical.

Here is the call graph for this function:

◆ CreateSectorBend()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateSectorBend ( G4String  name,
G4double  length,
const BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

sector bend outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 123 of file BDSMagnetOuterFactoryPolesBase.cc.

References CreateDipoleC(), CreateDipoleH(), and BDSMagnetOuterInfo::hStyle.

Here is the call graph for this function:

◆ CreateSextupole()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateSextupole ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

sextupole outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 156 of file BDSMagnetOuterFactoryPolesBase.cc.

References CommonConstructor().

Here is the call graph for this function:

◆ CreateSolenoid()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::CreateSolenoid ( G4String  name,
G4double  length,
BDSBeamPipe beamPipe,
G4double  containerLength,
const BDSMagnetOuterInfo recipe 
)
virtual

solenoid outer volume

Implements BDSMagnetOuterFactoryBase.

Definition at line 183 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::CreateSolenoid(), and cylindrical.

Here is the call graph for this function:

◆ CreateYokeAndContainerSolid()

void BDSMagnetOuterFactoryPolesBase::CreateYokeAndContainerSolid ( const G4String &  name,
G4double  length,
G4int  order,
G4double  magnetContainerLength,
G4double  magnetContainerRadiusIn 
)
protectedvirtual

Create yoke that connects poles and container to put them in. Also create the poleIntersectionSolid that will be used to chop the extended pole in IntersectPoleWithYoke().

Reimplemented in BDSMagnetOuterFactoryPolesFacetCommon, and BDSMagnetOuterFactoryPolesSquare.

Definition at line 504 of file BDSMagnetOuterFactoryPolesBase.cc.

References BDSMagnetOuterFactoryBase::BuildMagnetContainerSolidStraight(), BDSFactoryBase::lengthSafety, BDSFactoryBase::lengthSafetyLarge, poleIntersectionSolid, poleStartRadius, yokeFinishRadius, BDSMagnetOuterFactoryBase::yokeSolid, and yokeStartRadius.

Referenced by CommonConstructor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DipoleCalculations()

void BDSMagnetOuterFactoryPolesBase::DipoleCalculations ( G4bool  hStyle,
G4bool  buildVertically,
const BDSBeamPipe beamPipe,
G4double  length,
G4double  horizontalWidth,
G4double  angleIn,
G4double  angleOut,
G4double  yokeThicknessFraction,
G4double  vhRatio,
G4double  coilWidthFraction,
G4double  coilHeightFraction,
G4double &  cShapeOuterEdge,
G4double &  poleHalfGap,
G4double &  poleWidth,
G4double &  poleHeight,
G4double &  yokeWidth,
G4double &  yokeHalfHeight,
G4double &  yokeThickness,
G4double &  yokeOverHang,
G4double &  coilWidth,
G4double &  coilHeightIn,
G4double &  coilToYokeGap,
G4double &  coilToPoleGap,
G4double &  sLength,
G4double &  containerSLength,
G4double &  intersectionRadius 
)
protected

Common calculations to both dipole construction routines in one place. Pass by reference to modify variables declared in each function.

Definition at line 807 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, BDS::CalculateSafeAngledVolumeLength(), BDSGeometryComponent::GetExtent(), and BDSFactoryBase::lengthSafetyLarge.

Referenced by CreateDipoleC(), and CreateDipoleH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DipoleCommonConstruction()

BDSMagnetOuter * BDSMagnetOuterFactoryPolesBase::DipoleCommonConstruction ( const G4String &  name,
G4double  horizontalWidth,
G4bool  buildEndPiece,
G4double  coilWidth,
G4double  length,
G4double  containerLength,
G4double  sLength,
G4double  angleIn,
G4double  angleOut,
G4Colour *  colour,
G4Material *  material,
std::vector< G4ThreeVector > &  coilDisps,
G4bool  buildVertically,
BDSExtent ext,
G4double  poleHalfWidth,
G4double  poleHalfGap,
G4double  cDY,
G4double  coilDY,
G4double  intersectionRadius 
)
protected

Definition at line 1429 of file BDSMagnetOuterFactoryPolesBase.cc.

◆ DipoleCommonPreConstruction()

void BDSMagnetOuterFactoryPolesBase::DipoleCommonPreConstruction ( const G4String &  name,
G4double  angleIn,
G4double  angleOut,
G4double  length,
G4double &  horizontalWidth,
G4Material *&  material,
G4double &  vhRatio 
)
protected

Common task to both dipole construction routines. Clean up, test inputs and check if faces will intersect and warn user. Note reference to material pointer so it can be fixed if needs be to the default.

Definition at line 771 of file BDSMagnetOuterFactoryPolesBase.cc.

References CleanUp(), BDSMaterials::GetMaterial(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), and BDS::WillIntersect().

Referenced by CreateDipoleC(), and CreateDipoleH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IntersectPoleWithYoke()

void BDSMagnetOuterFactoryPolesBase::IntersectPoleWithYoke ( const G4String &  name,
G4double  length,
G4int  order 
)
protectedvirtual

Chop off the top of the pole to match the appropriate yoke geometry.

Reimplemented in BDSMagnetOuterFactoryPolesSquare.

Definition at line 542 of file BDSMagnetOuterFactoryPolesBase.cc.

References poleIntersectionSolid, and BDSMagnetOuterFactoryBase::poleSolid.

Referenced by CommonConstructor().

Here is the caller graph for this function:

◆ PlaceComponents()

void BDSMagnetOuterFactoryPolesBase::PlaceComponents ( const G4String &  name,
G4int  order 
)
protectedvirtual

Place the poles and yoke in the container volume.

Reimplemented in BDSMagnetOuterFactoryPolesSquare.

Definition at line 610 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, BDSFactoryBase::checkOverlaps, poleTranslation, and segmentAngle.

Referenced by CommonConstructor().

Here is the caller graph for this function:

◆ PlaceComponentsCoils()

void BDSMagnetOuterFactoryPolesBase::PlaceComponentsCoils ( const G4String &  name,
G4int  order 
)
protectedvirtual

If we're building coils, place two coils for each pole.

Definition at line 648 of file BDSMagnetOuterFactoryPolesBase.cc.

References buildPole, BDSFactoryBase::checkOverlaps, coilCentreRadius, coilLeftLV, coilRightLV, endPiece, endPieceCoilLV, endPieceContainerLV, endPieceLength, BDSGeometryComponent::RegisterPhysicalVolume(), BDSGeometryComponent::RegisterRotationMatrix(), and segmentAngle.

Referenced by CommonConstructor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestCoilFractions()

void BDSMagnetOuterFactoryPolesBase::TestCoilFractions ( G4double &  coilWidthFraction,
G4double &  coilHeightFraction 
)
protected

Ensure the coil fractions lie with [0.05, 0.98] and if they're negative set them to a provided default. -ve is assumed to require the default parameter and allows different usages of the function (in C and H dipoles) to control the defaults.

Definition at line 586 of file BDSMagnetOuterFactoryPolesBase.cc.

Referenced by CreateDipoleC(), and CreateDipoleH().

Here is the caller graph for this function:

Field Documentation

◆ bendHeightFraction

const G4double BDSMagnetOuterFactoryPolesBase::bendHeightFraction
protected

Bends are often wider in the bending plane. As we only have one parameter to pass which is outerDimaeter, make the non bending dimension a fixed (< 1) fraction of the outerDimaeter.

Definition at line 154 of file BDSMagnetOuterFactoryPolesBase.hh.

◆ buildPole

G4bool BDSMagnetOuterFactoryPolesBase::buildPole
protected

◆ coilCentreRadius

G4double BDSMagnetOuterFactoryPolesBase::coilCentreRadius
protected

Radius from magnet centre that the centre of the coils exist at.

Definition at line 173 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and PlaceComponentsCoils().

◆ coilHeight

G4double BDSMagnetOuterFactoryPolesBase::coilHeight
protected

Height along y for coil for coil beside 1 upgright pole aligned with y axis.

Definition at line 172 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), CreateDipoleC(), CreateDipoleH(), and CreateEndPiece().

◆ coilLeftLV

G4LogicalVolume* BDSMagnetOuterFactoryPolesBase::coilLeftLV
protected

Logical volume for left coil.

Definition at line 182 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateEndPiece(), CreateLogicalVolumesCoil(), and PlaceComponentsCoils().

◆ coilLeftSolid

G4VSolid* BDSMagnetOuterFactoryPolesBase::coilLeftSolid
protected

Left coil solid for one pole built upright along y axis.

Definition at line 179 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilSolids(), and CreateLogicalVolumesCoil().

◆ coilRightLV

G4LogicalVolume* BDSMagnetOuterFactoryPolesBase::coilRightLV
protected

Logical volume for right coil.

Definition at line 183 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateLogicalVolumesCoil(), and PlaceComponentsCoils().

◆ coilRightSolid

G4VSolid* BDSMagnetOuterFactoryPolesBase::coilRightSolid
protected

Right coil solid.

Definition at line 180 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilSolids(), and CreateLogicalVolumesCoil().

◆ cylindrical

BDSMagnetOuterFactoryBase* BDSMagnetOuterFactoryPolesBase::cylindrical
protected

Default factory to fall back to.

Definition at line 356 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CreateMultipole(), CreateMuonSpoiler(), CreateRfCavity(), and CreateSolenoid().

◆ endPiece

BDSSimpleComponent* BDSMagnetOuterFactoryPolesBase::endPiece
protected

Fully constructed end piece.

Definition at line 186 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CommonConstructor(), CreateEndPiece(), and PlaceComponentsCoils().

◆ endPieceCoilLV

G4LogicalVolume* BDSMagnetOuterFactoryPolesBase::endPieceCoilLV
protected

Logical volume for end piece single coil piece.

Definition at line 184 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateEndPiece(), and PlaceComponentsCoils().

◆ endPieceContainerLV

G4LogicalVolume* BDSMagnetOuterFactoryPolesBase::endPieceContainerLV
protected

Logical volume for end piece container.

Definition at line 185 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateEndPiece(), and PlaceComponentsCoils().

◆ endPieceContainerSolid

G4VSolid* BDSMagnetOuterFactoryPolesBase::endPieceContainerSolid
protected

End piece container solid.

Definition at line 181 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), and CreateEndPiece().

◆ endPieceInnerR

G4double BDSMagnetOuterFactoryPolesBase::endPieceInnerR
protected

Inner radius for end piece container.

Definition at line 175 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreateEndPiece().

◆ endPieceLength

G4double BDSMagnetOuterFactoryPolesBase::endPieceLength
protected

Length of the coil end piece along what will be curvilinear S.

Definition at line 174 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), CreateEndPiece(), and PlaceComponentsCoils().

◆ endPieceOuterR

G4double BDSMagnetOuterFactoryPolesBase::endPieceOuterR
protected

Outer radius for end piece container.

Definition at line 176 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreateEndPiece().

◆ endPiecePoints

std::vector<G4TwoVector> BDSMagnetOuterFactoryPolesBase::endPiecePoints
protected

Vector of 2D points for end piece looking from above down z.

Definition at line 190 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreateEndPiece().

◆ leftPoints

std::vector<G4TwoVector> BDSMagnetOuterFactoryPolesBase::leftPoints
protected

Vector of 2D points for left coil.

Definition at line 188 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreateCoilSolids().

◆ magnetContainerRadius

G4double BDSMagnetOuterFactoryPolesBase::magnetContainerRadius
protected

Radius of the container solid for the outer geometry.

Definition at line 163 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke(), CleanUpPolesBase(), and CommonConstructor().

◆ poleAngle

G4double BDSMagnetOuterFactoryPolesBase::poleAngle
protected

The angle allowed for the pole to occupy - less than segmentAngle.

Definition at line 170 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke(), CleanUpPolesBase(), and CreatePoleSolid().

◆ poleAngularFraction

const G4double BDSMagnetOuterFactoryPolesBase::poleAngularFraction
protected

Fraction of 2pi/Npoles that the pole will occupy - always < 1.

Definition at line 141 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke().

◆ poleAnnulusFraction

const G4double BDSMagnetOuterFactoryPolesBase::poleAnnulusFraction
protected

Fraction of length from pole tip to outerDiamter that the expanding section of the pole will take up. There's the tip, this bit, then a straight bit.

Definition at line 149 of file BDSMagnetOuterFactoryPolesBase.hh.

◆ poleFinishRadius

G4double BDSMagnetOuterFactoryPolesBase::poleFinishRadius
protected

Finish radius of the pole from magnet centre.

Definition at line 166 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke(), CleanUpPolesBase(), CreateCoilPoints(), and CreatePoleSolid().

◆ poleFraction

const G4double BDSMagnetOuterFactoryPolesBase::poleFraction
protected

The fraction of the distance from the beam pipe to the horizontalWidth/2 that each pole will take - always < 1

Definition at line 138 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke().

◆ poleIntersectionSolid

G4VSolid* BDSMagnetOuterFactoryPolesBase::poleIntersectionSolid
protected

◆ poleSquareStartRadius

G4double BDSMagnetOuterFactoryPolesBase::poleSquareStartRadius
protected

Radius from magnet centre that constant width section starts.

Definition at line 168 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreatePoleSolid().

◆ poleSquareWidth

G4double BDSMagnetOuterFactoryPolesBase::poleSquareWidth
protected

Full width of pole in constant width section.

Definition at line 167 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CalculatePoleAndYoke(), CleanUpPolesBase(), CreateCoilPoints(), and CreatePoleSolid().

◆ poleStartRadius

G4double BDSMagnetOuterFactoryPolesBase::poleStartRadius
protected

◆ poleStopFactor

const G4double BDSMagnetOuterFactoryPolesBase::poleStopFactor
protected

Factor by which the pole length is multiplied for the raw pole length before it's intersected with the inside of the yoke. Where the pole would normally stop at yokeStartRadius - lengthSaftey, it runs to yokeStartRadius x poleStopFactor.

Definition at line 159 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CreatePoleSolid().

◆ poleTipFraction

const G4double BDSMagnetOuterFactoryPolesBase::poleTipFraction
protected

Fraction of length from pole tip to horizontalWidth that pole tip ellisoid will take up

Definition at line 145 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CreatePoleSolid().

◆ poleTranslation

G4ThreeVector BDSMagnetOuterFactoryPolesBase::poleTranslation
protected

Offste of pole for placement from magnet centre.

Definition at line 171 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), and PlaceComponents().

◆ rightPoints

std::vector<G4TwoVector> BDSMagnetOuterFactoryPolesBase::rightPoints
protected

Vector of 2D points for right coil.

Definition at line 189 of file BDSMagnetOuterFactoryPolesBase.hh.

Referenced by CleanUpPolesBase(), CreateCoilPoints(), and CreateCoilSolids().

◆ segmentAngle

G4double BDSMagnetOuterFactoryPolesBase::segmentAngle
protected

◆ yokeFinishRadius

G4double BDSMagnetOuterFactoryPolesBase::yokeFinishRadius
protected

◆ yokeStartRadius

G4double BDSMagnetOuterFactoryPolesBase::yokeStartRadius
protected

The documentation for this class was generated from the following files: