00001 #ifndef DataFormats_FWLite_ChainEvent_h
00002 #define DataFormats_FWLite_ChainEvent_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021 #if !defined(__CINT__) && !defined(__MAKECINT__)
00022
00023 #include <vector>
00024 #include <string>
00025 #include <boost/shared_ptr.hpp>
00026
00027
00028 #include "DataFormats/FWLite/interface/Event.h"
00029
00030
00031 namespace edm {
00032 class EDProduct;
00033 class ProductRegistry;
00034 class BranchDescription;
00035 class EDProductGetter;
00036 class EventAux;
00037 }
00038
00039 namespace fwlite {
00040 class ChainEvent
00041 {
00042
00043 public:
00044 ChainEvent(const std::vector<std::string>& iFileNames);
00045 virtual ~ChainEvent();
00046
00047 const ChainEvent& operator++();
00048
00050 const ChainEvent& to(Long64_t iIndex);
00051
00052
00053
00054
00055
00057 const ChainEvent& toBegin();
00058
00059
00060 const std::string getBranchNameFor(const std::type_info&, const char*, const char*, const char*) const;
00061
00063 void getByLabel(const std::type_info&, const char*, const char*, const char*, void*) const;
00064
00065
00066 bool isValid() const;
00067 operator bool () const;
00068 bool atEnd() const;
00069
00070 Long64_t size() const;
00071
00072 edm::EventID id() const;
00073 const edm::Timestamp& time() const;
00074
00075 const std::vector<edm::BranchDescription>& getBranchDescriptions() const;
00076 const std::vector<std::string>& getProcessHistory() const;
00077
00078
00079 static void throwProductNotFoundException(const std::type_info&, const char*, const char*, const char*);
00080
00081
00082
00083 private:
00084 ChainEvent(const Event&);
00085
00086 const ChainEvent& operator=(const Event&);
00087
00088 void findSizes();
00089 void switchToFile(Long64_t);
00090
00091 std::vector<std::string> fileNames_;
00092 boost::shared_ptr<TFile> file_;
00093 boost::shared_ptr<Event> event_;
00094 Long64_t eventIndex_;
00095 std::vector<Long64_t> accumulatedSize_;
00096
00097 };
00098
00099 }
00100 #endif
00101 #endif