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