CMS 3D CMS Logo

ComputedVariable Class Reference

#include <PhysicsTools/UtilAlgos/interface/CachingVariable.h>

Inheritance diagram for ComputedVariable:

CachingVariable

List of all members.

Public Member Functions

 ComputedVariable (const std::string &M, std::string &N, edm::ParameterSet &P, const VariableComputer *c)
 ComputedVariable (CachingVariableFactoryArg arg)
virtual evalType eval (const edm::Event &iEvent) const
virtual ~ComputedVariable ()

Private Attributes

const VariableComputermyComputer


Detailed Description

Definition at line 133 of file CachingVariable.h.


Constructor & Destructor Documentation

ComputedVariable::ComputedVariable ( CachingVariableFactoryArg  arg  ) 

Definition at line 91 of file CachingVariable.cc.

References DBSPlugin::get(), edm::ParameterSet::getParameter(), CachingVariable::CachingVariableFactoryArg::iConfig, and myComputer.

00091                                                                  : 
00092   CachingVariable("ComputedVariable",arg.n,arg.iConfig){
00093   // instanciate the computer
00094     std::string computerType = arg.iConfig.getParameter<std::string>("computer");
00095     myComputer = VariableComputerFactory::get()->create(computerType,arg);
00096     //there is a memory leak here, because the object we are in is not register anywhere. since it happens once per job, this is not a big deal.
00097 }

ComputedVariable::ComputedVariable ( const std::string &  M,
std::string &  N,
edm::ParameterSet P,
const VariableComputer c 
) [inline]

Definition at line 136 of file CachingVariable.h.

00136                                                                                                         : 
00137     CachingVariable(M,N,P), myComputer(c){}

virtual ComputedVariable::~ComputedVariable (  )  [inline, virtual]

Definition at line 138 of file CachingVariable.h.

00138 {};


Member Function Documentation

virtual evalType ComputedVariable::eval ( const edm::Event iEvent  )  const [inline, virtual]

Reimplemented from CachingVariable.

Definition at line 140 of file CachingVariable.h.

References CachingVariable::cache_, VariableComputer::compute(), CachingVariable::holderName_, myComputer, and VariableComputer::name().

00140                                                        {
00141     if (edm::Service<UpdaterService>()->checkOnce(myComputer->name()+":"+holderName_))
00142       myComputer->compute(iEvent);
00143     return cache_;
00144   }


Member Data Documentation

const VariableComputer* ComputedVariable::myComputer [private]

Definition at line 146 of file CachingVariable.h.

Referenced by ComputedVariable(), and eval().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:37 2009 for CMSSW by  doxygen 1.5.4