lsst.jointcal  master-g59ec7209dd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Histo4d.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_HISTO4D_H
3 #define LSST_JOINTCAL_HISTO4D_H
4 
5 namespace lsst {
6 namespace jointcal {
7 
11 private:
12  std::unique_ptr<int[]> _data;
13  int _ndata;
14  int _dataSize;
15  int _n[4];
16  double _minVal[4], _maxVal[4];
17  double _scale[4];
18  bool _sorted;
19 
20 public:
22  // obvious meanings. NEntries is used as the size of the primary allocation.
23  SparseHisto4d(const int n1, double min1, double max1, const int n2, double min2, double max2,
24  const int n3, double min3, double max3, const int n4, double min4, double max4,
25  const int nEntries);
27  void fill(const double x[4]);
29  void fill(const double x1, const double x2, const double x3, const double x4);
31  int maxBin(double x[4]);
32 
34  void zeroBin(double x[4]);
35 
37  void binLimits(const double x[4], const int idim, double &xMin, double &xMax) const;
38 
40  int getNEntries() const { return _ndata; }
41 
43 
44  // private:
45  int code_value(const double x[4]) const;
46  void inverse_code(const int code, double x[4]) const;
47  void sort();
48  void dump() const;
49 };
50 } // namespace jointcal
51 } // namespace lsst
52 
53 #endif // LSST_JOINTCAL_HISTO4D_H
void fill(const double x[4])
Definition: Histo4d.cc:69
int code_value(const double x[4]) const
Definition: Histo4d.cc:44
A class to histogram in 4 dimensions.
Definition: Histo4d.h:10
int getNEntries() const
Definition: Histo4d.h:40
void inverse_code(const int code, double x[4]) const
Definition: Histo4d.cc:54
void binLimits(const double x[4], const int idim, double &xMin, double &xMax) const
return the bin limits of dimension idim (0&lt;=idim&lt;4), around point X.
Definition: Histo4d.cc:130
int maxBin(double x[4])
Definition: Histo4d.cc:93
void zeroBin(double x[4])
Definition: Histo4d.cc:115