Belle II Software  release-05-01-25
RootIOUtilities.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Christian Pulvermacher *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <string>
14 #include <vector>
15 #include <set>
16 
17 class TTree;
18 class TClass;
19 class TBranch;
20 
21 namespace Belle2 {
26  class FileMetaData;
27 
29  namespace RootIOUtilities {
41  std::set<std::string> filterBranches(const std::set<std::string>& branchesToFilter, const std::vector<std::string>& branches,
42  const std::vector<std::string>& excludeBranches, int durability, bool quiet = false);
43 
56  size_t setBranchStatus(TBranch* branch, bool process);
57 
59  std::vector<std::string> expandWordExpansions(const std::vector<std::string>& filenames);
60 
62  long getEntryNumberWithEvtRunExp(TTree* tree, long event, long run, long experiment);
63 
65  void buildIndex(TTree* tree);
66 
71  bool hasStreamer(const TClass* cl);
72 
78  bool hasCustomStreamer(const TClass* cl);
79 
81  void setCreationData(FileMetaData& metadata);
82 
90  std::string getCommitID();
91 
93  extern const std::string c_treeNames[];
94 
96  extern const std::string c_SteerBranchNames[];
97 
99  extern const std::string c_SteerExcludeBranchNames[];
100 
102  extern const std::string c_SteerAdditionalBranchNames[];
103  }
105 }
Belle2::RootIOUtilities::c_SteerAdditionalBranchNames
const std::string c_SteerAdditionalBranchNames[]
Steering parameter names for m_additionalBranchNames.
Definition: RootIOUtilities.cc:23
Belle2::RootIOUtilities::c_SteerBranchNames
const std::string c_SteerBranchNames[]
Steering parameter names for m_branchNames.
Definition: RootIOUtilities.cc:21
Belle2::RootIOUtilities::getCommitID
std::string getCommitID()
Return git SHA1 hashes taking into account local & central release.
Definition: RootIOUtilities.cc:200
Belle2::RootIOUtilities::hasStreamer
bool hasStreamer(const TClass *cl)
Returns true if and only if 'cl' or one of its bases has I/O streamers.
Definition: RootIOUtilities.cc:150
Belle2::RootIOUtilities::c_SteerExcludeBranchNames
const std::string c_SteerExcludeBranchNames[]
Steering parameter names for m_excludeBranchNames.
Definition: RootIOUtilities.cc:22
Belle2::RootIOUtilities::c_treeNames
const std::string c_treeNames[]
Names of trees.
Definition: RootIOUtilities.cc:20
Belle2::RootIOUtilities::hasCustomStreamer
bool hasCustomStreamer(const TClass *cl)
Returns true if and only if 'cl' has a user-defined streamer.
Definition: RootIOUtilities.cc:171
Belle2::RootIOUtilities::buildIndex
void buildIndex(TTree *tree)
Build TTreeIndex on tree (assumes EventMetaData branch exists there).
Definition: RootIOUtilities.cc:145
Belle2::RootIOUtilities::expandWordExpansions
std::vector< std::string > expandWordExpansions(const std::vector< std::string > &filenames)
Performs wildcard expansion using wordexp(), returns matches.
Definition: RootIOUtilities.cc:107
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RootIOUtilities::setCreationData
void setCreationData(FileMetaData &metadata)
Fill the creation info of a file meta data: site, user, data.
Definition: RootIOUtilities.cc:177
Belle2::RootIOUtilities::filterBranches
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...
Definition: RootIOUtilities.cc:25
Belle2::RootIOUtilities::setBranchStatus
size_t setBranchStatus(TBranch *branch, bool process)
Set Branch to be read or not.
Definition: RootIOUtilities.cc:85
Belle2::RootIOUtilities::getEntryNumberWithEvtRunExp
long getEntryNumberWithEvtRunExp(TTree *tree, long event, long run, long experiment)
return entry number with given (event, run, experiment) from tree.
Definition: RootIOUtilities.cc:126