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 
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  virtual ~ProducerSourceBase();
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  virtual ItemType getNextItemType() override 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  virtual void beginJob() override;
49  virtual void beginRun(Run&) override;
50  virtual void endRun(Run&) override;
51  virtual void beginLuminosityBlock(LuminosityBlock&) override;
52  virtual void endLuminosityBlock(LuminosityBlock&) override;
53  virtual void readEvent_(EventPrincipal& eventPrincipal) override;
54  virtual std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
55  virtual std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
56  virtual void skip(int offset) override;
57  virtual void rewind_() override;
58 
60  void retreatToPrevious(EventID& eventID, TimeValue_t& time);
61 
62  unsigned int numberEventsInRun_;
63  unsigned int numberEventsInLumi_;
67  unsigned int eventCreationDelay_; /* microseconds */
68 
69  unsigned int numberEventsInThisRun_;
75  EventAuxiliary::ExperimentType eType_;
76  };
77 }
78 #endif
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
EventNumber_t const zerothEvent_
unsigned int numberEventsInRun() const
tuple interval
Definition: MergeJob_cfg.py:20
virtual ItemType getNextItemType() overridefinal
virtual void readEvent_(EventPrincipal &eventPrincipal) override
virtual void beginLuminosityBlock(LuminosityBlock &) override
unsigned int numberEventsInThisLumi_
unsigned long long EventNumber_t
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
unsigned int LuminosityBlockNumber_t
virtual size_t fileIndex() const
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=0
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
string const
Definition: compareJSON.py:14
EventAuxiliary::ExperimentType eType_
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
unsigned int numberEventsInLumi() const
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