Belle II Software development
|
Some constants and helpers common to the RootInput and RootOutput modules. More...
Classes | |
class | RootFileInfo |
Helper class to factorize some necessary tasks when working with Belle2 output files. More... | |
Functions | |
std::set< std::string > | filterBranches (const std::set< std::string > &branchesToFilter, const std::vector< std::string > &branches, const std::vector< std::string > &excludeBranches, int durability, bool quiet=false) |
Given a list of input branches and lists of branches to include/exclude, returns a list of branches that are accepted. | |
size_t | setBranchStatus (TBranch *branch, bool process) |
Set Branch to be read or not. | |
std::vector< std::string > | expandWordExpansions (const std::vector< std::string > &filenames) |
Performs wildcard expansion using wordexp(), returns matches. | |
long | getEntryNumberWithEvtRunExp (TTree *tree, long event, long run, long experiment) |
return entry number with given (event, run, experiment) from tree. | |
void | buildIndex (TTree *tree) |
Build TTreeIndex on tree (assumes EventMetaData branch exists there). | |
bool | hasStreamer (const TClass *cl) |
Returns true if and only if 'cl' or one of its bases has I/O streamers. | |
bool | hasCustomStreamer (const TClass *cl) |
Returns true if and only if 'cl' has a user-defined streamer. | |
void | setCreationData (FileMetaData &metadata) |
Fill the creation info of a file meta data: site, user, data. | |
std::string | getCommitID () |
Return git SHA1 hashes taking into account local & central release. | |
Variables | |
const std::string | c_treeNames [] = { "tree", "persistent" } |
Names of trees. | |
const std::string | c_SteerBranchNames [] = { "branchNames", "branchNamesPersistent" } |
Steering parameter names for m_branchNames. | |
const std::string | c_SteerExcludeBranchNames [] = { "excludeBranchNames", "excludeBranchNamesPersistent" } |
Steering parameter names for m_excludeBranchNames. | |
const std::string | c_SteerAdditionalBranchNames [] = { "additionalBranchNames", "additionalBranchNamesPersistent" } |
Steering parameter names for m_additionalBranchNames. | |
Some constants and helpers common to the RootInput and RootOutput modules.
void buildIndex | ( | TTree * | tree | ) |
Build TTreeIndex on tree (assumes EventMetaData branch exists there).
Definition at line 152 of file RootIOUtilities.cc.
std::vector< std::string > expandWordExpansions | ( | const std::vector< std::string > & | filenames | ) |
Performs wildcard expansion using wordexp(), returns matches.
Definition at line 114 of file RootIOUtilities.cc.
std::set< std::string > filterBranches | ( | const std::set< std::string > & | branchesToFilter, |
const std::vector< std::string > & | branches, | ||
const std::vector< std::string > & | excludeBranches, | ||
int | durability, | ||
bool | quiet = false |
||
) |
Given a list of input branches and lists of branches to include/exclude, returns a list of branches that are accepted.
More precisely, an item b from 'branchesToFilter' will be in the returned set if b not in excludeBranches and (b in branches or empty(branches) or b in relationsBetweenAcceptedBranches) and b not in relationsInvolvingExcludedBranches
branchesToFilter | input |
branches | if not empty, the list of branches to be accepted |
excludeBranches | branches that should never end up in output (takes precedence over everything else) |
durability | Durability being filtered (used for messages only) |
quiet | If true don't warn about branches which are missing/extra/duplicate in the lists |
Definition at line 32 of file RootIOUtilities.cc.
std::string getCommitID | ( | ) |
Return git SHA1 hashes taking into account local & central release.
ID is a combined hash $CENTRAL_SHA1[+$LOCAL_SHA1][-modified], or just SHA1[-modified] if only one release or they are on the same revision. Empty string denotes at least one untracked release directory.
Definition at line 207 of file RootIOUtilities.cc.
long getEntryNumberWithEvtRunExp | ( | TTree * | tree, |
long | event, | ||
long | run, | ||
long | experiment | ||
) |
return entry number with given (event, run, experiment) from tree.
Returns -1 if not found.
Definition at line 133 of file RootIOUtilities.cc.
bool hasCustomStreamer | ( | const TClass * | cl | ) |
Returns true if and only if 'cl' has a user-defined streamer.
In that case, TClonesArrays of this type should be written with BypassStreamer(false) and split-level -1 (no splitting).
Definition at line 178 of file RootIOUtilities.cc.
bool hasStreamer | ( | const TClass * | cl | ) |
Returns true if and only if 'cl' or one of its bases has I/O streamers.
TObject is not considered to have any.
Definition at line 157 of file RootIOUtilities.cc.
size_t setBranchStatus | ( | TBranch * | branch, |
bool | process | ||
) |
Set Branch to be read or not.
TTree::SetBranchAddress doesn't do what we want it to do because our branch names seem to not be conform to their expectations. But we don't need to use name matching, we know our structure and it's simple enough so we just recursively go through the branch and all children and set processing on or off.
branch | The branch to change the status for |
process | Whether or not to read/process this branch |
Definition at line 92 of file RootIOUtilities.cc.
void setCreationData | ( | FileMetaData & | metadata | ) |
Fill the creation info of a file meta data: site, user, data.
Definition at line 184 of file RootIOUtilities.cc.
|
extern |
Steering parameter names for m_additionalBranchNames.
Definition at line 30 of file RootIOUtilities.cc.
|
extern |
Steering parameter names for m_branchNames.
Definition at line 28 of file RootIOUtilities.cc.
|
extern |
Steering parameter names for m_excludeBranchNames.
Definition at line 29 of file RootIOUtilities.cc.
|
extern |
Names of trees.
Definition at line 27 of file RootIOUtilities.cc.