ATLAS Offline Software
Loading...
Searching...
No Matches
TFCS1DFunction_HistogramInt32BinEdges Class Reference

#include <TFCS1DFunctionTemplateHelpers.h>

Inheritance diagram for TFCS1DFunction_HistogramInt32BinEdges:
Collaboration diagram for TFCS1DFunction_HistogramInt32BinEdges:

Public Types

typedef TFCS1DFunction_size_t size_t
typedef float value_type
typedef float random_type
typedef uint32_t internal_storage_type

Public Member Functions

 TFCS1DFunction_HistogramInt32BinEdges (size_t nbins=0)
std::size_t MemorySizeArray () const
std::size_t MemorySize () const
void set_nbins (size_t nbins)
 set number of bins
size_t get_nbins () const
 return number of bins
void SetBinLowEdge (size_t pos, const float &value)
 set position of lower edge of bins.
const float GetBinLowEdge (size_t pos) const
 get position of lower edge of bins.
const float GetBinLength (size_t pos) const
 get the length of a bin
void SetMin (const float &value)
 set and get minimum
const float & GetMin () const
void SetMax (const float &value)
 set and get maximum
const float & GetMax () const
void SetMinMax (const float &valuemin, const float &valuemax)
 set minimum and maximum
const float Length () const
 Get length of interval of all bins.
float position (size_t pos, const float &drnd) const
 return linear interpolated position for bin pos.
float position_lin (size_t pos, float m, const float &drnd) const
 return interpolated position for bin pos, such that histograming the position gives a linear slope m, where m is in units of the bin width for bin pos.
float position_exp (size_t pos, float beta, const float &drnd) const
 return exponentially interpolated position for bin pos, such that histograming the position gives a linear slope m, where m is in units of the bin width for bin pos.

Private Member Functions

size_t size () const

Private Attributes

TFCS1DFunction_Array< uint32_t > m_array
float m_Min
float m_Max

Detailed Description

Definition at line 527 of file TFCS1DFunctionTemplateHelpers.h.

Member Typedef Documentation

◆ internal_storage_type

typedef uint32_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::internal_storage_type
inherited

Definition at line 381 of file TFCS1DFunctionTemplateHelpers.h.

◆ random_type

typedef float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::random_type
inherited

Definition at line 380 of file TFCS1DFunctionTemplateHelpers.h.

◆ size_t

typedef TFCS1DFunction_size_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::size_t
inherited

Definition at line 378 of file TFCS1DFunctionTemplateHelpers.h.

◆ value_type

typedef float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::value_type
inherited

Definition at line 379 of file TFCS1DFunctionTemplateHelpers.h.

Constructor & Destructor Documentation

◆ TFCS1DFunction_HistogramInt32BinEdges()

TFCS1DFunction_HistogramInt32BinEdges::TFCS1DFunction_HistogramInt32BinEdges ( size_t nbins = 0)
inline

Member Function Documentation

◆ get_nbins()

size_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::get_nbins ( ) const
inlineinherited

return number of bins

Definition at line 394 of file TFCS1DFunctionTemplateHelpers.h.

◆ GetBinLength()

const float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::GetBinLength ( size_t pos) const
inlineinherited

◆ GetBinLowEdge()

const float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::GetBinLowEdge ( size_t pos) const
inlineinherited

◆ GetMax()

const float & TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::GetMax ( ) const
inlineinherited

◆ GetMin()

const float & TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::GetMin ( ) const
inlineinherited

◆ Length()

const float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::Length ( ) const
inlineinherited

Get length of interval of all bins.

Definition at line 443 of file TFCS1DFunctionTemplateHelpers.h.

443{ return GetMax() - GetMin(); };

◆ MemorySize()

std::size_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::MemorySize ( ) const
inlineinherited

Definition at line 388 of file TFCS1DFunctionTemplateHelpers.h.

◆ MemorySizeArray()

std::size_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::MemorySizeArray ( ) const
inlineinherited

Definition at line 387 of file TFCS1DFunctionTemplateHelpers.h.

387{ return m_array.MemorySizeArray(); };

◆ position()

float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::position ( size_t pos,
const float & drnd ) const
inlineinherited

return linear interpolated position for bin pos.

Interpolation is done with a random value in the range [0,1]

Definition at line 447 of file TFCS1DFunctionTemplateHelpers.h.

447 {
449 T pos2 = GetBinLowEdge(pos + 1);
450 return (1 - drnd) * pos1 + drnd * pos2;
451 };

◆ position_exp()

float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::position_exp ( size_t pos,
float beta,
const float & drnd ) const
inlineinherited

return exponentially interpolated position for bin pos, such that histograming the position gives a linear slope m, where m is in units of the bin width for bin pos.

Interpolation is done with a random value in the range [0,1]

(m_array[pos+1] - m_array[pos]);

Definition at line 478 of file TFCS1DFunctionTemplateHelpers.h.

478 {
479 Trandom z = drnd;
481 T pos2 = GetBinLowEdge(pos + 1);
482 if (fabs(beta) < 1.0e-8)
483 return (1 - z) * pos1 + z * pos2;
484 else {
485 T deltax = m_array[pos + 1] - m_array[pos];
486 if (deltax == 0)
487 return m_array[pos];
488 else {
489 z = 1 / beta * log(1.0 + drnd * (exp(beta * deltax) - 1.0)) / deltax;
490 }
491 }
492
493 return (1 - z) * pos1 + z * pos2;
494 };

◆ position_lin()

float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::position_lin ( size_t pos,
float m,
const float & drnd ) const
inlineinherited

return interpolated position for bin pos, such that histograming the position gives a linear slope m, where m is in units of the bin width for bin pos.

Interpolation is done with a random value in the range [0,1] return linearly interpolated position for bin pos, such that histograming the position gives a linear slope m, where m is in units of the bin width for bin pos. Interpolation is done with a random value in the range [0,1]

Definition at line 460 of file TFCS1DFunctionTemplateHelpers.h.

460 {
461 if (m > 2)
462 m = 2;
463 if (m < -2)
464 m = -2;
465 Trandom x =
466 fabs(m) > 0.001
467 ? (0.5 * std::sqrt(m * (m + 8 * drnd - 4) + 4) - 1) / m + 0.5
468 : drnd;
470 T pos2 = GetBinLowEdge(pos + 1);
471 return (1 - x) * pos1 + x * pos2;
472 };

◆ set_nbins()

void TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::set_nbins ( size_t nbins)
inlineinherited

set number of bins

Definition at line 391 of file TFCS1DFunctionTemplateHelpers.h.

391{ m_array.resize(nbins >= 1 ? nbins - 1 : 0); };

◆ SetBinLowEdge()

void TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::SetBinLowEdge ( size_t pos,
const float & value )
inlineinherited

set position of lower edge of bins.

Requires GetMin() and GetMax() to be set and may not be changed!

Definition at line 398 of file TFCS1DFunctionTemplateHelpers.h.

398 {
399 if (pos == 0) {
400 SetMin(value);
401 return;
402 }
403 if (pos >= get_nbins()) {
404 SetMax(value);
405 return;
406 }
408 (value - GetMin()) / Length());
409 };
static T ExpandToMaxRange(const Tfloat value)

◆ SetMax()

void TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::SetMax ( const float & value)
inlineinherited

set and get maximum

Definition at line 433 of file TFCS1DFunctionTemplateHelpers.h.

433{ m_Max = value; };

◆ SetMin()

void TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::SetMin ( const float & value)
inlineinherited

set and get minimum

Definition at line 429 of file TFCS1DFunctionTemplateHelpers.h.

429{ m_Min = value; };

◆ SetMinMax()

void TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::SetMinMax ( const float & valuemin,
const float & valuemax )
inlineinherited

set minimum and maximum

Definition at line 437 of file TFCS1DFunctionTemplateHelpers.h.

437 {
440 };

◆ size()

size_t TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::size ( ) const
inlineprivateinherited

Definition at line 498 of file TFCS1DFunctionTemplateHelpers.h.

498{ return m_array.size(); };

Member Data Documentation

◆ m_array

TFCS1DFunction_Array<uint32_t> TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::m_array
privateinherited

Definition at line 497 of file TFCS1DFunctionTemplateHelpers.h.

◆ m_Max

float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::m_Max
privateinherited

Definition at line 500 of file TFCS1DFunctionTemplateHelpers.h.

500{0};

◆ m_Min

float TFCS1DFunction_HistogramCompactBinEdges< float, uint32_t, float >::m_Min
privateinherited

Definition at line 499 of file TFCS1DFunctionTemplateHelpers.h.

499{0};

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