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
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::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 (std::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...
 
std::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...
 
std::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...
 
std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::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...
 
std::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 ()
 
std::shared_ptr
< ThinnedAssociationsHelper
thinnedAssociationsHelper () const
 Accessor for thinnedAssociationsHelper. More...
 
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 () overridefinal
 
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 std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ () override
 
virtual std::shared_ptr
< RunAuxiliary
readRunAuxiliary_ () override
 
void retreatToPrevious (EventID &eventID, TimeValue_t &time)
 
virtual void rewind_ () override
 
virtual bool setRunAndEventInfo (EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=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_
 
EventNumber_t 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
 
std::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
 
std::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 20 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.existsAs<unsigned int>("firstEvent", false) ? pset.getUntrackedParameter<unsigned int>("firstEvent", 1) - 1 :
31  pset.getUntrackedParameter<unsigned long long>("firstEvent", 1) - 1),
32  eventID_(pset.getUntrackedParameter<unsigned int>("firstRun", 1), pset.getUntrackedParameter<unsigned int>("firstLuminosityBlock", 1), zerothEvent_),
34  isRealData_(realData),
36 
38  // We need to map this string to the EventAuxiliary::ExperimentType enumeration
39  // std::string eType = pset.getUntrackedParameter<std::string>("experimentType", std::string("Any"))),
40  }
static unsigned long long const kNanoSecPerSec
EventNumber_t const zerothEvent_
unsigned int numberEventsInThisLumi_
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:349
int remainingEvents() const
Definition: InputSource.h:198
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 42 of file ProducerSourceBase.cc.

42  {
43  }

Member Function Documentation

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

Definition at line 174 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().

174  {
176  // same run
179  // new lumi
182  } else {
185  }
186  } else {
187  // new run
191  }
193  }
unsigned int numberEventsInThisLumi_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:44
unsigned int numberEventsInThisRun_
EventID const & eventID() const
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:53
void edm::ProducerSourceBase::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 92 of file ProducerSourceBase.cc.

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

92  {
93  // initialize cannot be called from the constructor, because it is a virtual function
94  // that needs to be invoked from a derived class if the derived class overrides it.
96  }
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 107 of file ProducerSourceBase.cc.

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

Reimplemented from edm::InputSource.

Reimplemented in MCatNLOSource, AlpgenSource, LHESource, and FRDStreamSource.

Definition at line 99 of file ProducerSourceBase.cc.

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

Reimplemented from edm::InputSource.

Reimplemented in FRDStreamSource.

Definition at line 111 of file ProducerSourceBase.cc.

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

Reimplemented from edm::InputSource.

Reimplemented in LHESource, and FRDStreamSource.

Definition at line 103 of file ProducerSourceBase.cc.

103  {
104  }
EventNumber_t edm::ProducerSourceBase::event ( ) const
inline
unsigned int edm::ProducerSourceBase::eventCreationDelay ( ) const
inline

Definition at line 29 of file ProducerSourceBase.h.

References eventCreationDelay_.

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

Definition at line 32 of file ProducerSourceBase.h.

References eventID_.

Referenced by LHESource::readEvent_().

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

Definition at line 225 of file ProducerSourceBase.cc.

Referenced by getNextItemType().

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

Definition at line 230 of file ProducerSourceBase.cc.

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

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

230  {
231  desc.addOptionalUntracked<unsigned int>("numberEventsInRun")->setComment("Number of events to generate in each run.");
232  desc.addOptionalUntracked<unsigned int>("numberEventsInLuminosityBlock")->setComment("Number of events to generate in each lumi.");
233  desc.addUntracked<unsigned long long>("firstTime", 1)->setComment("Time before first event (ns) (for timestamp).");
234  desc.addUntracked<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)->setComment("Time between consecutive events (ns) (for timestamp).");
235  desc.addUntracked<unsigned int>("eventCreationDelay", 0)->setComment("Real time delay between generation of consecutive events (ms).");
236 
237  desc.addNode( edm::ParameterDescription<unsigned int>("firstEvent", 1U, false) xor
238  edm::ParameterDescription<unsigned long long>("firstEvent", 1ULL, false))
239  ->setComment("'firstEvent' is an XOR group because it can have type uint32 or uint64, default:1\n"
240  "Event number of first event to generate.");
241 
242  desc.addUntracked<unsigned int>("firstLuminosityBlock", 1)->setComment("Luminosity block number of first lumi to generate.");
243  desc.addUntracked<unsigned int>("firstRun", 1)->setComment("Run number of first run to generate.");
245  }
static unsigned long long const kNanoSecPerSec
static unsigned long long const kAveEventPerSec
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:137
InputSource::ItemType edm::ProducerSourceBase::getNextItemType ( )
finaloverrideprivatevirtual

Implements edm::InputSource.

Definition at line 129 of file ProducerSourceBase.cc.

References advanceToNext(), eType_, edm::InputSource::eventCached(), eventCreationDelay_, eventID_, fileIndex(), cmsHarvester::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().

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

Reimplemented in cond::EmptyIOVSource.

Definition at line 115 of file ProducerSourceBase.cc.

Referenced by beginJob().

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

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 220 of file ProducerSourceBase.cc.

Referenced by getNextItemType().

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

Definition at line 26 of file ProducerSourceBase.h.

References numberEventsInLumi_.

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

Definition at line 25 of file ProducerSourceBase.h.

References numberEventsInRun_.

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

Definition at line 31 of file ProducerSourceBase.h.

References numberEventsInThisLumi_.

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

Definition at line 30 of file ProducerSourceBase.h.

References numberEventsInThisRun_.

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

Definition at line 27 of file ProducerSourceBase.h.

References presentTime_.

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

27 {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 61 of file ProducerSourceBase.cc.

References assert(), 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.

61  {
64  eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry());
65  Event e(eventPrincipal, moduleDescription(), nullptr);
66  produce(e);
67  e.commit_();
69  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Const accessor for process history registry.
Definition: InputSource.h:172
assert(m_qm.get())
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:257
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:218
void resetEventCached()
Definition: InputSource.h:386
EventAuxiliary::ExperimentType eType_
virtual void produce(Event &e)=0
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:209
bool eventCached() const
Definition: InputSource.h:383
std::shared_ptr< LuminosityBlockAuxiliary > edm::ProducerSourceBase::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 53 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.

53  {
54  if (processingMode() == Runs) return std::shared_ptr<LuminosityBlockAuxiliary>();
56  resetNewLumi();
57  return std::make_shared<LuminosityBlockAuxiliary>(eventID_.run(), eventID_.luminosityBlock(), ts, Timestamp::invalidTimestamp());
58  }
RunNumber_t run() const
Definition: EventID.h:39
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:257
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
std::shared_ptr< RunAuxiliary > edm::ProducerSourceBase::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 46 of file ProducerSourceBase.cc.

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

46  {
48  resetNewRun();
49  return std::make_shared<RunAuxiliary>(eventID_.run(), ts, Timestamp::invalidTimestamp());
50  }
RunNumber_t run() const
Definition: EventID.h:39
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
void edm::ProducerSourceBase::retreatToPrevious ( EventID eventID,
TimeValue_t time 
)
private

Definition at line 196 of file ProducerSourceBase.cc.

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

Referenced by skip().

196  {
197  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
198  // same run
201  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
202  // new lumi
205  } else {
207  }
208  } else {
209  // new run
215  }
217  }
RunNumber_t run() const
Definition: EventID.h:39
assert(m_qm.get())
unsigned int numberEventsInThisLumi_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:63
unsigned int numberEventsInThisRun_
EventID const & eventID() const
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:56
void edm::ProducerSourceBase::rewind_ ( )
overrideprivatevirtual
RunNumber_t edm::ProducerSourceBase::run ( void  ) const
inline

Definition at line 33 of file ProducerSourceBase.h.

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

Referenced by PixelSLinkDataInputSource::setRunAndEventInfo().

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

Reimplemented from edm::InputSource.

Definition at line 72 of file ProducerSourceBase.cc.

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

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

Definition at line 28 of file ProducerSourceBase.h.

References timeBetweenEvents_.

Referenced by HcalTBSource::setRunAndEventInfo().

28 {return timeBetweenEvents_;}

Member Data Documentation

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

Definition at line 75 of file ProducerSourceBase.h.

Referenced by getNextItemType(), and readEvent_().

unsigned int edm::ProducerSourceBase::eventCreationDelay_
private

Definition at line 67 of file ProducerSourceBase.h.

Referenced by eventCreationDelay(), and getNextItemType().

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

Definition at line 74 of file ProducerSourceBase.h.

Referenced by readEvent_().

unsigned int edm::ProducerSourceBase::numberEventsInLumi_
private

Definition at line 63 of file ProducerSourceBase.h.

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

unsigned int edm::ProducerSourceBase::numberEventsInRun_
private

Definition at line 62 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 73 of file ProducerSourceBase.h.

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

TimeValue_t edm::ProducerSourceBase::origTime_
private

Definition at line 65 of file ProducerSourceBase.h.

Referenced by rewind_().

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

Definition at line 66 of file ProducerSourceBase.h.

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

EventNumber_t const edm::ProducerSourceBase::zerothEvent_
private

Definition at line 71 of file ProducerSourceBase.h.