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

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

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

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


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