19 auto gsystem_node = gopts->getOptionNode(
"gsystem");
22 systems.reserve(gsystem_node.size());
24 auto exp = gopts->getScalarString(
"experiment");
25 auto run = gopts->getScalarInt(
"runno");
26 auto dbhost = gopts->getScalarString(
"sql");
27 auto ascii_db = gopts->getScalarString(
"ascii_db");
29 for (
auto gsystem_item : gsystem_node) {
36 std::make_shared<GSystem>(
39 gopts->get_variable_in_option<std::string>(gsystem_item,
"name",
goptions::NODFLT),
43 gopts->get_variable_in_option<std::string>(gsystem_item,
"variation",
"default"),
44 gopts->get_variable_in_option<std::string>(gsystem_item,
"annotations",
54std::vector<GModifier>
getModifiers(
const std::shared_ptr<GOptions>& gopts) {
55 std::vector<GModifier> gmods;
57 auto gmodifier_node = gopts->getOptionNode(
"gmodifier");
59 for (
auto gmodifier_item : gmodifier_node) {
61 gopts->get_variable_in_option<std::string>(gmodifier_item,
"name",
goptions::NODFLT),
62 gopts->get_variable_in_option<std::string>(gmodifier_item,
"shift",
GSYSTEMNOMODIFIER),
63 gopts->get_variable_in_option<std::string>(gmodifier_item,
"tilt",
GSYSTEMNOMODIFIER),
64 gopts->get_variable_in_option<
bool>(gmodifier_item,
"isPresent",
true));
82 help =
"A system definition includes the geometry location, factory and variation \n \n";
83 help +=
"Possible factories are: \n";
89 R
"RAWS(Example: -gsystem="[{name: b1}]")RAWS";
91 std::vector<GVariable> gsystem = {
92 {"name",
goptions::NODFLT,
"system name (mandatory). For ascii factories, it may include the path to the file"},
94 {
"variation",
"default",
"geometry variation)"},
100 help =
"The volume modifer can shift, tilt, or delete a volume from the gworld \n \n";
101 help += R
"RAWS(Example: +gmodifier={volume: "targetCell", tilt: "0*deg, 0*deg, -10*deg" })RAWS";
103 std::vector<GVariable> gmodifier = {
107 {
"isPresent",
true,
"f set to false, remove volume from world i"}
109 goptions.defineOption(
"gmodifier",
"modify volume existence or placement", gmodifier, help);
111 help =
"root volume definition. Default is: " + std::string(
ROOTDEFINITION) +
". \n\n";
112 help +=
"Command line Example: -root=\"G4Box 25*cm 24*cm 40*cm G4_WATER\"\n";
113 help +=
"YAML file example: root: G4Box, 24*cm, 24*cm, 40*cm, G4_WATER\n";
128 goptions.defineOption(
GVariable(
"experiment",
"examples",
"experiment selection"),
129 "Each experiment have a subset of unique systems");
133 "All systems share this run number");
Conventions and shared constants for the detector-system module.
#define GSYSTEMSQLITETFACTORYLABEL
#define GSYSTEMMYSQLTFACTORYLABEL
#define GSYSTEMSASCIISEARCHDIR
Default search directory for ASCII factory files.
#define GSYSTEMCADTFACTORYLABEL
#define GSYSTEMASCIIFACTORYLABEL
#define GSYSTEMSQLITETDEFAULTFILE
Default sqlite DB filename used when the user does not specify one.
#define GSYSTEMNOMODIFIER
#define ROOTWORLDGVOLUMENAME
Canonical name for the ROOT/world gvolume entry.
std::vector< SystemPtr > SystemList
Option definitions and extraction helpers for the gsystem module.
constexpr const char * GSFACTORY_LOGGER
constexpr const char * GSYSTEM_LOGGER
constexpr const char * GVOLUME_LOGGER
constexpr const char * GWORLD_LOGGER
constexpr const char * GMATERIAL_LOGGER
#define UNINITIALIZEDSTRINGQUANTITY
GOptions defineOptions()
Define and return all option groups required by the gsystem module.
std::vector< GModifier > getModifiers(const std::shared_ptr< GOptions > &gopts)
Build a list of volume modifiers from options.
SystemList getSystems(const std::shared_ptr< GOptions > &gopts)
Build a list of systems from options.