CMS 3D CMS Logo

FileBlock.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_FileBlock_h
2 #define FWCore_Framework_FileBlock_h
3 
4 /*----------------------------------------------------------------------
5 
6 FileBlock: Properties of an input file.
7 
8 ----------------------------------------------------------------------*/
9 
13 class TTree;
14 #include <memory>
15 #include <array>
16 #include <string>
17 #include <utility>
18 #include <vector>
19 
20 namespace edm {
21  class BranchDescription;
22  class FileBlock {
23  public:
24  // bit mask for reasons fast cloning can be disabled or not applicable
26  CanFastClone = 0x0,
27 
28  // For entire job
33 
34  // For a given input file
45 
46  // The remainder of these are defined here for convenience,
47  // but never set in FileBlock, because they are output module specific.
48 
49  // For a given output module
52 
53  // For given input and output files
57  };
58 
61  tree_(nullptr),
62  metaTree_(nullptr),
63  lumiTree_(nullptr),
64  lumiMetaTree_(nullptr),
65  runTree_(nullptr),
66  runMetaTree_(nullptr),
69  fileName_(),
73 
75  TTree* ev,
76  TTree* meta,
77  TTree* lumi,
78  TTree* lumiMeta,
79  TTree* run,
80  TTree* runMeta,
81  std::vector<TTree*> processBlockTrees,
82  std::vector<std::string> processesWithProcessBlockTrees,
84  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch,
85  std::string const& fileName,
87  bool modifiedIDs,
88  std::shared_ptr<BranchChildren const> branchChildren)
90  tree_(ev),
91  metaTree_(meta),
92  lumiTree_(lumi),
93  lumiMetaTree_(lumiMeta),
94  runTree_(run),
95  runMetaTree_(runMeta),
104 
106 
107  void updateTTreePointers(TTree* ev,
108  TTree* meta,
109  TTree* lumi,
110  TTree* lumiMeta,
111  TTree* run,
112  TTree* runMeta,
113  std::vector<TTree*> processBlockTrees,
114  std::vector<std::string> processesWithProcessBlockTrees);
115 
117  TTree* tree() const { return tree_; }
118  TTree* metaTree() const { return metaTree_; }
119  TTree* lumiTree() const { return lumiTree_; }
120  TTree* lumiMetaTree() const { return lumiMetaTree_; }
121  TTree* runTree() const { return runTree_; }
122  TTree* runMetaTree() const { return runMetaTree_; }
123  TTree* processBlockTree(std::string const& processName) const;
124 
125  std::vector<TTree*> const& processBlockTrees() const { return processBlockTrees_; }
126  std::vector<std::string> const& processesWithProcessBlockTrees() const { return processesWithProcessBlockTrees_; }
127 
128  int whyNotFastClonable() const { return whyNotFastClonable_; }
129  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const { return hasNewlyDroppedBranch_; }
130  std::string const& fileName() const { return fileName_; }
132  bool modifiedIDs() const { return modifiedIDs_; }
133 
135  BranchChildren const& branchChildren() const { return *branchChildren_; }
136  void close();
137 
138  private:
140  // We use bare pointers because ROOT owns these.
141  TTree* tree_;
142  TTree* metaTree_;
143  TTree* lumiTree_;
145  TTree* runTree_;
146  TTree* runMetaTree_;
147  std::vector<TTree*> processBlockTrees_;
148  std::vector<std::string> processesWithProcessBlockTrees_;
150  std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
154  std::shared_ptr<BranchChildren const> branchChildren_;
155  };
156 } // namespace edm
157 #endif
std::vector< TTree * > const & processBlockTrees() const
Definition: FileBlock.h:125
BranchChildren const & branchChildren() const
Definition: FileBlock.h:135
std::shared_ptr< BranchChildren const > branchChildren_
Definition: FileBlock.h:154
std::string const & fileName() const
Definition: FileBlock.h:130
TTree * processBlockTree(std::string const &processName) const
Definition: FileBlock.cc:24
TTree * lumiTree() const
Definition: FileBlock.h:119
void updateTTreePointers(TTree *ev, TTree *meta, TTree *lumi, TTree *lumiMeta, TTree *run, TTree *runMeta, std::vector< TTree *> processBlockTrees, std::vector< std::string > processesWithProcessBlockTrees)
Definition: FileBlock.cc:6
TTree * lumiMetaTree() const
Definition: FileBlock.h:120
std::string fileName_
Definition: FileBlock.h:151
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:139
TTree * lumiTree_
Definition: FileBlock.h:143
TTree * lumiMetaTree_
Definition: FileBlock.h:144
std::vector< TTree * > processBlockTrees_
Definition: FileBlock.h:147
int whyNotFastClonable_
Definition: FileBlock.h:149
void close()
Definition: FileBlock.cc:33
TTree * runMetaTree_
Definition: FileBlock.h:146
bool modifiedIDs_
Definition: FileBlock.h:153
TTree * tree() const
Definition: FileBlock.h:117
TTree * runTree_
Definition: FileBlock.h:145
FileBlock(FileFormatVersion const &version, TTree *ev, TTree *meta, TTree *lumi, TTree *lumiMeta, TTree *run, TTree *runMeta, std::vector< TTree *> processBlockTrees, std::vector< std::string > processesWithProcessBlockTrees, int whyNotFastClonable, std::array< bool, NumBranchTypes > const &hasNewlyDroppedBranch, std::string const &fileName, bool branchListIndexesUnchanged, bool modifiedIDs, std::shared_ptr< BranchChildren const > branchChildren)
Definition: FileBlock.h:74
TTree * metaTree() const
Definition: FileBlock.h:118
bool modifiedIDs() const
Definition: FileBlock.h:132
bool branchListIndexesUnchanged_
Definition: FileBlock.h:152
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:150
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:134
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:129
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:131
TTree * tree_
Definition: FileBlock.h:141
HLT enums.
TTree * runMetaTree() const
Definition: FileBlock.h:122
std::vector< std::string > const & processesWithProcessBlockTrees() const
Definition: FileBlock.h:126
int whyNotFastClonable() const
Definition: FileBlock.h:128
TTree * metaTree_
Definition: FileBlock.h:142
std::vector< std::string > processesWithProcessBlockTrees_
Definition: FileBlock.h:148
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:116
def move(src, dest)
Definition: eostools.py:511
TTree * runTree() const
Definition: FileBlock.h:121