17std::vector<std::string> volume_parameters(
const std::string& emfield,
18 const std::string& digitization,
19 const std::string& identity,
20 const std::string& copy_of,
21 const std::string& solids_operation,
22 const std::string& mirror,
23 const std::string& parameters =
"1*cm, 2*cm, 3*cm") {
25 "test_volume",
"G4Box", parameters,
"G4_AIR",
"root",
26 "0*cm, 0*cm, 0*cm",
"0*deg, 0*deg, 0*deg",
"active", emfield,
27 "1",
"1",
"778899",
"1", digitization, identity, copy_of,
28 solids_operation, mirror,
"1",
"optional field test",
"default",
"1"
35 const std::shared_ptr<GLogger> logger;
37 volume_parameters(
" NULL ",
" not provided ",
"~",
" no ",
"",
" none "),
46 [[maybe_unused]]
const auto& unresolvedName = unset.
getG4Name();
49 catch (
const std::logic_error&) {
55 GVolume imported(logger,
"test",
56 volume_parameters(
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL",
"NULL"));
59 GVolume configured(logger,
"test",
60 volume_parameters(
" torus field ",
" flux ",
" sector: 1 ",
" source ",
61 " left + right ",
" aluminum "),
64 if (configured.
getEMField() != std::optional<std::string>{
"torusfield"} ||
66 configured.
getGIdentity() != std::optional<std::string>{
"sector: 1"} ||
67 configured.
getCopyOf() != std::optional<std::string>{
"source"} ||
68 configured.
getSolidsOpr() != std::optional<std::string>{
"left + right"} ||
69 configured.
getMirror() != std::optional<std::string>{
"aluminum"} ||
70 configured.
getImportedFile() != std::optional<std::string>{
"meshes/part.stl"}) {
77 configured.
applyTilt(
"1*deg, 2*deg, 3*deg");
78 if (configured.
getShift() != std::optional<std::string>{
"1*cm, 2*cm, 3*cm"} ||
79 configured.
getTilt() != std::optional<std::string>{
"1*deg, 2*deg, 3*deg"}) {
Geometry volume record loaded into a GSystem.
const std::optional< std::string > & getTilt() const
void setGIdentity(std::optional< std::string > g)
Override the identity string after loading.
void setDigitization(std::optional< std::string > d)
Override the digitization label after loading.
const std::string & getG4Name() const
void assignG4Names(const std::string &g4n, const std::string &g4m)
Assign Geant4 names after all volumes are loaded.
void applyTilt(std::optional< std::string > t)
Apply an additional rotation to this volume.
const std::optional< std::string > & getSolidsOpr() const
void applyShift(std::optional< std::string > s)
Apply an additional translation to this volume.
const std::optional< std::string > & getParameters() const
const std::optional< std::string > & getCopyOf() const
const std::optional< std::string > & getGIdentity() const
const std::optional< std::string > & getShift() const
const std::optional< std::string > & getImportedFile() const
Return the import filename (path) for imported volumes.
const std::optional< std::string > & getEMField() const
std::vector< double > getDetectorDimensions() const
Returns numeric detector dimensions parsed from the parameters string.
const std::string & getG4MotherName() const
const std::optional< std::string > & getMirror() const
const std::optional< std::string > & getDigitization() const