CMS 3D CMS Logo

ChainEvent.h

Go to the documentation of this file.
00001 #ifndef DataFormats_FWLite_ChainEvent_h
00002 #define DataFormats_FWLite_ChainEvent_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     FWLite
00006 // Class  :     ChainEvent
00007 // 
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Tue May  8 15:01:20 EDT 2007
00019 // $Id: ChainEvent.h,v 1.3 2008/07/24 20:38:45 dsr Exp $
00020 //
00021 #if !defined(__CINT__) && !defined(__MAKECINT__)
00022 // system include files
00023 #include <vector>
00024 #include <string>
00025 #include <boost/shared_ptr.hpp>
00026 
00027 // user include files
00028 #include "DataFormats/FWLite/interface/Event.h"
00029 
00030 // forward declarations
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       //Go to event by Run & Event number
00053 //      bool to(edm::EventID id);
00054 //      bool to(edm::RunNumber_t run, edm::EventNumber_t event);
00055 
00057       const ChainEvent& toBegin();
00058       
00059       // ---------- const member functions ---------------------
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       //void getByBranchName(const std::type_info&, const char*, void*&) const;
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       // ---------- static member functions --------------------
00079       static void throwProductNotFoundException(const std::type_info&, const char*, const char*, const char*);
00080 
00081       // ---------- member functions ---------------------------
00082 
00083    private:
00084       ChainEvent(const Event&); // stop default
00085 
00086       const ChainEvent& operator=(const Event&); // stop default
00087 
00088       void findSizes();
00089       void switchToFile(Long64_t);
00090       // ---------- member data --------------------------------
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 /*__CINT__ */
00101 #endif

Generated on Tue Jun 9 17:30:46 2009 for CMSSW by  doxygen 1.5.4