Little struct that can pack a float into the unused bits of the mantissa of a NaN double.
This can be used to transport information about violation of function definition ranges, negative PDFs or other computation problems in RooFit. To separate NaNs that contain packed floats from regular NaNs, a tag is written into the upper bits of the mantissa. If this tag is found, a payload can be recovered. Otherwise, the NaN is assumed to originate from other sources than a RooFit class that wants to signal to the minimiser.
Definition at line 35 of file RooNaNPacker.h.
Public Member Functions  
constexpr  RooNaNPacker () 
RooNaNPacker (float value)  
Create NaN with a packed floating point number.  
void  accumulate (double val) 
Accumulate a packed float from another NaN into this .  
double  getNaNWithPayload () const 
Retrieve a NaN with the current float payload packed into the mantissa.  
float  getPayload () const 
Retrieve packed float.  
bool  isNaNWithPayload () const 
Test if this struct has a float packed into its mantissa.  
RooNaNPacker &  operator*= (float val) 
Multiply the packed float.  
RooNaNPacker &  operator+= (float val) 
Add to the packed float.  
void  setPayload (float payload) 
Pack float into mantissa of NaN.  
Static Public Member Functions  
template<class It_t >  
static double  accumulatePayloads (It_t begin, It_t end) 
Unpack floats from NaNs, and sum the packed values.  
static bool  isNaNWithPayload (double val) 
Test if val has a float packed into its mantissa.  
__roodevice__ static __roohost__ double  packFloatIntoNaN (float payload) 
Pack float into mantissa of a NaN.  
static float  unpackNaN (double val) 
If val is NaN and a this NaN has been tagged as containing a payload, unpack the float from the mantissa.  
static void  warn () 
Warn that packing only works on littleendian machines.  
Public Attributes  
double  _payload 
Static Public Attributes  
static constexpr uint64_t  magicTag = 0x321ab00000000 
static constexpr uint64_t  magicTagMask = 0x3ffff00000000 

inlineconstexpr 
Definition at line 45 of file RooNaNPacker.h.

inlineexplicit 
Create NaN with a packed floating point number.
Definition at line 48 of file RooNaNPacker.h.

inline 
Accumulate a packed float from another NaN into this
.
Definition at line 63 of file RooNaNPacker.h.

inlinestatic 
Unpack floats from NaNs, and sum the packed values.
Definition at line 67 of file RooNaNPacker.h.

inline 
Retrieve a NaN with the current float payload packed into the mantissa.
Definition at line 93 of file RooNaNPacker.h.

inline 
Retrieve packed float.
Returns zero if number is not NaN or if float wasn't packed by this class.
Definition at line 90 of file RooNaNPacker.h.

inline 
Test if this struct has a float packed into its mantissa.
Definition at line 96 of file RooNaNPacker.h.
Test if val
has a float packed into its mantissa.
Definition at line 99 of file RooNaNPacker.h.

inline 
Multiply the packed float.
Definition at line 82 of file RooNaNPacker.h.

inline 
Add to the packed float.
Definition at line 75 of file RooNaNPacker.h.

inlinestatic 
Pack float into mantissa of a NaN.
Adds a tag to the upper bits of the mantissa, so a "normal" NaN can be differentiated from a NaN with a payload.
Definition at line 109 of file RooNaNPacker.h.

inline 
Pack float into mantissa of NaN.
Definition at line 51 of file RooNaNPacker.h.

inlinestatic 
If val
is NaN and a this NaN has been tagged as containing a payload, unpack the float from the mantissa.
Return 0 otherwise.
Definition at line 123 of file RooNaNPacker.h.

inlinestatic 
Warn that packing only works on littleendian machines.
Definition at line 131 of file RooNaNPacker.h.
double RooNaNPacker::_payload 
Definition at line 36 of file RooNaNPacker.h.

staticconstexpr 
Definition at line 43 of file RooNaNPacker.h.

staticconstexpr 
Definition at line 42 of file RooNaNPacker.h.