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 | Protected Member Functions | Private Member Functions | Private Attributes
edm::ConfigurableInputSource Class Referenceabstract

#include <ConfigurableInputSource.h>

Inheritance diagram for edm::ConfigurableInputSource:
edm::InputSource edm::ProductRegistryHelper cond::EmptyIOVSource edm::ExternalInputSource edm::GeneratedInputSource LmfSource AlpgenSource edm::H2RootNtplSource edm::MCFileSource ErrorStreamSource HcalTBSource L1MuGMTHWFileReader LHESource MCatNLOSource PixelSLinkDataInputSource EcalSimpleSource edm::BaseFlatGunSource edm::BeamHaloSource edm::CosMuoGenSource edm::EmptySource edm::FlatBaseThetaGunSource LaserAlignmentSource

Public Member Functions

 ConfigurableInputSource (ParameterSet const &pset, InputSourceDescription const &desc, bool realData=true)
 
EventNumber_t event () const
 
unsigned int eventCreationDelay () 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
 
RunNumber_t run () const
 
unsigned int timeBetweenEvents () const
 
virtual ~ConfigurableInputSource ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
void closeFile (boost::shared_ptr< FileBlock >, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 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...
 
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 markLumi ()
 Mark lumi as read. More...
 
int markRun ()
 Mark run as read. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
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...
 
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 readAndCacheLumi (bool merge, HistoryAppender &historyAppender)
 Read next luminosity block. More...
 
void readAndCacheRun (bool merge, HistoryAppender &historyAppender)
 Read next run. More...
 
EventPrincipalreadEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
EventPrincipalreadEvent (EventID const &)
 Read a specific event. More...
 
boost::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. 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...
 
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)
 
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 &)
 

Protected Member Functions

void reallyReadEvent ()
 
void setEventNumber (EventNumber_t e)
 
void setTime (TimeValue_t t)
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
EventPrincipaleventPrincipalCache ()
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
PrincipalCache const & principalCache () const
 
PrincipalCacheprincipalCache ()
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetLuminosityBlockAuxiliary () const
 
void resetRunAuxiliary () const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemType state () const
 

Private Member Functions

void advanceToNext ()
 
virtual void beginLuminosityBlock (LuminosityBlock &)
 
virtual void beginRun (Run &)
 
virtual void endLuminosityBlock (LuminosityBlock &)
 
virtual void endRun (Run &)
 
virtual size_t fileIndex () const
 
virtual ItemType getNextItemType ()
 
virtual void nextEvent ()
 
virtual void postForkReacquireResources (boost::shared_ptr< edm::multicore::MessageReceiverForSource >)
 
virtual bool produce (Event &e)=0
 
virtual EventPrincipalreadEvent_ ()
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
virtual boost::shared_ptr
< RunAuxiliary
readRunAuxiliary_ ()
 
void retreatToPrevious ()
 
virtual void rewind_ ()
 
virtual void setLumi (LuminosityBlockNumber_t lb)
 
virtual void setRun (RunNumber_t r)
 
virtual void setRunAndEventInfo ()
 
virtual void skip (int offset)
 

Private Attributes

EventAuxiliary::ExperimentType eType_
 
bool eventCached_
 
unsigned int eventCreationDelay_
 
EventID eventID_
 
bool eventSet_
 
bool isRealData_
 
bool lumiSet_
 
bool newLumi_
 
bool newRun_
 
unsigned int numberEventsInLumi_
 
unsigned int numberEventsInRun_
 
unsigned int numberEventsInThisLumi_
 
unsigned int numberEventsInThisRun_
 
unsigned int numberOfEventsBeforeBigSkip_
 
unsigned int numberOfSequentialEvents_
 
EventID origEventID_
 
TimeValue_t origTime_
 
TimeValue_t presentTime_
 
boost::shared_ptr
< edm::multicore::MessageReceiverForSource
receiver_
 
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
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Detailed Description

Definition at line 19 of file ConfigurableInputSource.h.

Constructor & Destructor Documentation

edm::ConfigurableInputSource::ConfigurableInputSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc,
bool  realData = true 
)
explicit

Definition at line 20 of file ConfigurableInputSource.cc.

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

21  :
22  InputSource(pset, desc),
23  numberEventsInRun_(pset.getUntrackedParameter<unsigned int>("numberEventsInRun", remainingEvents())),
24  numberEventsInLumi_(pset.getUntrackedParameter<unsigned int>("numberEventsInLuminosityBlock", remainingEvents())),
25  presentTime_(pset.getUntrackedParameter<unsigned long long>("firstTime", 1ULL)), //time in ns
27  timeBetweenEvents_(pset.getUntrackedParameter<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)),
28  eventCreationDelay_(pset.getUntrackedParameter<unsigned int>("eventCreationDelay", 0)),
31  zerothEvent_(pset.getUntrackedParameter<unsigned int>("firstEvent", 1) - 1),
32  eventID_(pset.getUntrackedParameter<unsigned int>("firstRun", 1), pset.getUntrackedParameter<unsigned int>("firstLuminosityBlock", 1), zerothEvent_),
34  newRun_(true),
35  newLumi_(true),
36  eventCached_(false),
37  lumiSet_(false),
38  eventSet_(false),
39  isRealData_(realData),
43  {
44 
46  // We need to map this string to the EventAuxiliary::ExperimentType enumeration
47  // std::string eType = pset.getUntrackedParameter<std::string>("experimentType", std::string("Any"))),
48  }
EventAuxiliary::ExperimentType eType_
static unsigned long long const kNanoSecPerSec
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:293
int remainingEvents() const
Definition: InputSource.h:170
static unsigned long long const kAveEventPerSec
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:54
edm::ConfigurableInputSource::~ConfigurableInputSource ( )
virtual

Definition at line 50 of file ConfigurableInputSource.cc.

50  {
51  }

Member Function Documentation

void edm::ConfigurableInputSource::advanceToNext ( )
private

Definition at line 233 of file ConfigurableInputSource.cc.

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

Referenced by setRunAndEventInfo(), and skip().

233  {
235  // same run
238  // new lumi
241  } else {
244  }
245  } else {
246  // new run
250  }
252  }
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:47
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:56
void edm::ConfigurableInputSource::beginLuminosityBlock ( LuminosityBlock )
privatevirtual

Reimplemented from edm::InputSource.

Reimplemented in ErrorStreamSource.

Definition at line 123 of file ConfigurableInputSource.cc.

123  {
124  }
void edm::ConfigurableInputSource::beginRun ( Run )
privatevirtual

Reimplemented from edm::InputSource.

Reimplemented in ErrorStreamSource, MCatNLOSource, AlpgenSource, and LHESource.

Definition at line 115 of file ConfigurableInputSource.cc.

115  {
116  }
void edm::ConfigurableInputSource::endLuminosityBlock ( LuminosityBlock )
privatevirtual

Reimplemented from edm::InputSource.

Reimplemented in ErrorStreamSource.

Definition at line 127 of file ConfigurableInputSource.cc.

127  {
128  }
void edm::ConfigurableInputSource::endRun ( Run )
privatevirtual

Reimplemented from edm::InputSource.

Reimplemented in ErrorStreamSource, LHESource, and edm::CosMuoGenSource.

Definition at line 119 of file ConfigurableInputSource.cc.

119  {
120  }
EventNumber_t edm::ConfigurableInputSource::event ( ) const
inline
unsigned int edm::ConfigurableInputSource::eventCreationDelay ( ) const
inline

Definition at line 28 of file ConfigurableInputSource.h.

References eventCreationDelay_.

virtual size_t edm::ConfigurableInputSource::fileIndex ( ) const
inlineprivatevirtual

Reimplemented in edm::ExternalInputSource.

Definition at line 62 of file ConfigurableInputSource.h.

Referenced by getNextItemType().

62 {return 0UL;}
void edm::ConfigurableInputSource::fillDescription ( ParameterSetDescription desc)
static

Definition at line 299 of file ConfigurableInputSource.cc.

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

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

299  {
300  desc.addOptionalUntracked<unsigned int>("numberEventsInRun")->setComment("Number of events to generate in each run.");
301  desc.addOptionalUntracked<unsigned int>("numberEventsInLuminosityBlock")->setComment("Number of events to generate in each lumi.");
302  desc.addUntracked<unsigned long long>("firstTime", 1)->setComment("Time before first event (ns) (for timestamp).");
303  desc.addUntracked<unsigned long long>("timeBetweenEvents", kNanoSecPerSec/kAveEventPerSec)->setComment("Time between consecutive events (ns) (for timestamp).");
304  desc.addUntracked<unsigned int>("eventCreationDelay", 0)->setComment("Real time delay between generation of consecutive events (ms).");
305  desc.addUntracked<unsigned int>("firstEvent", 1)->setComment("Event number of first event to generate.");
306  desc.addUntracked<unsigned int>("firstLuminosityBlock", 1)->setComment("Luminosity block number of first lumi to generate.");
307  desc.addUntracked<unsigned int>("firstRun", 1)->setComment("Run number of first run to generate.");
309  }
static unsigned long long const kNanoSecPerSec
static unsigned long long const kAveEventPerSec
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:129
InputSource::ItemType edm::ConfigurableInputSource::getNextItemType ( )
privatevirtual

Implements edm::InputSource.

Definition at line 178 of file ConfigurableInputSource.cc.

References eventCached_, eventID_, eventSet_, fileIndex(), getHLTprescales::index, edm::InputSource::IsEvent, edm::InputSource::IsFile, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, edm::EventID::luminosityBlock(), lumiSet_, newLumi_, newRun_, nextEvent(), origEventID_, edm::InputSource::processingMode(), reallyReadEvent(), edm::EventID::run(), edm::InputSource::Runs, edm::EventID::setLuminosityBlockNumber(), and setRunAndEventInfo().

178  {
179  if (newRun_) {
180  if (eventID_.run() == RunNumber_t()) {
181  eventCached_ = false;
182  return IsStop;
183  }
184  return IsRun;
185  }
186  if (newLumi_) {
187  return IsLumi;
188  }
189  if(eventCached_) {
190  return IsEvent;
191  }
192  EventID oldEventID = eventID_;
194  size_t index = fileIndex();
195  if (!eventSet_) {
196  lumiSet_ = false;
198  eventSet_ = true;
199  nextEvent();
200  }
201  if (eventID_.run() == RunNumber_t()) {
202  eventCached_ = false;
203  return IsStop;
204  }
205  bool newFile = (fileIndex() > index);
206  if (oldEventID.run() != eventID_.run()) {
207  // New Run
208  // If the user did not explicitly set the luminosity block number,
209  // reset it back to the beginning.
210  if (!lumiSet_) {
212  }
213  newRun_ = newLumi_ = true;
214  return newFile ? IsFile : IsRun;
215  }
216  // Same Run
217  if (oldLumi != eventID_.luminosityBlock()) {
218  // New Lumi
219  newLumi_ = true;
220  if (processingMode() != Runs) {
221  return newFile ? IsFile : IsLumi;
222  }
223  }
224  reallyReadEvent();
225  if(!eventCached_) {
226  return IsStop;
227  }
228  eventSet_ = false;
229  return IsEvent;
230  }
RunNumber_t run() const
Definition: EventID.h:42
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
void setLuminosityBlockNumber(LuminosityBlockNumber_t const &lb)
Definition: EventID.h:115
virtual size_t fileIndex() const
unsigned int RunNumber_t
Definition: EventRange.h:32
LuminosityBlockNumber_t edm::ConfigurableInputSource::luminosityBlock ( ) const
inline

Definition at line 33 of file ConfigurableInputSource.h.

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

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), and setEventNumber().

33 {return eventID_.luminosityBlock();}
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
virtual void edm::ConfigurableInputSource::nextEvent ( )
inlineprivatevirtual

Reimplemented in MCatNLOSource, and LHESource.

Definition at line 63 of file ConfigurableInputSource.h.

Referenced by getNextItemType().

63 {}
unsigned int edm::ConfigurableInputSource::numberEventsInLumi ( ) const
inline

Definition at line 25 of file ConfigurableInputSource.h.

References numberEventsInLumi_.

unsigned int edm::ConfigurableInputSource::numberEventsInRun ( ) const
inline
unsigned int edm::ConfigurableInputSource::numberEventsInThisLumi ( ) const
inline

Definition at line 30 of file ConfigurableInputSource.h.

References numberEventsInThisLumi_.

unsigned int edm::ConfigurableInputSource::numberEventsInThisRun ( ) const
inline

Definition at line 29 of file ConfigurableInputSource.h.

References numberEventsInThisRun_.

void edm::ConfigurableInputSource::postForkReacquireResources ( boost::shared_ptr< edm::multicore::MessageReceiverForSource iReceiver)
privatevirtual

Definition at line 146 of file ConfigurableInputSource.cc.

References numberOfEventsBeforeBigSkip_, numberOfSequentialEvents_, receiver_, edm::InputSource::repeat(), and edm::InputSource::rewind().

146  {
147  receiver_ = iReceiver;
148  receiver_->receive();
149  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices() + 1;
150  numberOfSequentialEvents_ = receiver_->numberOfConsecutiveIndices();
151  repeat();
152  rewind();
153  }
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
void repeat()
Reset the remaining number of events/lumis to the maximum number.
Definition: InputSource.h:158
void rewind()
Begin again at the first event.
Definition: InputSource.cc:407
TimeValue_t edm::ConfigurableInputSource::presentTime ( ) const
inline

Definition at line 26 of file ConfigurableInputSource.h.

References presentTime_.

Referenced by HcalTBSource::setRunAndEventInfo().

virtual bool edm::ConfigurableInputSource::produce ( Event e)
privatepure virtual
EventPrincipal * edm::ConfigurableInputSource::readEvent_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 69 of file ConfigurableInputSource.cc.

References eventCached_, edm::InputSource::eventPrincipalCache(), edm::InputSource::processingMode(), and edm::InputSource::RunsLumisAndEvents.

69  {
71  eventCached_ = false;
72  return eventPrincipalCache();
73  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139
boost::shared_ptr< LuminosityBlockAuxiliary > edm::ConfigurableInputSource::readLuminosityBlockAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 61 of file ConfigurableInputSource.cc.

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

61  {
62  if (processingMode() == Runs) return boost::shared_ptr<LuminosityBlockAuxiliary>();
64  newLumi_ = false;
65  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(eventID_.run(), eventID_.luminosityBlock(), ts, Timestamp::invalidTimestamp()));
66  }
RunNumber_t run() const
Definition: EventID.h:42
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
boost::shared_ptr< RunAuxiliary > edm::ConfigurableInputSource::readRunAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 54 of file ConfigurableInputSource.cc.

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

54  {
56  newRun_ = false;
57  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(eventID_.run(), ts, Timestamp::invalidTimestamp()));
58  }
RunNumber_t run() const
Definition: EventID.h:42
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
void edm::ConfigurableInputSource::reallyReadEvent ( )
protected

Definition at line 76 of file ConfigurableInputSource.cc.

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

Referenced by getNextItemType().

76  {
77  if (processingMode() != RunsLumisAndEvents) return;
78  EventSourceSentry sentry(*this);
82  if (!produce(e)) {
83  eventCached_ = false;
84  return;
85  }
86  e.commit_();
87  eventCached_ = true;
88  }
EventAuxiliary::ExperimentType eType_
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
virtual bool produce(Event &e)=0
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:281
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:190
void fillEventPrincipal(EventAuxiliary const &aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), DelayedReader *reader=0)
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139
void edm::ConfigurableInputSource::retreatToPrevious ( )
private

Definition at line 255 of file ConfigurableInputSource.cc.

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

Referenced by skip().

255  {
256  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
257  // same run
260  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
261  // new lumi
264  } else {
266  }
267  } else {
268  // new run
273  }
275  }
RunNumber_t run() const
Definition: EventID.h:42
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:66
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:59
void edm::ConfigurableInputSource::rewind_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 156 of file ConfigurableInputSource.cc.

References edm::InputSource::decreaseRemainingEventsBy(), eventID_, newLumi_, newRun_, numberEventsInThisLumi_, numberEventsInThisRun_, numberOfEventsBeforeBigSkip_, origEventID_, origTime_, presentTime_, receiver_, and skip().

156  {
161 
162  if(receiver_) {
163  unsigned int numberToSkip = receiver_->numberToSkip();
164  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices() + 1;
165  //NOTE: skip() will decrease numberOfEventsBeforeBigSkip_ and therefore we need
166  // to be sure it is large enough so that it never goes to 0 during the skipping
167  if(numberOfEventsBeforeBigSkip_ < numberToSkip) {
168  numberOfEventsBeforeBigSkip_ = numberToSkip+1;
169  }
170  skip(numberToSkip);
171  decreaseRemainingEventsBy(numberToSkip);
172  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices() + 1;
173  }
174  newRun_ = newLumi_ = true;
175  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:482
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
RunNumber_t edm::ConfigurableInputSource::run ( void  ) const
inline

Definition at line 31 of file ConfigurableInputSource.h.

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

Referenced by Types.LuminosityBlockID::cppID(), and setEventNumber().

31 {return eventID_.run();}
RunNumber_t run() const
Definition: EventID.h:42
void edm::ConfigurableInputSource::setEventNumber ( EventNumber_t  e)
inlineprotected
void edm::ConfigurableInputSource::setLumi ( LuminosityBlockNumber_t  lb)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 131 of file ConfigurableInputSource.cc.

References eventID_, edm::EventID::luminosityBlock(), lumiSet_, newLumi_, numberEventsInThisLumi_, origEventID_, and edm::EventID::setLuminosityBlockNumber().

131  {
132  // Protect against invalid lumi.
133  if (lb == LuminosityBlockNumber_t()) {
135  }
136  // Do nothing if the lumi block is not changed.
137  if (lb != eventID_.luminosityBlock()) {
140  newLumi_ = true;
141  }
142  lumiSet_ = true;
143  }
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
void setLuminosityBlockNumber(LuminosityBlockNumber_t const &lb)
Definition: EventID.h:115
void edm::ConfigurableInputSource::setRun ( RunNumber_t  r)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 102 of file ConfigurableInputSource.cc.

References eventID_, edm::EventID::luminosityBlock(), newLumi_, newRun_, numberEventsInThisLumi_, numberEventsInThisRun_, origEventID_, edm::EventID::run(), and zerothEvent_.

102  {
103  // No need to check for invalid (zero) run number,
104  // as this is a legitimate way of stopping the job.
105  // Do nothing if the run is not changed.
106  if (r != eventID_.run()) {
110  newRun_ = newLumi_ = true;
111  }
112  }
RunNumber_t run() const
Definition: EventID.h:42
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
void edm::ConfigurableInputSource::setRunAndEventInfo ( )
privatevirtual

Reimplemented in L1MuGMTHWFileReader, ErrorStreamSource, LmfSource, HcalTBSource, and cond::EmptyIOVSource.

Definition at line 278 of file ConfigurableInputSource.cc.

References advanceToNext(), edm::InputSource::decreaseRemainingEventsBy(), eventCreationDelay_, eventID_, numberOfEventsBeforeBigSkip_, or, receiver_, edm::InputSource::remainingEvents(), edm::InputSource::remainingLuminosityBlocks(), and skip().

Referenced by getNextItemType().

278  {
280  receiver_->receive();
281  unsigned long numberOfEventsToSkip = receiver_->numberToSkip();
282  if (numberOfEventsToSkip !=0) {
283  skip(numberOfEventsToSkip);
284  decreaseRemainingEventsBy(numberOfEventsToSkip);
285  }
286  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
287  //Since we decrease 'remaining events' count we need to see if we reached 0 and therefore are at the end
289  //this means we are to stop
290  eventID_ = EventID();
291  return;
292  }
293  }
294  advanceToNext();
295  if (eventCreationDelay_ > 0) {usleep(eventCreationDelay_);}
296  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:482
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
int remainingEvents() const
Definition: InputSource.h:170
int remainingLuminosityBlocks() const
Definition: InputSource.h:178
void edm::ConfigurableInputSource::setTime ( TimeValue_t  t)
inlineprotected
void edm::ConfigurableInputSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 91 of file ConfigurableInputSource.cc.

References advanceToNext(), evf::evtn::offset(), and retreatToPrevious().

Referenced by rewind_(), and setRunAndEventInfo().

91  {
92  for (; offset < 0; ++offset) {
94  }
95  for (; offset > 0; --offset) {
96  advanceToNext();
97  }
98  }
unsigned int offset(bool)
unsigned int edm::ConfigurableInputSource::timeBetweenEvents ( ) const
inline

Definition at line 27 of file ConfigurableInputSource.h.

References timeBetweenEvents_.

Referenced by HcalTBSource::setRunAndEventInfo().

Member Data Documentation

EventAuxiliary::ExperimentType edm::ConfigurableInputSource::eType_
private

Definition at line 87 of file ConfigurableInputSource.h.

Referenced by reallyReadEvent().

bool edm::ConfigurableInputSource::eventCached_
private

Definition at line 83 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), readEvent_(), and reallyReadEvent().

unsigned int edm::ConfigurableInputSource::eventCreationDelay_
private

Definition at line 74 of file ConfigurableInputSource.h.

Referenced by eventCreationDelay(), and setRunAndEventInfo().

EventID edm::ConfigurableInputSource::eventID_
private
bool edm::ConfigurableInputSource::eventSet_
private

Definition at line 85 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), and setEventNumber().

bool edm::ConfigurableInputSource::isRealData_
private

Definition at line 86 of file ConfigurableInputSource.h.

Referenced by reallyReadEvent().

bool edm::ConfigurableInputSource::lumiSet_
private

Definition at line 84 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), and setLumi().

bool edm::ConfigurableInputSource::newLumi_
private
bool edm::ConfigurableInputSource::newRun_
private

Definition at line 81 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), readRunAuxiliary_(), rewind_(), and setRun().

unsigned int edm::ConfigurableInputSource::numberEventsInLumi_
private

Definition at line 70 of file ConfigurableInputSource.h.

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

unsigned int edm::ConfigurableInputSource::numberEventsInRun_
private

Definition at line 69 of file ConfigurableInputSource.h.

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

unsigned int edm::ConfigurableInputSource::numberEventsInThisLumi_
private
unsigned int edm::ConfigurableInputSource::numberEventsInThisRun_
private
unsigned int edm::ConfigurableInputSource::numberOfEventsBeforeBigSkip_
private
unsigned int edm::ConfigurableInputSource::numberOfSequentialEvents_
private

Definition at line 92 of file ConfigurableInputSource.h.

Referenced by postForkReacquireResources().

EventID edm::ConfigurableInputSource::origEventID_
private
TimeValue_t edm::ConfigurableInputSource::origTime_
private

Definition at line 72 of file ConfigurableInputSource.h.

Referenced by rewind_().

TimeValue_t edm::ConfigurableInputSource::presentTime_
private
boost::shared_ptr<edm::multicore::MessageReceiverForSource> edm::ConfigurableInputSource::receiver_
private
TimeValue_t edm::ConfigurableInputSource::timeBetweenEvents_
private

Definition at line 73 of file ConfigurableInputSource.h.

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

unsigned int const edm::ConfigurableInputSource::zerothEvent_
private

Definition at line 78 of file ConfigurableInputSource.h.

Referenced by setRun().