CMS 3D CMS Logo

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::PuttableSourceBase edm::InputSource edm::ProducerBase 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
 
 ~ProducerSourceBase () noexcept(false) override
 
- Public Member Functions inherited from edm::PuttableSourceBase
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
 PuttableSourceBase (ParameterSet const &, InputSourceDescription const &)
 
void registerProducts () final
 Register any produced products. More...
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doEndJob ()
 Called by framework at end of job. 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, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () 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
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
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< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 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
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader ()
 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)
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource () noexcept(false)
 Destructor. More...
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 

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)
 
void beginJob () override
 
virtual size_t fileIndex () const
 
ItemType getNextItemType () final
 
virtual void initialize (EventID &id, TimeValue_t &time, TimeValue_t &interval)
 
virtual bool noFiles () const
 
virtual void produce (Event &e)=0
 
void readEvent_ (EventPrincipal &eventPrincipal) override
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ () override
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ () override
 
void retreatToPrevious (EventID &eventID, TimeValue_t &time)
 
void rewind_ () override
 
RunNumber_t runForLumi (LuminosityBlockNumber_t) const
 
virtual bool setRunAndEventInfo (EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=0
 
void skip (int offset) override
 

Private Attributes

EventAuxiliary::ExperimentType eType_
 
unsigned int eventCreationDelay_
 
EventID eventID_
 
std::vector< edm::LuminosityBlockIDfirstLumiForRuns_
 
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 }
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Attributes inherited from edm::InputSource
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postEventReadFromSourceSignal_
 
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preEventReadFromSourceSignal_
 
- Protected Member Functions inherited from edm::PuttableSourceBase
void beginJob () override
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) 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 22 of file ProducerSourceBase.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file ProducerSourceBase.cc.

References eventID_, firstLumiForRuns_, edm::EventID::luminosityBlock(), numberEventsInRun_, presentTime_, runForLumi(), edm::InputSource::setTimestamp(), and zerothEvent_.

39  : PuttableSourceBase(pset, desc),
41  pset.getUntrackedParameter<std::vector<edm::LuminosityBlockID>>("firstLuminosityBlockForEachRun")),
42  numberEventsInRun_(pset.getUntrackedParameter<unsigned int>("numberEventsInRun", remainingEvents())),
44  pset.getUntrackedParameter<unsigned int>("numberEventsInLuminosityBlock", remainingEvents())),
45  presentTime_(pset.getUntrackedParameter<unsigned long long>("firstTime", 1ULL)), //time in ns
48  pset.getUntrackedParameter<unsigned long long>("timeBetweenEvents", kNanoSecPerSec / kAveEventPerSec)),
49  eventCreationDelay_(pset.getUntrackedParameter<unsigned int>("eventCreationDelay", 0)),
52  zerothEvent_(pset.existsAs<unsigned int>("firstEvent", false)
53  ? pset.getUntrackedParameter<unsigned int>("firstEvent", 1) - 1
54  : pset.getUntrackedParameter<unsigned long long>("firstEvent", 1) - 1),
55  eventID_(pset.getUntrackedParameter<unsigned int>("firstRun", 1),
56  pset.getUntrackedParameter<unsigned int>("firstLuminosityBlock", 1),
57  zerothEvent_),
59  isRealData_(realData),
62  checkFirstLumiForRuns(firstLumiForRuns_);
63  if (not firstLumiForRuns_.empty()) {
64  numberEventsInRun_ = -1;
66  }
67  }
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:324
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
static unsigned long long kAveEventPerSec
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
int remainingEvents() const
Definition: InputSource.h:187
static unsigned long long kNanoSecPerSec
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
PuttableSourceBase(ParameterSet const &, InputSourceDescription const &)
EventAuxiliary::ExperimentType eType_
unsigned int numberEventsInThisRun_
edm::ProducerSourceBase::~ProducerSourceBase ( )
overridenoexcept

Definition at line 69 of file ProducerSourceBase.cc.

69 {}

Member Function Documentation

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

Definition at line 180 of file ProducerSourceBase.cc.

References edm::EventID::event(), eventID_, firstLumiForRuns_, edm::EventID::luminosityBlock(), edm::EventID::next(), edm::EventID::nextRunFirstEvent(), numberEventsInLumi_, numberEventsInRun_, numberEventsInThisLumi_, numberEventsInThisRun_, origEventID_, run(), edm::EventID::run(), runForLumi(), and timeBetweenEvents_.

Referenced by getNextItemType(), luminosityBlock(), and skip().

180  {
182  // same run
185  // new lumi
188  if (not firstLumiForRuns_.empty()) {
190  if (run != eventID.run()) {
193 
194  eventID = EventID(run, eventID.luminosityBlock(), eventID.event());
195  }
196  }
197  } else {
200  }
201  } else {
202  // new run
206  }
208  }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
unsigned int numberEventsInThisLumi_
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:44
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
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 116 of file ProducerSourceBase.cc.

References edm::PuttableSourceBase::beginJob(), eventID_, initialize(), presentTime_, and timeBetweenEvents_.

Referenced by luminosityBlock().

116  {
118  // Initialize cannot be called from the constructor, because it is a virtual function
119  // that needs to be invoked from a derived class if the derived class overrides it.
121  }
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)
EventNumber_t edm::ProducerSourceBase::event ( ) const
inline

Definition at line 36 of file ProducerSourceBase.h.

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

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

Definition at line 31 of file ProducerSourceBase.h.

References eventCreationDelay_.

31 { return eventCreationDelay_; }
EventID const& edm::ProducerSourceBase::eventID ( ) const
inline
size_t edm::ProducerSourceBase::fileIndex ( ) const
privatevirtual

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 255 of file ProducerSourceBase.cc.

Referenced by getNextItemType(), and luminosityBlock().

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

Definition at line 257 of file ProducerSourceBase.cc.

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

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

257  {
258  desc.addOptionalUntracked<unsigned int>("numberEventsInRun")
259  ->setComment("Number of events to generate in each run.");
260  desc.addOptionalUntracked<unsigned int>("numberEventsInLuminosityBlock")
261  ->setComment("Number of events to generate in each lumi.");
262  desc.addUntracked<unsigned long long>("firstTime", 1)->setComment("Time before first event (ns) (for timestamp).");
263  desc.addUntracked<unsigned long long>("timeBetweenEvents", kNanoSecPerSec / kAveEventPerSec)
264  ->setComment("Time between consecutive events (ns) (for timestamp).");
265  desc.addUntracked<unsigned int>("eventCreationDelay", 0)
266  ->setComment("Real time delay between generation of consecutive events (ms).");
267 
268  desc.addNode(edm::ParameterDescription<unsigned int>("firstEvent", 1U, false) xor
269  edm::ParameterDescription<unsigned long long>("firstEvent", 1ULL, false))
270  ->setComment(
271  "'firstEvent' is an XOR group because it can have type uint32 or uint64, default:1\n"
272  "Event number of first event to generate.");
273 
274  desc.addUntracked<unsigned int>("firstLuminosityBlock", 1)
275  ->setComment("Luminosity block number of first lumi to generate.");
276  desc.addUntracked<unsigned int>("firstRun", 1)->setComment("Run number of first run to generate.");
277  desc.addUntracked<std::vector<edm::LuminosityBlockID>>("firstLuminosityBlockForEachRun", {})
278  ->setComment(
279  "When the source makes a new LuminosityBlock, this list is checked to see what Run number should be used. "
280  "The LuminosityBlock numbers are required to be in ascending order.");
282  }
static unsigned long long kAveEventPerSec
static unsigned long long kNanoSecPerSec
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:115
InputSource::ItemType edm::ProducerSourceBase::getNextItemType ( )
finalprivatevirtual

Implements edm::InputSource.

Definition at line 134 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock().

134  {
135  if (state() == IsInvalid) {
136  return noFiles() ? IsStop : IsFile;
137  }
138  if (newRun()) {
139  return IsRun;
140  }
141  if (newLumi()) {
142  return IsLumi;
143  }
144  if (eventCached()) {
145  return IsEvent;
146  }
147  EventID oldEventID = eventID_;
149  if (eventCreationDelay_ > 0) {
150  usleep(eventCreationDelay_);
151  }
152  size_t index = fileIndex();
154  if (!another) {
155  return IsStop;
156  }
157  bool newFile = (fileIndex() > index);
158  setEventCached();
159  if (newRun() || eventID_.run() != oldEventID.run()) {
160  // New Run
161  setNewRun();
162  setNewLumi();
163  return newFile ? IsFile : IsRun;
164  }
165  if (processingMode() == Runs) {
166  return newFile ? IsFile : IsRun;
167  }
168  if (processingMode() == RunsAndLumis) {
169  return newFile ? IsFile : IsLumi;
170  }
171  // Same Run
172  if (newLumi() || eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
173  // New Lumi
174  setNewLumi();
175  return newFile ? IsFile : IsLumi;
176  }
177  return newFile ? IsFile : IsEvent;
178  }
RunNumber_t run() const
Definition: EventID.h:39
bool newLumi() const
Definition: InputSource.h:353
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
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:350
ItemType state() const
Definition: InputSource.h:328
void setEventCached()
Called by the framework to merge or ached() const {return eventCached_;}.
Definition: InputSource.h:358
EventAuxiliary::ExperimentType eType_
virtual bool noFiles() const
void advanceToNext(EventID &eventID, TimeValue_t &time)
bool eventCached() const
Definition: InputSource.h:356
void edm::ProducerSourceBase::initialize ( EventID id,
TimeValue_t time,
TimeValue_t interval 
)
privatevirtual

Reimplemented in cond::EmptyIOVSource.

Definition at line 123 of file ProducerSourceBase.cc.

Referenced by beginJob(), and luminosityBlock().

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

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 253 of file ProducerSourceBase.cc.

Referenced by getNextItemType(), and luminosityBlock().

253 { return false; }
unsigned int edm::ProducerSourceBase::numberEventsInLumi ( ) const
inline

Definition at line 28 of file ProducerSourceBase.h.

References numberEventsInLumi_.

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

Definition at line 27 of file ProducerSourceBase.h.

References numberEventsInRun_.

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

Definition at line 33 of file ProducerSourceBase.h.

References numberEventsInThisLumi_.

33 { return numberEventsInThisLumi_; }
unsigned int numberEventsInThisLumi_
unsigned int edm::ProducerSourceBase::numberEventsInThisRun ( ) const
inline

Definition at line 32 of file ProducerSourceBase.h.

References numberEventsInThisRun_.

32 { return numberEventsInThisRun_; }
unsigned int numberEventsInThisRun_
TimeValue_t edm::ProducerSourceBase::presentTime ( ) const
inline
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 86 of file ProducerSourceBase.cc.

References printConversionInfo::aux, edm::Event::commit_(), MillePedeFileConverter_cfg::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(), edm::InputSource::RunsLumisAndEvents, and edm::Event::setProducer().

Referenced by luminosityBlock().

86  {
89  eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry());
90  Event e(eventPrincipal, moduleDescription(), nullptr);
91  e.setProducer(this, nullptr);
92  produce(e);
93  e.commit_(std::vector<ProductResolverIndex>());
95  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:155
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:204
void resetEventCached()
Definition: InputSource.h:359
EventAuxiliary::ExperimentType eType_
virtual void produce(Event &e)=0
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:198
bool eventCached() const
Definition: InputSource.h:356
std::shared_ptr< LuminosityBlockAuxiliary > edm::ProducerSourceBase::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Reimplemented in LHESource.

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

Referenced by luminosityBlock().

77  {
78  if (processingMode() == Runs)
79  return std::shared_ptr<LuminosityBlockAuxiliary>();
81  resetNewLumi();
82  return std::make_shared<LuminosityBlockAuxiliary>(
84  }
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:233
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
std::shared_ptr< RunAuxiliary > edm::ProducerSourceBase::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Reimplemented in LHESource.

Definition at line 71 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock().

71  {
73  resetNewRun();
74  return std::make_shared<RunAuxiliary>(eventID_.run(), ts, Timestamp::invalidTimestamp());
75  }
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 210 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock(), and skip().

210  {
211  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
212  // same run
215  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
216  // new lumi
219 
220  if (not firstLumiForRuns_.empty()) {
222  if (run != eventID.run()) {
224 
225  eventID = EventID(run, eventID.luminosityBlock(), eventID.event());
226  }
227  }
228  } else {
230  }
231  } else {
232  // new run
233  assert(numberEventsInLumi_ != 0);
238  }
240  }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
unsigned int numberEventsInThisLumi_
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:63
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
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 ( ) const
inline

Definition at line 35 of file ProducerSourceBase.h.

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

Referenced by advanceToNext(), retreatToPrevious(), and PixelSLinkDataInputSource::setRunAndEventInfo().

35 { return eventID_.run(); }
RunNumber_t run() const
Definition: EventID.h:39
RunNumber_t edm::ProducerSourceBase::runForLumi ( LuminosityBlockNumber_t  iLumi) const
private

Definition at line 242 of file ProducerSourceBase.cc.

References firstLumiForRuns_.

Referenced by advanceToNext(), luminosityBlock(), ProducerSourceBase(), and retreatToPrevious().

242  {
243  auto it = std::find_if(firstLumiForRuns_.rbegin(), firstLumiForRuns_.rend(), [iLumi](auto const& iV) {
244  return iV.luminosityBlock() <= iLumi;
245  });
246  if (it == firstLumiForRuns_.rend()) {
247  //use first since we are off the end
248  return firstLumiForRuns_[0].run();
249  }
250  return it->run();
251  }
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
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 97 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock().

97  {
98  EventID oldEventID = eventID_;
99  for (; offset < 0; ++offset) {
101  }
102  for (; offset > 0; --offset) {
104  }
105  if (eventID_.run() != oldEventID.run()) {
106  // New Run
107  setNewRun();
108  setNewLumi();
109  }
110  if (eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
111  // New Lumi
112  setNewLumi();
113  }
114  }
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 30 of file ProducerSourceBase.h.

References timeBetweenEvents_.

Referenced by HcalTBSource::setRunAndEventInfo().

30 { 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
std::vector<edm::LuminosityBlockID> edm::ProducerSourceBase::firstLumiForRuns_
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
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.

Referenced by ProducerSourceBase().