CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

CachingVariable Class Reference

#include <CachingVariable.h>

Inheritance diagram for CachingVariable:
ComputedVariable ExpressionVariable< Object, label > HLTBitVariable SimpleValueVariable< TYPE > SimpleValueVectorVariable< TYPE > Splitter TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator > VariablePower

List of all members.

Classes

struct  CachingVariableFactoryArg

Public Types

typedef std::pair< bool,
valueType
evalType
typedef double valueType
typedef std::map< std::string,
const CachingVariable * > 
vMap

Public Member Functions

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

Protected Member Functions

evalTypebaseEval (const edm::Event &iEvent) const
virtual evalType eval (const edm::Event &iEvent) const
void setCache (valueType &v) const
void setNotCompute () const

Protected Attributes

evalType cache_
edm::ParameterSet conf_
Description d_
std::string holderName_
std::string method_
std::string name_

Friends

class VariableComputer

Detailed Description

Definition at line 39 of file CachingVariable.h.


Member Typedef Documentation

typedef std::pair<bool, valueType> CachingVariable::evalType

Definition at line 43 of file CachingVariable.h.

Definition at line 42 of file CachingVariable.h.

typedef std::map<std::string, const CachingVariable*> CachingVariable::vMap

Definition at line 44 of file CachingVariable.h.


Constructor & Destructor Documentation

CachingVariable::CachingVariable ( std::string  m,
std::string  n,
const edm::ParameterSet iConfig 
) [inline]

Definition at line 53 of file CachingVariable.h.

                                                                             :
    cache_(std::make_pair(false,0)),method_(m),
    name_(n),conf_(iConfig) {}
virtual CachingVariable::~CachingVariable ( ) [inline, virtual]

Definition at line 57 of file CachingVariable.h.

{}

Member Function Documentation

void CachingVariable::addDescriptionLine ( const std::string &  s) [inline]
evalType& CachingVariable::baseEval ( const edm::Event iEvent) const [inline, protected]

Definition at line 89 of file CachingVariable.h.

References cache_, eval(), holderName_, LogDebug, and name_.

Referenced by compute(), and operator()().

                                                     {
    if (edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_)){
      LogDebug("CachingVariable")<<name_+":"+holderName_<<" is checking once";
      cache_=eval(iEvent);
    }
    return cache_;
  }
bool CachingVariable::compute ( const edm::Event iEvent) const [inline]
const Description& CachingVariable::description ( ) const [inline]

Definition at line 67 of file CachingVariable.h.

References d_.

Referenced by print().

{ return d_;}
virtual evalType CachingVariable::eval ( const edm::Event iEvent) const [inline, protected, virtual]
const std::string& CachingVariable::holderName ( ) const [inline]

Definition at line 69 of file CachingVariable.h.

References holderName_.

{ return holderName_;}
const std::string& CachingVariable::method ( ) const [inline]

Definition at line 66 of file CachingVariable.h.

References method_.

Referenced by ExpressionVariable< Object, label >::eval().

{ return method_;}
const std::string& CachingVariable::name ( void  ) const [inline]
valueType CachingVariable::operator() ( const edm::Event iEvent) const [inline]

Definition at line 63 of file CachingVariable.h.

References baseEval().

{    return baseEval(iEvent).second;  }
void CachingVariable::print ( void  ) const [inline]

Definition at line 72 of file CachingVariable.h.

References description(), name(), and Description::text().

                     {
    edm::LogVerbatim("CachingVariable")<<name()
                                       <<"\n"<<description().text();
  }
void CachingVariable::setCache ( valueType v) const [inline, protected]

Definition at line 83 of file CachingVariable.h.

References cache_, holderName_, name_, and v.

                                     { 
    edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_);
    cache_.first=true; cache_.second = v;}
void CachingVariable::setHolder ( std::string  hn) const [inline]

Definition at line 70 of file CachingVariable.h.

References holderName_.

{ holderName_=hn;}
void CachingVariable::setNotCompute ( ) const [inline, protected]

Definition at line 86 of file CachingVariable.h.

References cache_, holderName_, and name_.

                             { 
    edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_);
    cache_.first=false; cache_.second = 0;}

Friends And Related Function Documentation

friend class VariableComputer [friend]

Definition at line 101 of file CachingVariable.h.


Member Data Documentation

evalType CachingVariable::cache_ [mutable, protected]

Definition at line 78 of file CachingVariable.h.

Referenced by baseEval(), ComputedVariable::eval(), setCache(), and setNotCompute().

Definition at line 97 of file CachingVariable.h.

Referenced by addDescriptionLine(), and description().

std::string CachingVariable::holderName_ [mutable, protected]
std::string CachingVariable::method_ [protected]

Definition at line 80 of file CachingVariable.h.

Referenced by method().

std::string CachingVariable::name_ [protected]

Definition at line 81 of file CachingVariable.h.

Referenced by baseEval(), name(), setCache(), and setNotCompute().