MaCh3  2.5.0
Reference Guide
Public Member Functions | Private Attributes | List of all members
BinningHandler Class Reference

KS: Class handling binning for multiple samples. More...

#include <Samples/BinningHandler.h>

Collaboration diagram for BinningHandler:
[legend]

Public Member Functions

 BinningHandler ()
 Constructor. More...
 
virtual ~BinningHandler ()
 destructor More...
 
int FindGlobalBin (const int iSample, const std::vector< const double * > &KinVar, const std::vector< int > &NomBin) const
 Find Global bin including. More...
 
int FindNominalBin (const int iSample, const int iDim, const double Var) const
 Find the nominal bin for a given variable in a given sample and dimension. More...
 
int GetGlobalBinSafe (const int iSample, const std::vector< int > &Bins) const
 Get gloabl bin based on sample, and dimension of each sample with additional checks. More...
 
int GetBinSafe (const int iSample, const std::vector< int > &Bins) const
 Get gloabl bin based on sample, and dimension of each sample without any safety checks. More...
 
int GetNBins () const
 Get total number of bins over all samples/kinematic bins etc. More...
 
int GetNBins (const int iSample) const
 Get total number of bins over for a given sample. More...
 
int GetNDim (const int iSample) const
 Get total number of dimensions for sample iSample. More...
 
std::string GetBinName (const int GlobalBin) const
 Get fancy name for a given bin, to help match it with global properties. More...
 
std::string GetBinName (const int iSample, const int SampleBin) const
 Get fancy name for a given bin, to help match it with global properties. More...
 
std::string GetBinName (const int iSample, const std::vector< int > &Bins) const
 Get fancy name for a given bin, to help match it with global properties. More...
 
std::vector< double > GetBinEdges (const int iSample, const int iDim) const
 Get N-dim bin edges for a given sample. More...
 
int GetNAxisBins (const int iSample, const int iDim) const
 Get Number of N-axis bins for a given sample. More...
 
bool IsUniform (const int iSample) const
 Tells whether given sample is using unform binning. More...
 
int GetSampleStartBin (const int iSample) const
 Get bin number corresponding to where given sample starts. More...
 
int GetSampleEndBin (const int iSample) const
 Get bin number corresponding to where given sample ends. More...
 
const std::vector< BinInfoGetNonUniformBins (const int iSample) const
 Return NonUnifomr bins to for example check extent etc. More...
 
void SetGlobalBinNumbers ()
 Sets the GlobalOffset for each SampleBinningInfo to enable linearization of multiple 2D binning samples. More...
 
void SetupSampleBinning (const YAML::Node &Settings, SampleInfo &SingleSample)
 Function to setup the binning of your sample histograms and the underlying arrays that get handled in fillArray() and fillArray_MP(). More...
 

Private Attributes

int TotalNumberOfBins
 Total number of bins. More...
 
std::vector< SampleBinningInfoSampleBinning
 Binning info for individual sample. More...
 

Detailed Description

KS: Class handling binning for multiple samples.

Introduction

Each sample can define its own binning in an arbitrary number of dimensions. Internally, every sample's multi-dimensional binning is linearised into a single 1D array. All samples are then concatenated into one global bin index space, allowing the entire analysis to be treated as a single large vector of bins.

The concept of a "global bin" refers to the position of a bin in this linearised, analysis-wide bin index space. Local (sample) bins are always enumerated starting from zero, while global bins span all samples consecutively.

Example layout of global bins with offsets:

Sample 0 (GlobalOffset = 0, nBins = 4):
Local bins: [0] [1] [2] [3]
Global bins: [0] [1] [2] [3]
Sample 1 (GlobalOffset = 4, nBins = 3):
Local bins: [0] [1] [2]
Global bins: [4] [5] [6]
Sample 2 (GlobalOffset = 7, nBins = 2):
Local bins: [0] [1]
Global bins: [7] [8]
Global bin index space:
------------------------------------------------
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
------------------------------------------------

Uniform and Non-Uniform Binning Scheme

MaCh3 supports Uniform and Non-Uniform binning scheme

Uniform binning uses a regular Cartesian grid. Bins are constructed as the Cartesian product of 1D bin edges, forming axis-aligned rectangles (or hyper-rectangles in higher dimensions). Bin widths may be equal or variable, but the grid structure is regular.

In the non-uniform scheme, bin sizes may vary and bins may span different ranges along each dimension. However, all bins must remain axis-aligned hyper-rectangles. Arbitrary or irregular bin shapes (e.g. curved or "banana-shaped" bins) are not supported.

Example of Uniform

+--------+--------+--------+--------+
| Bin 0 | Bin 1 | Bin 2 | Bin 3 |
| (0,0) | (1,0) | (2,0) | (3,0) |
+--------+--------+--------+--------+
| Bin 4 | Bin 5 | Bin 6 | Bin 7 |
| (0,1) | (1,1) | (2,1) | (3,1) |
+--------+--------+--------+--------+
| Bin 8 | Bin 9 | Bin 10 | Bin 11 |
| (0,2) | (1,2) | (2,2) | (3,2) |
+--------+--------+--------+--------+

Example of Non-Uniform

+--------+------------+-------+---------------------+
| Bin 0 | Bin 1 | Bin 2 | Bin 3 |
| | | | |
+--------+------------+-------+---------------------+
| Bin 4 | | | |
| | | Bin 6 | |
+--------+ Bin 5 +-------+ |
| Bin 7 | | | Bin 9 |
| | | Bin 8 | |
+--------+------------+-------+---------------------+

Bin Finding Algorithm

Since MaCh3 supports event migration bin finding algorithm must be fast to efficiently be able find bin during running fit. MaCh3 is caching nominal bin with idea that during fit migration should be around this nominal bin. Thus MaCh3 first checks if after shift event falls into Nom-bin and later adjacent. If not backs to binary search.

Uniform

In case of uniform binning above algorithm is easy to test as one performs it for every dimension independently i.e. find X-bin, then Y etc. After which can find bin in flattened 1D space.

Non-Uniform

Internally, non-uniform binning is implemented using two levels:

  1. MegaBins (mapping bins) These form a coarse, uniform grid that spans the full phase space. Each MegaBin acts as a container for one or more non-uniform bins.
  2. Non-Uniform bins The actual analysis bins, defined as hyper-rectangles with arbitrary extents inside a MegaBin.

Bin finding procedure

For a given event, the bin-finding algorithm proceeds as follows:

  1. Locate the MegaBin using the same fast per-dimension logic as in uniform binning.
  2. Once the MegaBin is identified, loop over all non-uniform bins associated with that MegaBin.
  3. The first bin whose extents fully contain the event is selected.
  4. If no bin matches, the event is assigned to the under/overflow bin.
Author
Kamil Skwarczynski
Dan Barrow
Luke Pickering

Definition at line 129 of file BinningHandler.h.

Constructor & Destructor Documentation

◆ BinningHandler()

BinningHandler::BinningHandler ( )

Constructor.

Definition at line 4 of file BinningHandler.cpp.

4  {
5 // ************************************************
6 }

◆ ~BinningHandler()

virtual BinningHandler::~BinningHandler ( )
inlinevirtual

destructor

Definition at line 136 of file BinningHandler.h.

136 {};

Member Function Documentation

◆ FindGlobalBin()

int BinningHandler::FindGlobalBin ( const int  iSample,
const std::vector< const double * > &  KinVar,
const std::vector< int > &  NomBin 
) const

Find Global bin including.

Parameters
iSampleindex of a given sample
KinVarVector of pointers to kinematic variable like Erec
NomBinVector of nominal bin indices for this event, one per dimension.

Definition at line 265 of file BinningHandler.cpp.

267  {
268 // ************************************************
269  //DB Find the relevant bin in the PDF for each event
270  const int Dim = static_cast<int>(KinVar.size());
271  const SampleBinningInfo& _restrict_ Binning = SampleBinning[NomSample];
272  int GlobalBin = 0;
273 
274  for(int i = 0; i < Dim; ++i) {
275  const double Var = *KinVar[i];
276  const int Bin = Binning.FindBin(i, Var, NomBin[i]);
277  // KS: If we are outside of range in only one dimension this mean out of bounds, we can simply quickly finish
278  if(Bin < 0) return M3::UnderOverFlowBin;
279  // KS: inline GetBin computation to avoid any memory allocation, which in reweight loop is very costly
280  GlobalBin += Bin * Binning.Strides[i];
281  }
282 
283  if(Binning.Uniform) {
284  GlobalBin += static_cast<int>(Binning.GlobalOffset);
285  return GlobalBin;
286  } else {
287  const auto& _restrict_ BinMapping = Binning.BinGridMapping[GlobalBin];
288  const size_t nNonUniBins = BinMapping.size();
289  for(size_t iBin = 0; iBin < nNonUniBins; iBin++) {
290  const int BinNumber = BinMapping[iBin];
291  const auto& _restrict_ NonUniBin = Binning.Bins[BinNumber];
292  if(NonUniBin.IsEventInside(KinVar)){
293  return BinNumber + Binning.GlobalOffset;
294  }
295  }
296  MACH3LOG_DEBUG("Didn't find any bin so returning UnderOverFlowBin");
297  return M3::UnderOverFlowBin;
298  }
299 }
#define _restrict_
KS: Using restrict limits the effects of pointer aliasing, aiding optimizations. While reading I foun...
Definition: Core.h:108
#define MACH3LOG_DEBUG
Definition: MaCh3Logger.h:34
std::vector< SampleBinningInfo > SampleBinning
Binning info for individual sample.
constexpr static const int UnderOverFlowBin
Mark bin which is overflow or underflow in MaCh3 binning.
Definition: Core.h:91
KS: Struct storing all information required for sample binning.

◆ FindNominalBin()

int BinningHandler::FindNominalBin ( const int  iSample,
const int  iDim,
const double  Var 
) const

Find the nominal bin for a given variable in a given sample and dimension.

Parameters
iSampleSample index
iDimDimension index (0 = X, 1 = Y, ...)
VarKinematic variable value

Definition at line 302 of file BinningHandler.cpp.

304  {
305 // ************************************************
306  const SampleBinningInfo& info = SampleBinning[iSample];
307 
308  const auto& edges = info.BinEdges[iDim];
309 
310  // Outside binning range
311  if (Var < edges.front() || Var >= edges.back()) {
312  return M3::UnderOverFlowBin;
313  }
314  return static_cast<int>(std::distance(edges.begin(), std::upper_bound(edges.begin(), edges.end(), Var)) - 1);
315 }
std::vector< std::vector< double > > BinEdges
Vector to hold N-axis bin-edges.

◆ GetBinEdges()

std::vector<double> BinningHandler::GetBinEdges ( const int  iSample,
const int  iDim 
) const
inline

Get N-dim bin edges for a given sample.

Parameters
iSampleindex of a given sample
iDimdimension for which we extract bin edges

Definition at line 181 of file BinningHandler.h.

181 {return SampleBinning[iSample].BinEdges.at(iDim);};

◆ GetBinName() [1/3]

std::string BinningHandler::GetBinName ( const int  GlobalBin) const

Get fancy name for a given bin, to help match it with global properties.

Parameters
GlobalBinGlobal Bin integrated over all samples

Definition at line 433 of file BinningHandler.cpp.

433  {
434 // ************************************************
435  int SampleBin = GetSampleFromGlobalBin(SampleBinning, GlobalBin);
436  int LocalBin = GetLocalBinFromGlobalBin(SampleBinning, GlobalBin);
437  return GetBinName(SampleBin, LocalBin);
438 }
int GetSampleFromGlobalBin(const std::vector< SampleBinningInfo > &BinningInfo, const int GlobalBin)
Get the sample index corresponding to a global bin number.
int GetLocalBinFromGlobalBin(const std::vector< SampleBinningInfo > &BinningInfo, const int GlobalBin)
Get the local (sample) bin index from a global bin number.
std::string GetBinName(const int GlobalBin) const
Get fancy name for a given bin, to help match it with global properties.

◆ GetBinName() [2/3]

std::string BinningHandler::GetBinName ( const int  iSample,
const int  SampleBin 
) const

Get fancy name for a given bin, to help match it with global properties.

Parameters
iSampleindex of a given sample
SampleBinGlobal Bin for a given sample

Definition at line 379 of file BinningHandler.cpp.

379  {
380 // ************************************************
381  const auto& Binning = SampleBinning[iSample];
382 
383  // Safety checks
384  if (SampleBin < 0 || SampleBin >= static_cast<int>(Binning.nBins)) {
385  MACH3LOG_ERROR("Requested bin {} is out of range for sample {}", SampleBin, iSample);
386  throw MaCh3Exception(__FILE__, __LINE__);
387  }
388  std::string BinName;
389 
390  if(Binning.Uniform) {
391  int Dim = static_cast<int>(Binning.Strides.size());
392  std::vector<int> Bins(Dim, 0);
393  int Remaining = SampleBin;
394 
395  // Convert the flat/global bin index into per-dimension indices
396  // Dim0 is the fastest-changing axis, Dim1 the next, etc.
397  //
398  // For example (2D):
399  // x = bin % Nx
400  // y = bin / Nx
401  //
402  // For 3D:
403  // x = bin % Nx
404  // y = (bin / Nx) % Ny
405  // z = bin / (Nx * Ny)
406  for (int i = 0; i < Dim; ++i) {
407  const int nBinsDim = static_cast<int>(Binning.BinEdges[i].size()) - 1;
408  Bins[i] = Remaining % nBinsDim;
409  Remaining /= nBinsDim;
410  }
411 
412  for (int i = 0; i < Dim; ++i) {
413  if (i > 0) BinName += ", ";
414  const double min = Binning.BinEdges[i].at(Bins[i]);
415  const double max = Binning.BinEdges[i].at(Bins[i] + 1);
416  BinName += fmt::format("Dim{} ({:g}, {:g})", i, min, max);
417  }
418  } else{
419  const BinInfo& bin = Binning.Bins[SampleBin];
420  const int Dim = static_cast<int>(bin.Extent.size());
421 
422  for (int i = 0; i < Dim; ++i) {
423  if (i > 0) BinName += ", ";
424  const double min = bin.Extent[i][0];
425  const double max = bin.Extent[i][1];
426  BinName += fmt::format("Dim{} ({:g}, {:g})", i, min, max);
427  }
428  }
429  return BinName;
430 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
Custom exception class used throughout MaCh3.
KS: This hold bin extents in N-Dimensions allowing to check if Bin falls into.
std::vector< std::array< double, 2 > > Extent

◆ GetBinName() [3/3]

std::string BinningHandler::GetBinName ( const int  iSample,
const std::vector< int > &  Bins 
) const

Get fancy name for a given bin, to help match it with global properties.

Parameters
iSampleindex of a given sample
BinsVector of bin indices along each dimension

Definition at line 367 of file BinningHandler.cpp.

367  {
368 // ************************************************
369  const auto& Binning = SampleBinning[iSample];
370  if(!Binning.Uniform) {
371  MACH3LOG_ERROR("When using Non-Uniform binning for sample {} please use One bin instead of Axis bins", iSample);
372  throw MaCh3Exception(__FILE__, __LINE__);
373  }
374  return GetBinName(iSample, GetBinSafe(iSample, Bins));
375 }
int GetBinSafe(const int iSample, const std::vector< int > &Bins) const
Get gloabl bin based on sample, and dimension of each sample without any safety checks.

◆ GetBinSafe()

int BinningHandler::GetBinSafe ( const int  iSample,
const std::vector< int > &  Bins 
) const

Get gloabl bin based on sample, and dimension of each sample without any safety checks.

Parameters
iSampleindex of a given sample
BinsVector of bin indices along each dimension

Definition at line 318 of file BinningHandler.cpp.

318  {
319 // ************************************************
320  const int GlobalBin = SampleBinning[Sample].GetBinSafe(Bins);
321  return GlobalBin;
322 }

◆ GetGlobalBinSafe()

int BinningHandler::GetGlobalBinSafe ( const int  iSample,
const std::vector< int > &  Bins 
) const

Get gloabl bin based on sample, and dimension of each sample with additional checks.

Parameters
iSampleindex of a given sample
BinsVector of bin indices along each dimension

Definition at line 325 of file BinningHandler.cpp.

325  {
326 // ************************************************
327  const int GlobalBin = SampleBinning[Sample].GetBinSafe(Bins) + static_cast<int>(SampleBinning[Sample].GlobalOffset);
328  return GlobalBin;
329 }

◆ GetNAxisBins()

int BinningHandler::GetNAxisBins ( const int  iSample,
const int  iDim 
) const

Get Number of N-axis bins for a given sample.

Parameters
iSampleindex of a given sample
iDimdimension for which we extract number of bins

Definition at line 441 of file BinningHandler.cpp.

441  {
442 // ************************************************
443  const auto& Binning = SampleBinning[iSample];
444  if(!Binning.Uniform) {
445  MACH3LOG_ERROR("When using Non-Uniform binning for sample {} please use global bin instead of {}", iSample, __func__);
446  throw MaCh3Exception(__FILE__, __LINE__);
447  } else{
448  return static_cast<int>(Binning.AxisNBins.at(iDim));
449  }
450 }

◆ GetNBins() [1/2]

int BinningHandler::GetNBins ( ) const
inline

Get total number of bins over all samples/kinematic bins etc.

Definition at line 161 of file BinningHandler.h.

161 {return TotalNumberOfBins;};
int TotalNumberOfBins
Total number of bins.

◆ GetNBins() [2/2]

int BinningHandler::GetNBins ( const int  iSample) const
inline

Get total number of bins over for a given sample.

Definition at line 163 of file BinningHandler.h.

163 {return static_cast<int>(SampleBinning[iSample].nBins);};

◆ GetNDim()

int BinningHandler::GetNDim ( const int  iSample) const
inline

Get total number of dimensions for sample iSample.

Definition at line 165 of file BinningHandler.h.

165 { return int(SampleBinning[iSample].BinEdges.size()); }

◆ GetNonUniformBins()

const std::vector< BinInfo > BinningHandler::GetNonUniformBins ( const int  iSample) const

Return NonUnifomr bins to for example check extent etc.

Definition at line 460 of file BinningHandler.cpp.

460  {
461 // ************************************************
462  const auto& Binning = SampleBinning[iSample];
463  if(!Binning.Uniform) {
464  return Binning.Bins;
465  } else{
466  MACH3LOG_ERROR("{} for sample {} will not work becasue binnin is unfiorm", __func__, iSample);
467  throw MaCh3Exception(__FILE__, __LINE__);
468  }
469 }

◆ GetSampleEndBin()

int BinningHandler::GetSampleEndBin ( const int  iSample) const

Get bin number corresponding to where given sample ends.

Parameters
iSampleindex of a given sample

Definition at line 338 of file BinningHandler.cpp.

338  {
339 // ************************************************
340  if (Sample == static_cast<int>(SampleBinning.size()) - 1) {
341  return GetNBins();
342  } else {
343  return static_cast<int>(SampleBinning[Sample+1].GlobalOffset);
344  }
345 }
int GetNBins() const
Get total number of bins over all samples/kinematic bins etc.

◆ GetSampleStartBin()

int BinningHandler::GetSampleStartBin ( const int  iSample) const

Get bin number corresponding to where given sample starts.

Parameters
iSampleindex of a given sample

Definition at line 332 of file BinningHandler.cpp.

332  {
333 // ************************************************
334  return static_cast<int>(SampleBinning[Sample].GlobalOffset);
335 }

◆ IsUniform()

bool BinningHandler::IsUniform ( const int  iSample) const

Tells whether given sample is using unform binning.

Parameters
iSampleindex of a given sample

Definition at line 453 of file BinningHandler.cpp.

453  {
454 // ************************************************
455  const auto& Binning = SampleBinning[iSample];
456  return Binning.Uniform;
457 }

◆ SetGlobalBinNumbers()

void BinningHandler::SetGlobalBinNumbers ( )

Sets the GlobalOffset for each SampleBinningInfo to enable linearization of multiple 2D binning samples.

Definition at line 349 of file BinningHandler.cpp.

349  {
350 // ************************************************
351  if (SampleBinning.empty()) {
352  MACH3LOG_ERROR("No binning samples provided.");
353  throw MaCh3Exception(__FILE__, __LINE__);
354  }
355 
356  int GlobalOffsetCounter = 0;
357  for(size_t iSample = 0; iSample < SampleBinning.size(); iSample++){
358  SampleBinning[iSample].GlobalOffset = GlobalOffsetCounter;
359  GlobalOffsetCounter += SampleBinning[iSample].nBins;
360  }
361  // lastly modify total number of bins
362  TotalNumberOfBins = GlobalOffsetCounter;
363 }

◆ SetupSampleBinning()

void BinningHandler::SetupSampleBinning ( const YAML::Node &  Settings,
SampleInfo SingleSample 
)

Function to setup the binning of your sample histograms and the underlying arrays that get handled in fillArray() and fillArray_MP().

Definition at line 197 of file BinningHandler.cpp.

197  {
198 // ************************************************
199  MACH3LOG_INFO("Setting up Sample Binning");
200  //Binning
201  SingleSample.VarStr = (Settings["VarStr"] && Settings["VarStr"].IsScalar())
202  ? std::vector<std::string>{Get<std::string>(
203  Settings["VarStr"], __FILE__, __LINE__)}
204  : Get<std::vector<std::string>>(Settings["VarStr"],
205  __FILE__, __LINE__);
206  SingleSample.nDimensions = static_cast<int>(SingleSample.VarStr.size());
207 
208  SampleBinningInfo SingleBinning;
209  bool Uniform = Get<bool>(Settings["Uniform"], __FILE__ , __LINE__);
210  bool found_range_specifier = false;
211  if(Uniform == false) {
212  if(Settings["Bins"].IsSequence()) {
213  SingleBinning.InitNonUniform(Get<std::vector<std::vector<std::vector<double>>>>(Settings["Bins"], __FILE__, __LINE__));
214  } else if(Settings["Bins"].IsMap()){
215  // Load binning from external file
216  auto file = Get<std::string>(Settings["Bins"]["File"], __FILE__, __LINE__);
217  M3::AddPath(file);
218  auto key = Get<std::string>(Settings["Bins"]["Key"], __FILE__, __LINE__);
219  auto binfile = LoadYamlConfig(file, __FILE__, __LINE__);
220  SingleBinning.InitNonUniform(Get<std::vector<std::vector<std::vector<double>>>>(binfile[key], __FILE__, __LINE__));
221  } else {
222  std::stringstream ss;
223  ss << Settings["Bins"];
225  "When parsing binning, expected to find a YAML map or sequence, "
226  "but found:\n{}",
227  ss.str());
228  throw MaCh3Exception(__FILE__, __LINE__);
229  }
230  } else {
231  YAML::Node const & bin_edges_node = Settings["BinEdges"] ? Settings["BinEdges"] : Settings["VarBins"];
232  if(!bin_edges_node){
233  MACH3LOG_ERROR("When setting up Uniform sample binning, didn't find expected key: BinEdges (or VarBins for backward compatibility).");
234  throw MaCh3Exception(__FILE__, __LINE__);
235  }
236  SingleBinning.InitUniform(UniformBinEdgeConfigParser(bin_edges_node, found_range_specifier));
237  }
238  if(SingleSample.VarStr.size() != SingleBinning.BinEdges.size()) {
239  MACH3LOG_ERROR("Number of variables ({}) does not match number of bin edge sets ({}) in sample config '{}'",
240  SingleSample.VarStr.size(), SingleBinning.BinEdges.size(),SingleSample.SampleTitle);
241  if(found_range_specifier){
242  std::stringstream ss;
243  ss << (Settings["BinEdges"] ? Settings["BinEdges"] : Settings["VarBins"]);
244  MACH3LOG_ERROR(R"(A bin range specifier was found in node:
245 
246  {}
247 
248 Please carefully check the number of square brackets used, a 2D binning
249  comprised of just 2 range specifiers must explicitly include the axis
250  list specifier like:
251 
252  BinEdges: [ [ {{linspace: {{nb:10, low:0, up: 10}}}} ], [ {{linspace: {{nb:5, low:10, up: 100}}}} ] ]
253 )", ss.str());
254  }
255  throw MaCh3Exception(__FILE__, __LINE__);
256  }
257 
258  SampleBinning.emplace_back(SingleBinning);
259 
260  // now setup global numbering
262 }
auto UniformBinEdgeConfigParser(YAML::Node const &bin_edges_node, bool &found_range_specifier)
Parses YAML node describing multidim uniform binning.
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:35
YAML::Node LoadYamlConfig(const std::string &filename, const std::string &File, const int Line)
Open YAML file.
Definition: YamlHelper.h:356
Type Get(const YAML::Node &node, const std::string File, const int Line)
Get content of config file.
Definition: YamlHelper.h:291
void SetGlobalBinNumbers()
Sets the GlobalOffset for each SampleBinningInfo to enable linearization of multiple 2D binning sampl...
void AddPath(std::string &FilePath)
Prepends the MACH3 environment path to FilePath if it is not already present.
Definition: Monitor.cpp:382
void InitUniform(const std::vector< std::vector< double >> &InputEdges)
Initialise Uniform Binning.
void InitNonUniform(const std::vector< std::vector< std::vector< double >>> &InputBins)
Initialise Non-Uniform Binning.
int nDimensions
Keep track of the dimensions of the sample binning.
std::vector< std::string > VarStr
the strings associated with the variables used for the binning e.g. "RecoNeutrinoEnergy"
std::string SampleTitle
the name of this sample e.g."muon-like"

Member Data Documentation

◆ SampleBinning

std::vector<SampleBinningInfo> BinningHandler::SampleBinning
private

Binning info for individual sample.

Definition at line 209 of file BinningHandler.h.

◆ TotalNumberOfBins

int BinningHandler::TotalNumberOfBins
private

Total number of bins.

Definition at line 207 of file BinningHandler.h.


The documentation for this class was generated from the following files: