CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurableInputSource.h
Go to the documentation of this file.
1 #ifndef Framework_ConfigurableInputSource_h
2 #define Framework_ConfigurableInputSource_h
3 
4 /*----------------------------------------------------------------------
5 ----------------------------------------------------------------------*/
6 
13 
14 #include "boost/shared_ptr.hpp"
15 
16 namespace edm {
17  class ParameterSet;
20  public:
21  explicit ConfigurableInputSource(ParameterSet const& pset, InputSourceDescription const& desc, bool realData = true);
22  virtual ~ConfigurableInputSource();
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  RunNumber_t run() const {return eventID_.run();}
32  EventNumber_t event() const {return eventID_.event();}
34  static void fillDescription(ParameterSetDescription& desc);
35 
36  protected:
37 
39  RunNumber_t r = run();
41  eventID_ = EventID(r, lb, e);
42  eventSet_ = true;
43  }
45  void reallyReadEvent();
46 
47  private:
48  virtual ItemType getNextItemType();
49  virtual void setRunAndEventInfo();
50  virtual bool produce(Event& e) = 0;
51  virtual void beginRun(Run&);
52  virtual void endRun(Run&);
54  virtual void endLuminosityBlock(LuminosityBlock&);
55  virtual EventPrincipal* readEvent_();
56  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
57  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
58  virtual void skip(int offset);
59  virtual void setRun(RunNumber_t r);
60  virtual void setLumi(LuminosityBlockNumber_t lb);
61  virtual void rewind_();
62 
63  virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>);
64  void advanceToNext() ;
65  void retreatToPrevious();
66 
67  unsigned int numberEventsInRun_;
68  unsigned int numberEventsInLumi_;
71  unsigned int timeBetweenEvents_;
72  unsigned int eventCreationDelay_; /* microseconds */
73 
74  unsigned int numberEventsInThisRun_;
76  unsigned int const zerothEvent_;
79  bool newRun_;
80  bool newLumi_;
82  bool lumiSet_;
83  bool eventSet_;
86 
87  //used when process has been forked
88  boost::shared_ptr<edm::multicore::MessageReceiverForSource> receiver_;
91  };
92 }
93 #endif
LuminosityBlockNumber_t luminosityBlock() const
RunNumber_t run() const
Definition: EventID.h:42
EventAuxiliary::ExperimentType eType_
EventNumber_t event() const
Definition: EventID.h:44
static void fillDescription(ParameterSetDescription &desc)
unsigned int EventNumber_t
Definition: EventID.h:30
virtual void setRun(RunNumber_t r)
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
virtual bool produce(Event &e)=0
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
unsigned int numberEventsInThisRun() const
virtual void endLuminosityBlock(LuminosityBlock &)
unsigned int numberEventsInThisLumi() const
unsigned int offset(bool)
unsigned long long TimeValue_t
Definition: Timestamp.h:27
unsigned int numberEventsInLumi() const
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
unsigned int numberEventsInRun() const
ConfigurableInputSource(ParameterSet const &pset, InputSourceDescription const &desc, bool realData=true)
virtual void postForkReacquireResources(boost::shared_ptr< edm::multicore::MessageReceiverForSource >)
void setEventNumber(EventNumber_t e)
virtual void beginLuminosityBlock(LuminosityBlock &)
unsigned int timeBetweenEvents() const
unsigned int RunNumber_t
Definition: EventRange.h:32
unsigned int eventCreationDelay() const
virtual void setLumi(LuminosityBlockNumber_t lb)
virtual EventPrincipal * readEvent_()
Definition: Run.h:32