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;
36 "event header is null in GstreamerRootFactory::getOrInstantiateHeaderTree");
43 treePtr = std::make_unique<GRootTree>(event_header,
log);
51const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateHeaderTree(
52 [[maybe_unused]]
const std::unique_ptr<GRunHeader>& run_header) {
56 std::cerr <<
"FATAL: log is null in GstreamerRootFactory::getOrInstantiateHeaderTree" << std::endl;
62 "run header is null in GstreamerRootFactory::getOrInstantiateHeaderTree");
68 treePtr = std::make_unique<GRootTree>(run_header,
log);
76const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateTrueInfoDataTree(
77 const std::string& detectorName,
82 auto& treePtr = gRootTrees[treeName];
84 log->info(2,
"GstreamerRootFactory",
"Creating GTrueInfoData ROOT tree for ", detectorName);
85 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
93const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateDigitizedDataTree(
94 const std::string& detectorName,
99 auto& treePtr = gRootTrees[treeName];
101 log->info(2,
"GstreamerRootFactory",
"Creating GDigitizedData ROOT tree for ", detectorName);
102 treePtr = std::make_unique<GRootTree>(treeName, gdata,
log);
108const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateGeneratedParticleTree(
109 const std::string& treeName,
112 auto& treePtr = gRootTrees[treeName];
114 log->info(2,
"GstreamerRootFactory",
"Creating generated-particle ROOT tree for ", treeName);
115 treePtr = std::make_unique<GRootTree>(treeName, particles,
log);
121const std::unique_ptr<GRootTree>& GstreamerRootFactory::getOrInstantiateAncestorTree(
126 log->info(2,
"GstreamerRootFactory",
"Creating ancestor ROOT tree");
127 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.