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 
15 
16 #include <memory>
17 #include <vector>
18 
19 namespace edm {
20  class ParameterSet;
23  public:
24  explicit ProducerSourceBase(ParameterSet const& pset, InputSourceDescription const& desc, bool realData);
25  ~ProducerSourceBase() noexcept(false) override;
26 
27  unsigned int numberEventsInRun() const { return numberEventsInRun_; }
28  unsigned int numberEventsInLumi() const { return numberEventsInLumi_; }
29  TimeValue_t presentTime() const { return presentTime_; }
30  unsigned int timeBetweenEvents() const { return timeBetweenEvents_; }
31  unsigned int eventCreationDelay() const { return eventCreationDelay_; }
32  unsigned int numberEventsInThisRun() const { return numberEventsInThisRun_; }
33  unsigned int numberEventsInThisLumi() const { return numberEventsInThisLumi_; }
34  EventID const& eventID() const { return eventID_; }
35  RunNumber_t run() const { return eventID_.run(); }
36  EventNumber_t event() const { return eventID_.event(); }
38 
39  static void fillDescription(ParameterSetDescription& desc);
40 
41  protected:
42  private:
43  ItemType getNextItemType() final;
44  virtual void initialize(EventID& id, TimeValue_t& time, TimeValue_t& interval);
45  virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time, EventAuxiliary::ExperimentType& etype) = 0;
46  virtual void produce(Event& e) = 0;
47  virtual bool noFiles() const;
48  virtual size_t fileIndex() const;
49  void beginJob() override;
50 
51  void readEvent_(EventPrincipal& eventPrincipal) override;
52  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
53  std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
54  void skip(int offset) override;
55  void rewind_() override;
56 
58  void retreatToPrevious(EventID& eventID, TimeValue_t& time);
60 
61  std::vector<edm::LuminosityBlockID> firstLumiForRuns_;
62  unsigned int numberEventsInRun_;
63  unsigned int numberEventsInLumi_;
67  unsigned int eventCreationDelay_; /* microseconds */
68 
69  unsigned int numberEventsInThisRun_;
76  };
77 } // namespace edm
78 #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
RunNumber_t run() const
~ProducerSourceBase() noexcept(false) override
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
ItemType getNextItemType() final
unsigned int LuminosityBlockNumber_t
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
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
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
unsigned int numberEventsInThisRun() const
#define noexcept
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)