19#ifndef BDSGEOMETRYCOMPONENT_H
20#define BDSGEOMETRYCOMPONENT_H
22#include "BDSExtent.hh"
23#include "BDSSDType.hh"
26#include "G4LogicalVolume.hh"
27#include "G4Transform3D.hh"
33class G4AssemblyVolume;
36class G4VPhysicalVolume;
37class G4VSensitiveDetector;
42typedef CLHEP::HepRotation G4RotationMatrix;
73 G4LogicalVolume* containerLVIn,
76 const G4ThreeVector& placementOffsetIn = G4ThreeVector(0,0,0),
77 G4RotationMatrix* placementRotationIn =
nullptr);
82 const G4ThreeVector& placementOffsetIn = G4ThreeVector(0,0,0),
83 G4RotationMatrix* placementRotationIn =
nullptr);
94 virtual inline G4String
GetName()
const {
return containerLogicalVolume->GetName();}
137 const G4ThreeVector& offset);
234 G4VSolid* containerSolid;
235 G4LogicalVolume* containerLogicalVolume;
236 G4AssemblyVolume* containerAssembly;
246 std::set<G4LogicalVolume*> allLogicalVolumes;
Holder for +- extents in 3 dimensions.
std::pair< G4double, G4double > ExtentX() const
Accessor.
G4ThreeVector ExtentNegative() const
Accessor.
G4ThreeVector ExtentPositive() const
Accessor.
std::pair< G4double, G4double > ExtentZ() const
Accessor.
std::pair< G4double, G4double > ExtentY() const
Accessor.
A generic geometry component for a bdsim model.
virtual std::set< BDSGeometryComponent * > GetAllDaughters() const
Accessor - see member for more info.
std::set< G4VSolid * > allSolids
registry of all solids belonging to this component
G4LogicalVolume * GetContainerLogicalVolume() const
Accessor - see member for more info.
G4bool ContainerIsAssembly() const
Whether the container is an assembly. If not, it's a logical volume.
std::set< G4VPhysicalVolume * > allPhysicalVolumes
registry of all physical volumes belonging to this component
void InheritExtents(BDSGeometryComponent const *const anotherComponent)
Update the extents of this object with those of another object.
void SetInnerExtent(const BDSExtent &extIn)
Set extent.
G4RotationMatrix * GetPlacementRotation() const
Accessor - see member for more info.
BDSExtent GetExtent() const
Accessor - see member for more info.
G4Transform3D GetPlacementTransform() const
Accessor - see member for more info.
void SetPlacementOffset(const G4ThreeVector &offsetIn)
Set the offset from 0,0,0 that the object should ideally be placed in its parent.
virtual G4String GetName() const
Accessor - see member for more info.
std::pair< G4double, G4double > GetExtentZ() const
Accessor - see member for more info.
G4ThreeVector GetExtentPositive() const
Get the extent of the object in the positive direction in all dimensions.
void RegisterRotationMatrix(G4RotationMatrix *rotationMatrix)
std::set< G4UserLimits * > allUserLimits
registry of all user limits belonging to this component
G4AssemblyVolume * GetContainerAssemblyVolume() const
Accessor - see member for more info.
G4ThreeVector placementOffset
std::set< G4LogicalVolume * > * lvsExcludedFromBiasing
Volumes that should not be included when return GetAllBiasingVolumes().
void MakeAllVolumesSensitive(BDSSDType stype=BDSSDType::energydep)
virtual std::set< G4RotationMatrix * > GetAllRotationMatrices() const
Accessor - see member for more info.
void RegisterDaughter(BDSGeometryComponent *anotherComponent)
virtual void AttachSensitiveDetectors()
Attach a sensitive detector class to all registered sensitive volumes in this component.
std::pair< G4double, G4double > GetInnerExtentX() const
Accessor - see member for more info.
std::pair< G4double, G4double > GetInnerExtentY() const
Accessor - see member for more info.
virtual std::set< G4LogicalVolume * > GetAllBiasingVolumes() const
Return all logical volumes that should be used for biasing minus any that are in the excluded set.
void RegisterLogicalVolume(G4LogicalVolume *logicalVolume)
G4ThreeVector GetExtentNegative() const
Get the extent of the object in the negative direction in all dimensions.
virtual std::set< G4UserLimits * > GetAllUserLimits() const
Accessor - see member for more info.
std::map< G4LogicalVolume *, BDSSDType > sensitivity
virtual std::map< G4LogicalVolume *, BDSSDType > GetAllSensitiveVolumes() const
Access all sensitive volumes belonging to this component.
virtual std::set< G4LogicalVolume * > GetAllLogicalVolumes() const
Access all logical volumes belonging to this component.
std::pair< G4double, G4double > GetInnerExtentZ() const
Accessor - see member for more info.
void InheritObjects(BDSGeometryComponent *component)
static void AttachUserLimitsToAssembly(G4AssemblyVolume *av, G4UserLimits *ul)
Utility function to apply user limits to an assembly volume as there's not interface.
BDSGeometryComponent & operator=(const BDSGeometryComponent &)=delete
Assignment operator not used.
virtual std::set< G4VisAttributes * > GetAllVisAttributes() const
Accessor - see member for more info.
void RegisterPhysicalVolume(G4VPhysicalVolume *physicalVolume)
virtual std::set< G4VSolid * > GetAllSolids() const
Accessor - see member for more info.
G4VSolid * GetContainerSolid() const
Accessor - see member for more info.
std::set< BDSGeometryComponent * > allDaughters
registry of all daughter geometry components
std::pair< G4double, G4double > GetExtentY() const
Accessor - see member for more info.
G4ThreeVector GetPlacementOffset() const
Accessor - see member for more info.
void RegisterUserLimits(G4UserLimits *userLimit)
virtual void ExcludeLogicalVolumeFromBiasing(G4LogicalVolume *lv)
void StripOuterAndMakeAssemblyVolume()
Change from a container logical volume to an assembly volume.
std::set< G4VisAttributes * > allVisAttributes
registry of all visualisation attributes belonging to this component
std::set< G4RotationMatrix * > allRotationMatrices
registry of all rotation matrices belonging to this component
G4bool overrideSensitivity
BDSExtent GetInnerExtent() const
Accessor - see member for more info.
virtual std::set< G4VPhysicalVolume * > GetAllPhysicalVolumes() const
Accessor - see member for more info.
void SetExtent(const BDSExtent &extIn)
Set extent.
void RegisterVisAttributes(G4VisAttributes *visAttribute)
std::pair< G4double, G4double > GetExtentX() const
Accessor - see member for more info.
void RegisterSolid(G4VSolid *solid)
G4RotationMatrix * placementRotation
G4bool containerIsAssembly
True if the 'container' is really an assembly; false if an LV.
void RegisterSensitiveVolume(G4LogicalVolume *sensitiveVolume, BDSSDType sensitivityType)
Improve type-safety of native enum data type in C++.