CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::ProducerSourceBase Class Referenceabstract

#include <ProducerSourceBase.h>

Inheritance diagram for edm::ProducerSourceBase:
edm::InputSource edm::ProductRegistryHelper cond::EmptyIOVSource edm::EmptySource edm::ProducerSourceFromFiles LmfSource AlpgenSource edm::MCFileSource FRDStreamSource HcalTBSource L1MuGMTHWFileReader LHESource MCatNLOSource PixelSLinkDataInputSource

Public Member Functions

EventNumber_t event () const
 
unsigned int eventCreationDelay () const
 
EventID const & eventID () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
unsigned int numberEventsInLumi () const
 
unsigned int numberEventsInRun () const
 
unsigned int numberEventsInThisLumi () const
 
unsigned int numberEventsInThisRun () const
 
TimeValue_t presentTime () const
 
 ProducerSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
 
RunNumber_t run () const
 
unsigned int timeBetweenEvents () const
 
virtual ~ProducerSourceBase ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper () const
 Accessor for branchIDListHelper. More...
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp, ProcessContext const *)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 Advances the source to the next item. More...
 
InputSourceoperator= (InputSource const &)=delete
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Const accessor for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 Non-const accessor for process history registry. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific event. More...
 
std::unique_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
SharedResourcesAcquirerresourceSharedWithDelayedReader () const
 Returns nullptr if no resource shared between the Source and a DelayedReader. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
bool skipForForking ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource ()
 Destructor. More...
 

Static Public Member Functions

static void fillDescription (ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void advanceToNext (EventID &eventID, TimeValue_t &time)
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (LuminosityBlock &) override
 
virtual void beginRun (Run &) override
 
virtual void endLuminosityBlock (LuminosityBlock &) override
 
virtual void endRun (Run &) override
 
virtual size_t fileIndex () const
 
virtual ItemType getNextItemType () override
 
virtual void initialize (EventID &id, TimeValue_t &time, TimeValue_t &interval)
 
virtual bool noFiles () const
 
virtual void produce (Event &e)=0
 
virtual void readEvent_ (EventPrincipal &eventPrincipal) override
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ () override
 
virtual boost::shared_ptr
< RunAuxiliary
readRunAuxiliary_ () override
 
void retreatToPrevious (EventID &eventID, TimeValue_t &time)
 
virtual void rewind_ () override
 
virtual bool setRunAndEventInfo (EventID &id, TimeValue_t &time)=0
 
virtual void skip (int offset) override
 

Private Attributes

EventAuxiliary::ExperimentType eType_
 
unsigned int eventCreationDelay_
 
EventID eventID_
 
bool isRealData_
 
unsigned int numberEventsInLumi_
 
unsigned int numberEventsInRun_
 
unsigned int numberEventsInThisLumi_
 
unsigned int numberEventsInThisRun_
 
EventID origEventID_
 
TimeValue_t origTime_
 
TimeValue_t presentTime_
 
TimeValue_t timeBetweenEvents_
 
unsigned int const zerothEvent_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat, IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryUpdate () const
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemType state () const
 

Detailed Description

Definition at line 19 of file ProducerSourceBase.h.

Constructor & Destructor Documentation

edm::ProducerSourceBase::ProducerSourceBase ( ParameterSet const &  pset,
InputSourceDescription const &  desc,
bool  realData 
)
explicit

Definition at line 19 of file ProducerSourceBase.cc.

References presentTime_, and edm::InputSource::setTimestamp().

20  :
21  InputSource(pset, desc),
22  numberEventsInRun_(pset.getUntrackedParameter<unsigned int>("numberEventsInRun", remainingEvents())),
23  numberEventsInLumi_(pset.getUntrackedParameter<unsigned int>("numberEventsInLuminosityBlock", remainingEvents())),
24  presentTime_(pset.getUntrackedParameter<unsigned long long>("firstTime", 1ULL)), //time in ns
26  timeBetweenEvents_(pset.getUntrackedParameter<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)),
27  eventCreationDelay_(pset.getUntrackedParameter<unsigned int>("eventCreationDelay", 0)),
30  zerothEvent_(pset.getUntrackedParameter<unsigned int>("firstEvent", 1) - 1),
31  eventID_(pset.getUntrackedParameter<unsigned int>("firstRun", 1), pset.getUntrackedParameter<unsigned int>("firstLuminosityBlock", 1), zerothEvent_),
33  isRealData_(realData),
35 
37  // We need to map this string to the EventAuxiliary::ExperimentType enumeration
38  // std::string eType = pset.getUntrackedParameter<std::string>("experimentType", std::string("Any"))),
39  }
static unsigned long long const kNanoSecPerSec
unsigned int const zerothEvent_
unsigned int numberEventsInThisLumi_
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:345
int remainingEvents() const
Definition: InputSource.h:194
static unsigned long long const kAveEventPerSec
EventAuxiliary::ExperimentType eType_
unsigned int numberEventsInThisRun_
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:52
edm::ProducerSourceBase::~ProducerSourceBase ( )
virtual

Definition at line 41 of file ProducerSourceBase.cc.

41  {
42  }

Member Function Documentation

void edm::ProducerSourceBase::advanceToNext ( EventID eventID,
TimeValue_t time 
)
private

Definition at line 173 of file ProducerSourceBase.cc.

References edm::EventID::luminosityBlock(), edm::EventID::next(), edm::EventID::nextRunFirstEvent(), numberEventsInLumi_, numberEventsInRun_, numberEventsInThisLumi_, numberEventsInThisRun_, origEventID_, and timeBetweenEvents_.

Referenced by getNextItemType(), and skip().

173  {
175  // same run
178  // new lumi
179  eventID = eventID.next(eventID.luminosityBlock() + 1);
181  } else {
182  eventID = eventID.next(eventID.luminosityBlock());
184  }
185  } else {
186  // new run
187  eventID = eventID.nextRunFirstEvent(origEventID_.luminosityBlock());
190  }
192  }
unsigned int numberEventsInThisLumi_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int numberEventsInThisRun_
void edm::ProducerSourceBase::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 91 of file ProducerSourceBase.cc.

References eventID_, initialize(), presentTime_, and timeBetweenEvents_.

91  {
92  // initialize cannot be called from the constructor, because it is a virtual function
93  // that needs to be invoked from a derived class if the derived class overrides it.
95  }
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)
void edm::ProducerSourceBase::beginLuminosityBlock ( LuminosityBlock )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Reimplemented in FRDStreamSource.

Definition at line 106 of file ProducerSourceBase.cc.

106  {
107  }
void edm::ProducerSourceBase::beginRun ( Run )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Reimplemented in MCatNLOSource, AlpgenSource, LHESource, and FRDStreamSource.

Definition at line 98 of file ProducerSourceBase.cc.

98  {
99  }
void edm::ProducerSourceBase::endLuminosityBlock ( LuminosityBlock )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Reimplemented in FRDStreamSource.

Definition at line 110 of file ProducerSourceBase.cc.

110  {
111  }
void edm::ProducerSourceBase::endRun ( Run )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Reimplemented in LHESource, and FRDStreamSource.

Definition at line 102 of file ProducerSourceBase.cc.

102  {
103  }
EventNumber_t edm::ProducerSourceBase::event ( ) const
inline

Definition at line 33 of file ProducerSourceBase.h.

References edm::EventID::event(), and eventID_.

Referenced by FRDStreamSource::setRunAndEventInfo().

33 {return eventID_.event();}
EventNumber_t event() const
Definition: EventID.h:44
unsigned int edm::ProducerSourceBase::eventCreationDelay ( ) const
inline

Definition at line 28 of file ProducerSourceBase.h.

References eventCreationDelay_.

28 {return eventCreationDelay_;}
EventID const& edm::ProducerSourceBase::eventID ( ) const
inline

Definition at line 31 of file ProducerSourceBase.h.

References eventID_.

Referenced by LHESource::readEvent_().

31 {return eventID_;}
size_t edm::ProducerSourceBase::fileIndex ( ) const
privatevirtual

Definition at line 223 of file ProducerSourceBase.cc.

Referenced by getNextItemType().

223  {
224  return 0UL;
225  }
void edm::ProducerSourceBase::fillDescription ( ParameterSetDescription desc)
static

Definition at line 228 of file ProducerSourceBase.cc.

References edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), edm::InputSource::fillDescription(), edm::kAveEventPerSec, and edm::kNanoSecPerSec.

Referenced by edm::ProducerSourceFromFiles::fillDescription(), and edm::EmptySource::fillDescriptions().

228  {
229  desc.addOptionalUntracked<unsigned int>("numberEventsInRun")->setComment("Number of events to generate in each run.");
230  desc.addOptionalUntracked<unsigned int>("numberEventsInLuminosityBlock")->setComment("Number of events to generate in each lumi.");
231  desc.addUntracked<unsigned long long>("firstTime", 1)->setComment("Time before first event (ns) (for timestamp).");
232  desc.addUntracked<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)->setComment("Time between consecutive events (ns) (for timestamp).");
233  desc.addUntracked<unsigned int>("eventCreationDelay", 0)->setComment("Real time delay between generation of consecutive events (ms).");
234  desc.addUntracked<unsigned int>("firstEvent", 1)->setComment("Event number of first event to generate.");
235  desc.addUntracked<unsigned int>("firstLuminosityBlock", 1)->setComment("Luminosity block number of first lumi to generate.");
236  desc.addUntracked<unsigned int>("firstRun", 1)->setComment("Run number of first run to generate.");
238  }
static unsigned long long const kNanoSecPerSec
static unsigned long long const kAveEventPerSec
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:132
InputSource::ItemType edm::ProducerSourceBase::getNextItemType ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 128 of file ProducerSourceBase.cc.

References advanceToNext(), edm::InputSource::eventCached(), eventCreationDelay_, eventID_, fileIndex(), getHLTprescales::index, edm::InputSource::IsEvent, edm::InputSource::IsFile, edm::InputSource::IsInvalid, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, edm::EventID::luminosityBlock(), edm::InputSource::newLumi(), edm::InputSource::newRun(), noFiles(), presentTime_, edm::InputSource::processingMode(), edm::EventID::run(), edm::InputSource::Runs, edm::InputSource::RunsAndLumis, edm::InputSource::setEventCached(), edm::InputSource::setNewLumi(), edm::InputSource::setNewRun(), setRunAndEventInfo(), and edm::InputSource::state().

128  {
129  if(state() == IsInvalid) {
130  return noFiles() ? IsStop : IsFile;
131  }
132  if (newRun()) {
133  return IsRun;
134  }
135  if (newLumi()) {
136  return IsLumi;
137  }
138  if(eventCached()) {
139  return IsEvent;
140  }
141  EventID oldEventID = eventID_;
143  if (eventCreationDelay_ > 0) {usleep(eventCreationDelay_);}
144  size_t index = fileIndex();
145  bool another = setRunAndEventInfo(eventID_, presentTime_);
146  if(!another) {
147  return IsStop;
148  }
149  bool newFile = (fileIndex() > index);
150  setEventCached();
151  if(newRun() || eventID_.run() != oldEventID.run()) {
152  // New Run
153  setNewRun();
154  setNewLumi();
155  return newFile ? IsFile : IsRun;
156  }
157  if (processingMode() == Runs) {
158  return newFile ? IsFile : IsRun;
159  }
160  if (processingMode() == RunsAndLumis) {
161  return newFile ? IsFile : IsLumi;
162  }
163  // Same Run
164  if (newLumi() || eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
165  // New Lumi
166  setNewLumi();
167  return newFile ? IsFile : IsLumi;
168  }
169  return newFile ? IsFile : IsEvent;
170  }
RunNumber_t run() const
Definition: EventID.h:42
bool newLumi() const
Definition: InputSource.h:376
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:253
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
virtual size_t fileIndex() const
bool newRun() const
Definition: InputSource.h:373
ItemType state() const
Definition: InputSource.h:349
void setEventCached()
Called by the framework to merge or ached() const {return eventCached_;}.
Definition: InputSource.h:381
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time)=0
virtual bool noFiles() const
void advanceToNext(EventID &eventID, TimeValue_t &time)
bool eventCached() const
Definition: InputSource.h:379
void edm::ProducerSourceBase::initialize ( EventID id,
TimeValue_t time,
TimeValue_t interval 
)
privatevirtual

Reimplemented in cond::EmptyIOVSource.

Definition at line 114 of file ProducerSourceBase.cc.

Referenced by beginJob().

114  {
115  }
LuminosityBlockNumber_t edm::ProducerSourceBase::luminosityBlock ( ) const
inline
bool edm::ProducerSourceBase::noFiles ( ) const
privatevirtual

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 218 of file ProducerSourceBase.cc.

Referenced by getNextItemType().

218  {
219  return false;
220  }
unsigned int edm::ProducerSourceBase::numberEventsInLumi ( ) const
inline

Definition at line 25 of file ProducerSourceBase.h.

References numberEventsInLumi_.

25 {return numberEventsInLumi_;}
unsigned int edm::ProducerSourceBase::numberEventsInRun ( ) const
inline

Definition at line 24 of file ProducerSourceBase.h.

References numberEventsInRun_.

24 {return numberEventsInRun_;}
unsigned int edm::ProducerSourceBase::numberEventsInThisLumi ( ) const
inline

Definition at line 30 of file ProducerSourceBase.h.

References numberEventsInThisLumi_.

unsigned int numberEventsInThisLumi_
unsigned int edm::ProducerSourceBase::numberEventsInThisRun ( ) const
inline

Definition at line 29 of file ProducerSourceBase.h.

References numberEventsInThisRun_.

29 {return numberEventsInThisRun_;}
unsigned int numberEventsInThisRun_
TimeValue_t edm::ProducerSourceBase::presentTime ( ) const
inline

Definition at line 26 of file ProducerSourceBase.h.

References presentTime_.

Referenced by LHESource::readEvent_(), and HcalTBSource::setRunAndEventInfo().

26 {return presentTime_;}
virtual void edm::ProducerSourceBase::produce ( Event e)
privatepure virtual
void edm::ProducerSourceBase::readEvent_ ( EventPrincipal eventPrincipal)
overrideprivatevirtual

Implements edm::InputSource.

Reimplemented in LHESource.

Definition at line 60 of file ProducerSourceBase.cc.

References printConversionInfo::aux, edm::Event::commit_(), alignCSCRings::e, eType_, edm::InputSource::eventCached(), eventID_, edm::EventPrincipal::fillEventPrincipal(), isRealData_, edm::InputSource::moduleDescription(), presentTime_, edm::InputSource::processGUID(), edm::InputSource::processHistoryRegistry(), edm::InputSource::processingMode(), produce(), edm::InputSource::resetEventCached(), and edm::InputSource::RunsLumisAndEvents.

60  {
63  eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry());
64  Event e(eventPrincipal, moduleDescription(), nullptr);
65  produce(e);
66  e.commit_();
68  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Const accessor for process history registry.
Definition: InputSource.h:171
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:253
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:214
void resetEventCached()
Definition: InputSource.h:382
EventAuxiliary::ExperimentType eType_
virtual void produce(Event &e)=0
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:205
bool eventCached() const
Definition: InputSource.h:379
boost::shared_ptr< LuminosityBlockAuxiliary > edm::ProducerSourceBase::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 52 of file ProducerSourceBase.cc.

References eventID_, edm::Timestamp::invalidTimestamp(), edm::EventID::luminosityBlock(), presentTime_, edm::InputSource::processingMode(), edm::InputSource::resetNewLumi(), edm::EventID::run(), and edm::InputSource::Runs.

52  {
53  if (processingMode() == Runs) return boost::shared_ptr<LuminosityBlockAuxiliary>();
55  resetNewLumi();
56  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(eventID_.run(), eventID_.luminosityBlock(), ts, Timestamp::invalidTimestamp()));
57  }
RunNumber_t run() const
Definition: EventID.h:42
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:253
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
boost::shared_ptr< RunAuxiliary > edm::ProducerSourceBase::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 45 of file ProducerSourceBase.cc.

References eventID_, edm::Timestamp::invalidTimestamp(), presentTime_, edm::InputSource::resetNewRun(), and edm::EventID::run().

45  {
47  resetNewRun();
48  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(eventID_.run(), ts, Timestamp::invalidTimestamp()));
49  }
RunNumber_t run() const
Definition: EventID.h:42
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
void edm::ProducerSourceBase::retreatToPrevious ( EventID eventID,
TimeValue_t time 
)
private

Definition at line 195 of file ProducerSourceBase.cc.

References edm::EventID::luminosityBlock(), numberEventsInLumi_, numberEventsInRun_, numberEventsInThisLumi_, numberEventsInThisRun_, origEventID_, edm::EventID::previous(), edm::EventID::previousRunLastEvent(), edm::EventID::run(), and timeBetweenEvents_.

Referenced by skip().

195  {
196  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
197  // same run
199  eventID = eventID.previous(eventID.luminosityBlock());
200  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
201  // new lumi
202  eventID = eventID.previous(eventID.luminosityBlock() - 1);
204  } else {
206  }
207  } else {
208  // new run
209  eventID = eventID.previousRunLastEvent(origEventID_.luminosityBlock() + numberEventsInRun_/numberEventsInLumi_);
210  eventID = EventID(numberEventsInRun_, eventID.luminosityBlock(), eventID.run());
213  }
215  }
unsigned int numberEventsInThisLumi_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int numberEventsInThisRun_
void edm::ProducerSourceBase::rewind_ ( )
overrideprivatevirtual
RunNumber_t edm::ProducerSourceBase::run ( void  ) const
inline

Definition at line 32 of file ProducerSourceBase.h.

References eventID_, and edm::EventID::run().

Referenced by PixelSLinkDataInputSource::setRunAndEventInfo().

32 {return eventID_.run();}
RunNumber_t run() const
Definition: EventID.h:42
virtual bool edm::ProducerSourceBase::setRunAndEventInfo ( EventID id,
TimeValue_t time 
)
privatepure virtual
void edm::ProducerSourceBase::skip ( int  offset)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 71 of file ProducerSourceBase.cc.

References advanceToNext(), eventID_, edm::EventID::luminosityBlock(), evf::evtn::offset(), presentTime_, retreatToPrevious(), edm::EventID::run(), edm::InputSource::setNewLumi(), and edm::InputSource::setNewRun().

71  {
72  EventID oldEventID = eventID_;
73  for(; offset < 0; ++offset) {
75  }
76  for(; offset > 0; --offset) {
78  }
79  if(eventID_.run() != oldEventID.run()) {
80  // New Run
81  setNewRun();
82  setNewLumi();
83  }
84  if (eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
85  // New Lumi
86  setNewLumi();
87  }
88  }
RunNumber_t run() const
Definition: EventID.h:42
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int offset(bool)
void advanceToNext(EventID &eventID, TimeValue_t &time)
void retreatToPrevious(EventID &eventID, TimeValue_t &time)
unsigned int edm::ProducerSourceBase::timeBetweenEvents ( ) const
inline

Definition at line 27 of file ProducerSourceBase.h.

References timeBetweenEvents_.

Referenced by HcalTBSource::setRunAndEventInfo().

27 {return timeBetweenEvents_;}

Member Data Documentation

EventAuxiliary::ExperimentType edm::ProducerSourceBase::eType_
private

Definition at line 74 of file ProducerSourceBase.h.

Referenced by readEvent_().

unsigned int edm::ProducerSourceBase::eventCreationDelay_
private

Definition at line 66 of file ProducerSourceBase.h.

Referenced by eventCreationDelay(), and getNextItemType().

EventID edm::ProducerSourceBase::eventID_
private
bool edm::ProducerSourceBase::isRealData_
private

Definition at line 73 of file ProducerSourceBase.h.

Referenced by readEvent_().

unsigned int edm::ProducerSourceBase::numberEventsInLumi_
private

Definition at line 62 of file ProducerSourceBase.h.

Referenced by advanceToNext(), numberEventsInLumi(), and retreatToPrevious().

unsigned int edm::ProducerSourceBase::numberEventsInRun_
private

Definition at line 61 of file ProducerSourceBase.h.

Referenced by advanceToNext(), numberEventsInRun(), and retreatToPrevious().

unsigned int edm::ProducerSourceBase::numberEventsInThisLumi_
private
unsigned int edm::ProducerSourceBase::numberEventsInThisRun_
private
EventID edm::ProducerSourceBase::origEventID_
private

Definition at line 72 of file ProducerSourceBase.h.

Referenced by advanceToNext(), retreatToPrevious(), and rewind_().

TimeValue_t edm::ProducerSourceBase::origTime_
private

Definition at line 64 of file ProducerSourceBase.h.

Referenced by rewind_().

TimeValue_t edm::ProducerSourceBase::presentTime_
private
TimeValue_t edm::ProducerSourceBase::timeBetweenEvents_
private

Definition at line 65 of file ProducerSourceBase.h.

Referenced by advanceToNext(), beginJob(), retreatToPrevious(), and timeBetweenEvents().

unsigned int const edm::ProducerSourceBase::zerothEvent_
private

Definition at line 70 of file ProducerSourceBase.h.