CMS 3D CMS Logo

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 override
 
 SimpleValueVectorVariable (const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from CachingVariable
void addDescriptionLine (const std::string &s)
 
 CachingVariable (std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
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::EDGetTokenT< TYPE > src_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool, valueTypeevalType
 
typedef double valueType
 
typedef std::map< std::string, const CachingVariable * > vMap
 
- Protected Member Functions inherited from CachingVariable
evalTypebaseEval (const edm::Event &iEvent) const
 
bool notSeenThisEventAlready (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_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::string holderName_
 
std::string method_
 
std::string name_
 

Detailed Description

template<typename TYPE>
class SimpleValueVectorVariable< TYPE >

Definition at line 571 of file CachingVariable.h.

Constructor & Destructor Documentation

template<typename TYPE >
SimpleValueVectorVariable< TYPE >::SimpleValueVectorVariable ( const CachingVariableFactoryArg arg,
edm::ConsumesCollector iC 
)
inline

Definition at line 573 of file CachingVariable.h.

References CachingVariable::CachingVariableFactoryArg::m, and CachingVariable::CachingVariableFactoryArg::n.

574  : CachingVariable("SimpleValueVectorVariable", arg.n, arg.iConfig, iC),
575  src_(iC.consumes<TYPE>(edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig))),
576  index_(arg.iConfig.getParameter<unsigned int>("index")) {
577  arg.m[arg.n] = this;
578  }
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
A arg
Definition: Factorize.h:36
edm::EDGetTokenT< TYPE > src_

Member Function Documentation

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

Reimplemented from CachingVariable.

Definition at line 579 of file CachingVariable.h.

References edm::HandleBase::failedToGet(), edm::Event::getByToken(), edm::HandleBase::isValid(), and contentValuesCheck::values.

579  {
581  iEvent.getByToken(src_, values);
582  if (values.failedToGet() || !values.isValid())
583  return std::make_pair(false, 0);
584  else if (index_ >= values->size())
585  return std::make_pair(false, 0);
586  else
587  return std::make_pair(true, (*values)[index_]);
588  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< TYPE > src_
bool isValid() const
Definition: HandleBase.h:70
bool failedToGet() const
Definition: HandleBase.h:72

Member Data Documentation

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

Definition at line 592 of file CachingVariable.h.

template<typename TYPE >
edm::EDGetTokenT<TYPE> SimpleValueVectorVariable< TYPE >::src_
private

Definition at line 591 of file CachingVariable.h.