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 >)
 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)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp)
 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 const 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...
 
ProcessHistoryID const & processHistoryID () const
 Accessor for the input process history ID of the current run. 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 ()
 Read next luminosity block. More...
 
void readAndCacheRun ()
 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...
 
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...
 
void wakeUp ()
 Wake up 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)
 

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)
 
EventPrincipal *const eventPrincipalCache ()
 
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 setLumiPrematurelyRead ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setRunPrematurelyRead ()
 
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 ItemType getNextItemType ()
 
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_
 
unsigned int 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 int>("firstTime", 1)), //time in ns
27  timeBetweenEvents_(pset.getUntrackedParameter<unsigned int>("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 int const kAveEventPerSec
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:297
int remainingEvents() const
Definition: InputSource.h:176
static unsigned int const kNanoSecPerSec
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:74
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 230 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().

230  {
232  // same run
235  // new lumi
238  } else {
241  }
242  } else {
243  // new run
247  }
249  }
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_.

void edm::ConfigurableInputSource::fillDescription ( ParameterSetDescription desc)
static

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

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

Implements edm::InputSource.

Definition at line 178 of file ConfigurableInputSource.cc.

References eventCached_, eventID_, eventSet_, edm::InputSource::IsEvent, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, edm::EventID::luminosityBlock(), lumiSet_, newLumi_, newRun_, 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  if (!eventSet_) {
195  lumiSet_ = false;
197  eventSet_ = true;
198  }
199  if (eventID_.run() == RunNumber_t()) {
200  eventCached_ = false;
201  return IsStop;
202  }
203  if (oldEventID.run() != eventID_.run()) {
204  // New Run
205  // If the user did not explicitly set the luminosity block number,
206  // reset it back to the beginning.
207  if (!lumiSet_) {
209  }
210  newRun_ = newLumi_ = true;
211  return IsRun;
212  }
213  // Same Run
214  if (oldLumi != eventID_.luminosityBlock()) {
215  // New Lumi
216  newLumi_ = true;
217  if (processingMode() != Runs) {
218  return IsLumi;
219  }
220  }
221  reallyReadEvent();
222  if(!eventCached_) {
223  return IsStop;
224  }
225  eventSet_ = false;
226  return IsEvent;
227  }
RunNumber_t run() const
Definition: EventID.h:42
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
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
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
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 rewind()
Begin again at the first event.
Definition: InputSource.h:138
void repeat()
Reset the remaining number of events/lumis to the maximum number.
Definition: InputSource.h:164
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  }
EventPrincipal *const eventPrincipalCache()
Definition: InputSource.cc:156
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
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:233
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_(), 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);
79  std::auto_ptr<EventAuxiliary> aux(new EventAuxiliary(eventID_, processGUID(), Timestamp(presentTime_), isRealData_, eType_));
82  if (!produce(e)) {
83  eventCached_ = false;
84  return;
85  }
86  e.commit_();
87  eventCached_ = true;
88  }
EventAuxiliary::ExperimentType eType_
EventPrincipal *const eventPrincipalCache()
Definition: InputSource.cc:156
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
virtual bool produce(Event &e)=0
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:280
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:196
void fillEventPrincipal(std::auto_ptr< EventAuxiliary > aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(new EventSelectionIDVector), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(new BranchListIndexes), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
void edm::ConfigurableInputSource::retreatToPrevious ( )
private

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

252  {
253  if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
254  // same run
257  if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
258  // new lumi
261  } else {
263  }
264  } else {
265  // new run
270  }
272  }
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:472
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 275 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().

275  {
277  receiver_->receive();
278  unsigned long numberOfEventsToSkip = receiver_->numberToSkip();
279  if (numberOfEventsToSkip !=0) {
280  skip(numberOfEventsToSkip);
281  decreaseRemainingEventsBy(numberOfEventsToSkip);
282  }
283  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
284  //Since we decrease 'remaining events' count we need to see if we reached 0 and therefore are at the end
286  //this means we are to stop
287  eventID_ = EventID();
288  return;
289  }
290  }
291  advanceToNext();
292  if (eventCreationDelay_ > 0) {usleep(eventCreationDelay_);}
293  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:472
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:176
int remainingLuminosityBlocks() const
Definition: InputSource.h:184
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 85 of file ConfigurableInputSource.h.

Referenced by reallyReadEvent().

bool edm::ConfigurableInputSource::eventCached_
private

Definition at line 81 of file ConfigurableInputSource.h.

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

unsigned int edm::ConfigurableInputSource::eventCreationDelay_
private

Definition at line 72 of file ConfigurableInputSource.h.

Referenced by eventCreationDelay(), and setRunAndEventInfo().

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

Definition at line 83 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), and setEventNumber().

bool edm::ConfigurableInputSource::isRealData_
private

Definition at line 84 of file ConfigurableInputSource.h.

Referenced by reallyReadEvent().

bool edm::ConfigurableInputSource::lumiSet_
private

Definition at line 82 of file ConfigurableInputSource.h.

Referenced by getNextItemType(), and setLumi().

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

Definition at line 79 of file ConfigurableInputSource.h.

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

unsigned int edm::ConfigurableInputSource::numberEventsInLumi_
private

Definition at line 68 of file ConfigurableInputSource.h.

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

unsigned int edm::ConfigurableInputSource::numberEventsInRun_
private

Definition at line 67 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 90 of file ConfigurableInputSource.h.

Referenced by postForkReacquireResources().

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

Definition at line 70 of file ConfigurableInputSource.h.

Referenced by rewind_().

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

Definition at line 71 of file ConfigurableInputSource.h.

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

unsigned int const edm::ConfigurableInputSource::zerothEvent_
private

Definition at line 76 of file ConfigurableInputSource.h.

Referenced by setRun().