CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/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/array.hpp"
00017 #include "boost/scoped_ptr.hpp"
00018 
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 void readMany_(int number, EventPrincipalVector& result);
00052     virtual void readManyRandom_(int number, EventPrincipalVector& result, unsigned int& fileSeqNumber);
00053     virtual void readManySequential_(int number, EventPrincipalVector& result, unsigned int& fileSeqNumber);
00054     virtual void readManySpecified_(std::vector<EventID> const& events, EventPrincipalVector& result);
00055     virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
00056     virtual void preForkReleaseResources();
00057     virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>);
00058     virtual bool randomAccess_() const;
00059     virtual ProcessingController::ForwardState forwardState_() const;
00060     virtual ProcessingController::ReverseState reverseState_() const;
00061 
00062     RootServiceChecker rootServiceChecker_;
00063     boost::scoped_ptr<RootInputFileSequence> primaryFileSequence_;
00064     boost::scoped_ptr<RootInputFileSequence> secondaryFileSequence_;
00065     boost::shared_ptr<RunPrincipal> secondaryRunPrincipal_;
00066     boost::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_;
00067     boost::scoped_ptr<EventPrincipal> secondaryEventPrincipal_;
00068     boost::array<std::vector<BranchID>, NumBranchTypes>  branchIDsToReplace_;
00069 
00070     //used when process has been forked
00071     boost::shared_ptr<edm::multicore::MessageReceiverForSource> receiver_;
00072     unsigned int numberOfEventsBeforeBigSkip_;
00073 
00074   }; // class PoolSource
00075   typedef PoolSource PoolRASource;
00076 }
00077 #endif