#include <PhysicsTools/UtilAlgos/interface/CachingVariable.h>
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 Description & | description () 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 | |
evalType & | baseEval (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 |
Classes | |
struct | CachingVariableFactoryArg |
Definition at line 39 of file CachingVariable.h.
typedef std::pair<bool, valueType> CachingVariable::evalType |
Definition at line 43 of file CachingVariable.h.
typedef double CachingVariable::valueType |
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.
CachingVariable::CachingVariable | ( | std::string | m, | |
std::string | n, | |||
const edm::ParameterSet & | iConfig | |||
) | [inline] |
virtual CachingVariable::~CachingVariable | ( | ) | [inline, virtual] |
void CachingVariable::addDescriptionLine | ( | const std::string & | s | ) | [inline] |
Definition at line 68 of file CachingVariable.h.
References Description::addLine(), and d_.
Referenced by ExpressionVariable< Object, label >::ExpressionVariable(), TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable(), and VariablePower::VariablePower().
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()().
00089 { 00090 if (edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_)){ 00091 LogDebug("CachingVariable")<<name_+":"+holderName_<<" is checking once"; 00092 cache_=eval(iEvent); 00093 } 00094 return cache_; 00095 }
bool CachingVariable::compute | ( | const edm::Event & | iEvent | ) | const [inline] |
Definition at line 60 of file CachingVariable.h.
References baseEval().
Referenced by VarSplitter::eval(), VariablePower::eval(), ConfigurableHisto::fill(), SplittingConfigurableHisto::fill(), and VariableEventSelector::select().
00060 { return baseEval(iEvent).first; }
const Description& CachingVariable::description | ( | ) | const [inline] |
Definition at line 67 of file CachingVariable.h.
References d_.
Referenced by print().
00067 { return d_;}
virtual evalType CachingVariable::eval | ( | const edm::Event & | iEvent | ) | const [inline, protected, virtual] |
Reimplemented in ComputedVariable, Splitter, VarSplitter, ExpressionVariable< Object, label >, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >, VariablePower, SimpleValueVariable< TYPE >, and SimpleValueVectorVariable< TYPE >.
Definition at line 97 of file CachingVariable.h.
Referenced by baseEval().
const std::string& CachingVariable::holderName | ( | ) | const [inline] |
Definition at line 69 of file CachingVariable.h.
References holderName_.
00069 { return holderName_;}
const std::string& CachingVariable::method | ( | void | ) | const [inline] |
Definition at line 66 of file CachingVariable.h.
References method_.
Referenced by ExpressionVariable< Object, label >::eval().
00066 { return method_;}
const std::string& CachingVariable::name | ( | void | ) | const [inline] |
Definition at line 65 of file CachingVariable.h.
References name_.
Referenced by SplittingConfigurableHisto::book(), ExpressionVariable< Object, label >::ExpressionVariable(), TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), print(), SplittingConfigurableHisto::SplittingConfigurableHisto(), and VarSplitter::VarSplitter().
00065 {return name_;}
valueType CachingVariable::operator() | ( | const edm::Event & | iEvent | ) | const [inline] |
Definition at line 63 of file CachingVariable.h.
References baseEval().
00063 { return baseEval(iEvent).second; }
Definition at line 72 of file CachingVariable.h.
References description(), name(), and Description::text().
00072 { 00073 edm::LogVerbatim("CachingVariable")<<name() 00074 <<"\n"<<description().text(); 00075 }
Definition at line 83 of file CachingVariable.h.
References cache_, holderName_, and name_.
00083 { 00084 edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_); 00085 cache_.first=true; cache_.second = v;}
void CachingVariable::setHolder | ( | std::string | hn | ) | const [inline] |
void CachingVariable::setNotCompute | ( | ) | const [inline, protected] |
Definition at line 86 of file CachingVariable.h.
References cache_, holderName_, and name_.
00086 { 00087 edm::Service<UpdaterService>()->checkOnce(name_+":"+holderName_); 00088 cache_.first=false; cache_.second = 0;}
friend class VariableComputer [friend] |
Definition at line 101 of file CachingVariable.h.
evalType CachingVariable::cache_ [mutable, protected] |
Definition at line 78 of file CachingVariable.h.
Referenced by baseEval(), ComputedVariable::eval(), setCache(), and setNotCompute().
edm::ParameterSet CachingVariable::conf_ [protected] |
Definition at line 100 of file CachingVariable.h.
Referenced by Splitter::label(), Splitter::shortLabel(), and VarSplitter::VarSplitter().
Description CachingVariable::d_ [protected] |
Definition at line 97 of file CachingVariable.h.
Referenced by addDescriptionLine(), and description().
std::string CachingVariable::holderName_ [mutable, protected] |
Definition at line 82 of file CachingVariable.h.
Referenced by baseEval(), ComputedVariable::eval(), holderName(), setCache(), setHolder(), and setNotCompute().
std::string CachingVariable::method_ [protected] |
std::string CachingVariable::name_ [protected] |
Definition at line 81 of file CachingVariable.h.
Referenced by baseEval(), name(), setCache(), and setNotCompute().