test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InputSource.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 ----------------------------------------------------------------------*/
4 
25 
26 #include <cassert>
27 #include <fstream>
28 #include <iomanip>
29 
30 namespace edm {
31 
32  namespace {
33  std::string const& suffix(int count) {
34  static std::string const st("st");
35  static std::string const nd("nd");
36  static std::string const rd("rd");
37  static std::string const th("th");
38  // *0, *4 - *9 use "th".
39  int lastDigit = count % 10;
40  if(lastDigit >= 4 || lastDigit == 0) return th;
41  // *11, *12, or *13 use "th".
42  if(count % 100 - lastDigit == 10) return th;
43  return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
44  }
45  }
46 
49  actReg_(desc.actReg_),
50  maxEvents_(desc.maxEvents_),
51  remainingEvents_(maxEvents_),
52  maxLumis_(desc.maxLumis_),
53  remainingLumis_(maxLumis_),
54  readCount_(0),
55  maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_),
56  processingMode_(RunsLumisAndEvents),
57  moduleDescription_(desc.moduleDescription_),
58  productRegistry_(desc.productRegistry_),
59  processHistoryRegistry_(new ProcessHistoryRegistry),
60  branchIDListHelper_(desc.branchIDListHelper_),
61  thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
62  processGUID_(createGlobalIdentifier()),
63  time_(),
64  newRun_(true),
65  newLumi_(true),
66  eventCached_(false),
67  state_(IsInvalid),
68  runAuxiliary_(),
69  lumiAuxiliary_(),
70  statusFileName_(),
71  receiver_(),
72  numberOfEventsBeforeBigSkip_(0) {
73 
74  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
75  std::ostringstream statusfilename;
76  statusfilename << "source_" << getpid();
77  statusFileName_ = statusfilename.str();
78  }
79  if (maxSecondsUntilRampdown_ > 0) {
81  }
82 
83  std::string const defaultMode("RunsLumisAndEvents");
84  std::string const runMode("Runs");
85  std::string const runLumiMode("RunsAndLumis");
86 
87  // The default value provided as the second argument to the getUntrackedParameter function call
88  // is not used when the ParameterSet has been validated and the parameters are not optional
89  // in the description. As soon as all primary input sources and all modules with a secondary
90  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
91  // calls can and should be deleted from the code.
92  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
93  if(processingMode == runMode) {
95  } else if(processingMode == runLumiMode) {
97  } else if(processingMode != defaultMode) {
99  << "InputSource::InputSource()\n"
100  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
101  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
102  }
103  }
104 
106 
107  void
110  desc.setUnknown();
111  descriptions.addDefault(desc);
112  }
113 
114  void
116  }
117 
118 
119  static std::string const kBaseType("Source");
120 
121  std::string const&
123  return kBaseType;
124  }
125 
126  void
128  std::string defaultString("RunsLumisAndEvents");
129  desc.addUntracked<std::string>("processingMode", defaultString)->setComment(
130  "'RunsLumisAndEvents': process runs, lumis, and events.\n"
131  "'RunsAndLumis': process runs and lumis (not events).\n"
132  "'Runs': process runs (not lumis or events).");
133  desc.addUntracked<bool>("writeStatusFile", false)->setComment("Write a status file. Intended for use by workflow management.");
134  }
135 
136  bool
138  if(eventLimitReached()) {
139  return false;
140  }
142  receiver_->receive();
143  unsigned long toSkip = receiver_->numberToSkip();
144  if(0 != toSkip) {
145  skipEvents(toSkip);
147  }
148  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
150  return false;
151  }
152  }
153  return true;
154  }
155 
156  // This next function is to guarantee that "runs only" mode does not return events or lumis,
157  // and that "runs and lumis only" mode does not return events.
158  // For input sources that are not random access (e.g. you need to read through the events
159  // to get to the lumis and runs), this is all that is involved to implement these modes.
160  // For input sources where events or lumis can be skipped, getNextItemType() should
161  // implement the skipping internally, so that the performance gain is realized.
162  // If this is done for a source, the 'if' blocks in this function will never be entered
163  // for that source.
166  ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
167 
168  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
169  skipEvents(1);
170  return nextItemType_();
171  }
172  if(itemType == IsLumi && processingMode() == Runs) {
173  // QQQ skipLuminosityBlock_();
174  return nextItemType_();
175  }
176  return itemType;
177  }
178 
181  ItemType oldState = state_;
182  if(eventLimitReached()) {
183  // If the maximum event limit has been reached, stop.
184  state_ = IsStop;
185  } else if(lumiLimitReached()) {
186  // If the maximum lumi limit has been reached, stop
187  // when reaching a new file, run, or lumi.
188  if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
189  state_ = IsStop;
190  } else {
191  ItemType newState = nextItemType_();
192  if(newState == IsEvent) {
194  state_ = IsEvent;
195  } else {
196  state_ = IsStop;
197  }
198  }
199  } else {
200  ItemType newState = nextItemType_();
201  if(newState == IsStop) {
202  state_ = IsStop;
203  } else if(newState == IsSynchronize) {
205  } else if(newState == IsFile || oldState == IsInvalid) {
206  state_ = IsFile;
207  } else if(newState == IsRun || oldState == IsFile) {
209  state_ = IsRun;
210  } else if(newState == IsLumi || oldState == IsRun) {
211  assert (processingMode() != Runs);
213  state_ = IsLumi;
214  } else {
216  state_ = IsEvent;
217  }
218  }
219  if(state_ == IsStop) {
220  lumiAuxiliary_.reset();
221  runAuxiliary_.reset();
222  }
223  return state_;
224  }
225 
226  std::shared_ptr<LuminosityBlockAuxiliary>
228  return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
229  "Calling InputSource::readLuminosityBlockAuxiliary_" );
230  }
231 
232  std::shared_ptr<RunAuxiliary>
234  return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
235  "Calling InputSource::readRunAuxiliary_" );
236  }
237 
238  void
240  this->beginJob();
241  }
242 
243  void
245  endJob();
246  }
247 
251  }
252 
255  return nullptr;
256  }
257 
258  void
260  if(!typeLabelList().empty()) {
262  }
263  }
264 
265  // Return a dummy file block.
266  std::unique_ptr<FileBlock>
268  assert(state_ == IsFile);
269  assert(!limitReached());
270  return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [this](){ return readFile_(); },
271  "Calling InputSource::readFile_" );
272  }
273 
274  void
275  InputSource::closeFile(FileBlock* fb, bool cleaningUpAfterException) {
276  if(fb != nullptr) fb->close();
277  callWithTryCatchAndPrint<void>( [this](){ closeFile_(); },
278  "Calling InputSource::closeFile_",
279  cleaningUpAfterException );
280  return;
281  }
282 
283  // Return a dummy file block.
284  // This function must be overridden for any input source that reads a file
285  // containing Products.
286  std::unique_ptr<FileBlock>
288  return std::unique_ptr<FileBlock>(new FileBlock);
289  }
290 
291  void
293  RunSourceSentry sentry(*this);
294  callWithTryCatchAndPrint<void>( [this,&runPrincipal](){ readRun_(runPrincipal); }, "Calling InputSource::readRun_" );
295  }
296 
297  void
299  RunSourceSentry sentry(*this);
300  callWithTryCatchAndPrint<void>( [this,&rp](){ readRun_(rp); }, "Calling InputSource::readRun_" );
301  }
302 
303  void
305  LumiSourceSentry sentry(*this);
306  callWithTryCatchAndPrint<void>( [this,&lumiPrincipal](){ readLuminosityBlock_(lumiPrincipal); }, "Calling InputSource::readLuminosityBlock_" );
307  if(remainingLumis_ > 0) {
308  --remainingLumis_;
309  }
310  }
311 
312  void
314  LumiSourceSentry sentry(*this);
315  callWithTryCatchAndPrint<void>( [this,&lbp](){ readLuminosityBlock_(lbp); }, "Calling InputSource::readLuminosityBlock_" );
316  if(remainingLumis_ > 0) {
317  --remainingLumis_;
318  }
319  }
320 
321  void
323  // Note: For the moment, we do not support saving and restoring the state of the
324  // random number generator if random numbers are generated during processing of runs
325  // (e.g. beginRun(), endRun())
327  }
328 
329  void
332  }
333 
334  void
336  assert(state_ == IsEvent);
338  {
339  // block scope, in order to issue the PostSourceEvent signal before calling postRead and issueReports
340  EventSourceSentry sentry(*this, streamContext);
341 
342  callWithTryCatchAndPrint<void>( [this,&ep](){ readEvent_(ep); }, "Calling InputSource::readEvent_" );
343  if(receiver_) {
345  }
346  }
347 
349  ++readCount_;
350  setTimestamp(ep.time());
351  issueReports(ep.id());
352  }
353 
354  bool
355  InputSource::readEvent(EventPrincipal& ep, EventID const& eventID, StreamContext& streamContext) {
356  bool result = false;
357 
358  if (not limitReached()) {
359  // the Pre/PostSourceEvent signals should be generated only if the event is actually found.
360  // this should be taken care of by an EventSourceSentry in the implementaion of readIt()
361 
362  //result = callWithTryCatchAndPrint<bool>( [this,&eventID,&ep](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
363  result = readIt(eventID, ep, streamContext);
364 
365  if (result) {
367  ++readCount_;
368  issueReports(ep.id());
369  }
370  }
371  return result;
372  }
373 
374  void
376  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
377  }
378 
379  bool
380  InputSource::goToEvent(EventID const& eventID) {
381  return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
382  }
383 
384  void
386  state_ = IsInvalid;
388  setNewRun();
389  setNewLumi();
391  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
392  if(receiver_) {
393  unsigned int numberToSkip = receiver_->numberToSkip();
394  skip(numberToSkip);
395  decreaseRemainingEventsBy(numberToSkip);
396  }
397  }
398 
399  void
401  if(isInfoEnabled()) {
402  LogVerbatim("FwkReport") << "Begin processing the " << readCount_
403  << suffix(readCount_) << " record. Run " << eventID.run()
404  << ", Event " << eventID.event()
405  << ", LumiSection " << eventID.luminosityBlock()
406  << " at " << std::setprecision(3) << TimeOfDay();
407  }
408  if(!statusFileName_.empty()) {
409  std::ofstream statusFile(statusFileName_.c_str());
410  statusFile << eventID << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
411  statusFile.close();
412  }
413 
414  // At some point we may want to initiate checkpointing here
415  }
416 
417  bool
420  << "InputSource::readIt()\n"
421  << "Random access is not implemented for this type of Input Source\n"
422  << "Contact a Framework Developer\n";
423  }
424 
425  void
428  << "InputSource::setRun()\n"
429  << "Run number cannot be modified for this type of Input Source\n"
430  << "Contact a Framework Developer\n";
431  }
432 
433  void
436  << "InputSource::setLumi()\n"
437  << "Luminosity Block ID cannot be modified for this type of Input Source\n"
438  << "Contact a Framework Developer\n";
439  }
440 
441  void
444  << "InputSource::skip()\n"
445  << "Forking and random access are not implemented for this type of Input Source\n"
446  << "Contact a Framework Developer\n";
447  }
448 
449  bool
452  << "InputSource::goToEvent_()\n"
453  << "Random access is not implemented for this type of Input Source\n"
454  << "Contact a Framework Developer\n";
455  return true;
456  }
457 
458  void
461  << "InputSource::rewind()\n"
462  << "Forking and random access are not implemented for this type of Input Source\n"
463  << "Contact a Framework Developer\n";
464  }
465 
466  void
468  if(-1 == remainingEvents_) {
469  return;
470  }
471  if(iSkipped < remainingEvents_) {
472  remainingEvents_ -= iSkipped;
473  } else {
474  remainingEvents_ = 0;
475  }
476  }
477 
478  void
480  Run run(rp, moduleDescription(), nullptr);
481  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
482  run.commit_();
483  }
484 
485  void
486  InputSource::doEndRun(RunPrincipal& rp, bool cleaningUpAfterException, ProcessContext const* ) {
487  rp.setEndTime(time_);
488  rp.setComplete();
489  Run run(rp, moduleDescription(), nullptr);
490  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
491  run.commit_();
492  }
493 
494  void
496  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
497  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
498  lb.commit_();
499  }
500 
501  void
502  InputSource::doEndLumi(LuminosityBlockPrincipal& lbp, bool cleaningUpAfterException, ProcessContext const* ) {
503  lbp.setEndTime(time_);
504  lbp.setComplete();
505  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
506  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
507  lb.commit_();
508  }
509 
510  void
512  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
513  }
514 
515  void
516  InputSource::doPostForkReacquireResources(std::shared_ptr<multicore::MessageReceiverForSource> iReceiver) {
517  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
518  "Calling InputSource::postForkReacquireResources" );
519  }
520 
521  bool
523  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
524  "Calling InputSource::randomAccess_" );
525  }
526 
529  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
530  "Calling InputSource::forwardState_" );
531  }
532 
535  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
536  "Calling InputSource::reverseState__" );
537  }
538 
539  void
541 
542  void
544 
545  void
547 
548  void
550 
551  void
553 
554  void
556 
557  void
559 
560  void
561  InputSource::postForkReacquireResources(std::shared_ptr<multicore::MessageReceiverForSource> iReceiver) {
562  receiver_ = iReceiver;
563  receiver_->receive();
564  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
565  rewind();
566  }
567 
568  bool
570  return false;
571  }
572 
576  }
577 
581  }
582 
583  ProcessHistoryID const&
585  assert(runAuxiliary());
586  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
587  }
588 
591  assert(runAuxiliary());
592  return runAuxiliary()->run();
593  }
594 
598  return luminosityBlockAuxiliary()->luminosityBlock();
599  }
600 
601  InputSource::SourceSentry::SourceSentry(Sig& pre, Sig& post) : post_(post) {
602  pre();
603  }
604 
606  post_();
607  }
608 
610  source_(source),
611  sc_(sc)
612  {
613  source.actReg()->preSourceSignal_(sc_.streamID());
614  }
615 
617  source_.actReg()->postSourceSignal_(sc_.streamID());
618  }
619 
621  sentry_(source.actReg()->preSourceLumiSignal_, source.actReg()->postSourceLumiSignal_) {
622  }
623 
625  sentry_(source.actReg()->preSourceRunSignal_, source.actReg()->postSourceRunSignal_) {
626  }
627 
629  std::string const& lfn,
630  bool usedFallback) :
631  post_(source.actReg()->postOpenFileSignal_),
632  lfn_(lfn),
633  usedFallback_(usedFallback) {
634  source.actReg()->preOpenFileSignal_(lfn, usedFallback);
635  }
636 
638  post_(lfn_, usedFallback_);
639  }
640 
642  std::string const& lfn,
643  bool usedFallback) :
644  post_(source.actReg()->postCloseFileSignal_),
645  lfn_(lfn),
646  usedFallback_(usedFallback) {
647  source.actReg()->preCloseFileSignal_(lfn, usedFallback);
648  }
649 
651  post_(lfn_, usedFallback_);
652  }
653 }
RunNumber_t run() const
Definition: EventID.h:39
virtual ~InputSource()
Destructor.
Definition: InputSource.cc:105
EventNumber_t event() const
Definition: EventID.h:41
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:174
T getUntrackedParameter(std::string const &, T const &) const
virtual void setRun(RunNumber_t r)
Definition: InputSource.cc:426
virtual void endRun(Run &)
Definition: InputSource.cc:549
virtual void preForkReleaseResources()
Definition: InputSource.cc:558
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:400
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:450
void doBeginJob()
Called by framework at beginning of job.
Definition: InputSource.cc:239
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()=0
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:451
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:350
virtual void closeFile_()
Definition: InputSource.h:409
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:467
Timestamp time_
Definition: InputSource.h:445
static std::string const source("source")
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void doBeginRun(RunPrincipal &rp, ProcessContext const *)
Called by framework at beginning of run.
Definition: InputSource.cc:479
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
void doEndJob()
Called by framework at end of job.
Definition: InputSource.cc:244
RunSourceSentry(InputSource const &source)
Definition: InputSource.cc:624
void readAndMergeRun(RunPrincipal &rp)
Read next run (same as a prior run)
Definition: InputSource.cc:298
std::string statusFileName_
Definition: InputSource.h:452
void doPostForkReacquireResources(std::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:516
void registerProducts()
Register any produced products.
Definition: InputSource.cc:259
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:434
assert(m_qm.get())
EventID const & id() const
virtual void rewind_()
Definition: InputSource.cc:459
std::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:233
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:256
virtual void postForkReacquireResources(std::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:561
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:348
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:590
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:21
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
unsigned int LuminosityBlockNumber_t
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:540
virtual void readEvent_(EventPrincipal &eventPrincipal)=0
void closeFile(FileBlock *, bool cleaningUpAfterException)
close current file
Definition: InputSource.cc:275
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: InputSource.cc:584
bool limitReached() const
Definition: InputSource.h:399
tuple result
Definition: mps_fire.py:83
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:81
Timestamp const & time() const
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:450
void close()
Definition: FileBlock.h:114
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:437
FileCloseSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
Definition: InputSource.cc:641
ProcessingController::ForwardState forwardState() const
Definition: InputSource.cc:528
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:456
EventSourceSentry(InputSource const &source, StreamContext &sc)
Definition: InputSource.cc:609
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:574
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:455
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
int remainingEvents() const
Definition: InputSource.h:200
ProcessingController::ReverseState reverseState() const
Definition: InputSource.cc:534
void addDefault(ParameterSetDescription const &psetDescription)
bool lumiLimitReached() const
Definition: InputSource.h:391
void readRun(RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
Read next run (new run)
Definition: InputSource.cc:292
virtual void beginJob()
Definition: InputSource.cc:552
ProcessingMode processingMode_
Definition: InputSource.h:438
int maxSecondsUntilRampdown_
Definition: InputSource.h:436
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:227
void setEndTime(Timestamp const &time)
void doBeginLumi(LuminosityBlockPrincipal &lbp, ProcessContext const *)
Called by framework at beginning of lumi block.
Definition: InputSource.cc:495
virtual ItemType getNextItemType()=0
static const std::string & baseType()
Definition: InputSource.cc:122
void commit_()
Definition: Run.cc:79
void doEndLumi(LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *)
Called by framework at end of lumi block.
Definition: InputSource.cc:502
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
Definition: InputSource.cc:418
bool goToEvent(EventID const &eventID)
Definition: InputSource.cc:380
void doPreForkReleaseResources()
Called by the framework before forking the process.
Definition: InputSource.cc:511
SharedResourcesAcquirer * resourceSharedWithDelayedReader()
Returns nullptr if no resource shared between the Source and a DelayedReader.
Definition: InputSource.cc:249
SourceSentry(Sig &pre, Sig &post)
Definition: InputSource.cc:601
#define end
Definition: vmac.h:37
void resetEventCached()
Definition: InputSource.h:383
StreamID const & streamID() const
Definition: StreamContext.h:57
virtual SharedResourcesAcquirer * resourceSharedWithDelayedReader_()
Definition: InputSource.cc:254
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:596
bool eventLimitReached() const
Definition: InputSource.h:390
void readAndMergeLumi(LuminosityBlockPrincipal &lbp)
Read next luminosity block (same as a prior lumi)
Definition: InputSource.cc:313
void skipEvents(int offset)
Definition: InputSource.cc:375
virtual void beginRun(Run &)
Definition: InputSource.cc:546
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:322
virtual std::unique_ptr< FileBlock > readFile_()
Definition: InputSource.cc:287
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: InputSource.cc:108
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:262
void readEvent(EventPrincipal &ep, StreamContext &)
Read next event.
Definition: InputSource.cc:335
std::unique_ptr< FileBlock > readFile()
Read next file.
Definition: InputSource.cc:267
virtual bool randomAccess_() const
Definition: InputSource.cc:569
static const std::string kBaseType("EDAnalyzer")
bool isInfoEnabled()
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0
ItemType nextItemType_()
Definition: InputSource.cc:165
#define begin
Definition: vmac.h:30
std::shared_ptr< ActivityRegistry > actReg() const
Accessor for Activity Registry.
Definition: InputSource.h:259
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:441
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:579
bool randomAccess() const
Definition: InputSource.cc:522
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:127
void rewind()
Begin again at the first event.
Definition: InputSource.cc:385
int remainingLuminosityBlocks() const
Definition: InputSource.h:208
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:211
unsigned int RunNumber_t
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:330
volatile std::atomic< bool > shutdown_flag false
void readLuminosityBlock(LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
Read next luminosity block (new lumi)
Definition: InputSource.cc:304
FileOpenSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
Definition: InputSource.cc:628
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
void doEndRun(RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *)
Called by framework at end of run.
Definition: InputSource.cc:486
LumiSourceSentry(InputSource const &source)
Definition: InputSource.cc:620
std::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:265
ItemType nextItemType()
Advances the source to the next item.
Definition: InputSource.cc:180
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:47
virtual void endJob()
Definition: InputSource.cc:555
static void prevalidate(ConfigurationDescriptions &)
Definition: InputSource.cc:115
virtual void skip(int offset)
Definition: InputSource.cc:442
std::string createGlobalIdentifier()
Definition: Run.h:43
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:543