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