#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 >(), DelayedReader *reader=0) |
RunID const & | id () const |
void | mergeAuxiliary (RunAuxiliary const &aux) |
void | put (ConstBranchDescription const &bd, WrapperOwningHolder const &edp, 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 >) |
~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 26 of file RunPrincipal.h.
Definition at line 28 of file RunPrincipal.h.
typedef Principal edm::RunPrincipal::Base |
Definition at line 29 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 35 of file RunPrincipal.h.
{}
void edm::RunPrincipal::addToProcessHistory | ( | ) |
Definition at line 98 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 41 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 53 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 84 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 57 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>() , |
DelayedReader * | reader = 0 |
||
) |
Definition at line 20 of file RunPrincipal.cc.
References addToProcessHistory(), edm::ProductRegistry::anyProductProduced(), aux_, edm::Principal::begin(), edm::Principal::branchMapperPtr(), checkProcessHistory(), edm::Principal::end(), edm::Principal::fillPrincipal(), i, edm::Principal::processHistoryID(), edm::Principal::productRegistry(), and edm::Principal::reader().
{ if(productRegistry().anyProductProduced()) { checkProcessHistory(); } fillPrincipal(aux_->processHistoryID(), mapper, reader); if(productRegistry().anyProductProduced()) { addToProcessHistory(); } branchMapperPtr()->processHistoryID() = processHistoryID(); for (const_iterator i = this->begin(), iEnd = this->end(); i != iEnd; ++i) { (*i)->setProvenance(branchMapperPtr()); } }
RunID const& edm::RunPrincipal::id | ( | void | ) | const [inline] |
Definition at line 49 of file RunPrincipal.h.
References aux(), and edm::RunAuxiliary::id().
Referenced by edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal(), edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal(), DQMRootOutputModule::writeRun(), and edm::GetProductCheckerOutputModule::writeRun().
{ return aux().id(); }
void edm::RunPrincipal::mergeAuxiliary | ( | RunAuxiliary const & | aux | ) | [inline] |
Definition at line 65 of file RunPrincipal.h.
References aux_.
void edm::RunPrincipal::put | ( | ConstBranchDescription const & | bd, |
WrapperOwningHolder const & | edp, | ||
ProductProvenance & | productProvenance | ||
) |
Definition at line 37 of file RunPrincipal.cc.
References edm::ConstBranchDescription::branchID(), edm::Principal::branchMapperPtr(), Exception, g, edm::Principal::getExistingGroup(), edm::errors::InsertFailure, edm::WrapperHolder::isValid(), edm::ConstBranchDescription::produced(), and edm::Principal::putOrMerge().
Referenced by edm::Run::commit_().
{ assert(bd.produced()); if(!edp.isValid()) { 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 56 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 69 of file RunPrincipal.cc.
References edm::Group::branchDescription(), edm::ProductData::getInterface(), edm::getProduct(), edm::ConstBranchDescription::produced(), edm::Group::productData(), edm::Principal::putOrMerge(), and edm::Principal::reader().
Referenced by readImmediate().
{ if(g.branchDescription().produced()) return; // nothing to do. if(!reader()) return; // nothing to do. // must attempt to load from persistent store BranchKey const bk = BranchKey(g.branchDescription()); WrapperOwningHolder edp(reader()->getProduct(bk, g.productData().getInterface(), this)); // Now fix up the Group if(edp.isValid()) { putOrMerge(edp, &g); } }
RunNumber_t edm::RunPrincipal::run | ( | void | ) | const [inline] |
Definition at line 45 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 61 of file RunPrincipal.h.
References aux_.
Referenced by edm::InputSource::doEndRun().
void edm::RunPrincipal::setUnscheduledHandler | ( | boost::shared_ptr< UnscheduledHandler > | ) | [inline] |
Definition at line 74 of file RunPrincipal.h.
{}
virtual bool edm::RunPrincipal::unscheduledFill | ( | std::string const & | ) | const [inline, private, virtual] |
boost::shared_ptr<RunAuxiliary> edm::RunPrincipal::aux_ [private] |
Definition at line 90 of file RunPrincipal.h.
Referenced by aux(), checkProcessHistory(), fillRunPrincipal(), mergeAuxiliary(), and setEndTime().