Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-19 01:44:05

0001 #ifndef FWCore_Sources_RawInputSource_h
0002 #define FWCore_Sources_RawInputSource_h
0003 
0004 /*----------------------------------------------------------------------
0005 ----------------------------------------------------------------------*/
0006 
0007 #include <memory>
0008 #include <utility>
0009 
0010 #include "DataFormats/Provenance/interface/EventID.h"
0011 #include "FWCore/Framework/interface/InputSource.h"
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 
0014 namespace edm {
0015   class ParameterSet;
0016   class Timestamp;
0017   class RawInputSource : public InputSource {
0018   public:
0019     explicit RawInputSource(ParameterSet const& pset, InputSourceDescription const& desc);
0020     ~RawInputSource() override;
0021     static void fillDescription(ParameterSetDescription& description);
0022 
0023     //Next::kFile is only needed if the ProductRegistry must be updated
0024     enum class Next { kEvent, kFile, kStop };
0025 
0026   protected:
0027     void makeEvent(EventPrincipal& eventPrincipal, EventAuxiliary const& eventAuxiliary);
0028     virtual Next checkNext() = 0;
0029     virtual void read(EventPrincipal& eventPrincipal) = 0;
0030     void setInputFileTransitionsEachEvent() { inputFileTransitionsEachEvent_ = true; }
0031 
0032   private:
0033     void readEvent_(EventPrincipal& eventPrincipal) override;
0034     std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
0035     std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
0036     virtual void reset_();
0037     void rewind_() override;
0038     ItemType getNextItemType() override;
0039     void closeFile_() final;
0040     std::shared_ptr<FileBlock> readFile_() final;
0041     virtual void genuineCloseFile() {}
0042     virtual void genuineReadFile() {}
0043 
0044     bool inputFileTransitionsEachEvent_;
0045     bool fakeInputFileTransition_;
0046   };
0047 }  // namespace edm
0048 #endif