Mantid
Loading...
Searching...
No Matches
BinFinder.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidKernel/DllConfig.h"
13#include <vector>
14
15namespace Mantid {
16namespace Kernel {
17
30class MANTID_KERNEL_DLL BinFinder {
31public:
32 BinFinder(const std::vector<double> &binParams);
33
34 int bin(double x);
35
36 int lastBinIndex();
37
38private:
40 std::vector<double> boundaries;
42 std::vector<double> stepSizes;
44 std::vector<double> logSteps;
46 std::vector<double> logBoundaries;
48 std::vector<int> endBinIndex;
51};
52
53} // namespace Kernel
54} // namespace Mantid
The BinFinder class is a helper class that allows one to quickly find a bin index for many events.
Definition: BinFinder.h:30
std::vector< double > boundaries
Boundaries between binning regions.
Definition: BinFinder.h:40
std::vector< double > logSteps
Log of the step size (used by log binning)
Definition: BinFinder.h:44
std::vector< double > logBoundaries
Log of the boundary (used by log binning)
Definition: BinFinder.h:46
std::vector< double > stepSizes
Step sizes in binning regions; 1 smaller than boundaries.
Definition: BinFinder.h:42
int numRegions
How many regions?
Definition: BinFinder.h:50
std::vector< int > endBinIndex
Index of the last boundary in the bins.
Definition: BinFinder.h:48
Helper class which provides the Collimation Length for SANS instruments.