CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
12 class TTree;
13 #include "boost/shared_ptr.hpp"
14 #include <array>
15 #include <string>
16 
17 namespace edm {
18  class BranchDescription;
19  class FileBlock {
20  public:
21  // bit mask for reasons fast cloning can be disabled or not applicable
22  enum
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_(0), metaTree_(0),
60  lumiTree_(0), lumiMetaTree_(0),
61  runTree_(0), runMetaTree_(0),
64  fileName_(),
68 
70  TTree const* ev, TTree const* meta,
71  TTree const* lumi, TTree const* lumiMeta,
72  TTree const* run, TTree const* runMeta,
74  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch,
75  std::string const& fileName,
77  bool modifiedIDs,
78  boost::shared_ptr<BranchChildren> branchChildren) :
79  fileFormatVersion_(version),
80  tree_(const_cast<TTree*>(ev)),
81  metaTree_(const_cast<TTree*>(meta)),
82  lumiTree_(const_cast<TTree*>(lumi)),
83  lumiMetaTree_(const_cast<TTree*>(lumiMeta)),
84  runTree_(const_cast<TTree*>(run)),
85  runMetaTree_(const_cast<TTree*>(runMeta)),
86  whyNotFastClonable_(whyNotFastClonable),
87  hasNewlyDroppedBranch_(hasNewlyDroppedBranch),
88  fileName_(fileName),
89  branchListIndexesUnchanged_(branchListIndexesUnchanged),
90  modifiedIDs_(modifiedIDs),
91  branchChildren_(branchChildren) {}
92 
94 
96  TTree* tree() const {return tree_;}
97  TTree* metaTree() const {return metaTree_;}
98  TTree* lumiTree() const {return lumiTree_;}
99  TTree* lumiMetaTree() const {return lumiMetaTree_;}
100  TTree* runTree() const {return runTree_;}
101  TTree* runMetaTree() const {return runMetaTree_;}
102 
104  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const {return hasNewlyDroppedBranch_;}
105  std::string const& fileName() const {return fileName_;}
107  bool modifiedIDs() const {return modifiedIDs_;}
108 
110  whyNotFastClonable_ |= why;
111  }
112  BranchChildren const& branchChildren() const { return *branchChildren_; }
114 
115  private:
117  // We use bare pointers because ROOT owns these.
118  TTree* tree_;
119  TTree* metaTree_;
120  TTree* lumiTree_;
122  TTree* runTree_;
123  TTree* runMetaTree_;
125  std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
126  std::string fileName_;
129  boost::shared_ptr<BranchChildren> branchChildren_;
130  };
131 }
132 #endif
tuple lumi
Definition: fjr2json.py:35
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:95
int whyNotFastClonable() const
Definition: FileBlock.h:103
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:104
std::string fileName_
Definition: FileBlock.h:126
BranchChildren const & branchChildren() const
Definition: FileBlock.h:112
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:116
TTree * lumiTree_
Definition: FileBlock.h:120
TTree * metaTree() const
Definition: FileBlock.h:97
bool modifiedIDs() const
Definition: FileBlock.h:107
TTree * lumiMetaTree_
Definition: FileBlock.h:121
int whyNotFastClonable_
Definition: FileBlock.h:124
TTree * lumiMetaTree() const
Definition: FileBlock.h:99
void close()
Definition: FileBlock.h:113
TTree * runMetaTree_
Definition: FileBlock.h:123
bool modifiedIDs_
Definition: FileBlock.h:128
boost::shared_ptr< BranchChildren > branchChildren_
Definition: FileBlock.h:129
TTree * runMetaTree() const
Definition: FileBlock.h:101
TTree * runTree_
Definition: FileBlock.h:122
bool branchListIndexesUnchanged_
Definition: FileBlock.h:127
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:125
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:109
TTree * lumiTree() const
Definition: FileBlock.h:98
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, boost::shared_ptr< BranchChildren > branchChildren)
Definition: FileBlock.h:69
TTree * tree_
Definition: FileBlock.h:118
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:106
TTree * metaTree_
Definition: FileBlock.h:119
TTree * runTree() const
Definition: FileBlock.h:100
TTree * tree() const
Definition: FileBlock.h:96
std::string const & fileName() const
Definition: FileBlock.h:105