test
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 
13 class TTree;
14 #include "boost/shared_ptr.hpp"
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
23  enum
25  CanFastClone = 0x0,
26 
27  // For entire job
32 
33  // For a given input file
44 
45  // The remainder of these are defined here for convenience,
46  // but never set in FileBlock, because they are output module specific.
47 
48  // For a given output module
51 
52  // For given input and output files
56  };
57 
65  fileName_(),
69 
71  TTree const* ev, TTree const* meta,
72  TTree const* lumi, TTree const* lumiMeta,
73  TTree const* run, TTree const* runMeta,
75  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch,
76  std::string const& fileName,
78  bool modifiedIDs,
79  boost::shared_ptr<BranchChildren> branchChildren) :
80  fileFormatVersion_(version),
81  tree_(const_cast<TTree*>(ev)),
82  metaTree_(const_cast<TTree*>(meta)),
83  lumiTree_(const_cast<TTree*>(lumi)),
84  lumiMetaTree_(const_cast<TTree*>(lumiMeta)),
85  runTree_(const_cast<TTree*>(run)),
86  runMetaTree_(const_cast<TTree*>(runMeta)),
87  whyNotFastClonable_(whyNotFastClonable),
88  hasNewlyDroppedBranch_(hasNewlyDroppedBranch),
89  fileName_(fileName),
90  branchListIndexesUnchanged_(branchListIndexesUnchanged),
91  modifiedIDs_(modifiedIDs),
92  branchChildren_(branchChildren) {}
93 
95 
97  TTree* tree() const {return tree_;}
98  TTree* metaTree() const {return metaTree_;}
99  TTree* lumiTree() const {return lumiTree_;}
100  TTree* lumiMetaTree() const {return lumiMetaTree_;}
101  TTree* runTree() const {return runTree_;}
102  TTree* runMetaTree() const {return runMetaTree_;}
103 
105  std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const {return hasNewlyDroppedBranch_;}
106  std::string const& fileName() const {return fileName_;}
108  bool modifiedIDs() const {return modifiedIDs_;}
109 
111  whyNotFastClonable_ |= why;
112  }
113  BranchChildren const& branchChildren() const { return *branchChildren_; }
115 
116  private:
118  // We use bare pointers because ROOT owns these.
119  TTree* tree_;
120  TTree* metaTree_;
121  TTree* lumiTree_;
123  TTree* runTree_;
124  TTree* runMetaTree_;
126  std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
130  boost::shared_ptr<BranchChildren> branchChildren_;
131  };
132 }
133 #endif
tuple lumi
Definition: fjr2json.py:35
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:96
int whyNotFastClonable() const
Definition: FileBlock.h:104
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:105
std::string fileName_
Definition: FileBlock.h:127
BranchChildren const & branchChildren() const
Definition: FileBlock.h:113
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:117
bool ev
TTree * lumiTree_
Definition: FileBlock.h:121
#define nullptr
TTree * metaTree() const
Definition: FileBlock.h:98
bool modifiedIDs() const
Definition: FileBlock.h:108
TTree * lumiMetaTree_
Definition: FileBlock.h:122
int whyNotFastClonable_
Definition: FileBlock.h:125
TTree * lumiMetaTree() const
Definition: FileBlock.h:100
void close()
Definition: FileBlock.h:114
TTree * runMetaTree_
Definition: FileBlock.h:124
bool modifiedIDs_
Definition: FileBlock.h:129
boost::shared_ptr< BranchChildren > branchChildren_
Definition: FileBlock.h:130
TTree * runMetaTree() const
Definition: FileBlock.h:102
TTree * runTree_
Definition: FileBlock.h:123
bool branchListIndexesUnchanged_
Definition: FileBlock.h:128
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:126
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:110
TTree * lumiTree() const
Definition: FileBlock.h:99
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:70
TTree * tree_
Definition: FileBlock.h:119
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:107
volatile std::atomic< bool > shutdown_flag false
TTree * metaTree_
Definition: FileBlock.h:120
TTree * runTree() const
Definition: FileBlock.h:101
TTree * tree() const
Definition: FileBlock.h:97
std::string const & fileName() const
Definition: FileBlock.h:106