CMS 3D CMS Logo

SimpleValueVectorVariable< TYPE > Class Template Reference

#include <PhysicsTools/UtilAlgos/interface/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

uint 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.

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{


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::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   }


Member Data Documentation

template<typename TYPE>
uint 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().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:31:44 2009 for CMSSW by  doxygen 1.5.4