CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootDelayedReader.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_RootDelayedReader_h
2 #define IOPool_Input_RootDelayedReader_h
3 
4 /*----------------------------------------------------------------------
5 
6 RootDelayedReader.h // used by ROOT input sources
7 
8 ----------------------------------------------------------------------*/
9 
12 #include "RootTree.h"
13 
14 #include <map>
15 #include <memory>
16 #include <string>
17 
18 namespace edm {
19  class InputFile;
20  class RootTree;
21 
22  //------------------------------------------------------------
23  // Class RootDelayedReader: pretends to support file reading.
24  //
25 
27  public:
30  typedef roottree::BranchMap::const_iterator iterator;
33  RootTree const& tree,
34  boost::shared_ptr<InputFile> filePtr);
35 
36  virtual ~RootDelayedReader();
37 
38  RootDelayedReader(RootDelayedReader const&) = delete; // Disallow copying and moving
39  RootDelayedReader& operator=(RootDelayedReader const&) = delete; // Disallow copying and moving
40 
41  private:
42  virtual WrapperOwningHolder getProduct_(BranchKey const& k, WrapperInterfaceBase const* interface, EDProductGetter const* ep) const;
43  virtual void mergeReaders_(DelayedReader* other) {nextReader_ = other;}
44  virtual void reset_() {nextReader_ = 0;}
45  BranchMap const& branches() const {return tree_.branches();}
46  EntryNumber const& entryNumber() const {return tree_.entryNumber();}
47  iterator branchIter(BranchKey const& k) const {return branches().find(k);}
48  bool found(iterator const& iter) const {return iter != branches().end();}
49  BranchInfo const& getBranchInfo(iterator const& iter) const {return iter->second; }
50  // NOTE: filePtr_ appears to be unused, but is needed to prevent
51  // the file containing the branch from being reclaimed.
52  RootTree const& tree_;
53  boost::shared_ptr<InputFile> filePtr_;
55  }; // class RootDelayedReader
56  //------------------------------------------------------------
57 }
58 #endif
virtual void mergeReaders_(DelayedReader *other)
RootTree const & tree_
roottree::BranchMap BranchMap
BranchInfo const & getBranchInfo(iterator const &iter) const
DelayedReader * nextReader_
std::map< BranchKey const, BranchInfo > BranchMap
Definition: RootTree.h:50
virtual WrapperOwningHolder getProduct_(BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep) const
tuple InputFile
Open Root file and provide MEs ############.
boost::shared_ptr< InputFile > filePtr_
roottree::BranchMap::const_iterator iterator
RootDelayedReader & operator=(RootDelayedReader const &)=delete
int k[5][pyjets_maxn]
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
bool found(iterator const &iter) const
roottree::BranchInfo BranchInfo
RootDelayedReader(RootTree const &tree, boost::shared_ptr< InputFile > filePtr)
roottree::EntryNumber EntryNumber
Long64_t EntryNumber
Definition: RootTree.h:38
BranchMap const & branches() const
Definition: RootTree.cc:138
EntryNumber const & entryNumber() const
iterator branchIter(BranchKey const &k) const
BranchMap const & branches() const