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;
37 "event header is null in GstreamerRootFactory::getOrInstantiateHeaderTree");
44 treePtr = std::make_unique<GRootTree>(event_header,
log);
52const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateHeaderTree(
53 [[maybe_unused]]
const std::unique_ptr<GRunHeader>& run_header) {
57 std::cerr <<
"FATAL: log is null in GstreamerRootFactory::getOrInstantiateHeaderTree" << std::endl;
64 "run header is null in GstreamerRootFactory::getOrInstantiateHeaderTree");
70 treePtr = std::make_unique<GRootTree>(run_header,
log);
78const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateTrueInfoDataTree(
79 const std::string& detectorName,
84 auto& treePtr = gRootTrees[treeName];
86 log->info(2,
"GstreamerRootFactoryCreating GTrueInfoData ROOT tree for %1", detectorName);
87 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
95const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateDigitizedDataTree(
96 const std::string& detectorName,
101 auto& treePtr = gRootTrees[treeName];
103 log->info(2,
"GstreamerRootFactoryCreating GDigitizedData ROOT tree for %1", detectorName);
104 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
110const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateGeneratedParticleTree(
111 const std::string& treeName,
114 auto& treePtr = gRootTrees[treeName];
116 log->info(2,
"GstreamerRootFactoryCreating generated-particle ROOT tree for %1", treeName);
117 treePtr = std::make_unique<GRootTree>(treeName, particles,
log);
123const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateAncestorTree(
128 log->info(2,
"GstreamerRootFactoryCreating ancestor ROOT tree");
129 tree_ptr = std::make_unique<GRootTree>(ancestors,
log);
std::shared_ptr< GLogger > log
Abstract base class for all gstreamer output plugins.
ROOT plugin writing event and run content into TTree objects stored in one TFile.
std::vector< GAncestorData > GAncestorBank
std::vector< GGeneratedParticleData > GGeneratedParticleBank
ROOT tree adapter used internally by the ROOT gstreamer plugin.
GStreamer * GStreamerFactory(const std::shared_ptr< GOptions > &g)
ROOT streamer plugin declarations.
constexpr char TRUEINFONAMEPREFIX[]
constexpr char RUNHEADERTREENAME[]
constexpr char EVENTHEADERTREENAME[]
constexpr char ANCESTORTREENAME[]
constexpr char DIGITIZEDNAMEPREFIX[]
constexpr int ERR_PUBLISH_ERROR
Publish sequence encountered invalid state or invalid input data.