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 
18 namespace edm {
19  class BranchDescription;
20  class FileBlock {
21  public:
22  // bit mask for reasons fast cloning can be disabled or not applicable
24  CanFastClone = 0x0,
25 
26  // For entire job
31 
32  // For a given input file
43 
44  // The remainder of these are defined here for convenience,
45  // but never set in FileBlock, because they are output module specific.
46 
47  // For a given output module
50 
51  // For given input and output files
55  };
56 
59  tree_(nullptr),
67  fileName_(),
71 
73  TTree const* ev,
74  TTree const* meta,
75  TTree const* lumi,
76  TTree const* lumiMeta,
77  TTree const* run,
78  TTree const* runMeta,
80  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch,
81  std::string const& fileName,
83  bool modifiedIDs,
84  std::shared_ptr<BranchChildren const> branchChildren)
85  : fileFormatVersion_(version),
86  tree_(const_cast<TTree*>(ev)),
87  metaTree_(const_cast<TTree*>(meta)),
88  lumiTree_(const_cast<TTree*>(lumi)),
89  lumiMetaTree_(const_cast<TTree*>(lumiMeta)),
90  runTree_(const_cast<TTree*>(run)),
91  runMetaTree_(const_cast<TTree*>(runMeta)),
92  whyNotFastClonable_(whyNotFastClonable),
93  hasNewlyDroppedBranch_(hasNewlyDroppedBranch),
94  fileName_(fileName),
95  branchListIndexesUnchanged_(branchListIndexesUnchanged),
96  modifiedIDs_(modifiedIDs),
97  branchChildren_(branchChildren) {}
98 
100 
102  TTree* tree() const { return tree_; }
103  TTree* metaTree() const { return metaTree_; }
104  TTree* lumiTree() const { return lumiTree_; }
105  TTree* lumiMetaTree() const { return lumiMetaTree_; }
106  TTree* runTree() const { return runTree_; }
107  TTree* runMetaTree() const { return runMetaTree_; }
108 
109  int whyNotFastClonable() const { return whyNotFastClonable_; }
110  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const { return hasNewlyDroppedBranch_; }
111  std::string const& fileName() const { return fileName_; }
113  bool modifiedIDs() const { return modifiedIDs_; }
114 
116  BranchChildren const& branchChildren() const { return *branchChildren_; }
118 
119  private:
121  // We use bare pointers because ROOT owns these.
122  TTree* tree_;
123  TTree* metaTree_;
124  TTree* lumiTree_;
126  TTree* runTree_;
127  TTree* runMetaTree_;
129  std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
133  std::shared_ptr<BranchChildren const> branchChildren_;
134  };
135 } // namespace edm
136 #endif
std::shared_ptr< BranchChildren const > branchChildren_
Definition: FileBlock.h:133
#define nullptr
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:101
int whyNotFastClonable() const
Definition: FileBlock.h:109
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:110
std::string fileName_
Definition: FileBlock.h:130
BranchChildren const & branchChildren() const
Definition: FileBlock.h:116
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:120
bool ev
TTree * lumiTree_
Definition: FileBlock.h:124
TTree * metaTree() const
Definition: FileBlock.h:103
bool modifiedIDs() const
Definition: FileBlock.h:113
TTree * lumiMetaTree_
Definition: FileBlock.h:125
int whyNotFastClonable_
Definition: FileBlock.h:128
TTree * lumiMetaTree() const
Definition: FileBlock.h:105
void close()
Definition: FileBlock.h:117
TTree * runMetaTree_
Definition: FileBlock.h:127
bool modifiedIDs_
Definition: FileBlock.h:132
TTree * runMetaTree() const
Definition: FileBlock.h:107
TTree * runTree_
Definition: FileBlock.h:126
FileBlock(FileFormatVersion const &version, TTree const *ev, TTree const *meta, TTree const *lumi, TTree const *lumiMeta, TTree const *run, TTree const *runMeta, 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:72
bool branchListIndexesUnchanged_
Definition: FileBlock.h:131
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:129
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:115
TTree * lumiTree() const
Definition: FileBlock.h:104
TTree * tree_
Definition: FileBlock.h:122
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:112
HLT enums.
TTree * metaTree_
Definition: FileBlock.h:123
TTree * runTree() const
Definition: FileBlock.h:106
TTree * tree() const
Definition: FileBlock.h:102
std::string const & fileName() const
Definition: FileBlock.h:111