Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
LhaElement< T > Class Template Reference

Template concrete implementation of an LHA/FLHA block element. More...

#include <lha_elements.h>

Inheritance diagram for LhaElement< T >:
Collaboration diagram for LhaElement< T >:

Public Member Functions

 LhaElement (const Prototype &prototype, const std::vector< std::string > &line)
 Constructs an LhaElement from a prototype and a line of data.
 
T getValue () const
 Returns the stored value of the element.
 
RenormalizationScheme getScheme () const
 Returns the renormalization scheme of the element.
 
double getScale () const override
 Returns the renormalization scale Q of the element.
 
std::pair< double, double > getBinning () const override
 Returns the binning associated with the element.
 
std::string toString () const override
 Returns a line-like string representation of the element.
 
std::shared_ptr< DBNodetoDBNode () const override
 Converts the element to a DBNode representation.
 
- Public Member Functions inherited from AbstractElement
 AbstractElement (const LhaID &id_)
 Constructs an AbstractElement with a given identifier.
 
LhaID getId () const
 Returns the identifier of the element.
 
virtual ~AbstractElement ()=default
 Virtual destructor.
 

Additional Inherited Members

- Protected Attributes inherited from AbstractElement
const LhaID id
 

Detailed Description

template<typename T>
class LhaElement< T >

Template concrete implementation of an LHA/FLHA block element.

LhaElement<T> represents an element whose numerical content is of type T (e.g. double or std::string). It is constructed from:

  • a Prototype describing the block structure (column indices),
  • a parsed line (vector of strings).

From these, it:

  • determines the identifier (LhaID) by inspecting columns other than value/scale/scheme/bin,
  • extracts the value of type T,
  • optionally extracts:
    • the renormalization scale Q,
    • the renormalization scheme,
    • a binning (low, high).
Template Parameters
TValue type stored by the element (e.g. double or std::string).

Definition at line 135 of file lha_elements.h.

Constructor & Destructor Documentation

◆ LhaElement()

template<typename T >
LhaElement< T >::LhaElement ( const Prototype prototype,
const std::vector< std::string > &  line 
)

Constructs an LhaElement from a prototype and a line of data.

The constructor:

  • normalizes the indices using the Prototype (value, scale, scheme, bin),
  • builds the element ID via encodeId(),
  • parses the scale Q (either global header scale or per-line),
  • parses the renormalization scheme (if present),
  • parses the binning (if present),
  • converts the value token to type T.
Parameters
prototypeDescription of the block structure.
lineVector of tokens representing one line of the block.
Exceptions
std::runtime_errorif indices are inconsistent or conversion fails.

Definition at line 43 of file lha_elements.cpp.

Member Function Documentation

◆ getBinning()

template<typename T >
std::pair< double, double > LhaElement< T >::getBinning ( ) const
inlineoverridevirtual

Returns the binning associated with the element.

If no binning is defined, the default pair (-1.0, -1.0) is returned.

Returns
Pair (low, high) bin edges.

Implements AbstractElement.

Definition at line 211 of file lha_elements.h.

◆ getScale()

template<typename T >
double LhaElement< T >::getScale ( ) const
inlineoverridevirtual

Returns the renormalization scale Q of the element.

If no scale is defined, 0.0 is returned by convention.

Returns
Scale value Q.

Implements AbstractElement.

Definition at line 202 of file lha_elements.h.

◆ getScheme()

template<typename T >
RenormalizationScheme LhaElement< T >::getScheme ( ) const
inline

Returns the renormalization scheme of the element.

If no scheme is defined, RenormalizationScheme::NONE is returned.

Returns
RenormalizationScheme of this element.

Definition at line 193 of file lha_elements.h.

◆ getValue()

template<typename T >
T LhaElement< T >::getValue ( ) const
inline

Returns the stored value of the element.

Returns
Value of type T.

Definition at line 184 of file lha_elements.h.

◆ toDBNode()

template<typename T >
std::shared_ptr< DBNode > LhaElement< T >::toDBNode ( ) const
overridevirtual

Converts the element to a DBNode representation.

The returned DBNode contains at least:

  • "central_value" : T and optionally:
  • "scale" : double,
  • "renormalization_scheme": int,
  • "bin_low", "bin_high" : double.
Returns
Shared pointer to a new DBNode containing the element data.

Implements AbstractElement.

Definition at line 106 of file lha_elements.cpp.

◆ toString()

template<typename T >
std::string LhaElement< T >::toString ( ) const
overridevirtual

Returns a line-like string representation of the element.

The exact format is: "<id>\t<value>[\t<scale>][\t<scheme>]\n"

where the optional parts are printed only if available.

Returns
String representation of this element.

Implements AbstractElement.

Definition at line 92 of file lha_elements.cpp.


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