MaCh3  2.4.2
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 186 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 207 of file SampleStructs.h.

207  {
208  bool inside = true;
209  const size_t N = KinVars.size();
210  #ifdef MULTITHREAD
211  #pragma omp simd reduction(&:inside)
212  #endif
213  for (size_t i = 0; i < N; ++i) {
214  const double Var = *KinVars[i];
215  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
216  inside &= in_bin;
217  }
218  return inside;
219  }
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 193 of file SampleStructs.h.

193  {
194  bool inside = true;
195  const size_t N = KinVars.size();
196  #ifdef MULTITHREAD
197  #pragma omp simd reduction(&:inside)
198  #endif
199  for(size_t i = 0; i < N; ++i) {
200  const double Var = KinVars[i];
201  const bool in_bin = (Var > Extent[i][0]) & (Var <= Extent[i][1]);
202  inside &= in_bin;
203  }
204  return inside;
205  }

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


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