MaCh3  2.8.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 195 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 216 of file SampleStructs.h.

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

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

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


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