#include <CachingVariable.h>
Public Member Functions | |
CachingVariable::evalType | eval (const edm::Event &iEvent) const |
SimpleValueVectorVariable (CachingVariableFactoryArg arg) | |
Private Attributes | |
unsigned int | index_ |
edm::InputTag | src_ |
Definition at line 522 of file CachingVariable.h.
SimpleValueVectorVariable< TYPE >::SimpleValueVectorVariable | ( | CachingVariableFactoryArg | arg | ) | [inline] |
Definition at line 524 of file CachingVariable.h.
References CachingVariable::CachingVariableFactoryArg::m, and CachingVariable::CachingVariableFactoryArg::n.
: CachingVariable("SimpleValueVectorVariable",arg.n,arg.iConfig), src_(edm::Service<InputTagDistributorService>()->retrieve("src",arg.iConfig)), index_(arg.iConfig.getParameter<unsigned int>("index")) { arg.m[arg.n]=this;}
CachingVariable::evalType SimpleValueVectorVariable< TYPE >::eval | ( | const edm::Event & | iEvent | ) | const [inline, virtual] |
Reimplemented from CachingVariable.
Definition at line 528 of file CachingVariable.h.
References edm::HandleBase::failedToGet(), edm::Event::getByLabel(), SimpleValueVectorVariable< TYPE >::index_, edm::HandleBase::isValid(), SimpleValueVectorVariable< TYPE >::src_, and makeHLTPrescaleTable::values.
{ edm::Handle<std::vector<TYPE> > values; try { iEvent.getByLabel(src_,values);} catch(...){ return std::make_pair(false,0); } if (values.failedToGet() || !values.isValid()) return std::make_pair(false,0); else if (index_>=values->size()) return std::make_pair(false,0); else return std::make_pair(true, (*values)[index_]); }
unsigned int SimpleValueVectorVariable< TYPE >::index_ [private] |
Definition at line 539 of file CachingVariable.h.
Referenced by SimpleValueVectorVariable< TYPE >::eval().
edm::InputTag SimpleValueVectorVariable< TYPE >::src_ [private] |
Definition at line 538 of file CachingVariable.h.
Referenced by SimpleValueVectorVariable< TYPE >::eval().