Belle II Software development
RootIOUtilities.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <string>
12#include <vector>
13#include <set>
14
15class TTree;
16class TClass;
17class TBranch;
18
19namespace Belle2 {
24 class FileMetaData;
25
27 namespace RootIOUtilities {
39 std::set<std::string> filterBranches(const std::set<std::string>& branchesToFilter, const std::vector<std::string>& branches,
40 const std::vector<std::string>& excludeBranches, int durability, bool quiet = false);
41
54 size_t setBranchStatus(TBranch* branch, bool process);
55
57 std::vector<std::string> expandWordExpansions(const std::vector<std::string>& filenames);
58
60 long getEntryNumberWithEvtRunExp(TTree* tree, long event, long run, long experiment);
61
63 void buildIndex(TTree* tree);
64
69 bool hasStreamer(const TClass* cl);
70
76 bool hasCustomStreamer(const TClass* cl);
77
79 void setCreationData(FileMetaData& metadata);
80
88 std::string getCommitID();
89
91 extern const std::string c_treeNames[];
92
94 extern const std::string c_SteerBranchNames[];
95
97 extern const std::string c_SteerExcludeBranchNames[];
98
100 extern const std::string c_SteerAdditionalBranchNames[];
101 }
103}
bool hasCustomStreamer(const TClass *cl)
Returns true if and only if 'cl' has a user-defined streamer.
const std::string c_treeNames[]
Names of trees.
const std::string c_SteerExcludeBranchNames[]
Steering parameter names for m_excludeBranchNames.
std::string getCommitID()
Return git SHA1 hashes taking into account local & central release.
std::vector< std::string > expandWordExpansions(const std::vector< std::string > &filenames)
Performs wildcard expansion using wordexp(), returns matches.
const std::string c_SteerBranchNames[]
Steering parameter names for m_branchNames.
void setCreationData(FileMetaData &metadata)
Fill the creation info of a file meta data: site, user, data.
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 t...
const std::string c_SteerAdditionalBranchNames[]
Steering parameter names for m_additionalBranchNames.
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.
size_t setBranchStatus(TBranch *branch, bool process)
Set Branch to be read or not.
Abstract base class for different kinds of events.