![]() |
MaCh3
2.4.2
Reference Guide
|
KS: Struct storing all information required for sample binning. More...
#include <Samples/SampleStructs.h>
Public Member Functions | |
| void | InitUniform (const std::vector< std::vector< double >> &InputEdges) |
| Initialise Uniform Binning. More... | |
| void | CheckBinsDoNotOverlap (const std::vector< BinInfo > &TestedBins) const |
| Check that non-uniform bin extents do not overlap. More... | |
| void | CheckBinsHaveNoGaps (const std::vector< BinInfo > &TestedBins, const std::vector< double > &MinVal, const std::vector< double > &MaxVal, size_t ValidationBinsPerDim=100) const |
| Check that non-uniform bins fully cover the bounding box (no gaps) More... | |
| void | InitialiseGridMapping () |
| Initialise Non-Uniform Binning. More... | |
| void | InitNonUniform (const std::vector< std::vector< std::vector< double >>> &InputBins) |
| Initialise Non-Uniform Binning. More... | |
| int | GetBinSafe (const std::vector< int > &BinIndices) const |
| Get linear bin index from ND bin indices with additional checks. More... | |
| int | GetBin (const std::vector< int > &BinIndices) const |
| Convert N-dimensional bin indices to a linear bin index. More... | |
| int | FindBin (const int Dimension, const double Var, const int NomBin) const |
| DB Find the relevant bin in the PDF for each event. More... | |
| int | FindBin (const double KinVar, const int NomBin, const int N_Bins, const std::vector< double > &Bin_Edges, const std::vector< BinShiftLookup > &Bin_Lookup) const |
| DB Find the relevant bin in the PDF for each event. More... | |
| void | InitialiseLookUpSingleDimension (std::vector< BinShiftLookup > &Bin_Lookup, const std::vector< double > &Bin_Edges, const int TotBins) |
| Initializes lookup arrays for efficient bin migration in a single dimension. More... | |
| void | InitialiseStrides (const int Dimension) |
| Initialise stride factors for linear bin index calculation. More... | |
| void | InitialiseBinMigrationLookUp (const int Dimension) |
| Initialise special lookup arrays allowing to more efficiently perform bin-migration These arrays store the lower and upper edges of each bin and their neighboring bins. More... | |
Public Attributes | |
| std::vector< std::vector< double > > | BinEdges |
| Vector to hold N-axis bin-edges. More... | |
| std::vector< int > | AxisNBins |
| Number of N-axis bins in the histogram used for likelihood calculation. More... | |
| int | nBins = M3::_BAD_INT_ |
| Number of total bins. More... | |
| int | GlobalOffset = M3::_BAD_INT_ |
| If you have binning for multiple samples and trying to define 1D vector let's. More... | |
| std::vector< std::vector< BinShiftLookup > > | BinLookup |
| Bin lookups for all dimensions. More... | |
| std::vector< int > | Strides |
| Stride factors for converting N-dimensional bin indices to a linear index. More... | |
| bool | Uniform = true |
| Tells whether to use inform binning grid or non-uniform. More... | |
| std::vector< BinInfo > | Bins |
| Bins used only for non-uniform. More... | |
| std::vector< std::vector< int > > | BinGridMapping |
| This grid tells what bins are associated with with what BinEdges of Grid Binnins. More... | |
KS: Struct storing all information required for sample binning.
This struct encapsulates the full binning definition for a single analysis sample. It stores the bin edges, number of bins per dimension, stride factors, and lookup tables required to efficiently map multi-dimensional kinematic variables to linear bin indices.
Definition at line 232 of file SampleStructs.h.
|
inline |
|
inline |
Check that non-uniform bins fully cover the bounding box (no gaps)
The idea is:
Definition at line 332 of file SampleStructs.h.
|
inline |
DB Find the relevant bin in the PDF for each event.
| KinVar | The value of the kinematic variable for the event. |
| NomBin | The nominal bin index where the event would fall without any shifts. |
| N_Bins | The total number of bins in this dimension. |
| Bin_Edges | Vector of bin edge values (size = N_Bins + 1). |
| Bin_Lookup | Vector of BinShiftLookup structs providing precomputed lower and upper edges for the nominal bin and its neighbors to efficiently handle shifted events |
Definition at line 575 of file SampleStructs.h.
|
inline |
DB Find the relevant bin in the PDF for each event.
Definition at line 563 of file SampleStructs.h.
|
inline |
Convert N-dimensional bin indices to a linear bin index.
| BinIndices | Vector of bin indices along each dimension |
Mapping follows row-major order:
Definition at line 554 of file SampleStructs.h.
|
inline |
Get linear bin index from ND bin indices with additional checks.
| BinIndices | Vector of bin indices along each dimension |
Definition at line 536 of file SampleStructs.h.
|
inline |
Initialise special lookup arrays allowing to more efficiently perform bin-migration These arrays store the lower and upper edges of each bin and their neighboring bins.
Definition at line 666 of file SampleStructs.h.
|
inline |
Initialise Non-Uniform Binning.
Definition at line 392 of file SampleStructs.h.
|
inline |
Initializes lookup arrays for efficient bin migration in a single dimension.
| Bin_Lookup | Reference to the BinShiftLookup struct to be initialized. |
| Bin_Edges | Vector of bin edges defining the bin boundaries. |
| TotBins | Number of bins in the dimension. |
Definition at line 617 of file SampleStructs.h.
|
inline |
Initialise stride factors for linear bin index calculation.
Strides define how N-dimensional bin indices are converted into a single linear bin index using row-major ordering.
For example:
Definition at line 654 of file SampleStructs.h.
|
inline |
Initialise Non-Uniform Binning.
prepare special histograms used for event migration
Lastly GridMap
Definition at line 468 of file SampleStructs.h.
|
inline |
Initialise Uniform Binning.
Lastly prepare special histograms used for event migration
Definition at line 255 of file SampleStructs.h.
| std::vector<int> SampleBinningInfo::AxisNBins |
Number of N-axis bins in the histogram used for likelihood calculation.
Definition at line 237 of file SampleStructs.h.
| std::vector<std::vector<double> > SampleBinningInfo::BinEdges |
Vector to hold N-axis bin-edges.
Definition at line 235 of file SampleStructs.h.
| std::vector<std::vector<int> > SampleBinningInfo::BinGridMapping |
This grid tells what bins are associated with with what BinEdges of Grid Binnins.
Definition at line 252 of file SampleStructs.h.
| std::vector<std::vector<BinShiftLookup> > SampleBinningInfo::BinLookup |
Bin lookups for all dimensions.
Definition at line 244 of file SampleStructs.h.
| std::vector<BinInfo> SampleBinningInfo::Bins |
Bins used only for non-uniform.
Definition at line 250 of file SampleStructs.h.
| int SampleBinningInfo::GlobalOffset = M3::_BAD_INT_ |
If you have binning for multiple samples and trying to define 1D vector let's.
Definition at line 242 of file SampleStructs.h.
| int SampleBinningInfo::nBins = M3::_BAD_INT_ |
Number of total bins.
Definition at line 240 of file SampleStructs.h.
| std::vector<int> SampleBinningInfo::Strides |
Stride factors for converting N-dimensional bin indices to a linear index.
Definition at line 246 of file SampleStructs.h.
| bool SampleBinningInfo::Uniform = true |
Tells whether to use inform binning grid or non-uniform.
Definition at line 248 of file SampleStructs.h.