![]() |
![]() |
00001 #ifndef DataFormats_FWLite_EventSetup_h 00002 #define DataFormats_FWLite_EventSetup_h 00003 // -*- C++ -*- 00004 // 00005 // Package: FWLite 00006 // Class : EventSetup 00007 // 00041 // 00042 // Original Author: 00043 // Created: Thu Dec 10 15:57:46 CST 2009 00044 // 00045 00046 // system include files 00047 #include <vector> 00048 #include <string> 00049 00050 // user include files 00051 #include "DataFormats/Provenance/interface/EventID.h" 00052 #include "DataFormats/Provenance/interface/Timestamp.h" 00053 00054 // forward declarations 00055 class TFile; 00056 00057 namespace edm { 00058 class EventBase; 00059 } 00060 00061 namespace fwlite 00062 { 00063 class Record; 00064 typedef unsigned int RecordID; 00065 00066 class EventSetup { 00067 00068 public: 00069 EventSetup(TFile*); 00070 virtual ~EventSetup(); 00071 00072 // ---------- const member functions --------------------- 00073 const Record& get(const RecordID&) const; 00074 00079 RecordID recordID(const char* iRecordName) const; 00080 00083 bool exists(const char* iRecordName) const; 00084 00085 std::vector<std::string> namesOfAvailableRecords() const; 00086 // ---------- static member functions -------------------- 00087 00088 // ---------- member functions --------------------------- 00089 //void syncTo(unsigned long iRun, unsigned long iLumi); 00090 //void syncTo(const edm::EventID&); 00091 00094 void syncTo(const edm::EventID&, const edm::Timestamp&); 00095 00096 //void autoSyncTo(const edm::EventBase&); 00097 00098 00099 private: 00100 EventSetup(const EventSetup&); // stop default 00101 00102 const EventSetup& operator=(const EventSetup&); // stop default 00103 00104 // ---------- member data -------------------------------- 00105 const edm::EventBase* m_event; 00106 edm::EventID m_syncedEvent; 00107 edm::Timestamp m_syncedTimestamp; 00108 00109 TFile* m_file; 00110 00111 mutable std::vector<Record*> m_records; 00112 }; 00113 } /* fwlite */ 00114 00115 00116 #endif