CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
13 
14 #include "boost/shared_ptr.hpp"
15 
16 namespace edm {
17  class ParameterSet;
20  public:
21  explicit ProducerSourceBase(ParameterSet const& pset, InputSourceDescription const& desc, bool realData);
22  virtual ~ProducerSourceBase();
23 
24  unsigned int numberEventsInRun() const {return numberEventsInRun_;}
25  unsigned int numberEventsInLumi() const {return numberEventsInLumi_;}
27  unsigned int timeBetweenEvents() const {return timeBetweenEvents_;}
28  unsigned int eventCreationDelay() const {return eventCreationDelay_;}
29  unsigned int numberEventsInThisRun() const {return numberEventsInThisRun_;}
30  unsigned int numberEventsInThisLumi() const {return numberEventsInThisLumi_;}
31  EventID const& eventID() const {return eventID_;}
32  RunNumber_t run() const {return eventID_.run();}
33  EventNumber_t event() const {return eventID_.event();}
35 
36  static void fillDescription(ParameterSetDescription& desc);
37 
38  protected:
39 
40  private:
41  virtual ItemType getNextItemType() override;
42  virtual void initialize(EventID& id, TimeValue_t& time, TimeValue_t& interval);
43  virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time) = 0;
44  virtual void produce(Event& e) = 0;
45  virtual bool noFiles() const;
46  virtual size_t fileIndex() const;
47  virtual void beginJob() override;
48  virtual void beginRun(Run&) override;
49  virtual void endRun(Run&) override;
50  virtual void beginLuminosityBlock(LuminosityBlock&) override;
51  virtual void endLuminosityBlock(LuminosityBlock&) override;
52  virtual void readEvent_(EventPrincipal& eventPrincipal) override;
53  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
54  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
55  virtual void skip(int offset) override;
56  virtual void rewind_() override;
57 
60 
61  unsigned int numberEventsInRun_;
62  unsigned int numberEventsInLumi_;
66  unsigned int eventCreationDelay_; /* microseconds */
67 
68  unsigned int numberEventsInThisRun_;
70  unsigned int const zerothEvent_;
75  };
76 }
77 #endif
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
unsigned int const zerothEvent_
unsigned int numberEventsInRun() const
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
tuple interval
Definition: MergeJob_cfg.py:20
unsigned int EventNumber_t
Definition: EventID.h:30
virtual void readEvent_(EventPrincipal &eventPrincipal) override
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
virtual void beginLuminosityBlock(LuminosityBlock &) override
unsigned int numberEventsInThisLumi_
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
virtual size_t fileIndex() const
virtual void endRun(Run &) override
ProducerSourceBase(ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
virtual void beginJob() override
unsigned int timeBetweenEvents() const
virtual void beginRun(Run &) override
static void fillDescription(ParameterSetDescription &desc)
unsigned int offset(bool)
unsigned long long TimeValue_t
Definition: Timestamp.h:28
virtual void endLuminosityBlock(LuminosityBlock &) override
unsigned int numberEventsInThisRun() const
unsigned int numberEventsInThisLumi() const
TimeValue_t presentTime() const
virtual void rewind_() override
EventAuxiliary::ExperimentType eType_
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time)=0
unsigned int numberEventsInThisRun_
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
Definition: EventRange.h:32
unsigned int numberEventsInLumi() const
virtual ItemType getNextItemType() override
unsigned int eventCreationDelay() const
virtual void skip(int offset) override
void retreatToPrevious(EventID &eventID, TimeValue_t &time)
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)
Definition: Run.h:41