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 "boost/shared_ptr.hpp"
16 #include "boost/utility.hpp"
17 
18 #include <map>
19 #include <memory>
20 #include <string>
21 
22 namespace edm {
23  class RootFile;
24  class RootTree;
25 
26  //------------------------------------------------------------
27  // Class RootDelayedReader: pretends to support file reading.
28  //
29 
30  class RootDelayedReader : public DelayedReader, private boost::noncopyable {
31  public:
34  typedef roottree::BranchMap::const_iterator iterator;
37  boost::shared_ptr<BranchMap const> bMap,
38  RootTree const& tree,
39  FileFormatVersion const& fileFormatVersion,
40  boost::shared_ptr<RootFile> filePtr);
41 
42  virtual ~RootDelayedReader();
43 
44  private:
45  virtual std::auto_ptr<EDProduct> getProduct_(BranchKey const& k, EDProductGetter const* ep) const;
46  virtual void mergeReaders_(boost::shared_ptr<DelayedReader> other) {nextReader_ = other;}
47  BranchMap const& branches() const {return *branches_;}
48  iterator branchIter(BranchKey const& k) const {return branches().find(k);}
49  bool found(iterator const& iter) const {return iter != branches().end();}
50  BranchInfo const& getBranchInfo(iterator const& iter) const {return iter->second; }
52  boost::shared_ptr<BranchMap const> branches_;
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<RootFile> filePtr_;
57  boost::shared_ptr<DelayedReader> nextReader_;
59  }; // class RootDelayedReader
60  //------------------------------------------------------------
61 }
62 #endif
RootTree const & tree_
roottree::BranchMap BranchMap
boost::shared_ptr< BranchMap const > branches_
BranchInfo const & getBranchInfo(iterator const &iter) const
std::map< BranchKey const, BranchInfo > BranchMap
Definition: RootTree.h:57
boost::shared_ptr< RootFile > filePtr_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
roottree::BranchMap::const_iterator iterator
virtual std::auto_ptr< EDProduct > getProduct_(BranchKey const &k, EDProductGetter const *ep) const
int k[5][pyjets_maxn]
bool found(iterator const &iter) const
boost::shared_ptr< DelayedReader > nextReader_
roottree::BranchInfo BranchInfo
RootDelayedReader(EntryNumber const &entry, boost::shared_ptr< BranchMap const > bMap, RootTree const &tree, FileFormatVersion const &fileFormatVersion, boost::shared_ptr< RootFile > filePtr)
roottree::EntryNumber EntryNumber
virtual void mergeReaders_(boost::shared_ptr< DelayedReader > other)
Long64_t EntryNumber
Definition: RootTree.h:43
FileFormatVersion fileFormatVersion_
EntryNumber const entryNumber_
iterator branchIter(BranchKey const &k) const
BranchMap const & branches() const