BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Factory class for outer volume of magnets. More...
#include <BDSMagnetOuterFactoryPolesSquare.hh>
Private Member Functions | |
virtual void | CleanUp () |
Clean up all memebers used. | |
void | CleanUpPolesSquare () |
Clean up for this factory. Non-virtual as used in constructor. | |
virtual void | CreateYokeAndContainerSolid (const G4String &name, G4double length, G4int order, G4double magnetContainerLength, G4double magnetContainerRadiusIn) |
Create yoke that connects poles and container to put them in. | |
virtual void | IntersectPoleWithYoke (const G4String &name, G4double length, G4int orderIn) |
Chop off the top of the pole to match the appropriate yoke geometry. | |
virtual void | CreateLogicalVolumes (const G4String &name, G4Colour *colour, G4Material *outerMaterial) |
virtual void | PlaceComponents (const G4String &name, G4int order) |
Place the poles and yoke in the container volume. | |
virtual BDSMagnetOuter * | CommonConstructor (const G4String &name, G4double length, BDSBeamPipe *beamPipe, G4int order, G4double magnetContainerLength, const BDSMagnetOuterInfo *recipe) |
Private Attributes | |
std::vector< G4RotationMatrix * > | poleRotations |
std::vector< G4VSolid * > | poleSolids |
std::vector< G4LogicalVolume * > | poleLVs |
G4int | order |
Additional Inherited Members | |
![]() | |
BDSMagnetOuterFactoryPolesBase (G4double poleStopFactorIn) | |
virtual BDSMagnetOuter * | CreateSectorBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
sector bend outer volume | |
virtual BDSMagnetOuter * | CreateRectangularBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
rectangular bend outer volume | |
virtual BDSMagnetOuter * | CreateQuadrupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
quadrupole outer volume | |
virtual BDSMagnetOuter * | CreateSextupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
sextupole outer volume | |
virtual BDSMagnetOuter * | CreateOctupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
octupole outer volume | |
virtual BDSMagnetOuter * | CreateDecapole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
decapole outer volume | |
virtual BDSMagnetOuter * | CreateSolenoid (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
solenoid outer volume | |
virtual BDSMagnetOuter * | CreateMultipole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
general multipole outer volume - could be any 2N order multipole | |
virtual BDSMagnetOuter * | CreateRfCavity (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
RF cavity outer volume. | |
virtual BDSMagnetOuter * | CreateMuonSpoiler (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe) |
muon spoiler outer volume | |
virtual BDSMagnetOuter * | CreateKicker (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool vertical) |
horizontal and vertical kicker outer volume | |
![]() | |
virtual BDSMagnetOuter * | CreateSectorBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
sector bend outer volume | |
virtual BDSMagnetOuter * | CreateRectangularBend (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
rectangular bend outer volume | |
virtual BDSMagnetOuter * | CreateQuadrupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
quadrupole outer volume | |
virtual BDSMagnetOuter * | CreateSextupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
sextupole outer volume | |
virtual BDSMagnetOuter * | CreateOctupole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
octupole outer volume | |
virtual BDSMagnetOuter * | CreateDecapole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
decapole outer volume | |
virtual BDSMagnetOuter * | CreateSolenoid (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
solenoid outer volume | |
virtual BDSMagnetOuter * | CreateMultipole (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
general multipole outer volume - could be any 2N order multipole | |
virtual BDSMagnetOuter * | CreateRfCavity (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
RF cavity outer volume. | |
virtual BDSMagnetOuter * | CreateMuonSpoiler (G4String name, G4double length, BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe)=0 |
muon spoiler outer volume | |
virtual BDSMagnetOuter * | CreateKicker (G4String name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool vertical)=0 |
horizontal and vertical kicker outer volume | |
virtual void | CleanUp () |
Empty containers for next use - factories are never deleted so can't rely on scope. | |
void | CleanUpBase () |
Non-virtual clean up that can be used in the constructor. | |
virtual | ~BDSMagnetOuterFactoryBase () |
Virtual base destructor. | |
![]() | |
virtual void | FactoryBaseCleanUp () |
Empty containers for next use - factories are never deleted so can't rely on scope. | |
![]() | |
virtual void | CleanUp () |
Empty containers for next use - this class is never deleted so can't rely on scope. | |
void | CleanUpPolesBase () |
Non-virtual clean up to be used in constructor. | |
virtual BDSMagnetOuter * | CommonConstructor (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. | |
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. | |
virtual void | CreateCoilPoints () |
Create all the points that make up the extruded solid of the pole. | |
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. | |
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. | |
virtual void | PlaceComponentsCoils (const G4String &name, G4int order) |
If we're building coils, place two coils for each pole. | |
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) |
BDSMagnetOuter * | CreateDipoleC (const G4String &name, G4double length, const BDSBeamPipe *beamPipe, G4double containerLength, const BDSMagnetOuterInfo *recipe, G4bool buildVertically) |
BDSMagnetOuter * | CreateDipoleH (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. | |
BDSMagnetOuter * | 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) |
![]() | |
virtual void | CreateLogicalVolumes (const G4String &name, G4Colour *colour, G4Material *outerMaterial) |
virtual void | SetUserLimits () |
Attach default user limits to all logical volumes. | |
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. | |
![]() | |
const G4double | poleFraction |
const G4double | poleAngularFraction |
Fraction of 2pi/Npoles that the pole will occupy - always < 1. | |
const G4double | poleTipFraction |
const G4double | poleAnnulusFraction |
const G4double | bendHeightFraction |
const G4double | poleStopFactor |
G4double | yokeStartRadius |
Start radius of yoke geometry from magnet cetnre. | |
G4double | yokeFinishRadius |
Finish radius of yoke geometry from magnet centre - less than horizontalWidth. | |
G4double | magnetContainerRadius |
Radius of the container solid for the outer geometry. | |
G4bool | buildPole |
Whether or not to build poles (and therefore coils). | |
G4double | poleStartRadius |
Start radius of the pole from magnet centre. | |
G4double | poleFinishRadius |
Finish radius of the pole from magnet centre. | |
G4double | poleSquareWidth |
Full width of pole in constant width section. | |
G4double | poleSquareStartRadius |
Radius from magnet centre that constant width section starts. | |
G4double | segmentAngle |
2PI / # of poles - angle per segment allocated for each pole. | |
G4double | poleAngle |
The angle allowed for the pole to occupy - less than segmentAngle. | |
G4ThreeVector | poleTranslation |
Offste of pole for placement from magnet centre. | |
G4double | coilHeight |
Height along y for coil for coil beside 1 upgright pole aligned with y axis. | |
G4double | coilCentreRadius |
Radius from magnet centre that the centre of the coils exist at. | |
G4double | endPieceLength |
Length of the coil end piece along what will be curvilinear S. | |
G4double | endPieceInnerR |
Inner radius for end piece container. | |
G4double | endPieceOuterR |
Outer radius for end piece container. | |
G4VSolid * | poleIntersectionSolid |
Solid used to chop off pole. | |
G4VSolid * | coilLeftSolid |
Left coil solid for one pole built upright along y axis. | |
G4VSolid * | coilRightSolid |
Right coil solid. | |
G4VSolid * | endPieceContainerSolid |
End piece container solid. | |
G4LogicalVolume * | coilLeftLV |
Logical volume for left coil. | |
G4LogicalVolume * | coilRightLV |
Logical volume for right coil. | |
G4LogicalVolume * | endPieceCoilLV |
Logical volume for end piece single coil piece. | |
G4LogicalVolume * | endPieceContainerLV |
Logical volume for end piece container. | |
BDSSimpleComponent * | endPiece |
Fully constructed end piece. | |
std::vector< G4TwoVector > | leftPoints |
Vector of 2D points for left coil. | |
std::vector< G4TwoVector > | rightPoints |
Vector of 2D points for right coil. | |
std::vector< G4TwoVector > | endPiecePoints |
Vector of 2D points for end piece looking from above down z. | |
BDSMagnetOuterFactoryBase * | cylindrical |
Default factory to fall back to. | |
![]() | |
G4VSolid * | poleSolid |
Solid for an individual pole that will be placed multiple times. | |
G4VSolid * | yokeSolid |
Solid for outer part that connects all poles. | |
G4VSolid * | containerSolid |
G4VSolid * | magnetContainerSolid |
G4LogicalVolume * | poleLV |
G4LogicalVolume * | yokeLV |
G4LogicalVolume * | containerLV |
G4LogicalVolume * | magnetContainerLV |
G4VPhysicalVolume * | yokePV |
G4VisAttributes * | outerVisAttributes |
BDSExtent | magContExtent |
BDSGeometryComponent * | magnetContainer |
G4ThreeVector | inputFaceNormal |
G4ThreeVector | outputFaceNormal |
G4bool | sensitiveOuter |
Cache of global constants variable. | |
![]() | |
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. | |
G4double | lengthSafetyLarge |
Cache of global constants variable. | |
G4bool | checkOverlaps |
Cache of global constants variable. | |
G4bool | visDebug |
Cache of global constants variable. | |
G4int | nSegmentsPerCircle |
Cache of global constants variable. | |
G4VisAttributes * | containerVisAttr |
Cache of global constants variable. | |
G4UserLimits * | defaultUserLimits |
Cache of global constants variable. | |
Factory class for outer volume of magnets.
Produces magnets with 2N-poles around the beampipe with a square yoke.
Most magnets are 2N poles, but sector- and r-bends as well as muon spoilers, and h/v kickers are unique.
Definition at line 45 of file BDSMagnetOuterFactoryPolesSquare.hh.
BDSMagnetOuterFactoryPolesSquare::BDSMagnetOuterFactoryPolesSquare | ( | ) |
Definition at line 42 of file BDSMagnetOuterFactoryPolesSquare.cc.
|
inlinevirtual |
Definition at line 49 of file BDSMagnetOuterFactoryPolesSquare.hh.
|
privatevirtual |
Clean up all memebers used.
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 48 of file BDSMagnetOuterFactoryPolesSquare.cc.
References BDSMagnetOuterFactoryPolesBase::CleanUp(), and CleanUpPolesSquare().
|
private |
Clean up for this factory. Non-virtual as used in constructor.
Definition at line 54 of file BDSMagnetOuterFactoryPolesSquare.cc.
References order, and poleRotations.
Referenced by CleanUp().
|
privatevirtual |
Common construction tasks to all methods - assemble yoke and poles in container have to override this as we have multiple pole logical volumes and they need to be registered
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 242 of file BDSMagnetOuterFactoryPolesSquare.cc.
References BDSMagnetOuterFactoryPolesBase::CommonConstructor(), BDSGeometryComponent::RegisterLogicalVolume(), BDSGeometryComponent::RegisterSensitiveVolume(), and BDSMagnetOuterFactoryBase::sensitiveOuter.
|
privatevirtual |
Build the logical volumes from the solids assigning materials and colours and cuts. This doesn't make use of any base class implementation as this class creates a vector of unique poles that must all be built individually into logical volumes. It does however make use of BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumesCoil.
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 151 of file BDSMagnetOuterFactoryPolesSquare.cc.
References BDSFactoryBase::containerVisAttr, BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumesCoil(), BDSFactoryBase::defaultUserLimits, BDSMaterials::GetMaterial(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), BDSFactoryBase::nSegmentsPerCircle, order, and BDSMagnetOuterFactoryBase::yokeSolid.
|
privatevirtual |
Create yoke that connects poles and container to put them in.
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 62 of file BDSMagnetOuterFactoryPolesSquare.cc.
References BDSFactoryBase::lengthSafety, BDSMagnetOuterFactoryPolesBase::poleIntersectionSolid, BDSMagnetOuterFactoryPolesBase::poleStartRadius, BDSMagnetOuterFactoryPolesBase::yokeFinishRadius, BDSMagnetOuterFactoryBase::yokeSolid, and BDSMagnetOuterFactoryPolesBase::yokeStartRadius.
|
privatevirtual |
Chop off the top of the pole to match the appropriate yoke geometry.
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 125 of file BDSMagnetOuterFactoryPolesSquare.cc.
References order, BDSMagnetOuterFactoryPolesBase::poleIntersectionSolid, BDSMagnetOuterFactoryBase::poleSolid, and BDSMagnetOuterFactoryPolesBase::segmentAngle.
|
privatevirtual |
Place the poles and yoke in the container volume.
Reimplemented from BDSMagnetOuterFactoryPolesBase.
Definition at line 201 of file BDSMagnetOuterFactoryPolesSquare.cc.
References BDSMagnetOuterFactoryPolesBase::buildPole, BDSFactoryBase::checkOverlaps, and BDSMagnetOuterFactoryPolesBase::segmentAngle.
|
private |
Need to pass order to CreateLogicalVolumes but should override for neatness and therefore can't change the signature of the function, so pass by internal variable.
Definition at line 99 of file BDSMagnetOuterFactoryPolesSquare.hh.
Referenced by CleanUpPolesSquare(), CreateLogicalVolumes(), and IntersectPoleWithYoke().
|
private |
Definition at line 95 of file BDSMagnetOuterFactoryPolesSquare.hh.
|
private |
Poles have to be different lengths to fit in a square - have to be unique therefore keep a vector of them
Definition at line 93 of file BDSMagnetOuterFactoryPolesSquare.hh.
Referenced by CleanUpPolesSquare().
|
private |
Definition at line 94 of file BDSMagnetOuterFactoryPolesSquare.hh.