Go to the documentation of this file.00001 #ifndef FWLite_BareRootProductGetter_h
00002 #define FWLite_BareRootProductGetter_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022 #include "DataFormats/Common/interface/EDProductGetter.h"
00023 #include "DataFormats/Common/interface/WrapperHolder.h"
00024 #include "DataFormats/Common/interface/WrapperOwningHolder.h"
00025 #include "FWCore/FWLite/interface/BranchMapReader.h"
00026
00027
00028 #include "Rtypes.h"
00029 #include <map>
00030
00031
00032 class TBranch;
00033 class TFile;
00034 class TTree;
00035
00036 class BareRootProductGetter : public edm::EDProductGetter {
00037
00038 public:
00039 BareRootProductGetter();
00040 virtual ~BareRootProductGetter();
00041
00042
00043 virtual edm::WrapperHolder getIt(edm::ProductID const&) const;
00044
00045
00046
00047
00048
00049 struct Buffer {
00050 Buffer(edm::WrapperOwningHolder const& iProd, TBranch* iBranch, void* iAddress,
00051 TClass* iClass) :
00052 product_(iProd), branch_(iBranch), address_(iAddress), eventEntry_(-1),
00053 class_(iClass) {}
00054 Buffer() : product_(), branch_(), address_(), eventEntry_(-1),class_(0) {}
00055
00056 edm::WrapperOwningHolder product_;
00057 TBranch* branch_;
00058 void* address_;
00059 Long_t eventEntry_;
00060 TClass* class_;
00061 };
00062 private:
00063 BareRootProductGetter(BareRootProductGetter const&);
00064
00065 BareRootProductGetter const& operator=(BareRootProductGetter const&);
00066
00067
00068 void setupNewFile(TFile*) const;
00069 TBranch* findBranch(edm::ProductID const&) const;
00070 Buffer* createNewBuffer(edm::ProductID const&) const;
00071
00072
00073
00074
00075
00076
00077 typedef std::map<edm::ProductID, Buffer> IdToBuffers;
00078 mutable IdToBuffers idToBuffers_;
00079 mutable fwlite::BranchMapReader branchMap_;
00080 };
00081
00082 #endif