6#include <ROOT/RConfig.hxx>
15 ROOT::EnableThreadSafety();
16 std::cout <<
"GstreamerRootFactory: ROOT thread safety enabled" << std::endl;
20 static EnableRootTS _enableROOTLocks;
25const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateHeaderTree(
26 [[maybe_unused]]
const std::unique_ptr<GEventHeader>& event_header) {
30 std::cerr <<
"FATAL: log is null in GstreamerRootFactory::getOrInstantiateHeaderTree" << std::endl;
42 treePtr = std::make_unique<GRootTree>(event_header,
log);
50const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateHeaderTree(
51 [[maybe_unused]]
const std::unique_ptr<GRunHeader>& run_header) {
55 std::cerr <<
"FATAL: log is null in GstreamerRootFactory::getOrInstantiateHeaderTree" << std::endl;
66 treePtr = std::make_unique<GRootTree>(run_header,
log);
74const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateTrueInfoDataTree(
75 const std::string& detectorName,
79 auto& treePtr = gRootTrees[treeName];
81 log->
info(2,
"GstreamerRootFactory",
"Creating GTrueInfoData ROOT tree for ", detectorName);
82 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
90const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateDigitizedDataTree(
91 const std::string& detectorName,
95 auto& treePtr = gRootTrees[treeName];
97 log->
info(2,
"GstreamerRootFactory",
"Creating GDigitizedData ROOT tree for ", detectorName);
98 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
104const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateGeneratedParticleTree(
105 const std::string& treeName,
107 auto& treePtr = gRootTrees[treeName];
109 log->
info(2,
"GstreamerRootFactory",
"Creating generated-particle ROOT tree for ", treeName);
110 treePtr = std::make_unique<GRootTree>(treeName, particles,
log);
std::shared_ptr< GLogger > log
void info(int level, Args &&... args) const
void error(int exit_code, Args &&... args) const
Abstract base class for all gstreamer output plugins.
ROOT plugin writing event and run content into TTree objects stored in one TFile.
std::vector< GGeneratedParticleData > GGeneratedParticleBank
ROOT tree adapter used internally by the ROOT gstreamer plugin.
#define EVENTHEADERTREENAME
#define RUNHEADERTREENAME
#define DIGITIZEDNAMEPREFIX
#define TRUEINFONAMEPREFIX
#define ERR_PUBLISH_ERROR
Publish sequence encountered invalid state or invalid input data.
GStreamer * GStreamerFactory(const std::shared_ptr< GOptions > &g)
ROOT streamer plugin declarations.