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 override;
44 
45 private:
46 
47  // ---------- static member functions --------------------
48 
49  // ---------- member functions ---------------------------
50  virtual unsigned int transitionIndex_() const override {
51  return 0u;
52  }
53 
54  struct Buffer {
55  Buffer(edm::WrapperOwningHolder const& iProd, TBranch* iBranch, void* iAddress,
56  TClass* iClass) :
57  product_(iProd), branch_(iBranch), address_(iAddress), eventEntry_(-1),
58  class_(iClass) {}
60 
62  TBranch* branch_;
63  void* address_; //the address to pass to Root since as of 5.13 they cache that info
64  Long_t eventEntry_; //the event Entry used with the last GetEntry call
65  TClass* class_;
66  };
67  private:
68  BareRootProductGetter(BareRootProductGetter const&); // stop default
69 
70  BareRootProductGetter const& operator=(BareRootProductGetter const&); // stop default
71 
72  // ---------- member data --------------------------------
73  void setupNewFile(TFile*) const;
74  TBranch* findBranch(edm::ProductID const&) const;
75  Buffer* createNewBuffer(edm::ProductID const&) const;
76 
77 // mutable TFile* presentFile_;
78 // mutable TTree* eventTree_;
79 // mutable Long_t eventEntry_;
80 // typedef std::map<edm::ProductID,edm::BranchDescription> IdToBranchDesc;
81 // mutable IdToBranchDesc idToBranchDesc_;
82  typedef std::map<edm::ProductID, Buffer> IdToBuffers;
85 };
86 
87 #endif
TBranch * findBranch(edm::ProductID const &) const
void setupNewFile(TFile *) const
virtual edm::WrapperHolder getIt(edm::ProductID const &) const override
Buffer(edm::WrapperOwningHolder const &iProd, TBranch *iBranch, void *iAddress, TClass *iClass)
Buffer * createNewBuffer(edm::ProductID const &) const
std::map< edm::ProductID, Buffer > IdToBuffers
virtual unsigned int transitionIndex_() const override
edm::WrapperOwningHolder product_
BareRootProductGetter const & operator=(BareRootProductGetter const &)
fwlite::BranchMapReader branchMap_