CMS 3D CMS Logo

Public Member Functions | Private Attributes

SimpleValueVectorVariable< TYPE > Class Template Reference

#include <CachingVariable.h>

Inheritance diagram for SimpleValueVectorVariable< TYPE >:
CachingVariable

List of all members.

Public Member Functions

CachingVariable::evalType eval (const edm::Event &iEvent) const
 SimpleValueVectorVariable (CachingVariableFactoryArg arg)

Private Attributes

unsigned int index_
edm::InputTag src_

Detailed Description

template<typename TYPE>
class SimpleValueVectorVariable< TYPE >

Definition at line 522 of file CachingVariable.h.


Constructor & Destructor Documentation

template<typename TYPE >
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;}

Member Function Documentation

template<typename TYPE >
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_]);
  }

Member Data Documentation

template<typename TYPE >
unsigned int SimpleValueVectorVariable< TYPE >::index_ [private]

Definition at line 539 of file CachingVariable.h.

Referenced by SimpleValueVectorVariable< TYPE >::eval().

template<typename TYPE >
edm::InputTag SimpleValueVectorVariable< TYPE >::src_ [private]

Definition at line 538 of file CachingVariable.h.

Referenced by SimpleValueVectorVariable< TYPE >::eval().