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 () 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
 
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_
 
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 20 of file ProducerSourceBase.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file ProducerSourceBase.cc.

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

25  :
26  PuttableSourceBase(pset, desc),
27  numberEventsInRun_(pset.getUntrackedParameter<unsigned int>("numberEventsInRun", remainingEvents())),
28  numberEventsInLumi_(pset.getUntrackedParameter<unsigned int>("numberEventsInLuminosityBlock", remainingEvents())),
29  presentTime_(pset.getUntrackedParameter<unsigned long long>("firstTime", 1ULL)), //time in ns
31  timeBetweenEvents_(pset.getUntrackedParameter<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)),
32  eventCreationDelay_(pset.getUntrackedParameter<unsigned int>("eventCreationDelay", 0)),
35  zerothEvent_(pset.existsAs<unsigned int>("firstEvent", false) ? pset.getUntrackedParameter<unsigned int>("firstEvent", 1) - 1 :
36  pset.getUntrackedParameter<unsigned long long>("firstEvent", 1) - 1),
37  eventID_(pset.getUntrackedParameter<unsigned int>("firstRun", 1), pset.getUntrackedParameter<unsigned int>("firstLuminosityBlock", 1), zerothEvent_),
39  isRealData_(realData),
41 
43  // We need to map this string to the EventAuxiliary::ExperimentType enumeration
44  // std::string eType = pset.getUntrackedParameter<std::string>("experimentType", std::string("Any"))),
45  }
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:332
int remainingEvents() const
Definition: InputSource.h:194
PuttableSourceBase(ParameterSet const &, InputSourceDescription const &)
static unsigned long long const kAveEventPerSec
EventAuxiliary::ExperimentType eType_
unsigned int numberEventsInThisRun_
edm::ProducerSourceBase::~ProducerSourceBase ( )
overridenoexcept

Definition at line 47 of file ProducerSourceBase.cc.

47  {
48  }

Member Function Documentation

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

Definition at line 166 of file ProducerSourceBase.cc.

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

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

166  {
168  // same run
171  // new lumi
174  } else {
177  }
178  } else {
179  // new run
183  }
185  }
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 99 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock().

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

Definition at line 34 of file ProducerSourceBase.h.

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

34 {return eventID_.event();}
EventNumber_t event() const
Definition: EventID.h:41
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
size_t edm::ProducerSourceBase::fileIndex ( ) const
privatevirtual

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 217 of file ProducerSourceBase.cc.

Referenced by getNextItemType(), and luminosityBlock().

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

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

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

Implements edm::InputSource.

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

121  {
122  if(state() == IsInvalid) {
123  return noFiles() ? IsStop : IsFile;
124  }
125  if (newRun()) {
126  return IsRun;
127  }
128  if (newLumi()) {
129  return IsLumi;
130  }
131  if(eventCached()) {
132  return IsEvent;
133  }
134  EventID oldEventID = eventID_;
136  if (eventCreationDelay_ > 0) {usleep(eventCreationDelay_);}
137  size_t index = fileIndex();
139  if(!another) {
140  return IsStop;
141  }
142  bool newFile = (fileIndex() > index);
143  setEventCached();
144  if(newRun() || eventID_.run() != oldEventID.run()) {
145  // New Run
146  setNewRun();
147  setNewLumi();
148  return newFile ? IsFile : IsRun;
149  }
150  if (processingMode() == Runs) {
151  return newFile ? IsFile : IsRun;
152  }
153  if (processingMode() == RunsAndLumis) {
154  return newFile ? IsFile : IsLumi;
155  }
156  // Same Run
157  if (newLumi() || eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
158  // New Lumi
159  setNewLumi();
160  return newFile ? IsFile : IsLumi;
161  }
162  return newFile ? IsFile : IsEvent;
163  }
RunNumber_t run() const
Definition: EventID.h:39
bool newLumi() const
Definition: InputSource.h:361
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:240
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:358
ItemType state() const
Definition: InputSource.h:336
void setEventCached()
Called by the framework to merge or ached() const {return eventCached_;}.
Definition: InputSource.h:366
EventAuxiliary::ExperimentType eType_
virtual bool noFiles() const
void advanceToNext(EventID &eventID, TimeValue_t &time)
bool eventCached() const
Definition: InputSource.h:364
void edm::ProducerSourceBase::initialize ( EventID id,
TimeValue_t time,
TimeValue_t interval 
)
privatevirtual

Reimplemented in cond::EmptyIOVSource.

Definition at line 107 of file ProducerSourceBase.cc.

Referenced by beginJob(), and luminosityBlock().

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

Reimplemented in edm::ProducerSourceFromFiles.

Definition at line 212 of file ProducerSourceBase.cc.

Referenced by getNextItemType(), and luminosityBlock().

212  {
213  return false;
214  }
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
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 67 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().

67  {
70  eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry());
71  Event e(eventPrincipal, moduleDescription(), nullptr);
72  e.setProducer(this,nullptr);
73  produce(e);
74  e.commit_(std::vector<ProductResolverIndex>());
76  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:168
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:240
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:211
void resetEventCached()
Definition: InputSource.h:367
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:364
std::shared_ptr< LuminosityBlockAuxiliary > edm::ProducerSourceBase::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Reimplemented in LHESource.

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

59  {
60  if (processingMode() == Runs) return std::shared_ptr<LuminosityBlockAuxiliary>();
62  resetNewLumi();
63  return std::make_shared<LuminosityBlockAuxiliary>(eventID_.run(), eventID_.luminosityBlock(), ts, Timestamp::invalidTimestamp());
64  }
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:240
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 52 of file ProducerSourceBase.cc.

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

Referenced by luminosityBlock().

52  {
54  resetNewRun();
55  return std::make_shared<RunAuxiliary>(eventID_.run(), ts, Timestamp::invalidTimestamp());
56  }
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 188 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 luminosityBlock(), and skip().

188  {
189  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
190  // same run
193  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
194  // new lumi
197  } else {
199  }
200  } else {
201  // new run
202  assert(numberEventsInLumi_ != 0);
207  }
209  }
RunNumber_t run() const
Definition: EventID.h:39
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 ( ) 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 79 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().

79  {
80  EventID oldEventID = eventID_;
81  for(; offset < 0; ++offset) {
83  }
84  for(; offset > 0; --offset) {
86  }
87  if(eventID_.run() != oldEventID.run()) {
88  // New Run
89  setNewRun();
90  setNewLumi();
91  }
92  if (eventID_.luminosityBlock() != oldEventID.luminosityBlock()) {
93  // New Lumi
94  setNewLumi();
95  }
96  }
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 72 of file ProducerSourceBase.h.

Referenced by getNextItemType(), and readEvent_().

unsigned int edm::ProducerSourceBase::eventCreationDelay_
private

Definition at line 64 of file ProducerSourceBase.h.

Referenced by eventCreationDelay(), and getNextItemType().

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

Definition at line 71 of file ProducerSourceBase.h.

Referenced by readEvent_().

unsigned int edm::ProducerSourceBase::numberEventsInLumi_
private

Definition at line 60 of file ProducerSourceBase.h.

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

unsigned int edm::ProducerSourceBase::numberEventsInRun_
private

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

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

TimeValue_t edm::ProducerSourceBase::origTime_
private

Definition at line 62 of file ProducerSourceBase.h.

Referenced by rewind_().

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

Definition at line 63 of file ProducerSourceBase.h.

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

EventNumber_t const edm::ProducerSourceBase::zerothEvent_
private

Definition at line 68 of file ProducerSourceBase.h.