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) {
193  assert (processingMode() == RunsLumisAndEvents);
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 {
215  assert (processingMode() == RunsLumisAndEvents);
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 
248  std::pair<SharedResourcesAcquirer*,std::recursive_mutex*>
251  }
252 
253  std::pair<SharedResourcesAcquirer*,std::recursive_mutex*>
255  return std::pair<SharedResourcesAcquirer*,std::recursive_mutex*>(nullptr,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::make_unique<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);
337  assert(!eventLimitReached());
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_(std::vector<edm::ProductResolverIndex>());
483  }
484 
485  void
486  InputSource::doEndRun(RunPrincipal& rp, bool cleaningUpAfterException, ProcessContext const* ) {
487  Run run(rp, moduleDescription(), nullptr);
488  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
489  run.commit_(std::vector<edm::ProductResolverIndex>());
490  }
491 
492  void
494  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
495  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
496  lb.commit_(std::vector<edm::ProductResolverIndex>());
497  }
498 
499  void
500  InputSource::doEndLumi(LuminosityBlockPrincipal& lbp, bool cleaningUpAfterException, ProcessContext const* ) {
501  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
502  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
503  lb.commit_(std::vector<edm::ProductResolverIndex>());
504  }
505 
506  void
508  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
509  }
510 
511  void
512  InputSource::doPostForkReacquireResources(std::shared_ptr<multicore::MessageReceiverForSource> iReceiver) {
513  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
514  "Calling InputSource::postForkReacquireResources" );
515  }
516 
517  bool
519  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
520  "Calling InputSource::randomAccess_" );
521  }
522 
525  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
526  "Calling InputSource::forwardState_" );
527  }
528 
531  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
532  "Calling InputSource::reverseState__" );
533  }
534 
535  void
537 
538  void
540 
541  void
543 
544  void
546 
547  void
549 
550  void
552 
553  void
555 
556  void
557  InputSource::postForkReacquireResources(std::shared_ptr<multicore::MessageReceiverForSource> iReceiver) {
558  receiver_ = iReceiver;
559  receiver_->receive();
560  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
561  rewind();
562  }
563 
564  bool
566  return false;
567  }
568 
572  }
573 
577  }
578 
579  ProcessHistoryID const&
581  assert(runAuxiliary());
582  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
583  }
584 
587  assert(runAuxiliary());
588  return runAuxiliary()->run();
589  }
590 
593  assert(luminosityBlockAuxiliary());
594  return luminosityBlockAuxiliary()->luminosityBlock();
595  }
596 
597  InputSource::SourceSentry::SourceSentry(Sig& pre, Sig& post) : post_(post) {
598  pre();
599  }
600 
602  post_();
603  }
604 
606  source_(source),
607  sc_(sc)
608  {
609  source.actReg()->preSourceSignal_(sc_.streamID());
610  }
611 
613  source_.actReg()->postSourceSignal_(sc_.streamID());
614  }
615 
617  sentry_(source.actReg()->preSourceLumiSignal_, source.actReg()->postSourceLumiSignal_) {
618  }
619 
621  sentry_(source.actReg()->preSourceRunSignal_, source.actReg()->postSourceRunSignal_) {
622  }
623 
625  std::string const& lfn,
626  bool usedFallback) :
627  post_(source.actReg()->postOpenFileSignal_),
628  lfn_(lfn),
629  usedFallback_(usedFallback) {
630  source.actReg()->preOpenFileSignal_(lfn, usedFallback);
631  }
632 
635  }
636 
638  std::string const& lfn,
639  bool usedFallback) :
640  post_(source.actReg()->postCloseFileSignal_),
641  lfn_(lfn),
642  usedFallback_(usedFallback) {
643  source.actReg()->preCloseFileSignal_(lfn, usedFallback);
644  }
645 
648  }
649 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:176
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:545
virtual void preForkReleaseResources()
Definition: InputSource.cc:554
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:400
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:456
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:457
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:356
virtual void closeFile_()
Definition: InputSource.h:415
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:467
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
void doEndJob()
Called by framework at end of job.
Definition: InputSource.cc:244
RunSourceSentry(InputSource const &source)
Definition: InputSource.cc:620
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader()
Returns nullptr if no resource shared between the Source and a DelayedReader.
Definition: InputSource.cc:249
void readAndMergeRun(RunPrincipal &rp)
Read next run (same as a prior run)
Definition: InputSource.cc:298
std::string statusFileName_
Definition: InputSource.h:458
void doPostForkReacquireResources(std::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:512
void registerProducts()
Register any produced products.
Definition: InputSource.cc:259
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:434
EventID const & id() const
virtual void rewind_()
Definition: InputSource.cc:459
#define noexcept
std::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:233
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:258
virtual void postForkReacquireResources(std::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:557
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:354
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:586
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:20
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
unsigned int LuminosityBlockNumber_t
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:536
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:580
bool limitReached() const
Definition: InputSource.h:405
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:443
FileCloseSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
Definition: InputSource.cc:637
ProcessingController::ForwardState forwardState() const
Definition: InputSource.cc:524
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:462
EventSourceSentry(InputSource const &source, StreamContext &sc)
Definition: InputSource.cc:605
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:570
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_()
Definition: InputSource.cc:254
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
int remainingEvents() const
Definition: InputSource.h:202
ProcessingController::ReverseState reverseState() const
Definition: InputSource.cc:530
void addDefault(ParameterSetDescription const &psetDescription)
bool lumiLimitReached() const
Definition: InputSource.h:397
void readRun(RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
Read next run (new run)
Definition: InputSource.cc:292
virtual void beginJob()
Definition: InputSource.cc:548
ProcessingMode processingMode_
Definition: InputSource.h:444
int maxSecondsUntilRampdown_
Definition: InputSource.h:442
void commit_(std::vector< edm::ProductResolverIndex > const &iShouldPut)
Definition: Run.cc:79
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:227
void doBeginLumi(LuminosityBlockPrincipal &lbp, ProcessContext const *)
Called by framework at beginning of lumi block.
Definition: InputSource.cc:493
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
virtual ItemType getNextItemType()=0
static const std::string & baseType()
Definition: InputSource.cc:122
void doEndLumi(LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *)
Called by framework at end of lumi block.
Definition: InputSource.cc:500
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:507
SourceSentry(Sig &pre, Sig &post)
Definition: InputSource.cc:597
#define end
Definition: vmac.h:37
runMode
define run mode.
void resetEventCached()
Definition: InputSource.h:389
StreamID const & streamID() const
Definition: StreamContext.h:57
virtual ~InputSource() noexcept(false)
Destructor.
Definition: InputSource.cc:105
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:592
bool eventLimitReached() const
Definition: InputSource.h:396
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:542
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:264
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:565
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
HLT enums.
std::shared_ptr< ActivityRegistry > actReg() const
Accessor for Activity Registry.
Definition: InputSource.h:261
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:447
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:575
bool randomAccess() const
Definition: InputSource.cc:518
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:210
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
unsigned int RunNumber_t
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:330
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:624
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:616
std::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:267
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:551
static void prevalidate(ConfigurationDescriptions &)
Definition: InputSource.cc:115
void commit_(std::vector< edm::ProductResolverIndex > const &iShouldPut)
virtual void skip(int offset)
Definition: InputSource.cc:442
std::string createGlobalIdentifier()
Definition: Run.h:42
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:539