|
gstreamer
|
Helper class encapsulating one ROOT TTree and its branch storage.
More...
#include <gRootTree.h>
Public Member Functions | |
| ~GRootTree () | |
| Destructor emitting a debug trace when a logger is available. | |
| GRootTree (const std::unique_ptr< GEventHeader > &gevent_header, std::shared_ptr< GLogger > &log) | |
| Construct an event-header tree and register its branches. | |
| GRootTree (const std::unique_ptr< GRunHeader > &grun_header, std::shared_ptr< GLogger > &log) | |
| Construct a run-header tree and register its branches. | |
| GRootTree (const std::string &detectorName, const GTrueInfoData *gdata, std::shared_ptr< GLogger > &log) | |
| Construct a true-information tree for one detector and register its branches. | |
| GRootTree (const std::string &detectorName, const GDigitizedData *gdata, std::shared_ptr< GLogger > &log) | |
| Construct a digitized-data tree for one detector and register its branches. | |
| bool | fillTree (const std::unique_ptr< GEventHeader > &gevent_header) |
| Fill the event-header tree with one event header entry. | |
| bool | fillTree (const std::unique_ptr< GRunHeader > &run_header) |
| Fill the run-header tree with one run header entry. | |
| bool | fillTree (const std::vector< const GTrueInfoData * > &trueInfoData) |
| Fill a true-information detector tree with one detector collection. | |
| bool | fillTree (const std::vector< const GDigitizedData * > &digitizedData) |
| Fill a digitized detector tree with one detector collection. | |
This class adapts GEMC header and hit data models to ROOT vector branches. It owns:
TTree Data organization:
std::vector<int> branchesstd::vector<double> branchesstd::vector<std::string> branchesFor hit-based trees, one branch vector entry corresponds to one hit in the published detector collection. The same hit index therefore lines up across all branch vectors in a given tree fill.
Definition at line 50 of file gRootTree.h.
|
inline |
Definition at line 54 of file gRootTree.h.
| GRootTree::GRootTree | ( | const std::unique_ptr< GEventHeader > & | gevent_header, |
| std::shared_ptr< GLogger > & | log ) |
The event-header schema contains:
g4localEventNumber threadID timeStamp | gevent_header | Event header used to determine and initialize the schema. |
| log | Logger used for diagnostics. |
Definition at line 10 of file gRootTree.cc.
| GRootTree::GRootTree | ( | const std::unique_ptr< GRunHeader > & | grun_header, |
| std::shared_ptr< GLogger > & | log ) |
The run-header schema contains the run identifier.
| grun_header | Run header used to determine and initialize the schema. |
| log | Logger used for diagnostics. |
Definition at line 28 of file gRootTree.cc.
| GRootTree::GRootTree | ( | const std::string & | detectorName, |
| const GTrueInfoData * | gdata, | ||
| std::shared_ptr< GLogger > & | log ) |
Branches are inferred from the variable maps exposed by the sample hit:
std::vector<double> branchesstd::vector<std::string> branches| detectorName | Final ROOT tree name for this detector collection. |
| gdata | Sample true-information hit used to determine the schema. |
| log | Logger used for diagnostics. |
Definition at line 44 of file gRootTree.cc.
| GRootTree::GRootTree | ( | const std::string & | detectorName, |
| const GDigitizedData * | gdata, | ||
| std::shared_ptr< GLogger > & | log ) |
Branches are inferred from the observable maps exposed by the sample hit:
std::vector<int> branchesstd::vector<double> branches| detectorName | Final ROOT tree name for this detector collection. |
| gdata | Sample digitized hit used to determine the schema. |
| log | Logger used for diagnostics. |
Definition at line 61 of file gRootTree.cc.
| bool GRootTree::fillTree | ( | const std::unique_ptr< GEventHeader > & | gevent_header | ) |
The method clears the branch storage vectors, inserts the current header values, and calls TTree::Fill().
| gevent_header | Event header providing the values for this entry. |
true on success. Definition at line 75 of file gRootTree.cc.
| bool GRootTree::fillTree | ( | const std::unique_ptr< GRunHeader > & | run_header | ) |
| run_header | Run header providing the values for this entry. |
true on success. Definition at line 94 of file gRootTree.cc.
| bool GRootTree::fillTree | ( | const std::vector< const GDigitizedData * > & | digitizedData | ) |
Each hit contributes one entry to each registered branch vector.
| digitizedData | Raw-pointer view of the detector digitized hits. |
true on success. Definition at line 123 of file gRootTree.cc.
| bool GRootTree::fillTree | ( | const std::vector< const GTrueInfoData * > & | trueInfoData | ) |
Each hit contributes one entry to each registered branch vector.
| trueInfoData | Raw-pointer view of the detector true-information hits. |
true on success. Definition at line 107 of file gRootTree.cc.