lsst.jointcal  master-g52a623bc1f+4
Histo2d.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_HISTO2D_H
3 #define LSST_JOINTCAL_HISTO2D_H
4 
5 namespace lsst {
6 namespace jointcal {
7 
8 class Histo2d {
9 private:
10  std::unique_ptr<float[]> data;
11  int nx, ny;
12  float minx, miny;
13  float scalex, scaley;
14 
15  bool indices(double x, double y, int &ix, int &iy) const;
16 
17 public:
18  Histo2d() : data() {}
19  Histo2d(int nx, float minx, float maxx, int ny, float miny, float maxy);
20 
21  Histo2d(const Histo2d &other);
22 
23  void fill(float x, float y, float weight = 1.);
24 
25  double maxBin(double &x, double &y) const;
26 
27  void binWidth(double &Hdx, double &Hdy) const {
28  Hdx = 1. / scalex;
29  Hdy = 1. / scaley;
30  }
31 
32  double binContent(double x, double y) const;
33 
34  void zeroBin(double x, double y);
35 
36  ~Histo2d() {}
37 
38 private:
39  void operator=(const Histo2d &right);
40 };
41 } // namespace jointcal
42 } // namespace lsst
43 
44 #endif // LSST_JOINTCAL_HISTO2D_H
void binWidth(double &Hdx, double &Hdy) const
Definition: Histo2d.h:27
double binContent(double x, double y) const
Definition: Histo2d.cc:77
void fill(float x, float y, float weight=1.)
Definition: Histo2d.cc:49
void zeroBin(double x, double y)
Definition: Histo2d.cc:72
double maxBin(double &x, double &y) const
Definition: Histo2d.cc:54
Class for a simple mapping implementing a generic Gtransfo.
Definition: Associations.h:24