#include <Run.h>
Public Types | |
typedef PrincipalGetAdapter | Base |
Public Member Functions | |
template<typename PROD > | |
bool | get (SelectorBase const &, Handle< PROD > &result) const |
void | getAllProvenance (std::vector< Provenance const * > &provenances) const |
template<typename PROD > | |
bool | getByLabel (std::string const &label, Handle< PROD > &result) const |
template<typename PROD > | |
bool | getByLabel (std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const |
template<typename PROD > | |
bool | getByLabel (InputTag const &tag, Handle< PROD > &result) const |
same as above, but using the InputTag class | |
template<typename PROD > | |
bool | getByType (Handle< PROD > &result) const |
template<typename PROD > | |
void | getMany (SelectorBase const &, std::vector< Handle< PROD > > &results) const |
template<typename PROD > | |
void | getManyByType (std::vector< Handle< PROD > > &results) const |
Provenance | getProvenance (BranchID const &theID) const |
ProcessHistory const & | processHistory () const |
template<typename PROD > | |
void | put (std::auto_ptr< PROD > product) |
Put a new product. | |
template<typename PROD > | |
void | put (std::auto_ptr< PROD > product, std::string const &productInstanceName) |
Put a new product with a 'product instance name'. | |
Run (RunPrincipal &rp, ModuleDescription const &md) | |
RunAuxiliary const & | runAuxiliary () const |
~Run () | |
Private Types | |
typedef std::set< BranchID > | BranchIDSet |
typedef std::vector< std::pair < EDProduct *, ConstBranchDescription const * > > | ProductPtrVec |
Private Member Functions | |
void | addToGotBranchIDs (Provenance const &prov) const |
void | commit_ () |
virtual BasicHandle | getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const |
ProductPtrVec const & | putProducts () const |
ProductPtrVec & | putProducts () |
RunPrincipal const & | runPrincipal () const |
RunPrincipal & | runPrincipal () |
Private Attributes | |
RunAuxiliary const & | aux_ |
BranchIDSet | gotBranchIDs_ |
PrincipalGetAdapter | provRecorder_ |
ProductPtrVec | putProducts_ |
Friends | |
class | ConfigurableInputSource |
class | DaqSource |
class | EDFilter |
class | EDProducer |
class | InputSource |
class | RawInputSource |
typedef PrincipalGetAdapter edm::Run::Base |
typedef std::set<BranchID> edm::Run::BranchIDSet [private] |
typedef std::vector<std::pair<EDProduct*, ConstBranchDescription const*> > edm::Run::ProductPtrVec [private] |
Run::Run | ( | RunPrincipal & | rp, |
ModuleDescription const & | md | ||
) |
Definition at line 8 of file Run.cc.
: provRecorder_(rp, md), aux_(rp.aux()) { }
Run::~Run | ( | ) |
Definition at line 13 of file Run.cc.
References edm::for_all(), and putProducts_.
{ // anything left here must be the result of a failure // let's record them as failed attempts in the event principal for_all(putProducts_, principal_get_adapter_detail::deleter()); }
void Run::addToGotBranchIDs | ( | Provenance const & | prov | ) | const [private] |
Definition at line 105 of file Run.cc.
References edm::Provenance::branchID(), and gotBranchIDs_.
Referenced by getByLabelImpl().
{ gotBranchIDs_.insert(prov.branchID()); }
void Run::commit_ | ( | ) | [private] |
Definition at line 77 of file Run.cc.
References begin, end, edm::productstatus::present(), edm::RunPrincipal::put(), putProducts(), and runPrincipal().
Referenced by edm::InputSource::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::EDFilter::doEndRun(), edm::EDProducer::doEndRun(), and edm::InputSource::doEndRun().
{ // fill in guts of provenance here RunPrincipal& rp = runPrincipal(); ProductPtrVec::iterator pit(putProducts().begin()); ProductPtrVec::iterator pie(putProducts().end()); while(pit != pie) { // set provenance std::auto_ptr<ProductProvenance> runEntryInfoPtr( new ProductProvenance(pit->second->branchID(), productstatus::present())); std::auto_ptr<EDProduct> pr(pit->first); // Ownership has passed, so clear the pointer. pit->first = 0; rp.put(*pit->second, pr, runEntryInfoPtr); ++pit; } // the cleanup is all or none putProducts().clear(); }
bool Run::get | ( | SelectorBase const & | sel, |
Handle< PROD > & | result | ||
) | const |
Definition at line 169 of file Run.h.
References edm::PrincipalGetAdapter::get(), and provRecorder_.
{ return provRecorder_.get(sel, result); }
void Run::getAllProvenance | ( | std::vector< Provenance const * > & | provenances | ) | const |
Definition at line 35 of file Run.cc.
References edm::Principal::getAllProvenance(), and runPrincipal().
Referenced by GlobalHitsProdHistStripper::beginRun(), and L1GtUtils::getL1GtTriggerMenuLiteInputTag().
{ runPrincipal().getAllProvenance(provenances); }
bool Run::getByLabel | ( | std::string const & | label, |
std::string const & | productInstanceName, | ||
Handle< PROD > & | result | ||
) | const |
Definition at line 181 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
{ return provRecorder_.getByLabel(label, productInstanceName, result); }
bool Run::getByLabel | ( | InputTag const & | tag, |
Handle< PROD > & | result | ||
) | const |
same as above, but using the InputTag class
Reimplemented from edm::RunBase.
Definition at line 190 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
{ return provRecorder_.getByLabel(tag, result); }
bool Run::getByLabel | ( | std::string const & | label, |
Handle< PROD > & | result | ||
) | const |
Definition at line 175 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
Referenced by L1GtAnalyzer::analyzeConditionsInRunBlock(), L1GtAnalyzer::analyzeL1GtTriggerMenuLite(), pat::PATTriggerEventProducer::beginRun(), edm::HadronizerFilter< HAD, DEC >::beginRun(), pat::PATTriggerProducer::beginRun(), LHEWriter::beginRun(), LHEProducer::beginRun(), HLTPrescaleRecorder::beginRun(), AlignmentProducer::endRun(), TkLasBeamFitter::endRun(), L1GtBeamModeFilter::filter(), PrescaleWeightProvider::initRun(), and L1GtUtils::retrieveL1GtTriggerMenuLite().
{ return provRecorder_.getByLabel(label, result); }
BasicHandle Run::getByLabelImpl | ( | std::type_info const & | iWrapperType, |
std::type_info const & | iProductType, | ||
InputTag const & | iTag | ||
) | const [private, virtual] |
Implements edm::RunBase.
Definition at line 110 of file Run.cc.
References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByLabel_(), h, edm::BasicHandle::isValid(), edm::BasicHandle::provenance(), and provRecorder_.
{ BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType),iTag); if (h.isValid()) { addToGotBranchIDs(*(h.provenance())); } return h; }
bool Run::getByType | ( | Handle< PROD > & | result | ) | const |
Definition at line 202 of file Run.h.
References edm::PrincipalGetAdapter::getByType(), and provRecorder_.
Referenced by FWFFLooper::beginRun(), EveService::postBeginRun(), and FWFFService::postBeginRun().
{ return provRecorder_.getByType(result); }
void Run::getMany | ( | SelectorBase const & | sel, |
std::vector< Handle< PROD > > & | results | ||
) | const |
Definition at line 196 of file Run.h.
References edm::PrincipalGetAdapter::getMany(), provRecorder_, and python::entryComment::results.
{ return provRecorder_.getMany(sel, results); }
void Run::getManyByType | ( | std::vector< Handle< PROD > > & | results | ) | const |
Definition at line 208 of file Run.h.
References edm::PrincipalGetAdapter::getManyByType(), provRecorder_, and python::entryComment::results.
Referenced by GlobalHitsProdHistStripper::endRun().
{ return provRecorder_.getManyByType(results); }
Provenance Run::getProvenance | ( | BranchID const & | theID | ) | const |
Definition at line 30 of file Run.cc.
References edm::Principal::getProvenance(), and runPrincipal().
{ return runPrincipal().getProvenance(bid); }
ProcessHistory const & Run::processHistory | ( | ) | const |
Definition at line 100 of file Run.cc.
References edm::PrincipalGetAdapter::processHistory(), and provRecorder_.
Referenced by pat::PATTriggerEventProducer::beginRun(), pat::PATTriggerProducer::beginRun(), MEtoMEComparitor::beginRun(), and HLTConfigProvider::init().
{ return provRecorder_.processHistory(); }
void edm::Run::put | ( | std::auto_ptr< PROD > | product | ) | [inline] |
Put a new product.
Definition at line 80 of file Run.h.
Referenced by AlpgenSource::beginRun(), MCatNLOSource::beginRun(), L1GtTriggerMenuLiteProducer::beginRun(), LHESource::beginRun(), LaserAlignment::endRun(), edm::CosMuoGenSource::endRun(), HLTPrescaleRecorder::endRun(), edm::PomwigProducer::endRun(), edm::CosMuoGenProducer::endRun(), edm::BeamHaloProducer::endRun(), edm::FlatBaseThetaGunProducer::endRun(), edm::HadronizerFilter< HAD, DEC >::endRun(), GlobalHitsProdHist::endRun(), LHESource::endRun(), ConditionDumperInEdm::endRun(), edm::GeneratorFilter< HAD, DEC >::endRun(), TkLasBeamFitter::endRun(), edm::ExhumeProducer::endRun(), edm::BaseFlatGunProducer::endRun(), and LHEProducer::endRun().
{put<PROD>(product, std::string());}
void Run::put | ( | std::auto_ptr< PROD > | product, |
std::string const & | productInstanceName | ||
) |
Put a new product with a 'product instance name'.
Definition at line 143 of file Run.h.
References edm::PrincipalGetAdapter::getBranchDescription(), PROD, provRecorder_, putProducts(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), and relativeConstraints::value.
{ if (product.get() == 0) { // null pointer is illegal TypeID typeID(typeid(PROD)); principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, productInstanceName); } // The following will call post_insert if T has such a function, // and do nothing if T has no such function. typename boost::mpl::if_c<detail::has_postinsert<PROD>::value, DoPostInsert<PROD>, DoNotPostInsert<PROD> >::type maybe_inserter; maybe_inserter(product.get()); ConstBranchDescription const& desc = provRecorder_.getBranchDescription(TypeID(*product), productInstanceName); Wrapper<PROD> *wp(new Wrapper<PROD>(product)); putProducts().push_back(std::make_pair(wp, &desc)); // product.release(); // The object has been copied into the Wrapper. // The old copy must be deleted, so we cannot release ownership. }
ProductPtrVec& edm::Run::putProducts | ( | ) | [inline, private] |
Definition at line 117 of file Run.h.
References putProducts_.
Referenced by commit_(), and put().
{return putProducts_;}
ProductPtrVec const& edm::Run::putProducts | ( | ) | const [inline, private] |
RunAuxiliary const& edm::Run::runAuxiliary | ( | ) | const [inline, virtual] |
Implements edm::RunBase.
Definition at line 39 of file Run.h.
References aux_.
Referenced by L1GtUtils::retrieveL1GtTriggerMenuLite().
{return aux_;}
RunPrincipal const & Run::runPrincipal | ( | ) | const [private] |
Definition at line 25 of file Run.cc.
References compareJSON::const, edm::PrincipalGetAdapter::principal(), and provRecorder_.
Referenced by commit_(), getAllProvenance(), and getProvenance().
{ return dynamic_cast<RunPrincipal const&>(provRecorder_.principal()); }
RunPrincipal & Run::runPrincipal | ( | ) | [private] |
Definition at line 20 of file Run.cc.
References edm::PrincipalGetAdapter::principal(), and provRecorder_.
{ return dynamic_cast<RunPrincipal&>(provRecorder_.principal()); }
friend class ConfigurableInputSource [friend] |
friend class EDProducer [friend] |
friend class InputSource [friend] |
friend class RawInputSource [friend] |
RunAuxiliary const& edm::Run::aux_ [private] |
Definition at line 136 of file Run.h.
Referenced by runAuxiliary().
BranchIDSet edm::Run::gotBranchIDs_ [mutable, private] |
Definition at line 138 of file Run.h.
Referenced by addToGotBranchIDs().
PrincipalGetAdapter edm::Run::provRecorder_ [private] |
Definition at line 134 of file Run.h.
Referenced by get(), getByLabel(), getByLabelImpl(), getByType(), getMany(), getManyByType(), processHistory(), put(), and runPrincipal().
ProductPtrVec edm::Run::putProducts_ [private] |
Definition at line 135 of file Run.h.
Referenced by putProducts(), and ~Run().