25#include <gemc/glogging/glogger.h>
28#include "G4FieldManager.hh"
29#include "G4LogicalVolume.hh"
30#include "G4RotationMatrix.hh"
31#include "G4ThreeVector.hh"
32#include "G4VPhysicalVolume.hh"
71 [[nodiscard]] G4VSolid*
getSolid() const noexcept {
return solidVolume; }
77 [[nodiscard]] G4LogicalVolume*
getLogical() const noexcept {
return logicalVolume; }
83 [[nodiscard]] G4VPhysicalVolume*
getPhysical() const noexcept {
return physicalVolume; }
92 [[nodiscard]]
const G4RotationMatrix&
getSolidRotation() const noexcept {
return solidRotation; }
105 solidTranslation = pos;
119 void setSolid(G4VSolid* s,
const std::shared_ptr<GLogger>& log);
130 void setLogical(G4LogicalVolume* l,
const std::shared_ptr<GLogger>& log);
141 void setPhysical(G4VPhysicalVolume* p,
const std::shared_ptr<GLogger>& log);
159 G4VSolid* solidVolume{
nullptr};
162 G4RotationMatrix solidRotation;
165 G4ThreeVector solidTranslation;
168 G4LogicalVolume* logicalVolume{
nullptr};
171 G4VPhysicalVolume* physicalVolume{
nullptr};
Convenience container holding a Geant4 solid, logical, and physical volume.
const G4RotationMatrix & getSolidRotation() const noexcept
Return the volume's local frame rotation, recorded at solid-creation time.
void setLogical(G4LogicalVolume *l, const std::shared_ptr< GLogger > &log)
Store a G4LogicalVolume pointer and log the assignment.
G4VSolid * getSolid() const noexcept
Return the stored G4VSolid pointer.
void setPhysical(G4VPhysicalVolume *p, const std::shared_ptr< GLogger > &log)
Store a G4VPhysicalVolume pointer and log the assignment.
G4VPhysicalVolume * getPhysical() const noexcept
Return the stored G4VPhysicalVolume pointer.
G4LogicalVolume * getLogical() const noexcept
Return the stored G4LogicalVolume pointer.
void setFieldManager(G4FieldManager *fm, bool forceToAllDaughters)
Attach a G4FieldManager to the stored logical volume, if present.
~G4Volume()=default
Destructor (no-op).
void setSolidPlacement(const G4RotationMatrix &rot, const G4ThreeVector &pos)
Record the volume's local frame rotation and position.
void setSolid(G4VSolid *s, const std::shared_ptr< GLogger > &log)
Store a G4VSolid pointer and log the assignment.
const G4ThreeVector & getSolidTranslation() const noexcept
Return the volume's local position, recorded at solid-creation time.
G4Volume()=default
Default construct an empty wrapper (all pointers set to nullptr).