CMS 3D CMS Logo

List of all members | Public Member Functions
VariableComputerTest Class Reference

#include <CachingVariable.h>

Inheritance diagram for VariableComputerTest:
VariableComputer

Public Member Functions

void compute (const edm::Event &iEvent) const override
 
 VariableComputerTest (const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
 
 ~VariableComputerTest () override
 
- Public Member Functions inherited from VariableComputer
void assign (std::string var, double &value) const
 
void declare (std::string var, edm::ConsumesCollector &iC)
 
void doesNotCompute () const
 
void doesNotCompute (std::string var) const
 
const std::string & name () const
 
bool notSeenThisEventAlready (const edm::Event &iEvent) const
 
 VariableComputer (const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
 
virtual ~VariableComputer ()
 

Additional Inherited Members

- Protected Attributes inherited from VariableComputer
const CachingVariable::CachingVariableFactoryArgarg_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::map< std::string, const ComputedVariable * > iCompute_
 
std::string method_
 
std::string name_
 
std::string separator_
 

Detailed Description

Definition at line 174 of file CachingVariable.h.

Constructor & Destructor Documentation

◆ VariableComputerTest()

VariableComputerTest::VariableComputerTest ( const CachingVariable::CachingVariableFactoryArg arg,
edm::ConsumesCollector iC 
)

Definition at line 100 of file CachingVariable.cc.

References VariableComputer::declare().

102  : VariableComputer(arg, iC) {
103  declare("toto", iC);
104  declare("tutu", iC);
105  declare("much", iC);
106 }
VariableComputer(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
A arg
Definition: Factorize.h:31
void declare(std::string var, edm::ConsumesCollector &iC)

◆ ~VariableComputerTest()

VariableComputerTest::~VariableComputerTest ( )
inlineoverride

Definition at line 177 of file CachingVariable.h.

177 {}

Member Function Documentation

◆ compute()

void VariableComputerTest::compute ( const edm::Event iEvent) const
overridevirtual

Implements VariableComputer.

Definition at line 108 of file CachingVariable.cc.

References VariableComputer::assign(), and VariableComputer::doesNotCompute().

108  {
109  //does some mumbo jumbo with the event.
110  // computes a bunch of doubles
111  double toto = 3;
112  double tutu = 4;
113 
114  //set the variables value (which do as if they had been cached)
115  assign("toto", toto);
116  assign("tutu", tutu);
117  doesNotCompute("much");
118 }
void assign(std::string var, double &value) const
void doesNotCompute() const