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 
13 #include "RootTree.h"
14 
15 #include <map>
16 #include <memory>
17 #include <string>
18 
19 namespace edm {
20  class InputFile;
21  class RootTree;
22 
23  //------------------------------------------------------------
24  // Class RootDelayedReader: pretends to support file reading.
25  //
26 
28  public:
31  typedef roottree::BranchMap::const_iterator iterator;
34  RootTree const& tree,
35  boost::shared_ptr<InputFile> filePtr,
36  InputType inputType);
37 
38  virtual ~RootDelayedReader();
39 
40  RootDelayedReader(RootDelayedReader const&) = delete; // Disallow copying and moving
41  RootDelayedReader& operator=(RootDelayedReader const&) = delete; // Disallow copying and moving
42 
43  private:
45  WrapperInterfaceBase const* interface,
46  EDProductGetter const* ep) const override;
47  virtual void mergeReaders_(DelayedReader* other) {nextReader_ = other;}
48  virtual void reset_() {nextReader_ = 0;}
49  BranchMap const& branches() const {return tree_.branches();}
50  iterator branchIter(BranchKey const& k) const {return branches().find(k);}
51  bool found(iterator const& iter) const {return iter != branches().end();}
52  BranchInfo const& getBranchInfo(iterator const& iter) const {return iter->second; }
53  // NOTE: filePtr_ appears to be unused, but is needed to prevent
54  // the file containing the branch from being reclaimed.
55  RootTree const& tree_;
56  boost::shared_ptr<InputFile> filePtr_;
59  }; // class RootDelayedReader
60  //------------------------------------------------------------
61 }
62 #endif
InputType
Definition: InputType.h:5
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:53
tuple InputFile
Open Root file and provide MEs ############.
boost::shared_ptr< InputFile > filePtr_
IndexIntoFile::EntryNumber_t EntryNumber
Definition: RootTree.h:41
roottree::BranchMap::const_iterator iterator
RootDelayedReader & operator=(RootDelayedReader const &)=delete
int k[5][pyjets_maxn]
virtual WrapperOwningHolder getProduct_(BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep) const override
bool found(iterator const &iter) const
roottree::BranchInfo BranchInfo
roottree::EntryNumber EntryNumber
RootDelayedReader(RootTree const &tree, boost::shared_ptr< InputFile > filePtr, InputType inputType)
BranchMap const & branches() const
Definition: RootTree.cc:171
iterator branchIter(BranchKey const &k) const
BranchMap const & branches() const