You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passive: inject external (CAD) geometry modules from JSON config
Make external geometry modules configurable from the outside instead of
hardcoding them in build_geometry.C. Adds:
- ExternalModule::createFromJSON(): builds a list of external passive
modules from a JSON file ("externalModules" array of {name, macro,
anchor, optional placement{translation, rotation_deg}}).
- SimConfig: new --extGeomFile option, carried through SimConfigData and
exposed via getExtGeomFilename().
- build_geometry.C: replaces the single hardcoded EXT block with a loop
that adds every external module whose name is in the active module list.
Also fixes a blocker for running several external modules at once: every
geom.C produced by O2_CADtoTGeo.py exports identical symbols
(build(), get_builder_hook_unchecked(), ...). Loading them all into the
single global Cling scope made the first definition win and silently
ignored later macros. initGeomBuilderHook() now JITs each macro into a
unique per-instance namespace (hoisting #include lines to global scope),
so multiple CAD modules coexist.
Tested with o2-sim-serial -n 1 injecting two CAD detectors (oTOF and IRIS,
the latter with materials from a BOM CSV) simultaneously.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
"asservice", bpo::value<bool>()->default_value(false), "run in service/server mode")(
76
76
"noGeant", bpo::bool_switch(), "prohibits any Geant transport/physics (by using tight cuts)")(
77
77
"forwardKine", bpo::bool_switch(), "forward kinematics on a FairMQ channel")(
78
-
"noDiscOutput", bpo::bool_switch(), "switch off writing sim results to disc (useful in combination with forwardKine)");
78
+
"noDiscOutput", bpo::bool_switch(), "switch off writing sim results to disc (useful in combination with forwardKine)")(
79
+
"extGeomFile", bpo::value<std::string>()->default_value(""), "Path to a JSON file describing external (CAD) geometry modules to inject (see Detectors/Passive ExternalModule). Modules are added when their 'name' is part of the active module list.");
79
80
options.add_options()("fromCollContext", bpo::value<std::string>()->default_value(""), "Use a pregenerated collision context to infer number of events to simulate, how to embedd them, the vertex position etc. Takes precedence of other options such as \"--nEvents\". The format is COLLISIONCONTEXTFILE.root[:SIGNALNAME] where SIGNALNAME is the event part in the context which is relevant.");
0 commit comments