CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
mkfit::axis< R, I, M, N > Struct Template Reference

#include <binnor.h>

Inheritance diagram for mkfit::axis< R, I, M, N >:
mkfit::axis_base< R, I, M, N >

Public Member Functions

 axis (R min, R max, unsigned n_bins)
 
 axis (R min, R max, R bin_width)
 
unsigned int size_of_M () const
 
unsigned int size_of_N () const
 
- Public Member Functions inherited from mkfit::axis_base< R, I, M, N >
 axis_base (R min, R max, unsigned int M_size, unsigned int N_size)
 
from_M_bin_to_N_bin (I m) const
 
I_pair from_R_minmax_to_N_bins (R rmin, R rmax) const
 
I_pair from_R_rdr_to_N_bins (R r, R dr) const
 
from_R_to_M_bin (R r) const
 
from_R_to_M_bin_safe (R r) const
 
from_R_to_N_bin (R r) const
 
from_R_to_N_bin_safe (R r) const
 
next_N_bin (I bin) const
 

Public Attributes

const unsigned int m_num_M_bins
 
const unsigned int m_num_N_bins
 
- Public Attributes inherited from mkfit::axis_base< R, I, M, N >
const I m_last_M_bin
 
const I m_last_N_bin
 
const R m_M_fac
 
const R m_M_lbhp
 
const R m_N_fac
 
const R m_N_lbhp
 
const R m_R_max
 
const R m_R_min
 

Additional Inherited Members

- Public Types inherited from mkfit::axis_base< R, I, M, N >
typedef I index_t
 
typedef R real_t
 
- Static Public Attributes inherited from mkfit::axis_base< R, I, M, N >
static constexpr unsigned int c_M = M
 
static constexpr unsigned int c_M2N_shift = M - N
 
static constexpr unsigned int c_N = N
 

Detailed Description

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
struct mkfit::axis< R, I, M, N >

Definition at line 126 of file binnor.h.

Constructor & Destructor Documentation

◆ axis() [1/2]

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
mkfit::axis< R, I, M, N >::axis ( min,
max,
unsigned  n_bins 
)
inline

Definition at line 129 of file binnor.h.

Referenced by mkfit::axis< float, bin_index_t, 16, 8 >::axis().

130  : axis_base<R, I, M, N>(min, max, n_bins << this->c_M2N_shift, n_bins),
131  m_num_M_bins(n_bins << this->c_M2N_shift),
132  m_num_N_bins(n_bins) {}
const unsigned int m_num_N_bins
Definition: binnor.h:127
static constexpr unsigned int c_M2N_shift
Definition: binnor.h:31
const unsigned int m_num_M_bins
Definition: binnor.h:127

◆ axis() [2/2]

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
mkfit::axis< R, I, M, N >::axis ( min,
max,
bin_width 
)
inline

Definition at line 134 of file binnor.h.

134  {
135  R extent = max - min;
136  unsigned int n_bins = std::ceil(extent / bin_width);
137  R extra = (n_bins * bin_width - extent) / 2;
138 
139  axis(min - extra, max + extra, n_bins);
140  }
constexpr int32_t ceil(float num)
axis(R min, R max, unsigned n_bins)
Definition: binnor.h:129

Member Function Documentation

◆ size_of_M()

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
unsigned int mkfit::axis< R, I, M, N >::size_of_M ( ) const
inline

Definition at line 142 of file binnor.h.

142 { return m_num_M_bins; }
const unsigned int m_num_M_bins
Definition: binnor.h:127

◆ size_of_N()

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
unsigned int mkfit::axis< R, I, M, N >::size_of_N ( ) const
inline

Definition at line 143 of file binnor.h.

Referenced by mkfit::LayerOfHits::LayerOfHits().

143 { return m_num_N_bins; }
const unsigned int m_num_N_bins
Definition: binnor.h:127

Member Data Documentation

◆ m_num_M_bins

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
const unsigned int mkfit::axis< R, I, M, N >::m_num_M_bins

Definition at line 127 of file binnor.h.

Referenced by mkfit::axis< float, bin_index_t, 16, 8 >::size_of_M().

◆ m_num_N_bins

template<typename R, typename I, unsigned M = 8 * sizeof(I), unsigned N = 8 * sizeof(I)>
const unsigned int mkfit::axis< R, I, M, N >::m_num_N_bins

Definition at line 127 of file binnor.h.

Referenced by mkfit::axis< float, bin_index_t, 16, 8 >::size_of_N().