CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/IOPool/Input/src/PoolSource.h

Go to the documentation of this file.
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_(EventPrincipal& eventPrincipal);
00039     virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
00040     virtual boost::shared_ptr<LuminosityBlockPrincipal> readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal);
00041     virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
00042     virtual boost::shared_ptr<RunPrincipal> readRun_(boost::shared_ptr<RunPrincipal> runPrincipal);
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, EventPrincipal& eventPrincipal);
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 bool randomAccess_() const;
00059     virtual ProcessingController::ForwardState forwardState_() const;
00060     virtual ProcessingController::ReverseState reverseState_() const;
00061 
00062     RootServiceChecker rootServiceChecker_;
00063     std::unique_ptr<RootInputFileSequence> primaryFileSequence_;
00064     std::unique_ptr<RootInputFileSequence> secondaryFileSequence_;
00065     boost::shared_ptr<RunPrincipal> secondaryRunPrincipal_;
00066     boost::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_;
00067     std::unique_ptr<EventPrincipal> secondaryEventPrincipal_;
00068     std::array<std::vector<BranchID>, NumBranchTypes>  branchIDsToReplace_;
00069   }; // class PoolSource
00070   typedef PoolSource PoolRASource;
00071 }
00072 #endif