BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Abstract base class for crystal factory classes. More...
#include <BDSCrystalFactory.hh>
Public Member Functions | |
BDSCrystal * | CreateCrystal (const G4String &nameIn, const BDSCrystalInfo *recipe) |
Main interface to create a crystal. | |
![]() | |
virtual void | FactoryBaseCleanUp () |
Empty containers for next use - factories are never deleted so can't rely on scope. | |
Private Member Functions | |
void | CleanUp () |
void | CommonConstruction (const G4String &nameIn, const BDSCrystalInfo *recipe) |
Common construction tasks. | |
BDSCrystal * | BuildCrystalObject (const BDSCrystalInfo *recipe, const BDSExtent &extent) |
build beampipe and register logical volumes | |
void | SetVisAttributes () |
Set visual attributes. | |
void | SetUserLimits (G4double length) |
Set user limits. | |
BDSCrystal * | CreateCrystalBox (const G4String &nameIn, const BDSCrystalInfo *recipe) |
Create box geometry for a crystal. | |
BDSCrystal * | CreateCrystalCylinder (const G4String &nameIn, const BDSCrystalInfo *recipe) |
Create cylinder geometry for a crystal. | |
BDSCrystal * | CreateCrystalTorus (const G4String &nameIn, const BDSCrystalInfo *recipe) |
Create torus geometry for a cyrstal. | |
void | CalculateSolidAngles (G4double bendingAngle, G4double &startAngle, G4double &sweepAngle) const |
BDSExtent | CalculateExtents (G4double bendingAngle, G4double xBendingRadius, G4double xThickness, const BDSCrystalInfo *recipe) const |
Produce an extent for a curved crystal. | |
Private Attributes | |
const G4double | maxStepFactor |
Fraction of length for maximum step in user limits. | |
const G4int | nPoints |
Number of points to split torus into. | |
G4VSolid * | crystalSolid |
G4LogicalVolume * | crystalLV |
G4ThreeVector | placementOffset |
G4RotationMatrix * | placementRotation |
Additional Inherited Members | |
![]() | |
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. | |
Abstract base class for crystal factory classes.
Class to construct required crystal geometry. Normally our factories are defined by an abstract base class, but as the required geometry is just one primitive, this isn't required and we can do everything in one factory.
Definition at line 49 of file BDSCrystalFactory.hh.
BDSCrystalFactory::BDSCrystalFactory | ( | ) |
Definition at line 63 of file BDSCrystalFactory.cc.
|
inlinevirtual |
Definition at line 53 of file BDSCrystalFactory.hh.
|
private |
build beampipe and register logical volumes
Definition at line 177 of file BDSCrystalFactory.cc.
References BDSGeometryComponent::ExcludeLogicalVolumeFromBiasing(), BDSGeometryComponent::RegisterSensitiveVolume(), BDSGeometryComponent::RegisterSolid(), BDSGeometryComponent::RegisterUserLimits(), and BDSGeometryComponent::RegisterVisAttributes().
Referenced by CreateCrystalBox(), CreateCrystalCylinder(), and CreateCrystalTorus().
|
private |
Produce an extent for a curved crystal.
Definition at line 228 of file BDSCrystalFactory.cc.
References BDSCrystalInfo::lengthY.
Referenced by CreateCrystalCylinder(), and CreateCrystalTorus().
|
private |
Calculate the start angle and sweep angle given a bending angle. Different formula if bending angle is -ve or +ve.
Definition at line 212 of file BDSCrystalFactory.cc.
Referenced by CreateCrystalCylinder(), and CreateCrystalTorus().
|
private |
Initialiser and can be used to reset factory pointers after use. Note, non-virtual as used in constructor.
Definition at line 70 of file BDSCrystalFactory.cc.
References BDSFactoryBase::FactoryBaseCleanUp().
Referenced by CreateCrystal().
|
private |
Common construction tasks.
Definition at line 99 of file BDSCrystalFactory.cc.
References BDSCrystalInfo::data, BDS::FileExists(), BDS::GetFullPath(), BDSCrystalInfo::lengthZ, BDSCrystalInfo::material, SetUserLimits(), SetVisAttributes(), and BDSAcceleratorModel::VolumeSet().
Referenced by CreateCrystalBox(), CreateCrystalCylinder(), and CreateCrystalTorus().
BDSCrystal * BDSCrystalFactory::CreateCrystal | ( | const G4String & | nameIn, |
const BDSCrystalInfo * | recipe | ||
) |
Main interface to create a crystal.
Definition at line 79 of file BDSCrystalFactory.cc.
References CleanUp(), CreateCrystalBox(), CreateCrystalCylinder(), CreateCrystalTorus(), BDSCrystalInfo::shape, and BDSTypeSafeEnum< def, inner >::underlying().
Referenced by BDSCollimatorCrystal::Build().
|
private |
Create box geometry for a crystal.
Definition at line 194 of file BDSCrystalFactory.cc.
References BuildCrystalObject(), CommonConstruction(), BDSCrystalInfo::lengthX, BDSCrystalInfo::lengthY, and BDSCrystalInfo::lengthZ.
Referenced by CreateCrystal(), CreateCrystalCylinder(), and CreateCrystalTorus().
|
private |
Create cylinder geometry for a crystal.
Definition at line 252 of file BDSCrystalFactory.cc.
References BDSCrystalInfo::bendingAngleYAxis, BuildCrystalObject(), CalculateExtents(), CalculateSolidAngles(), CommonConstruction(), CreateCrystalBox(), BDS::IsFinite(), BDSCrystalInfo::lengthX, and BDSCrystalInfo::lengthY.
Referenced by CreateCrystal().
|
private |
Create torus geometry for a cyrstal.
Definition at line 296 of file BDSCrystalFactory.cc.
References BDSCrystalInfo::bendingAngleYAxis, BDSCrystalInfo::bendingAngleZAxis, BuildCrystalObject(), CalculateExtents(), CalculateSolidAngles(), CommonConstruction(), CreateCrystalBox(), BDS::IsFinite(), BDSCrystalInfo::lengthX, nPoints, BDSExtent::XNeg(), BDSExtent::XPos(), BDSExtent::YNeg(), BDSExtent::YPos(), BDSExtent::ZNeg(), and BDSExtent::ZPos().
Referenced by CreateCrystal().
|
private |
Set user limits.
Definition at line 166 of file BDSCrystalFactory.cc.
References BDS::CreateUserLimits(), BDSGlobalConstants::Instance(), and maxStepFactor.
Referenced by CommonConstruction().
|
private |
Set visual attributes.
Definition at line 157 of file BDSCrystalFactory.cc.
References BDSColours::Instance().
Referenced by CommonConstruction().
|
private |
Definition at line 103 of file BDSCrystalFactory.hh.
|
private |
Definition at line 102 of file BDSCrystalFactory.hh.
|
private |
Fraction of length for maximum step in user limits.
Definition at line 99 of file BDSCrystalFactory.hh.
Referenced by SetUserLimits().
|
private |
Number of points to split torus into.
Definition at line 100 of file BDSCrystalFactory.hh.
Referenced by CreateCrystalTorus().
|
private |
Definition at line 104 of file BDSCrystalFactory.hh.
|
private |
Definition at line 105 of file BDSCrystalFactory.hh.