34 for (
unsigned int k=0; k<points.size(); k++) {
53 if (lower_boundaries.rows()!=upper_boundaries.rows()) {
54 throw std::runtime_error(Form(
"File: %s, Line: %d\nDataBin::DataBin - Dimensions of lower and upper bin boundaries disagree.", __FILE__, __LINE__));
180 if (ref_coord>=
static_cast<unsigned int >(
m_bin_centre.rows())) {
181 throw std::runtime_error(Form(
"File: %s, Line: %d\nDataBin::splitBin - Reference coordinate out of range!", __FILE__, __LINE__));
189 throw std::runtime_error(Form(
"File: %s, Line: %d\nDataBin::splitBin - Less than 4 points in the bin!", __FILE__, __LINE__));
196 for (
unsigned int k=0; k<
m_points.size(); k++) {
197 m_points[k].setReferenceComponent(ref_coord);
212 bin_1_up[ref_coord] = (
m_points[k_split]).dataVector()[ref_coord];
213 std::vector<DataPoint> bin_1_points(k_split);
214 for (
unsigned k=0; k<k_split; k++) {
220 bin_2_low[ref_coord] = (
m_points[k_split]).dataVector()[ref_coord];
222 std::vector<DataPoint> bin_2_points(
m_points.size()-k_split);
223 for (
unsigned int k=k_split; k<
m_points.size(); k++) {
224 bin_2_points[k-k_split] =
m_points[k];
249 for (
int k=0; k<point.
dataVector().rows(); k++) {
265 for (
unsigned int l=0; l<
m_points.size(); l++) {
270 static_cast<double>(
m_points.size());
271 for (
unsigned int l=0; l<
m_points.size(); l++) {
277 static_cast<double>(
m_points.size()-1);
280 static_cast<double>(
m_points.size());
306 for (
unsigned int l=0; l<
m_points.size(); l++) {
311 static_cast<double>(
m_points.size());
312 for (
unsigned int l=0; l<
m_points.size(); l++) {
318 static_cast<double>(
m_points.size()-1);
321 static_cast<double>(
m_points.size());
372 for (
unsigned int l=0; l<
m_points.size(); l++) {
377 static_cast<double>(
m_points.size());
378 for (
unsigned int l=0; l<
m_points.size(); l++) {
384 static_cast<double>(
m_points.size()-1);
387 static_cast<double>(
m_points.size());
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
const Amg::VectorX & centreOfBin() const
get the centre of the bin
Amg::VectorX m_centre_of_gravity
void setPoints(const std::vector< DataPoint > &points)
fill the bin with the given points; the use of this method is highly discouraged, it is needed for th...
DataBin * splitBin(const unsigned int &ref_coord)
divide the bin into two of equal content; splitting is done along the coordinate ref_coord; the metho...
Amg::VectorX m_lower_boundaries
std::vector< DataPoint > m_points
const Amg::VectorX & lowerBinBoundaries() const
get the lower boundaries of the bin
const std::vector< DataPoint > & dataPoints() const
get the data points filling this bin
Amg::VectorX m_upper_boundaries
Amg::VectorX m_standard_deviations
const Amg::VectorX & centreOfGravity() const
get the centre of gravity of the data points
DataBin()
Default constructor. Give a bin with 0 content and no extensions.
double density() const
get the data point density in the bin
const Amg::VectorX & upperbinBoundaries() const
get the upper boundaries of the bin
bool addPoint(const DataPoint &point)
add the data point to the bin if possible; returns true if the point can be added,...
Amg::VectorX m_bin_centre
unsigned int numberOfDataPoints() const
get the number of data points
const Amg::VectorX & standardDeviations() const
get the standard deviations of the data points from the centre of gravity in all dimensions
void addPointAndResize(const DataPoint &point, const double epsilon)
add the data point to the bin; the bin will be resized if the point does not fit into the bin; the up...
const Amg::VectorX & dataVector() const
get the data vector
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.