82 lines
2.1 KiB
C++
Executable File
82 lines
2.1 KiB
C++
Executable File
#ifndef POSITION_BINNING_H
|
|
#define POSITION_BINNING_H
|
|
|
|
#include <vector>
|
|
#include "blitz/array.h"
|
|
|
|
class LowerAndUpperBoundBinning {
|
|
public:
|
|
LowerAndUpperBoundBinning(int num_bins, double maximum);
|
|
|
|
int bin(double position) const;
|
|
double stepsize() const;
|
|
int numBins() const;
|
|
int binIndexMin() const;
|
|
int binIndexMax() const;
|
|
std::vector<double> binBorders() const;
|
|
|
|
private:
|
|
int num_bins_;
|
|
double stepsize_;
|
|
};
|
|
|
|
class LowerBoundBinningWithOverflow {
|
|
public:
|
|
LowerBoundBinningWithOverflow(int num_bins_excluding_overflow,
|
|
double maximum);
|
|
|
|
int bin(double position) const;
|
|
double stepsize() const;
|
|
int numBinsWithOverflow() const;
|
|
int numBinsWithoutOverflow() const;
|
|
int binIndexMin() const;
|
|
int binIndexMax() const;
|
|
std::vector<double> binBorders() const;
|
|
|
|
private:
|
|
int num_bins_;
|
|
double stepsize_;
|
|
};
|
|
|
|
class BinningWithOverAndUnderflow {
|
|
public:
|
|
BinningWithOverAndUnderflow(int num_bins_excluding_overunderflow,
|
|
double maximum);
|
|
|
|
int bin(double position) const;
|
|
double stepsize() const;
|
|
int numBinsWithOverUnderflow() const;
|
|
int numBinsWithoutOverUnderflow() const;
|
|
int binIndexMin() const;
|
|
int binIndexMax() const;
|
|
std::vector<double> binBorders() const;
|
|
|
|
private:
|
|
int num_bins_;
|
|
double stepsize_;
|
|
};
|
|
|
|
class CylinderBinning {
|
|
public:
|
|
CylinderBinning(int num_bins_radial,
|
|
double radius,
|
|
int num_bins_azimuthal,
|
|
int num_bins_longitudinal,
|
|
double height);
|
|
|
|
blitz::TinyVector<int, 3> bin(
|
|
const blitz::TinyVector<double, 3>& cylinder_position) const;
|
|
blitz::TinyVector<double, 3> stepsize() const;
|
|
|
|
blitz::TinyVector<int, 3> numBins() const;
|
|
blitz::TinyVector<int, 3> numBinsIncludingOverUnderflow() const;
|
|
blitz::TinyVector<int, 3> binIndexMin() const;
|
|
blitz::TinyVector<int, 3> binIndexMax() const;
|
|
|
|
const LowerBoundBinningWithOverflow radial_binning;
|
|
const LowerAndUpperBoundBinning azimuth_binning;
|
|
const BinningWithOverAndUnderflow longitudinal_binning;
|
|
};
|
|
|
|
#endif /* POSITION_BINNING_H */
|