Belle II Software development
VarSet< AVarNames >::AssignFinite< AFloat > Struct Template Reference

Helper construct to assign a finite value to float variables. More...

#include <VarSet.h>

Public Member Functions

 AssignFinite (AFloat &value)
 Setup the assignment to a variable.
 
 operator AFloat & ()
 Unpacker of the wrapper.
 
void operator= (const AFloat value)
 Assign value replacing infinite values with the maximum value possible.
 

Private Attributes

AFloat & m_value
 Reference to the variable to be assigned.
 

Detailed Description

template<class AVarNames>
template<typename AFloat>
struct Belle2::TrackFindingCDC::VarSet< AVarNames >::AssignFinite< AFloat >

Helper construct to assign a finite value to float variables.

Definition at line 101 of file VarSet.h.

Constructor & Destructor Documentation

◆ AssignFinite()

AssignFinite ( AFloat &  value)
inlineexplicit

Setup the assignment to a variable.

Definition at line 103 of file VarSet.h.

104 : m_value(value)
105 {
106 }
AFloat & m_value
Reference to the variable to be assigned.
Definition: VarSet.h:125

Member Function Documentation

◆ operator AFloat &()

operator AFloat & ( )
inline

Unpacker of the wrapper.

Definition at line 109 of file VarSet.h.

110 {
111 return m_value;
112 }

◆ operator=()

void operator= ( const AFloat  value)
inline

Assign value replacing infinite values with the maximum value possible.

Definition at line 115 of file VarSet.h.

116 {
117 m_value = value;
118 if (not std::isfinite(value)) {
119 m_value = std::copysign(std::numeric_limits<AFloat>::max(), value);
120 }
121 }

Member Data Documentation

◆ m_value

AFloat& m_value
private

Reference to the variable to be assigned.

Definition at line 125 of file VarSet.h.


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