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