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 
14 class TTree;
15 #include "boost/shared_ptr.hpp"
16 #include <array>
17 #include <string>
18 
19 namespace edm {
20  class BranchDescription;
21  class FileBlock {
22  public:
23  // bit mask for reasons fast cloning can be disabled or not applicable
24  enum
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 
66  fileName_(),
71 
73  TTree const* ev, TTree const* meta,
74  TTree const* lumi, TTree const* lumiMeta,
75  TTree const* run, TTree const* runMeta,
77  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch,
78  std::string const& fileName,
80  bool modifiedIDs,
81  boost::shared_ptr<BranchChildren> branchChildren,
82  boost::shared_ptr<BranchIDLists const> branchIDLists) :
83  fileFormatVersion_(version),
84  tree_(const_cast<TTree*>(ev)),
85  metaTree_(const_cast<TTree*>(meta)),
86  lumiTree_(const_cast<TTree*>(lumi)),
87  lumiMetaTree_(const_cast<TTree*>(lumiMeta)),
88  runTree_(const_cast<TTree*>(run)),
89  runMetaTree_(const_cast<TTree*>(runMeta)),
90  whyNotFastClonable_(whyNotFastClonable),
91  hasNewlyDroppedBranch_(hasNewlyDroppedBranch),
92  fileName_(fileName),
93  branchListIndexesUnchanged_(branchListIndexesUnchanged),
94  modifiedIDs_(modifiedIDs),
95  branchChildren_(branchChildren),
96  branchIDLists_(branchIDLists) {}
97 
99 
101  TTree* tree() const {return tree_;}
102  TTree* metaTree() const {return metaTree_;}
103  TTree* lumiTree() const {return lumiTree_;}
104  TTree* lumiMetaTree() const {return lumiMetaTree_;}
105  TTree* runTree() const {return runTree_;}
106  TTree* runMetaTree() const {return runMetaTree_;}
107 
109  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const {return hasNewlyDroppedBranch_;}
110  std::string const& fileName() const {return fileName_;}
112  bool modifiedIDs() const {return modifiedIDs_;}
113 
115  whyNotFastClonable_ |= why;
116  }
117  BranchChildren const& branchChildren() const { return *branchChildren_; }
118  BranchIDLists const& branchIDLists() const { return *branchIDLists_; }
120 
121  private:
123  // We use bare pointers because ROOT owns these.
124  TTree* tree_;
125  TTree* metaTree_;
126  TTree* lumiTree_;
128  TTree* runTree_;
129  TTree* runMetaTree_;
131  std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
135  boost::shared_ptr<BranchChildren> branchChildren_;
136  boost::shared_ptr<BranchIDLists const> branchIDLists_;
137  };
138 }
139 #endif
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
tuple lumi
Definition: fjr2json.py:35
BranchIDLists const & branchIDLists() const
Definition: FileBlock.h:118
#define nullptr
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:100
int whyNotFastClonable() const
Definition: FileBlock.h:108
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:109
std::string fileName_
Definition: FileBlock.h:132
BranchChildren const & branchChildren() const
Definition: FileBlock.h:117
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:122
TTree * lumiTree_
Definition: FileBlock.h:126
TTree * metaTree() const
Definition: FileBlock.h:102
bool modifiedIDs() const
Definition: FileBlock.h:112
TTree * lumiMetaTree_
Definition: FileBlock.h:127
int whyNotFastClonable_
Definition: FileBlock.h:130
TTree * lumiMetaTree() const
Definition: FileBlock.h:104
void close()
Definition: FileBlock.h:119
TTree * runMetaTree_
Definition: FileBlock.h:129
bool modifiedIDs_
Definition: FileBlock.h:134
boost::shared_ptr< BranchChildren > branchChildren_
Definition: FileBlock.h:135
TTree * runMetaTree() const
Definition: FileBlock.h:106
TTree * runTree_
Definition: FileBlock.h:128
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: FileBlock.h:136
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, boost::shared_ptr< BranchIDLists const > branchIDLists)
Definition: FileBlock.h:72
bool branchListIndexesUnchanged_
Definition: FileBlock.h:133
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:131
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:114
TTree * lumiTree() const
Definition: FileBlock.h:103
TTree * tree_
Definition: FileBlock.h:124
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:111
volatile std::atomic< bool > shutdown_flag false
TTree * metaTree_
Definition: FileBlock.h:125
TTree * runTree() const
Definition: FileBlock.h:105
TTree * tree() const
Definition: FileBlock.h:101
std::string const & fileName() const
Definition: FileBlock.h:110