CMS 3D CMS Logo

ProducerSourceBase.h
Go to the documentation of this file.
1 #ifndef Framework_Sources_ProducerSourceBase_h
2 #define Framework_Sources_ProducerSourceBase_h
3 
4 /*----------------------------------------------------------------------
5 ----------------------------------------------------------------------*/
6 
14 
15 #include <memory>
16 
17 namespace edm {
18  class ParameterSet;
21  public:
22  explicit ProducerSourceBase(ParameterSet const& pset, InputSourceDescription const& desc, bool realData);
23  ~ProducerSourceBase() noexcept(false) override;
24 
25  unsigned int numberEventsInRun() const {return numberEventsInRun_;}
26  unsigned int numberEventsInLumi() const {return numberEventsInLumi_;}
28  unsigned int timeBetweenEvents() const {return timeBetweenEvents_;}
29  unsigned int eventCreationDelay() const {return eventCreationDelay_;}
30  unsigned int numberEventsInThisRun() const {return numberEventsInThisRun_;}
31  unsigned int numberEventsInThisLumi() const {return numberEventsInThisLumi_;}
32  EventID const& eventID() const {return eventID_;}
33  RunNumber_t run() const {return eventID_.run();}
34  EventNumber_t event() const {return eventID_.event();}
36 
37  static void fillDescription(ParameterSetDescription& desc);
38 
39  protected:
40 
41  private:
42  ItemType getNextItemType() final;
43  virtual void initialize(EventID& id, TimeValue_t& time, TimeValue_t& interval);
44  virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time, EventAuxiliary::ExperimentType& etype) = 0;
45  virtual void produce(Event& e) = 0;
46  virtual bool noFiles() const;
47  virtual size_t fileIndex() const;
48  void beginJob() override;
49 
50  void readEvent_(EventPrincipal& eventPrincipal) override;
51  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
52  std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
53  void skip(int offset) override;
54  void rewind_() override;
55 
57  void retreatToPrevious(EventID& eventID, TimeValue_t& time);
58 
59  unsigned int numberEventsInRun_;
60  unsigned int numberEventsInLumi_;
64  unsigned int eventCreationDelay_; /* microseconds */
65 
66  unsigned int numberEventsInThisRun_;
73  };
74 }
75 #endif
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
EventNumber_t const zerothEvent_
unsigned int numberEventsInRun() const
void readEvent_(EventPrincipal &eventPrincipal) override
unsigned int numberEventsInThisLumi_
unsigned long long EventNumber_t
#define noexcept
RunNumber_t run() const
~ProducerSourceBase() noexcept(false) override
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
ItemType getNextItemType() final
unsigned int LuminosityBlockNumber_t
virtual size_t fileIndex() const
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=0
ProducerSourceBase(ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
unsigned int timeBetweenEvents() const
static void fillDescription(ParameterSetDescription &desc)
unsigned long long TimeValue_t
Definition: Timestamp.h:28
unsigned int numberEventsInThisRun() const
unsigned int numberEventsInThisLumi() const
TimeValue_t presentTime() const
EventAuxiliary::ExperimentType eType_
unsigned int numberEventsInThisRun_
HLT enums.
EventID const & eventID() const
EventNumber_t event() const
virtual bool noFiles() const
virtual void produce(Event &e)=0
void advanceToNext(EventID &eventID, TimeValue_t &time)
LuminosityBlockNumber_t luminosityBlock() const
unsigned int RunNumber_t
unsigned int numberEventsInLumi() const
unsigned int eventCreationDelay() const
void skip(int offset) override
void retreatToPrevious(EventID &eventID, TimeValue_t &time)
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)