#include <PhysicsTools/UtilAlgos/interface/CachingVariable.h>
Public Member Functions | |
CachingVariable::evalType | eval (const edm::Event &iEvent) const |
SimpleValueVectorVariable (CachingVariableFactoryArg arg) | |
Private Attributes | |
uint | 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.
00524 : 00525 CachingVariable("SimpleValueVectorVariable",arg.n,arg.iConfig), 00526 src_(edm::Service<InputTagDistributorService>()->retrieve("src",arg.iConfig)), 00527 index_(arg.iConfig.getParameter<uint>("index")) { arg.m[arg.n]=this;} CachingVariable::evalType eval(const edm::Event & iEvent) const{
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::Handle< T >::failedToGet(), edm::Event::getByLabel(), SimpleValueVectorVariable< TYPE >::index_, edm::Handle< T >::isValid(), SimpleValueVectorVariable< TYPE >::src_, and values.
00528 { 00529 edm::Handle<std::vector<TYPE> > values; 00530 try { iEvent.getByLabel(src_,values);} 00531 catch(...){ return std::make_pair(false,0); } 00532 if (values.failedToGet() || !values.isValid()) return std::make_pair(false,0); 00533 else if (index_>=values->size()) return std::make_pair(false,0); 00534 else return std::make_pair(true, (*values)[index_]); 00535 }
uint 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().