MaCh3  2.5.0
Reference Guide
Public Member Functions | Public Attributes | List of all members
BinInfo Struct Reference

KS: This hold bin extents in N-Dimensions allowing to check if Bin falls into. More...

#include <Samples/SampleStructs.h>

Collaboration diagram for BinInfo:
[legend]

Public Member Functions

bool IsEventInside (const std::vector< double > &KinVars) const _noexcept_
 Checks if a given event (point) falls inside the bin. More...
 
bool IsEventInside (const std::vector< const double * > &KinVars) const _noexcept_
 Checks if a given event (point) falls inside the bin using pointer array. More...
 

Public Attributes

std::vector< std::array< double, 2 > > Extent
 

Detailed Description

KS: This hold bin extents in N-Dimensions allowing to check if Bin falls into.

Definition at line 205 of file SampleStructs.h.

Member Function Documentation

◆ IsEventInside() [1/2]

bool BinInfo::IsEventInside ( const std::vector< const double * > &  KinVars) const
inline

Checks if a given event (point) falls inside the bin using pointer array.

Definition at line 226 of file SampleStructs.h.

226  {
227  bool inside = true;
228  const size_t N = KinVars.size();
229  #ifdef MULTITHREAD
230  #pragma omp simd reduction(&:inside)
231  #endif
232  for (size_t i = 0; i < N; ++i) {
233  const double Var = *KinVars[i];
234  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
235  inside &= in_bin;
236  }
237  return inside;
238  }
std::vector< std::array< double, 2 > > Extent

◆ IsEventInside() [2/2]

bool BinInfo::IsEventInside ( const std::vector< double > &  KinVars) const
inline

Checks if a given event (point) falls inside the bin.

Definition at line 212 of file SampleStructs.h.

212  {
213  bool inside = true;
214  const size_t N = KinVars.size();
215  #ifdef MULTITHREAD
216  #pragma omp simd reduction(&:inside)
217  #endif
218  for(size_t i = 0; i < N; ++i) {
219  const double Var = KinVars[i];
220  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
221  inside &= in_bin;
222  }
223  return inside;
224  }

Member Data Documentation

◆ Extent

std::vector<std::array<double, 2> > BinInfo::Extent

The extent of the bin, stored as {lower, upper} bounds for each dimension. Extent[d][0] = lower edge Extent[d][1] = upper edge

Definition at line 210 of file SampleStructs.h.


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