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
edm::FileBlock::BranchMismatch
Definition: FileBlock.h:56
edm::FileBlock::OutputMaxEventsTooSmall
Definition: FileBlock.h:54
funct::false
false
Definition: Factorize.h:29
edm::FileBlock::tree
TTree * tree() const
Definition: FileBlock.h:117
edm::FileBlock::processBlockTrees_
std::vector< TTree * > processBlockTrees_
Definition: FileBlock.h:147
BranchType.h
edm::FileBlock::tree_
TTree * tree_
Definition: FileBlock.h:141
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::FileBlock::processesWithProcessBlockTrees_
std::vector< std::string > processesWithProcessBlockTrees_
Definition: FileBlock.h:148
edm::FileBlock::NoRootInputSource
Definition: FileBlock.h:29
edm::FileBlock::RunNumberModified
Definition: FileBlock.h:43
edm::FileBlock::NotProcessingEvents
Definition: FileBlock.h:31
edm::FileBlock::fileFormatVersion
FileFormatVersion const & fileFormatVersion() const
Definition: FileBlock.h:116
edm::FileBlock::RunOrLumiNotContiguous
Definition: FileBlock.h:38
edm::FileBlock::~FileBlock
~FileBlock()
Definition: FileBlock.h:105
edm::FileBlock::processesWithProcessBlockTrees
std::vector< std::string > const & processesWithProcessBlockTrees() const
Definition: FileBlock.h:126
edm::FileBlock::metaTree_
TTree * metaTree_
Definition: FileBlock.h:142
edm::FileBlock::EventsToBeSorted
Definition: FileBlock.h:37
edm::FileBlock::setNotFastClonable
void setNotFastClonable(WhyNotFastClonable const &why)
Definition: FileBlock.h:134
edm::FileBlock::modifiedIDs
bool modifiedIDs() const
Definition: FileBlock.h:132
edm::FileBlock
Definition: FileBlock.h:22
edm::FileBlock::hasNewlyDroppedBranch_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: FileBlock.h:150
edm::FileBlock::CanFastClone
Definition: FileBlock.h:26
edm::FileBlock::WhyNotFastClonable
WhyNotFastClonable
Definition: FileBlock.h:25
edm::FileBlock::fileName
std::string const & fileName() const
Definition: FileBlock.h:130
edm::FileBlock::processBlockTree
TTree * processBlockTree(std::string const &processName) const
Definition: FileBlock.cc:24
edm::FileBlock::lumiTree
TTree * lumiTree() const
Definition: FileBlock.h:119
edm::FileBlock::lumiMetaTree
TTree * lumiMetaTree() const
Definition: FileBlock.h:120
edm::FileBlock::fileFormatVersion_
FileFormatVersion fileFormatVersion_
Definition: FileBlock.h:139
edm::FileBlock::branchListIndexesUnchanged
bool branchListIndexesUnchanged() const
Definition: FileBlock.h:131
edm::FileBlock::branchChildren_
std::shared_ptr< BranchChildren const > branchChildren_
Definition: FileBlock.h:154
edm::FileBlock::whyNotFastClonable
int whyNotFastClonable() const
Definition: FileBlock.h:128
edm::FileFormatVersion
Definition: FileFormatVersion.h:7
FileFormatVersion.h
edm::FileBlock::FileTooOld
Definition: FileBlock.h:35
edm::FileBlock::lumiMetaTree_
TTree * lumiMetaTree_
Definition: FileBlock.h:144
edm::FileBlock::HasSecondaryFileSequence
Definition: FileBlock.h:32
edm::FileBlock::EventsOrLumisSelectedByID
Definition: FileBlock.h:39
edm::BranchChildren
Definition: BranchChildren.h:18
edm::FileBlock::close
void close()
Definition: FileBlock.cc:33
edm::FileBlock::runMetaTree
TTree * runMetaTree() const
Definition: FileBlock.h:122
edm::FileBlock::NoEventsInFile
Definition: FileBlock.h:36
edm::FileBlock::runMetaTree_
TTree * runMetaTree_
Definition: FileBlock.h:146
edm::FileBlock::FileBlock
FileBlock()
Definition: FileBlock.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::FileBlock::processBlockTrees
std::vector< TTree * > const & processBlockTrees() const
Definition: FileBlock.h:125
edm::FileBlock::whyNotFastClonable_
int whyNotFastClonable_
Definition: FileBlock.h:149
edm::FileBlock::runTree
TTree * runTree() const
Definition: FileBlock.h:121
edm::FileBlock::runTree_
TTree * runTree_
Definition: FileBlock.h:145
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::FileBlock::EventSelectionUsed
Definition: FileBlock.h:51
edm::FileBlock::branchChildren
BranchChildren const & branchChildren() const
Definition: FileBlock.h:135
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::FileBlock::modifiedIDs_
bool modifiedIDs_
Definition: FileBlock.h:153
edm::FileBlock::DisabledInConfigFile
Definition: FileBlock.h:50
edm::FileBlock::metaTree
TTree * metaTree() const
Definition: FileBlock.h:118
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
edm::FileBlock::ParallelProcesses
Definition: FileBlock.h:30
edm::FileBlock::lumiTree_
TTree * lumiTree_
Definition: FileBlock.h:143
edm::FileBlock::MaxEventsTooSmall
Definition: FileBlock.h:41
lumi
Definition: LumiSectionData.h:20
edm::FileBlock::hasNewlyDroppedBranch
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: FileBlock.h:129
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
edm::FileBlock::branchListIndexesUnchanged_
bool branchListIndexesUnchanged_
Definition: FileBlock.h:152
edm::FileBlock::MaxLumisTooSmall
Definition: FileBlock.h:42
edm::FileBlock::DuplicateEventsRemoved
Definition: FileBlock.h:44
edm::FileBlock::updateTTreePointers
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
edm::FileBlock::fileName_
std::string fileName_
Definition: FileBlock.h:151
edm::FileBlock::SplitLevelMismatch
Definition: FileBlock.h:55
edm::FileBlock::FileBlock
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
edm::FileBlock::InitialEventsSkipped
Definition: FileBlock.h:40
BranchChildren.h