#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 |
ProcessHistoryID const & | processHistoryID () 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 < WrapperOwningHolder, 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<WrapperOwningHolder, 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 104 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::RunPrincipal::put(), putProducts(), and runPrincipal().
Referenced by edm::InputSource::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), and edm::InputSource::doEndRun().
{ RunPrincipal& rp = runPrincipal(); ProductPtrVec::iterator pit(putProducts().begin()); ProductPtrVec::iterator pie(putProducts().end()); while(pit != pie) { rp.put(*pit->second, pit->first); // Ownership has passed, so clear the pointer. pit->first.reset(); ++pit; } // the cleanup is all or none putProducts().clear(); }
bool Run::get | ( | SelectorBase const & | sel, |
Handle< PROD > & | result | ||
) | const |
Definition at line 171 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 | ( | InputTag const & | tag, |
Handle< PROD > & | result | ||
) | const |
same as above, but using the InputTag class
Reimplemented from edm::RunBase.
Definition at line 192 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
{ return provRecorder_.getByLabel(tag, result); }
bool Run::getByLabel | ( | std::string const & | label, |
std::string const & | productInstanceName, | ||
Handle< PROD > & | result | ||
) | const |
Definition at line 183 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
{ return provRecorder_.getByLabel(label, productInstanceName, result); }
bool Run::getByLabel | ( | std::string const & | label, |
Handle< PROD > & | result | ||
) | const |
Definition at line 177 of file Run.h.
References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.
Referenced by L1GtAnalyzer::analyzeConditionsInRunBlock(), L1GtAnalyzer::analyzeL1GtTriggerMenuLite(), pat::PATTriggerEventProducer::beginRun(), pat::PATTriggerProducer::beginRun(), RunHistogramManager::beginRun(), LHEWriter::beginRun(), LHEProducer::beginRun(), HLTPrescaleRecorder::beginRun(), LHE2HepMCConverter::beginRun(), LHECOMWeightProducer::beginRun(), AlignmentProducer::endRun(), ExternalLHEAsciiDumper::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 109 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 204 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 198 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 210 of file Run.h.
References edm::PrincipalGetAdapter::getManyByType(), provRecorder_, and python::entryComment::results.
Referenced by edm::HadronizerFilter< HAD, DEC >::beginRun(), and 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 99 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(); }
ProcessHistoryID const & Run::processHistoryID | ( | ) | const |
Definition at line 94 of file Run.cc.
References edm::Principal::processHistoryID(), and runPrincipal().
{ return runPrincipal().processHistoryID(); }
void edm::Run::put | ( | std::auto_ptr< PROD > | product | ) | [inline] |
Put a new product.
Definition at line 81 of file Run.h.
Referenced by AlpgenSource::beginRun(), ExternalLHEProducer::beginRun(), MCatNLOSource::beginRun(), L1GtTriggerMenuLiteProducer::beginRun(), LHESource::beginRun(), LaserAlignment::endRun(), edm::CosMuoGenSource::endRun(), HLTPrescaleRecorder::endRun(), LumiProducer::endRun(), edm::PomwigProducer::endRun(), edm::CosMuoGenProducer::endRun(), edm::BeamHaloProducer::endRun(), edm::FlatBaseThetaGunProducer::endRun(), edm::HadronizerFilter< HAD, DEC >::endRun(), LHESource::endRun(), GlobalHitsProdHist::endRun(), ConditionDumperInEdm::endRun(), edm::GeneratorFilter< HAD, DEC >::endRun(), TkLasBeamFitter::endRun(), edm::ExhumeProducer::endRun(), edm::BaseFlatGunProducer::endRun(), LHEProducer::endRun(), and ExternalLHEProducer::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 146 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); WrapperOwningHolder edp(new Wrapper<PROD>(product), Wrapper<PROD>::getInterface()); putProducts().push_back(std::make_pair(edp, &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 120 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 40 of file Run.h.
References aux_.
Referenced by L1GtUtils::getL1GtRunCache(), L1GtUtils::getL1GtTriggerMenuLiteInputTag(), and 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(), getProvenance(), and processHistoryID().
{ 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 139 of file Run.h.
Referenced by runAuxiliary().
BranchIDSet edm::Run::gotBranchIDs_ [mutable, private] |
Definition at line 141 of file Run.h.
Referenced by addToGotBranchIDs().
PrincipalGetAdapter edm::Run::provRecorder_ [private] |
Definition at line 137 of file Run.h.
Referenced by get(), getByLabel(), getByLabelImpl(), getByType(), getMany(), getManyByType(), processHistory(), put(), and runPrincipal().
ProductPtrVec edm::Run::putProducts_ [private] |
Definition at line 138 of file Run.h.
Referenced by putProducts(), and ~Run().