00001 #ifndef IOPool_Input_PoolSource_h 00002 #define IOPool_Input_PoolSource_h 00003 00004 /*---------------------------------------------------------------------- 00005 00006 PoolSource: This is an InputSource 00007 00008 ----------------------------------------------------------------------*/ 00009 00010 #include "DataFormats/Provenance/interface/BranchType.h" 00011 #include "FWCore/Framework/interface/Frameworkfwd.h" 00012 #include "FWCore/Framework/interface/ProcessingController.h" 00013 #include "FWCore/Sources/interface/VectorInputSource.h" 00014 #include "IOPool/Common/interface/RootServiceChecker.h" 00015 00016 #include "boost/shared_ptr.hpp" 00017 00018 #include <array> 00019 #include <memory> 00020 #include <string> 00021 #include <vector> 00022 00023 namespace edm { 00024 00025 class ConfigurationDescriptions; 00026 class FileCatalogItem; 00027 class RootInputFileSequence; 00028 00029 class PoolSource : public VectorInputSource { 00030 public: 00031 explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc); 00032 virtual ~PoolSource(); 00033 using InputSource::productRegistryUpdate; 00034 00035 static void fillDescriptions(ConfigurationDescriptions & descriptions); 00036 00037 private: 00038 virtual EventPrincipal* readEvent_(); 00039 virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_(); 00040 virtual boost::shared_ptr<LuminosityBlockPrincipal> readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lbCache); 00041 virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_(); 00042 virtual boost::shared_ptr<RunPrincipal> readRun_(boost::shared_ptr<RunPrincipal> rpCache); 00043 virtual boost::shared_ptr<FileBlock> readFile_(); 00044 virtual void closeFile_(); 00045 virtual void endJob(); 00046 virtual ItemType getNextItemType(); 00047 virtual EventPrincipal* readIt(EventID const& id); 00048 virtual void skip(int offset); 00049 virtual bool goToEvent_(EventID const& eventID); 00050 virtual void rewind_(); 00051 virtual EventPrincipal* readOneRandom(); 00052 virtual EventPrincipal* readOneRandomWithID(LuminosityBlockID const& lumiID); 00053 virtual EventPrincipal* readOneSequential(); 00054 virtual EventPrincipal* readOneSequentialWithID(LuminosityBlockID const& lumiID); 00055 virtual EventPrincipal* readOneSpecified(EventID const& id); 00056 virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches); 00057 virtual void preForkReleaseResources(); 00058 virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>); 00059 virtual bool randomAccess_() const; 00060 virtual ProcessingController::ForwardState forwardState_() const; 00061 virtual ProcessingController::ReverseState reverseState_() const; 00062 00063 RootServiceChecker rootServiceChecker_; 00064 std::unique_ptr<RootInputFileSequence> primaryFileSequence_; 00065 std::unique_ptr<RootInputFileSequence> secondaryFileSequence_; 00066 boost::shared_ptr<RunPrincipal> secondaryRunPrincipal_; 00067 boost::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_; 00068 std::unique_ptr<EventPrincipal> secondaryEventPrincipal_; 00069 std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_; 00070 00071 //used when process has been forked 00072 boost::shared_ptr<edm::multicore::MessageReceiverForSource> receiver_; 00073 unsigned int numberOfEventsBeforeBigSkip_; 00074 00075 }; // class PoolSource 00076 typedef PoolSource PoolRASource; 00077 } 00078 #endif