MaCh3  2.6.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 194 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 215 of file SampleStructs.h.

215  {
216  bool inside = true;
217  const size_t N = KinVars.size();
218  #ifdef MULTITHREAD
219  #pragma omp simd reduction(&:inside)
220  #endif
221  for (size_t i = 0; i < N; ++i) {
222  const double Var = *KinVars[i];
223  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
224  inside &= in_bin;
225  }
226  return inside;
227  }
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 201 of file SampleStructs.h.

201  {
202  bool inside = true;
203  const size_t N = KinVars.size();
204  #ifdef MULTITHREAD
205  #pragma omp simd reduction(&:inside)
206  #endif
207  for(size_t i = 0; i < N; ++i) {
208  const double Var = KinVars[i];
209  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
210  inside &= in_bin;
211  }
212  return inside;
213  }

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 199 of file SampleStructs.h.


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