|
gstreamer
|
The gstreamer module is the output layer responsible for taking in-memory GEMC data collections and serializing them through a plugin architecture. The module supports multiple output backends, allowing the same event or frame production flow to be directed to different storage formats without changing the event-building code.
In practice, a user configures one or more outputs through the -gstreamer option, and the module loads the corresponding plugin libraries at runtime. Each plugin then receives a high-level publish sequence from the common GStreamer interface.
Supported built-in format tokens currently include:
root ascii csv jlabsro json These map to plugin names using the standard naming convention:
gstreamer_root_plugin gstreamer_ascii_plugin gstreamer_csv_plugin gstreamer_jlabsro_plugin gstreamer_json_plugin The module is designed around explicit ownership boundaries:
Event data ownership remains outside the streamer. The base streamer only stores std::shared_ptr<GEventDataCollection> objects in its buffer so that all event-owned hit data remain valid until the flush is complete. Concrete plugins receive read-only views during publication and do not take ownership of the source event content.
The normal lifecycle is:
The architecture is intentionally layered:
Each concrete plugin derives from GStreamer and overrides only the hooks relevant to its output model. For event publication, the base class drives a fixed sequence:
Similar hook sequences exist for run data and frame streams.
Event output includes two generated-particle banks when generator metadata is available:
generated : runtime records for particles propagated in Geant4 plus source-only file rows that are not propagated.generated_tracked : runtime records for particles propagated in Geant4. For Lund input, this corresponds to rows with type == 1.Both banks publish the same columns: particle name, pid, source type, multiplicity, momentum, theta, phi, and vertex components. The concrete representation is backend-specific:
<rootname>_generated.csv and <rootname>_generated_tracked.csv.generated object.generated and generated_tracked.Design choices in this module include:
The module contributes the following user-facing options through gstreamer::defineOptions() :
ebuffer DEFAULT_GSTREAMER_BUFFER_FLUSH_LIMIT -gstreamer format filename type, defaulting to "event" Example:
The module also aggregates options defined by the gdynamicdigitization module through gdynamicdigitization::defineOptions(). Those options apply when the example or application simultaneously uses dynamic digitization and streaming.
Classes in this module log through the module logger category "gstreamer".
Typical verbosity interpretation is:
Debug output is intended for developers. It prints function-level traces, lifecycle transitions, and internal state information that help diagnose ordering, buffering, and plugin behavior.
The following example is documented as part of this module:
Example snippet: