CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/FWCore/Framework/src/InputSource.cc

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------
00002 ----------------------------------------------------------------------*/
00003 #include "FWCore/Framework/interface/InputSource.h"
00004 
00005 #include "DataFormats/Provenance/interface/ProcessHistory.h"
00006 #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
00007 #include "DataFormats/Provenance/interface/FullHistoryToReducedHistoryMap.h"
00008 #include "FWCore/Framework/interface/Event.h"
00009 #include "FWCore/Framework/interface/EventPrincipal.h"
00010 #include "FWCore/Framework/interface/ExceptionHelpers.h"
00011 #include "FWCore/Framework/interface/FileBlock.h"
00012 #include "FWCore/Framework/interface/InputSourceDescription.h"
00013 #include "FWCore/Framework/interface/LuminosityBlock.h"
00014 #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h"
00015 #include "FWCore/Framework/interface/Run.h"
00016 #include "FWCore/Framework/interface/RunPrincipal.h"
00017 #include "FWCore/Framework/src/PrincipalCache.h"
00018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00021 #include "FWCore/ServiceRegistry/interface/Service.h"
00022 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00024 #include "FWCore/Utilities/interface/do_nothing_deleter.h"
00025 #include "FWCore/Utilities/interface/GlobalIdentifier.h"
00026 #include "FWCore/Utilities/interface/RandomNumberGenerator.h"
00027 #include "FWCore/Utilities/interface/TimeOfDay.h"
00028 
00029 #include <cassert>
00030 #include <fstream>
00031 #include <iomanip>
00032 
00033 namespace edm {
00034 
00035   namespace {
00036         std::string const& suffix(int count) {
00037           static std::string const st("st");
00038           static std::string const nd("nd");
00039           static std::string const rd("rd");
00040           static std::string const th("th");
00041           // *0, *4 - *9 use "th".
00042           int lastDigit = count % 10;
00043           if(lastDigit >= 4 || lastDigit == 0) return th;
00044           // *11, *12, or *13 use "th".
00045           if(count % 100 - lastDigit == 10) return th;
00046           return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
00047         }
00048         template <typename T>
00049         boost::shared_ptr<T> createSharedPtrToStatic(T* ptr) {
00050           return boost::shared_ptr<T>(ptr, do_nothing_deleter());
00051         }
00052   }
00053 
00054   InputSource::InputSource(ParameterSet const& pset, InputSourceDescription const& desc) :
00055       ProductRegistryHelper(),
00056       actReg_(desc.actReg_),
00057       principalCache_(desc.principalCache_),
00058       maxEvents_(desc.maxEvents_),
00059       remainingEvents_(maxEvents_),
00060       maxLumis_(desc.maxLumis_),
00061       remainingLumis_(maxLumis_),
00062       readCount_(0),
00063       processingMode_(RunsLumisAndEvents),
00064       moduleDescription_(desc.moduleDescription_),
00065       productRegistry_(createSharedPtrToStatic<ProductRegistry const>(desc.productRegistry_)),
00066       primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
00067       processGUID_(primary_ ? createGlobalIdentifier() : std::string()),
00068       time_(),
00069       doneReadAhead_(false),
00070       state_(IsInvalid),
00071       runAuxiliary_(),
00072       lumiAuxiliary_(),
00073       statusFileName_() {
00074 
00075     if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
00076       std::ostringstream statusfilename;
00077       statusfilename << "source_" << getpid();
00078       statusFileName_ = statusfilename.str();
00079     }
00080 
00081     // Secondary input sources currently do not have a product registry.
00082     if(primary_) {
00083       assert(desc.productRegistry_ != 0);
00084     }
00085     std::string const defaultMode("RunsLumisAndEvents");
00086     std::string const runMode("Runs");
00087     std::string const runLumiMode("RunsAndLumis");
00088 
00089     // The default value provided as the second argument to the getUntrackedParameter function call
00090     // is not used when the ParameterSet has been validated and the parameters are not optional
00091     // in the description.  As soon as all primary input sources and all modules with a secondary
00092     // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
00093     // calls can and should be deleted from the code.
00094     std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
00095     if(processingMode == runMode) {
00096       processingMode_ = Runs;
00097     } else if(processingMode == runLumiMode) {
00098       processingMode_ = RunsAndLumis;
00099     } else if(processingMode != defaultMode) {
00100       throw Exception(errors::Configuration)
00101         << "InputSource::InputSource()\n"
00102         << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
00103         << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
00104     }
00105   }
00106 
00107   InputSource::~InputSource() {}
00108 
00109   void
00110   InputSource::fillDescriptions(ConfigurationDescriptions& descriptions) {
00111     ParameterSetDescription desc;
00112     desc.setUnknown();
00113     descriptions.addDefault(desc);
00114   }
00115 
00116   void
00117   InputSource::prevalidate(ConfigurationDescriptions& ) {
00118   }
00119   
00120 
00121   static std::string const kBaseType("Source");
00122 
00123   std::string const&
00124   InputSource::baseType() {
00125     return kBaseType;
00126   }
00127 
00128   void
00129   InputSource::fillDescription(ParameterSetDescription& desc) {
00130     std::string defaultString("RunsLumisAndEvents");
00131     desc.addUntracked<std::string>("processingMode", defaultString)->setComment(
00132     "'RunsLumisAndEvents': process runs, lumis, and events.\n"
00133     "'RunsAndLumis':       process runs and lumis (not events).\n"
00134     "'Runs':               process runs (not lumis or events).");
00135     desc.addUntracked<bool>("writeStatusFile", false)->setComment("Write a status file. Intended for use by workflow management.");
00136   }
00137 
00138   EventPrincipal*
00139   InputSource::eventPrincipalCache() {
00140     return &principalCache().eventPrincipal();
00141   }
00142 
00143   // This next function is to guarantee that "runs only" mode does not return events or lumis,
00144   // and that "runs and lumis only" mode does not return events.
00145   // For input sources that are not random access (e.g. you need to read through the events
00146   // to get to the lumis and runs), this is all that is involved to implement these modes.
00147   // For input sources where events or lumis can be skipped, getNextItemType() should
00148   // implement the skipping internally, so that the performance gain is realized.
00149   // If this is done for a source, the 'if' blocks in this function will never be entered
00150   // for that source.
00151   InputSource::ItemType
00152   InputSource::nextItemType_() {
00153 
00154     ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
00155 
00156     if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
00157       callWithTryCatchAndPrint<EventPrincipal*>( [this](){ return readEvent_(); },
00158                                                  "Calling InputSource::readEvent_" );
00159       return nextItemType_();
00160     }
00161     if(itemType == IsLumi && processingMode() == Runs) {
00162       // QQQ skipLuminosityBlock_();
00163       return nextItemType_();
00164     }
00165     return itemType;
00166   }
00167 
00168   InputSource::ItemType
00169   InputSource::nextItemType() {
00170     if(doneReadAhead_) {
00171       return state_;
00172     }
00173     doneReadAhead_ = true;
00174     ItemType oldState = state_;
00175     if(eventLimitReached()) {
00176       // If the maximum event limit has been reached, stop.
00177       state_ = IsStop;
00178     } else if(lumiLimitReached()) {
00179       // If the maximum lumi limit has been reached, stop
00180       // when reaching a new file, run, or lumi.
00181       if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
00182         state_ = IsStop;
00183       } else {
00184         ItemType newState = nextItemType_();
00185         if(newState == IsEvent) {
00186           assert (processingMode() == RunsLumisAndEvents);
00187           state_ = IsEvent;
00188         } else {
00189           state_ = IsStop;
00190         }
00191       }
00192     } else {
00193       ItemType newState = nextItemType_();
00194       if(newState == IsStop) {
00195         state_ = IsStop;
00196       } else if(newState == IsFile || oldState == IsInvalid) {
00197         state_ = IsFile;
00198       } else if(newState == IsRun || oldState == IsFile) {
00199         runAuxiliary_ = readRunAuxiliary();
00200         state_ = IsRun;
00201       } else if(newState == IsLumi || oldState == IsRun) {
00202         assert (processingMode() != Runs);
00203         lumiAuxiliary_ = readLuminosityBlockAuxiliary();
00204         state_ = IsLumi;
00205       } else {
00206         assert (processingMode() == RunsLumisAndEvents);
00207         state_ = IsEvent;
00208       }
00209     }
00210     if(state_ == IsStop) {
00211       lumiAuxiliary_.reset();
00212       runAuxiliary_.reset();
00213     }
00214     return state_;
00215   }
00216 
00217   boost::shared_ptr<LuminosityBlockAuxiliary>
00218   InputSource::readLuminosityBlockAuxiliary() {
00219     return callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
00220                                                                                    "Calling InputSource::readLuminosityBlockAuxiliary_" );
00221   }
00222 
00223   boost::shared_ptr<RunAuxiliary>
00224   InputSource::readRunAuxiliary() {
00225     return callWithTryCatchAndPrint<boost::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
00226                                                                        "Calling InputSource::readRunAuxiliary_" );
00227   }
00228 
00229   void
00230   InputSource::doBeginJob() {
00231     this->beginJob();
00232   }
00233 
00234   void
00235   InputSource::doEndJob() {
00236     endJob();
00237   }
00238 
00239   void
00240   InputSource::registerProducts() {
00241     if(!typeLabelList().empty()) {
00242       addToRegistry(typeLabelList().begin(), typeLabelList().end(), moduleDescription(), productRegistryUpdate());
00243     }
00244   }
00245 
00246   // Return a dummy file block.
00247   boost::shared_ptr<FileBlock>
00248   InputSource::readFile() {
00249     assert(doneReadAhead_);
00250     assert(state_ == IsFile);
00251     assert(!limitReached());
00252     doneReadAhead_ = false;
00253     boost::shared_ptr<FileBlock> fb = callWithTryCatchAndPrint<boost::shared_ptr<FileBlock> >( [this](){ return readFile_(); },
00254                                                                                                "Calling InputSource::readFile_" );
00255     return fb;
00256   }
00257 
00258   void
00259   InputSource::closeFile(boost::shared_ptr<FileBlock> fb, bool cleaningUpAfterException) {
00260     fb->close();
00261     callWithTryCatchAndPrint<void>( [this](){ closeFile_(); },
00262                                     "Calling InputSource::closeFile_",
00263                                     cleaningUpAfterException );
00264     return;
00265   }
00266 
00267   // Return a dummy file block.
00268   // This function must be overridden for any input source that reads a file
00269   // containing Products.
00270   boost::shared_ptr<FileBlock>
00271   InputSource::readFile_() {
00272     return boost::shared_ptr<FileBlock>(new FileBlock);
00273   }
00274 
00275   boost::shared_ptr<RunPrincipal> const
00276   InputSource::runPrincipal() const {
00277     return principalCache_->runPrincipalPtr();
00278   }
00279 
00280   boost::shared_ptr<LuminosityBlockPrincipal> const
00281   InputSource::luminosityBlockPrincipal() const {
00282     return principalCache_->lumiPrincipalPtr();
00283   }
00284 
00285   void
00286   InputSource::readAndCacheRun(bool merge, HistoryAppender& historyAppender) {
00287     RunSourceSentry(*this);
00288     if (merge) {
00289       principalCache_->merge(runAuxiliary(), productRegistry_);
00290     } else {
00291       boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(runAuxiliary(), productRegistry_, processConfiguration(), &historyAppender));
00292       principalCache_->insert(rp);
00293     }
00294     callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [this](){ return readRun_(principalCache_->runPrincipalPtr()); },
00295                                                                 "Calling InputSource::readRun_" );
00296   }
00297 
00298   int
00299   InputSource::markRun() {
00300     assert(doneReadAhead_);
00301     assert(state_ == IsRun);
00302     assert(!limitReached());
00303     doneReadAhead_ = false;
00304     return principalCache_->runPrincipal().run();
00305   }
00306 
00307   void
00308   InputSource::readAndCacheLumi(bool merge, HistoryAppender& historyAppender) {
00309     LumiSourceSentry(*this);
00310     if (merge) {
00311       principalCache_->merge(luminosityBlockAuxiliary(), productRegistry_);
00312     } else {
00313       boost::shared_ptr<LuminosityBlockPrincipal> lb(
00314         new LuminosityBlockPrincipal(luminosityBlockAuxiliary(),
00315                                      productRegistry_,
00316                                      processConfiguration(),
00317                                      principalCache_->runPrincipalPtr(),
00318                                      &historyAppender));
00319       principalCache_->insert(lb);
00320     }
00321     callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [this](){ return readLuminosityBlock_(principalCache_->lumiPrincipalPtr()); },
00322                                                                             "Calling InputSource::readLuminosityBlock_" );
00323   }
00324 
00325   int
00326   InputSource::markLumi() {
00327     assert(doneReadAhead_);
00328     assert(state_ == IsLumi);
00329     assert(!limitReached());
00330     doneReadAhead_ = false;
00331     --remainingLumis_;
00332     assert(principalCache_->lumiPrincipal().luminosityBlock() == luminosityBlockAuxiliary()->luminosityBlock());
00333     return principalCache_->lumiPrincipal().luminosityBlock();
00334   }
00335 
00336   boost::shared_ptr<RunPrincipal>
00337   InputSource::readRun_(boost::shared_ptr<RunPrincipal> rpCache) {
00338     // Note: For the moment, we do not support saving and restoring the state of the
00339     // random number generator if random numbers are generated during processing of runs
00340     // (e.g. beginRun(), endRun())
00341     rpCache->fillRunPrincipal();
00342     return rpCache;
00343   }
00344 
00345   boost::shared_ptr<LuminosityBlockPrincipal>
00346   InputSource::readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lbCache) {
00347     lbCache->fillLuminosityBlockPrincipal();
00348     return lbCache;
00349   }
00350 
00351   EventPrincipal*
00352   InputSource::readEvent(boost::shared_ptr<LuminosityBlockPrincipal> lbCache) {
00353     assert(doneReadAhead_);
00354     assert(state_ == IsEvent);
00355     assert(!eventLimitReached());
00356     doneReadAhead_ = false;
00357 
00358     EventPrincipal* result = callWithTryCatchAndPrint<EventPrincipal*>( [this](){ return readEvent_(); },
00359                                                                         "Calling InputSource::readEvent_" );
00360 
00361     if(result != 0) {
00362       assert(result->luminosityBlockPrincipalPtrValid());
00363       assert(lbCache->run() == result->run());
00364       assert(lbCache->luminosityBlock() == result->luminosityBlock());
00365       Event event(*result, moduleDescription());
00366       postRead(event);
00367       if(remainingEvents_ > 0) --remainingEvents_;
00368       ++readCount_;
00369       setTimestamp(result->time());
00370       issueReports(result->id());
00371     }
00372     return result;
00373   }
00374 
00375   EventPrincipal*
00376   InputSource::readEvent(EventID const& eventID) {
00377     EventPrincipal* result = 0;
00378 
00379     if(!limitReached()) {
00380       result = callWithTryCatchAndPrint<EventPrincipal*>( [this,&eventID](){ return readIt(eventID); },
00381                                                           "Calling InputSource::readIt" );
00382 
00383       if(result != 0) {
00384         Event event(*result, moduleDescription());
00385         postRead(event);
00386         if(remainingEvents_ > 0) --remainingEvents_;
00387         ++readCount_;
00388         issueReports(result->id());
00389       }
00390     }
00391     return result;
00392   }
00393 
00394   void
00395   InputSource::skipEvents(int offset) {
00396     doneReadAhead_ = false;
00397     callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
00398   }
00399 
00400   bool
00401   InputSource::goToEvent(EventID const& eventID) {
00402     doneReadAhead_ = false;
00403     return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
00404   }
00405 
00406   void
00407   InputSource::rewind() {
00408     doneReadAhead_ = false;
00409     state_ = IsInvalid;
00410     remainingEvents_ = maxEvents_;
00411     callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
00412   }
00413 
00414   void
00415   InputSource::issueReports(EventID const& eventID) {
00416     if(isInfoEnabled()) {
00417       LogVerbatim("FwkReport") << "Begin processing the " << readCount_
00418                                << suffix(readCount_) << " record. Run " << eventID.run()
00419                                << ", Event " << eventID.event()
00420                                << ", LumiSection " << eventID.luminosityBlock()
00421                                << " at " << std::setprecision(3) << TimeOfDay();
00422     }
00423     if(!statusFileName_.empty()) {
00424       std::ofstream statusFile(statusFileName_.c_str());
00425       statusFile << eventID << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
00426       statusFile.close();
00427     }
00428 
00429     // At some point we may want to initiate checkpointing here
00430   }
00431 
00432   EventPrincipal*
00433   InputSource::readIt(EventID const&) {
00434     throw Exception(errors::LogicError)
00435       << "InputSource::readIt()\n"
00436       << "Random access is not implemented for this type of Input Source\n"
00437       << "Contact a Framework Developer\n";
00438   }
00439 
00440   void
00441   InputSource::setRun(RunNumber_t) {
00442     throw Exception(errors::LogicError)
00443       << "InputSource::setRun()\n"
00444       << "Run number cannot be modified for this type of Input Source\n"
00445       << "Contact a Framework Developer\n";
00446   }
00447 
00448   void
00449   InputSource::setLumi(LuminosityBlockNumber_t) {
00450     throw Exception(errors::LogicError)
00451       << "InputSource::setLumi()\n"
00452       << "Luminosity Block ID cannot be modified for this type of Input Source\n"
00453       << "Contact a Framework Developer\n";
00454   }
00455 
00456   void
00457   InputSource::skip(int) {
00458     throw Exception(errors::LogicError)
00459       << "InputSource::skip()\n"
00460       << "Random access is not implemented for this type of Input Source\n"
00461       << "Contact a Framework Developer\n";
00462   }
00463 
00464   bool
00465   InputSource::goToEvent_(EventID const&) {
00466     throw Exception(errors::LogicError)
00467       << "InputSource::goToEvent_()\n"
00468       << "Random access is not implemented for this type of Input Source\n"
00469       << "Contact a Framework Developer\n";
00470     return true;
00471   }
00472 
00473   void
00474   InputSource::rewind_() {
00475     throw Exception(errors::LogicError)
00476       << "InputSource::rewind()\n"
00477       << "Rewind is not implemented for this type of Input Source\n"
00478       << "Contact a Framework Developer\n";
00479   }
00480 
00481   void
00482   InputSource::decreaseRemainingEventsBy(int iSkipped) {
00483     if(-1 == remainingEvents_) {
00484       return;
00485     }
00486     if(iSkipped < remainingEvents_) {
00487       remainingEvents_ -= iSkipped;
00488     } else {
00489       remainingEvents_ = 0;
00490     }
00491   }
00492 
00493   void
00494   InputSource::postRead(Event& event) {
00495     Service<RandomNumberGenerator> rng;
00496     if(rng.isAvailable()) {
00497       rng->postEventRead(event);
00498     }
00499   }
00500 
00501   void
00502   InputSource::doBeginRun(RunPrincipal& rp) {
00503     Run run(rp, moduleDescription());
00504     callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
00505     run.commit_();
00506   }
00507 
00508   void
00509   InputSource::doEndRun(RunPrincipal& rp, bool cleaningUpAfterException) {
00510     rp.setEndTime(time_);
00511     Run run(rp, moduleDescription());
00512     callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
00513     run.commit_();
00514   }
00515 
00516   void
00517   InputSource::doBeginLumi(LuminosityBlockPrincipal& lbp) {
00518     LuminosityBlock lb(lbp, moduleDescription());
00519     callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
00520     lb.commit_();
00521   }
00522 
00523   void
00524   InputSource::doEndLumi(LuminosityBlockPrincipal& lbp, bool cleaningUpAfterException) {
00525     lbp.setEndTime(time_);
00526     LuminosityBlock lb(lbp, moduleDescription());
00527     callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
00528     lb.commit_();
00529   }
00530 
00531   void
00532   InputSource::doPreForkReleaseResources() {
00533     callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
00534   }
00535 
00536   void
00537   InputSource::doPostForkReacquireResources(boost::shared_ptr<multicore::MessageReceiverForSource> iReceiver) {
00538     callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
00539                                     "Calling InputSource::postForkReacquireResources" );
00540   }
00541 
00542   bool
00543   InputSource::randomAccess() const {
00544     return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
00545                                            "Calling InputSource::randomAccess_" );
00546   }
00547 
00548   ProcessingController::ForwardState
00549   InputSource::forwardState() const {
00550     return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
00551                                                                          "Calling InputSource::forwardState_" );
00552   }
00553 
00554   ProcessingController::ReverseState
00555   InputSource::reverseState() const {
00556     return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
00557                                                                          "Calling InputSource::reverseState__" );
00558   }
00559 
00560   void
00561   InputSource::beginLuminosityBlock(LuminosityBlock&) {}
00562 
00563   void
00564   InputSource::endLuminosityBlock(LuminosityBlock&) {}
00565 
00566   void
00567   InputSource::beginRun(Run&) {}
00568 
00569   void
00570   InputSource::endRun(Run&) {}
00571 
00572   void
00573   InputSource::beginJob() {}
00574 
00575   void
00576   InputSource::endJob() {}
00577 
00578   void
00579   InputSource::preForkReleaseResources() {}
00580 
00581   void
00582   InputSource::postForkReacquireResources(boost::shared_ptr<multicore::MessageReceiverForSource>) {}
00583 
00584   bool
00585   InputSource::randomAccess_() const {
00586     return false;
00587   }
00588 
00589   ProcessingController::ForwardState
00590   InputSource::forwardState_() const {
00591     return ProcessingController::kUnknownForward;
00592   }
00593 
00594   ProcessingController::ReverseState
00595   InputSource::reverseState_() const {
00596     return ProcessingController::kUnknownReverse;
00597   }
00598 
00599   ProcessHistoryID const&
00600   InputSource::reducedProcessHistoryID() const {
00601     assert(runAuxiliary());
00602     return ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(runAuxiliary()->processHistoryID());
00603   }
00604 
00605   RunNumber_t
00606   InputSource::run() const {
00607     assert(runAuxiliary());
00608     return runAuxiliary()->run();
00609   }
00610 
00611   LuminosityBlockNumber_t
00612   InputSource::luminosityBlock() const {
00613     assert(luminosityBlockAuxiliary());
00614     return luminosityBlockAuxiliary()->luminosityBlock();
00615   }
00616 
00617   InputSource::SourceSentry::SourceSentry(Sig& pre, Sig& post) : post_(post) {
00618     pre();
00619   }
00620 
00621   InputSource::SourceSentry::~SourceSentry() {
00622     post_();
00623   }
00624 
00625   InputSource::EventSourceSentry::EventSourceSentry(InputSource const& source) :
00626      sentry_(source.actReg()->preSourceSignal_, source.actReg()->postSourceSignal_) {
00627   }
00628 
00629   InputSource::LumiSourceSentry::LumiSourceSentry(InputSource const& source) :
00630      sentry_(source.actReg()->preSourceLumiSignal_, source.actReg()->postSourceLumiSignal_) {
00631   }
00632 
00633   InputSource::RunSourceSentry::RunSourceSentry(InputSource const& source) :
00634      sentry_(source.actReg()->preSourceRunSignal_, source.actReg()->postSourceRunSignal_) {
00635   }
00636 
00637   InputSource::FileOpenSentry::FileOpenSentry(InputSource const& source) :
00638      sentry_(source.actReg()->preOpenFileSignal_, source.actReg()->postOpenFileSignal_) {
00639   }
00640 
00641   InputSource::FileCloseSentry::FileCloseSentry(InputSource const& source) :
00642      sentry_(source.actReg()->preCloseFileSignal_, source.actReg()->postCloseFileSignal_) {
00643   }
00644 }