![]() |
![]() |
#include <RunPrincipal.h>
Public Types | |
typedef RunAuxiliary | Auxiliary |
typedef Principal | Base |
Public Member Functions | |
void | addToProcessHistory () |
RunAuxiliary const & | aux () const |
Timestamp const & | beginTime () const |
void | checkProcessHistory () const |
Timestamp const & | endTime () const |
void | fillRunPrincipal (boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader)) |
RunID const & | id () const |
void | mergeAuxiliary (RunAuxiliary const &aux) |
void | put (ConstBranchDescription const &bd, std::auto_ptr< EDProduct > edp, std::auto_ptr< ProductProvenance > productProvenance) |
void | readImmediate () const |
RunNumber_t | run () const |
RunPrincipal (boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc) | |
void | setEndTime (Timestamp const &time) |
void | setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler >) |
void | swap (RunPrincipal &) |
~RunPrincipal () | |
Private Member Functions | |
void | resolveProductImmediate (Group const &g) const |
virtual bool | unscheduledFill (std::string const &) const |
Private Attributes | |
boost::shared_ptr< RunAuxiliary > | aux_ |
Definition at line 28 of file RunPrincipal.h.
Definition at line 30 of file RunPrincipal.h.
typedef Principal edm::RunPrincipal::Base |
Definition at line 31 of file RunPrincipal.h.
edm::RunPrincipal::RunPrincipal | ( | boost::shared_ptr< RunAuxiliary > | aux, |
boost::shared_ptr< ProductRegistry const > | reg, | ||
ProcessConfiguration const & | pc | ||
) |
edm::RunPrincipal::~RunPrincipal | ( | ) | [inline] |
Definition at line 37 of file RunPrincipal.h.
{}
void edm::RunPrincipal::addToProcessHistory | ( | ) |
Definition at line 94 of file RunPrincipal.cc.
References edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::Principal::processConfiguration(), edm::Principal::processHistoryUpdate(), edm::ProcessHistory::push_back(), and edm::Principal::setProcessHistory().
Referenced by fillRunPrincipal().
{ ProcessHistory& ph = processHistoryUpdate(); ph.push_back(processConfiguration()); //OPTIMIZATION NOTE: As of 0_9_0_pre3 // For very simple Sources (e.g. EmptySource) this routine takes up nearly 50% of the time per event. // 96% of the time for this routine is being spent in computing the // ProcessHistory id which happens because we are reconstructing the ProcessHistory for each event. // (The process ID is first computed in the call to 'insertMapped(..)' below.) // It would probably be better to move the ProcessHistory construction out to somewhere // which persists for longer than one Event ProcessHistoryRegistry::instance()->insertMapped(ph); setProcessHistory(*this); }
RunAuxiliary const& edm::RunPrincipal::aux | ( | ) | const [inline] |
Definition at line 43 of file RunPrincipal.h.
References aux_.
Referenced by edm::SubProcess::beginRun(), beginTime(), endTime(), id(), run(), and edm::RootOutputFile::writeRun().
{ return *aux_; }
Timestamp const& edm::RunPrincipal::beginTime | ( | ) | const [inline] |
Definition at line 55 of file RunPrincipal.h.
References aux(), and edm::RunAuxiliary::beginTime().
Referenced by edm::EventProcessor::beginRun(), edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal(), and DQMRootOutputModule::writeRun().
{ return aux().beginTime(); }
void edm::RunPrincipal::checkProcessHistory | ( | ) | const |
Definition at line 80 of file RunPrincipal.cc.
References aux_, edm::ProcessHistory::begin(), edm::errors::Configuration, edm::ProcessHistory::end(), Exception, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::Principal::processConfiguration(), and edm::ProcessConfiguration::processName().
Referenced by fillRunPrincipal().
{ ProcessHistory ph; ProcessHistoryRegistry::instance()->getMapped(aux_->processHistoryID(), ph); std::string const& processName = processConfiguration().processName(); for (ProcessHistory::const_iterator it = ph.begin(), itEnd = ph.end(); it != itEnd; ++it) { if (processName == it->processName()) { throw edm::Exception(errors::Configuration, "Duplicate Process") << "The process name " << processName << " was previously used on these products.\n" << "Please modify the configuration file to use a distinct process name.\n"; } } }
Timestamp const& edm::RunPrincipal::endTime | ( | ) | const [inline] |
Definition at line 59 of file RunPrincipal.h.
References aux(), and edm::RunAuxiliary::endTime().
Referenced by edm::EventProcessor::endRun(), edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal(), and DQMRootOutputModule::writeRun().
{ return aux().endTime(); }
void edm::RunPrincipal::fillRunPrincipal | ( | boost::shared_ptr< BranchMapper > | mapper = boost::shared_ptr<BranchMapper>(new BranchMapper) , |
boost::shared_ptr< DelayedReader > | rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader) |
||
) |
Definition at line 17 of file RunPrincipal.cc.
References addToProcessHistory(), edm::ProductRegistry::anyProductProduced(), aux_, edm::Principal::begin(), checkProcessHistory(), edm::Principal::end(), edm::Principal::fillPrincipal(), i, edm::Principal::processHistoryID(), and edm::Principal::productRegistry().
{ if (productRegistry().anyProductProduced()) { checkProcessHistory(); } fillPrincipal(aux_->processHistoryID(), mapper, rtrv); if (productRegistry().anyProductProduced()) { addToProcessHistory(); } mapper->processHistoryID() = processHistoryID(); for (const_iterator i = this->begin(), iEnd = this->end(); i != iEnd; ++i) { (*i)->setProvenance(mapper); } }
RunID const& edm::RunPrincipal::id | ( | void | ) | const [inline] |
Definition at line 51 of file RunPrincipal.h.
References aux(), and edm::RunAuxiliary::id().
Referenced by edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal(), edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal(), DQMRootOutputModule::writeRun(), and edm::GetProductCheckerOutputModule::writeRun().
{ return aux().id(); }
void edm::RunPrincipal::mergeAuxiliary | ( | RunAuxiliary const & | aux | ) | [inline] |
Definition at line 67 of file RunPrincipal.h.
References aux_.
void edm::RunPrincipal::put | ( | ConstBranchDescription const & | bd, |
std::auto_ptr< EDProduct > | edp, | ||
std::auto_ptr< ProductProvenance > | productProvenance | ||
) |
Definition at line 34 of file RunPrincipal.cc.
References edm::ConstBranchDescription::branchID(), edm::Principal::branchMapperPtr(), Exception, g, edm::Principal::getExistingGroup(), edm::errors::InsertFailure, edm::ConstBranchDescription::produced(), and edm::Principal::putOrMerge().
Referenced by edm::Run::commit_().
{ assert(bd.produced()); if (edp.get() == 0) { throw edm::Exception(edm::errors::InsertFailure,"Null Pointer") << "put: Cannot put because auto_ptr to product is null." << "\n"; } branchMapperPtr()->insert(*productProvenance); Group *g = getExistingGroup(bd.branchID()); assert(g); // Group assumes ownership putOrMerge(edp, productProvenance, g); }
void edm::RunPrincipal::readImmediate | ( | ) | const |
Definition at line 53 of file RunPrincipal.cc.
References edm::Principal::begin(), edm::Group::branchDescription(), edm::Principal::branchMapperPtr(), edm::Principal::end(), g, i, edm::ConstBranchDescription::produced(), edm::Group::productUnavailable(), and resolveProductImmediate().
{ for (Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) { Group const& g = **i; if (!g.branchDescription().produced()) { if (!g.productUnavailable()) { resolveProductImmediate(g); } } } branchMapperPtr()->setDelayedRead(false); }
void edm::RunPrincipal::resolveProductImmediate | ( | Group const & | g | ) | const [private] |
Definition at line 66 of file RunPrincipal.cc.
References edm::Group::branchDescription(), edm::getProduct(), edm::ConstBranchDescription::produced(), edm::Principal::putOrMerge(), and edm::Principal::store().
Referenced by readImmediate().
{ if (g.branchDescription().produced()) return; // nothing to do. // must attempt to load from persistent store BranchKey const bk = BranchKey(g.branchDescription()); std::auto_ptr<EDProduct> edp(store()->getProduct(bk, this)); // Now fix up the Group if (edp.get() != 0) { putOrMerge(edp, &g); } }
RunNumber_t edm::RunPrincipal::run | ( | void | ) | const [inline] |
Definition at line 47 of file RunPrincipal.h.
References aux(), and edm::RunAuxiliary::run().
Referenced by edm::EventProcessor::beginRun(), edm::EventProcessor::endRun(), edm::InputSource::markRun(), and edm::PoolOutputModule::writeRun().
{ return aux().run(); }
void edm::RunPrincipal::setEndTime | ( | Timestamp const & | time | ) | [inline] |
Definition at line 63 of file RunPrincipal.h.
References aux_.
Referenced by edm::InputSource::doEndRun().
void edm::RunPrincipal::setUnscheduledHandler | ( | boost::shared_ptr< UnscheduledHandler > | ) | [inline] |
Definition at line 76 of file RunPrincipal.h.
{}
void edm::RunPrincipal::swap | ( | RunPrincipal & | iOther | ) |
Definition at line 110 of file RunPrincipal.cc.
References aux_, and edm::Principal::swapBase().
virtual bool edm::RunPrincipal::unscheduledFill | ( | std::string const & | ) | const [inline, private, virtual] |
boost::shared_ptr<RunAuxiliary> edm::RunPrincipal::aux_ [private] |
Definition at line 94 of file RunPrincipal.h.
Referenced by aux(), checkProcessHistory(), fillRunPrincipal(), mergeAuxiliary(), setEndTime(), and swap().