CMS 3D CMS Logo

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

#include <binnor.h>

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

Classes

struct  I_pair
 

Public Types

typedef I index_t
 
typedef R real_t
 

Public Member Functions

 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 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
 

Static Public Attributes

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, unsigned N>
struct mkfit::axis_base< R, I, M, N >

Definition at line 23 of file binnor.h.

Member Typedef Documentation

◆ index_t

template<typename R, typename I, unsigned M, unsigned N>
typedef I mkfit::axis_base< R, I, M, N >::index_t

Definition at line 27 of file binnor.h.

◆ real_t

template<typename R, typename I, unsigned M, unsigned N>
typedef R mkfit::axis_base< R, I, M, N >::real_t

Definition at line 24 of file binnor.h.

Constructor & Destructor Documentation

◆ axis_base()

template<typename R, typename I, unsigned M, unsigned N>
mkfit::axis_base< R, I, M, N >::axis_base ( min,
max,
unsigned int  M_size,
unsigned int  N_size 
)
inline

Definition at line 46 of file binnor.h.

47  : m_R_min(min),
48  m_R_max(max),
49  m_M_fac(M_size / (max - min)),
50  m_N_fac(N_size / (max - min)),
51  m_M_lbhp(max - 0.5 / m_M_fac),
52  m_N_lbhp(max - 0.5 / m_N_fac),
53  m_last_M_bin(M_size - 1),
54  m_last_N_bin(N_size - 1) {
55  // Requested number of bins must fit within the intended bit-field (declared by binnor, later).
56  assert(M_size <= (1 << M));
57  assert(N_size <= (1 << N));
58  assert(max > min);
59  }
assert(be >=bs)
const R m_N_lbhp
Definition: binnor.h:35
const R m_R_max
Definition: binnor.h:33
const I m_last_M_bin
Definition: binnor.h:36
#define N
Definition: blowfish.cc:9
const R m_M_fac
Definition: binnor.h:34
const I m_last_N_bin
Definition: binnor.h:36
const R m_M_lbhp
Definition: binnor.h:35
const R m_N_fac
Definition: binnor.h:34
const R m_R_min
Definition: binnor.h:33

Member Function Documentation

◆ from_M_bin_to_N_bin()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::from_M_bin_to_N_bin ( m) const
inline

Definition at line 67 of file binnor.h.

◆ from_R_minmax_to_N_bins()

template<typename R, typename I, unsigned M, unsigned N>
I_pair mkfit::axis_base< R, I, M, N >::from_R_minmax_to_N_bins ( rmin,
rmax 
) const
inline

Definition at line 69 of file binnor.h.

Referenced by mkfit::axis_base< float, bin_index_t, M, N >::from_R_rdr_to_N_bins().

69  {
70  return I_pair(from_R_to_N_bin_safe(rmin), from_R_to_N_bin_safe(rmax) + I{1});
71  }
const std::complex< double > I
Definition: I.h:8
I from_R_to_N_bin_safe(R r) const
Definition: binnor.h:65

◆ from_R_rdr_to_N_bins()

template<typename R, typename I, unsigned M, unsigned N>
I_pair mkfit::axis_base< R, I, M, N >::from_R_rdr_to_N_bins ( r,
dr 
) const
inline

Definition at line 73 of file binnor.h.

Referenced by mkfit::StdSeq::clean_cms_seedtracks_iter().

73 { return from_R_minmax_to_N_bins(r - dr, r + dr); }
I_pair from_R_minmax_to_N_bins(R rmin, R rmax) const
Definition: binnor.h:69

◆ from_R_to_M_bin()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::from_R_to_M_bin ( r) const
inline

◆ from_R_to_M_bin_safe()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::from_R_to_M_bin_safe ( r) const
inline

Definition at line 64 of file binnor.h.

64 { return r <= m_R_min ? 0 : (r >= m_M_lbhp ? m_last_M_bin : from_R_to_M_bin(r)); }
I from_R_to_M_bin(R r) const
Definition: binnor.h:61
const I m_last_M_bin
Definition: binnor.h:36
const R m_M_lbhp
Definition: binnor.h:35

◆ from_R_to_N_bin()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::from_R_to_N_bin ( r) const
inline

◆ from_R_to_N_bin_safe()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::from_R_to_N_bin_safe ( r) const
inline

Definition at line 65 of file binnor.h.

Referenced by mkfit::axis_base< float, bin_index_t, M, N >::from_R_minmax_to_N_bins(), and mkfit::LayerOfHits::qBinChecked().

65 { return r <= m_R_min ? 0 : (r >= m_N_lbhp ? m_last_N_bin : from_R_to_N_bin(r)); }
const R m_N_lbhp
Definition: binnor.h:35
I from_R_to_N_bin(R r) const
Definition: binnor.h:62
const I m_last_N_bin
Definition: binnor.h:36

◆ next_N_bin()

template<typename R, typename I, unsigned M, unsigned N>
I mkfit::axis_base< R, I, M, N >::next_N_bin ( bin) const
inline

Definition at line 74 of file binnor.h.

Referenced by mkfit::StdSeq::clean_cms_seedtracks_iter().

74 { return bin + 1; }

Member Data Documentation

◆ c_M

template<typename R, typename I, unsigned M, unsigned N>
constexpr unsigned int mkfit::axis_base< R, I, M, N >::c_M = M
static

Definition at line 29 of file binnor.h.

◆ c_M2N_shift

template<typename R, typename I, unsigned M, unsigned N>
constexpr unsigned int mkfit::axis_base< R, I, M, N >::c_M2N_shift = M - N
static

◆ c_N

template<typename R, typename I, unsigned M, unsigned N>
constexpr unsigned int mkfit::axis_base< R, I, M, N >::c_N = N
static

Definition at line 30 of file binnor.h.

◆ m_last_M_bin

template<typename R, typename I, unsigned M, unsigned N>
const I mkfit::axis_base< R, I, M, N >::m_last_M_bin

◆ m_last_N_bin

template<typename R, typename I, unsigned M, unsigned N>
const I mkfit::axis_base< R, I, M, N >::m_last_N_bin

◆ m_M_fac

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_M_fac

◆ m_M_lbhp

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_M_lbhp

◆ m_N_fac

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_N_fac

◆ m_N_lbhp

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_N_lbhp

◆ m_R_max

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_R_max

Definition at line 33 of file binnor.h.

◆ m_R_min

template<typename R, typename I, unsigned M, unsigned N>
const R mkfit::axis_base< R, I, M, N >::m_R_min