CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BareRootProductGetter.h
Go to the documentation of this file.
1 #ifndef FWLite_BareRootProductGetter_h
2 #define FWLite_BareRootProductGetter_h
3 // -*- C++ -*-
4 //
5 // Package: FWLite
6 // Class : BareRootProductGetter
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Tue May 23 11:03:27 EDT 2006
19 //
20 
21 // user include files
26 
27 // system include files
28 #include "Rtypes.h"
29 #include <map>
30 
31 // forward declarations
32 class TBranch;
33 class TFile;
34 class TTree;
35 
37 
38  public:
40  virtual ~BareRootProductGetter();
41 
42  // ---------- const member functions ---------------------
43  virtual edm::WrapperHolder getIt(edm::ProductID const&) const;
44 
45  // ---------- static member functions --------------------
46 
47  // ---------- member functions ---------------------------
48 
49  struct Buffer {
50  Buffer(edm::WrapperOwningHolder const& iProd, TBranch* iBranch, void* iAddress,
51  TClass* iClass) :
52  product_(iProd), branch_(iBranch), address_(iAddress), eventEntry_(-1),
53  class_(iClass) {}
55 
57  TBranch* branch_;
58  void* address_; //the address to pass to Root since as of 5.13 they cache that info
59  Long_t eventEntry_; //the event Entry used with the last GetEntry call
60  TClass* class_;
61  };
62  private:
63  BareRootProductGetter(BareRootProductGetter const&); // stop default
64 
65  BareRootProductGetter const& operator=(BareRootProductGetter const&); // stop default
66 
67  // ---------- member data --------------------------------
68  void setupNewFile(TFile*) const;
69  TBranch* findBranch(edm::ProductID const&) const;
70  Buffer* createNewBuffer(edm::ProductID const&) const;
71 
72 // mutable TFile* presentFile_;
73 // mutable TTree* eventTree_;
74 // mutable Long_t eventEntry_;
75 // typedef std::map<edm::ProductID,edm::BranchDescription> IdToBranchDesc;
76 // mutable IdToBranchDesc idToBranchDesc_;
77  typedef std::map<edm::ProductID, Buffer> IdToBuffers;
80 };
81 
82 #endif
TBranch * findBranch(edm::ProductID const &) const
void setupNewFile(TFile *) const
virtual edm::WrapperHolder getIt(edm::ProductID const &) const
Buffer(edm::WrapperOwningHolder const &iProd, TBranch *iBranch, void *iAddress, TClass *iClass)
Buffer * createNewBuffer(edm::ProductID const &) const
std::map< edm::ProductID, Buffer > IdToBuffers
edm::WrapperOwningHolder product_
BareRootProductGetter const & operator=(BareRootProductGetter const &)
fwlite::BranchMapReader branchMap_