TTTT Analysis  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
filval::DerivedValue< T > Class Template Referenceabstract

A generic, derived, value. More...

#include <value.hpp>

Inheritance diagram for filval::DerivedValue< T >:
Inheritance graph
[legend]
Collaboration diagram for filval::DerivedValue< T >:
Collaboration graph
[legend]

Public Member Functions

 DerivedValue (const std::string &name)
 
T & get_value ()
 Calculate, if necessary, and return the value held by this object.
 
- Public Member Functions inherited from filval::Value< T >
 Value (const std::string &name)
 
- Public Member Functions inherited from filval::GenValue
 GenValue (const std::string &name)
 
const std::string & get_name ()
 

Protected Member Functions

virtual void update_value ()=0
 Updates the internal value. More...
 

Protected Attributes

value
 
bool value_valid
 

Private Member Functions

void _reset ()
 Mark the internal value as invalid. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from filval::GenValue
static void reset ()
 
static GenValueget_value (const std::string &name)
 
static void summary ()
 
- Static Protected Attributes inherited from filval::GenValue
static std::map< const std::string, GenValue * > values
 A static mapping containing all created Value objects. More...
 

Detailed Description

template<typename T>
class filval::DerivedValue< T >

A generic, derived, value.

A DerivedValue is generally defined as some function of other Value objects. For example, a Pair is a function of two other Value objects that makes a pair of them. Note that these other Value objects are free to be either ObservedValues or other DerivedValues.

It is desireable from a performance standpoint that each DerivedValue be calculated no more than once per observation. Therefore, when a get_value is called on a DerivedValue, it first checks whether the value that it holds is valid, meaning it has already been calculated for this observation. If so, it simply returns the value. If not, the update_value function is called to calculate the value. and then the newly calculated value is marked as valid and returned.

Member Function Documentation

§ _reset()

template<typename T>
void filval::DerivedValue< T >::_reset ( )
inlineprivatevirtual

Mark the internal value as invalid.

This is needed for DerivedValue to force a recalculation of the internal value when a new observation is loaded into memory. It is called automatically for all GenValue objects when reset is called.

Implements filval::GenValue.

§ update_value()

template<typename T>
virtual void filval::DerivedValue< T >::update_value ( )
protectedpure virtual

Updates the internal value.

This function should be overridden by any child class to do the actual work of updating value based on whatever rules the class chooses. Normally, this consists of geting the values from some associated Value objects, doing some calculation on them, and storing the result in value.

Implemented in filval::ConstantValue< T >, filval::BoundValue< T >, filval::MultiFunc< R, T >, filval::ReduceIndex< T >, filval::Reduce< T >, filval::ZipMapFour< R, T >, filval::Pair< T1, T2 >, filval::WrapperVector< T >, filval::root::LorentzVectorEnergy, filval::Filter, filval::root::LorentzVector, and filval::root::MassFilter.


The documentation for this class was generated from the following file: