CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SimpleValueVectorVariable< TYPE > Class Template Reference

#include <CachingVariable.h>

Inheritance diagram for SimpleValueVectorVariable< TYPE >:
CachingVariable

Public Member Functions

CachingVariable::evalType eval (const edm::Event &iEvent) const
 
 SimpleValueVectorVariable (CachingVariableFactoryArg arg)
 
- Public Member Functions inherited from CachingVariable
void addDescriptionLine (const std::string &s)
 
 CachingVariable (std::string m, std::string n, const edm::ParameterSet &iConfig)
 
bool compute (const edm::Event &iEvent) const
 
const Descriptiondescription () const
 
const std::string & holderName () const
 
const std::string & method () const
 
const std::string & name () const
 
valueType operator() (const edm::Event &iEvent) const
 
void print () const
 
void setHolder (std::string hn) const
 
virtual ~CachingVariable ()
 

Private Attributes

unsigned int index_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool,
valueType
evalType
 
typedef double valueType
 
typedef std::map< std::string,
const CachingVariable * > 
vMap
 
- Protected Member Functions inherited from CachingVariable
evalTypebaseEval (const edm::Event &iEvent) const
 
void setCache (valueType &v) const
 
void setNotCompute () const
 
- Protected Attributes inherited from CachingVariable
evalType cache_
 
edm::ParameterSet conf_
 
Description d_
 
std::string holderName_
 
std::string method_
 
std::string name_
 

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.

524  :
525  CachingVariable("SimpleValueVectorVariable",arg.n,arg.iConfig),
526  src_(edm::Service<InputTagDistributorService>()->retrieve("src",arg.iConfig)),
527  index_(arg.iConfig.getParameter<unsigned int>("index")) { arg.m[arg.n]=this;}
A arg
Definition: Factorize.h:36
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig)

Member Function Documentation

template<typename TYPE >
CachingVariable::evalType SimpleValueVectorVariable< TYPE >::eval ( const edm::Event iEvent) const
inlinevirtual

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.

528  {
530  try { iEvent.getByLabel(src_,values);}
531  catch(...){ return std::make_pair(false,0); }
532  if (values.failedToGet() || !values.isValid()) return std::make_pair(false,0);
533  else if (index_>=values->size()) return std::make_pair(false,0);
534  else return std::make_pair(true, (*values)[index_]);
535  }
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
bool failedToGet() const
Definition: HandleBase.h:80

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().