CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Public Attributes | Static Public Attributes
mkfit::binnor< C, A1, A2, NB_first, NB_count > Struct Template Reference

#include <binnor.h>

Classes

struct  B_pair
 
struct  C_pair
 

Public Member Functions

void begin_registration (C n_items)
 
 binnor (const A1 &a1, const A2 &a2)
 
void finalize_registration ()
 
C_pair get_content (B_pair n_bin) const
 
C_pair get_content (typename A1::index_t n1, typename A2::index_t n2) const
 
C_pair get_content (typename A1::real_t r1, typename A2::real_t r2) const
 
B_pair get_n_bin (typename A1::index_t n1, typename A2::index_t n2) const
 
B_pair get_n_bin (typename A1::real_t r1, typename A2::real_t r2) const
 
B_pair m_bin_to_n_bin (B_pair m_bin)
 
C_pairref_content (B_pair n_bin)
 
void register_entry (typename A1::real_t r1, typename A2::real_t r2)
 
void register_entry_safe (typename A1::real_t r1, typename A2::real_t r2)
 
void register_m_bins (typename A1::index_t m1, typename A2::index_t m2)
 
void reset_contents ()
 

Public Attributes

const A1 & m_a1
 
const A2 & m_a2
 
std::vector< C_pairm_bins
 
std::vector< B_pairm_cons
 
std::vector< C > m_ranks
 

Static Public Attributes

static constexpr unsigned int c_A1_mask = (1 << A1::c_M) - 1
 
static constexpr unsigned int c_A2_Mout_mask = ~(((1 << A2::c_M2N_shift) - 1) << A1::c_M)
 

Detailed Description

template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
struct mkfit::binnor< C, A1, A2, NB_first, NB_count >

Definition at line 158 of file binnor.h.

Constructor & Destructor Documentation

template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
mkfit::binnor< C, A1, A2, NB_first, NB_count >::binnor ( const A1 &  a1,
const A2 &  a2 
)
inline

Definition at line 195 of file binnor.h.

195 : m_a1(a1), m_a2(a2), m_bins(m_a1.size_of_N() * m_a2.size_of_N()) {}
const A2 & m_a2
Definition: binnor.h:190
std::vector< C_pair > m_bins
Definition: binnor.h:192
const A1 & m_a1
Definition: binnor.h:189

Member Function Documentation

template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::begin_registration ( n_items)
inline

Definition at line 229 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons.

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

229 { m_cons.reserve(n_items); }
std::vector< B_pair > m_cons
Definition: binnor.h:191
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::finalize_registration ( )
inline

Definition at line 242 of file binnor.h.

References a, b, mkfit::binnor< C, A1, A2, NB_first, NB_count >::B_pair::bin1(), mkfit::binnor< C, A1, A2, NB_first, NB_count >::B_pair::bin2(), gen::C, mkfit::binnor< C, A1, A2, NB_first, NB_count >::C_pair::count, mkfit::binnor< C, A1, A2, NB_first, NB_count >::C_pair::first, mps_fire::i, dqmiolumiharvest::j, mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_bin_to_n_bin(), mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons, mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_ranks, gpuVertexFinder::printf(), and mkfit::binnor< C, A1, A2, NB_first, NB_count >::ref_content().

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

242  {
243  // call internal sort, bin building from icc where template instantiation has to be made.
244 
245  m_ranks.resize(m_cons.size());
246  std::iota(m_ranks.begin(), m_ranks.end(), 0);
247 
248  std::sort(m_ranks.begin(), m_ranks.end(), [&](auto &a, auto &b) {
249  return m_cons[a].mask_A2_M_bins() < m_cons[b].mask_A2_M_bins();
250  });
251 
252  for (C i = 0; i < m_ranks.size(); ++i) {
253  C j = m_ranks[i];
254  C_pair &c_bin = ref_content(m_bin_to_n_bin(m_cons[j]));
255  if (c_bin.count == 0)
256  c_bin.first = i;
257  ++c_bin.count;
258 
259 #ifdef DEBUG
260  B_pair n_pair = m_bin_to_n_bin(m_cons[j]);
261  printf("i=%4u j=%4u %u %u %u %u\n", i, j, n_pair.bin1, n_pair.bin2, c_bin.first, c_bin.count);
262 #endif
263  }
264 
265  // Those could be kept to do preselection when determining search ranges.
266  // Especially since additional precision on Axis2 is screened out during sorting.
267  m_cons.clear();
268  m_cons.shrink_to_fit();
269  }
std::vector< B_pair > m_cons
Definition: binnor.h:191
std::vector< C > m_ranks
Definition: binnor.h:193
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
B_pair m_bin_to_n_bin(B_pair m_bin)
Definition: binnor.h:199
C_pair & ref_content(B_pair n_bin)
Definition: binnor.h:209
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
C_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_content ( B_pair  n_bin) const
inline
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
C_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_content ( typename A1::index_t  n1,
typename A2::index_t  n2 
) const
inline

Definition at line 213 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_bins.

213  {
214  return m_bins[n2 * m_a1.size_of_N() + n1];
215  }
std::vector< C_pair > m_bins
Definition: binnor.h:192
const A1 & m_a1
Definition: binnor.h:189
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
C_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_content ( typename A1::real_t  r1,
typename A2::real_t  r2 
) const
inline

Definition at line 217 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_content(), mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a2.

217  {
218  return get_content(m_a1.from_R_to_N_bin(r1), m_a2.from_R_to_N_bin(r2));
219  }
const A2 & m_a2
Definition: binnor.h:190
C_pair get_content(B_pair n_bin) const
Definition: binnor.h:211
const A1 & m_a1
Definition: binnor.h:189
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
B_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_n_bin ( typename A1::index_t  n1,
typename A2::index_t  n2 
) const
inline

Definition at line 203 of file binnor.h.

203 { return {n1, n2}; }
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
B_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::get_n_bin ( typename A1::real_t  r1,
typename A2::real_t  r2 
) const
inline

Definition at line 205 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a2.

205  {
206  return {m_a1.from_R_to_N_bin(r1), m_a2.from_R_to_N_bin(r2)};
207  }
const A2 & m_a2
Definition: binnor.h:190
const A1 & m_a1
Definition: binnor.h:189
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
B_pair mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_bin_to_n_bin ( B_pair  m_bin)
inline
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
C_pair& mkfit::binnor< C, A1, A2, NB_first, NB_count >::ref_content ( B_pair  n_bin)
inline
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::register_entry ( typename A1::real_t  r1,
typename A2::real_t  r2 
)
inline

Definition at line 231 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1, mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a2, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons.

231  {
232  m_cons.push_back({m_a1.from_R_to_M_bin(r1), m_a2.from_R_to_M_bin(r2)});
233  }
const A2 & m_a2
Definition: binnor.h:190
std::vector< B_pair > m_cons
Definition: binnor.h:191
const A1 & m_a1
Definition: binnor.h:189
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::register_entry_safe ( typename A1::real_t  r1,
typename A2::real_t  r2 
)
inline

Definition at line 235 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1, mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a2, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons.

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

235  {
236  m_cons.push_back({m_a1.from_R_to_M_bin_safe(r1), m_a2.from_R_to_M_bin_safe(r2)});
237  }
const A2 & m_a2
Definition: binnor.h:190
std::vector< B_pair > m_cons
Definition: binnor.h:191
const A1 & m_a1
Definition: binnor.h:189
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::register_m_bins ( typename A1::index_t  m1,
typename A2::index_t  m2 
)
inline

Definition at line 240 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons.

240 { m_cons.push_back({m1, m2}); }
std::vector< B_pair > m_cons
Definition: binnor.h:191
tuple m2
Definition: callgraph.py:57
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
void mkfit::binnor< C, A1, A2, NB_first, NB_count >::reset_contents ( )
inline

Definition at line 223 of file binnor.h.

References mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_bins, and mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_ranks.

223  {
224  m_bins.assign(m_bins.size(), C_pair());
225  m_ranks.clear();
226  m_ranks.shrink_to_fit();
227  }
std::vector< C_pair > m_bins
Definition: binnor.h:192
std::vector< C > m_ranks
Definition: binnor.h:193

Member Data Documentation

template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
constexpr unsigned int mkfit::binnor< C, A1, A2, NB_first, NB_count >::c_A1_mask = (1 << A1::c_M) - 1
static
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
constexpr unsigned int mkfit::binnor< C, A1, A2, NB_first, NB_count >::c_A2_Mout_mask = ~(((1 << A2::c_M2N_shift) - 1) << A1::c_M)
static
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
const A1& mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a1
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
const A2& mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_a2
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
std::vector<C_pair> mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_bins
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
std::vector<B_pair> mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_cons
template<typename C, typename A1, typename A2, unsigned NB_first = 8 * sizeof(C), unsigned NB_count = 8 * sizeof(C)>
std::vector<C> mkfit::binnor< C, A1, A2, NB_first, NB_count >::m_ranks