BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
BDSCrystalFactory Class Reference

Abstract base class for crystal factory classes. More...

#include <BDSCrystalFactory.hh>

Inheritance diagram for BDSCrystalFactory:
Inheritance graph
Collaboration diagram for BDSCrystalFactory:
Collaboration graph

Public Member Functions

BDSCrystalCreateCrystal (const G4String &nameIn, const BDSCrystalInfo *recipe)
 Main interface to create a crystal.
 
- Public Member Functions inherited from BDSFactoryBase
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.
 
BDSCrystalBuildCrystalObject (const BDSCrystalInfo *recipe, const BDSExtent &extent)
 build beampipe and register logical volumes
 
void SetVisAttributes ()
 Set visual attributes.

 
void SetUserLimits (G4double length)
 Set user limits.
 
BDSCrystalCreateCrystalBox (const G4String &nameIn, const BDSCrystalInfo *recipe)
 Create box geometry for a crystal.
 
BDSCrystalCreateCrystalCylinder (const G4String &nameIn, const BDSCrystalInfo *recipe)
 Create cylinder geometry for a crystal.
 
BDSCrystalCreateCrystalTorus (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

- 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.
 
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.
 

Detailed Description

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.

Author
Laurie Nevay

Definition at line 49 of file BDSCrystalFactory.hh.

Constructor & Destructor Documentation

◆ BDSCrystalFactory()

BDSCrystalFactory::BDSCrystalFactory ( )

Definition at line 63 of file BDSCrystalFactory.cc.

◆ ~BDSCrystalFactory()

virtual BDSCrystalFactory::~BDSCrystalFactory ( )
inlinevirtual

Definition at line 53 of file BDSCrystalFactory.hh.

Member Function Documentation

◆ BuildCrystalObject()

BDSCrystal * BDSCrystalFactory::BuildCrystalObject ( const BDSCrystalInfo recipe,
const BDSExtent extent 
)
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().

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

◆ CalculateExtents()

BDSExtent BDSCrystalFactory::CalculateExtents ( G4double  bendingAngle,
G4double  xBendingRadius,
G4double  xThickness,
const BDSCrystalInfo recipe 
) const
private

Produce an extent for a curved crystal.

Definition at line 228 of file BDSCrystalFactory.cc.

References BDSCrystalInfo::lengthY.

Referenced by CreateCrystalCylinder(), and CreateCrystalTorus().

Here is the caller graph for this function:

◆ CalculateSolidAngles()

void BDSCrystalFactory::CalculateSolidAngles ( G4double  bendingAngle,
G4double &  startAngle,
G4double &  sweepAngle 
) const
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().

Here is the caller graph for this function:

◆ CleanUp()

void BDSCrystalFactory::CleanUp ( )
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().

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

◆ CommonConstruction()

void BDSCrystalFactory::CommonConstruction ( const G4String &  nameIn,
const BDSCrystalInfo recipe 
)
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().

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

◆ CreateCrystal()

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().

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

◆ CreateCrystalBox()

BDSCrystal * BDSCrystalFactory::CreateCrystalBox ( const G4String &  nameIn,
const BDSCrystalInfo recipe 
)
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().

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

◆ CreateCrystalCylinder()

BDSCrystal * BDSCrystalFactory::CreateCrystalCylinder ( const G4String &  nameIn,
const BDSCrystalInfo recipe 
)
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().

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

◆ CreateCrystalTorus()

BDSCrystal * BDSCrystalFactory::CreateCrystalTorus ( const G4String &  nameIn,
const BDSCrystalInfo recipe 
)
private

◆ SetUserLimits()

void BDSCrystalFactory::SetUserLimits ( G4double  length)
private

Set user limits.

Definition at line 166 of file BDSCrystalFactory.cc.

References BDS::CreateUserLimits(), BDSGlobalConstants::Instance(), and maxStepFactor.

Referenced by CommonConstruction().

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

◆ SetVisAttributes()

void BDSCrystalFactory::SetVisAttributes ( )
private

Set visual attributes.

Definition at line 157 of file BDSCrystalFactory.cc.

References BDSColours::Instance().

Referenced by CommonConstruction().

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

Field Documentation

◆ crystalLV

G4LogicalVolume* BDSCrystalFactory::crystalLV
private

Definition at line 103 of file BDSCrystalFactory.hh.

◆ crystalSolid

G4VSolid* BDSCrystalFactory::crystalSolid
private

Definition at line 102 of file BDSCrystalFactory.hh.

◆ maxStepFactor

const G4double BDSCrystalFactory::maxStepFactor
private

Fraction of length for maximum step in user limits.

Definition at line 99 of file BDSCrystalFactory.hh.

Referenced by SetUserLimits().

◆ nPoints

const G4int BDSCrystalFactory::nPoints
private

Number of points to split torus into.

Definition at line 100 of file BDSCrystalFactory.hh.

Referenced by CreateCrystalTorus().

◆ placementOffset

G4ThreeVector BDSCrystalFactory::placementOffset
private

Definition at line 104 of file BDSCrystalFactory.hh.

◆ placementRotation

G4RotationMatrix* BDSCrystalFactory::placementRotation
private

Definition at line 105 of file BDSCrystalFactory.hh.


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