Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_bufferedhistogram2d.cxx
Go to the documentation of this file.
1
#include "
WireCellUtil/BufferedHistogram2D.h
"
2
#include "
WireCellUtil/Testing.h
"
3
4
#include <vector>
5
#include <iostream>
6
7
using namespace
WireCell
;
8
using namespace
std
;
9
10
int
main
()
11
{
12
BufferedHistogram2D
hist
;
13
Assert
(hist.
popx
().size() == 0);
14
Assert
(
false
== hist.
fill
(-1,-1,0));
15
Assert
(hist.
xmin
() == 0.0);
16
Assert
(hist.
ymin
() == 0.0);
17
18
cerr <<
"mins: "
<< hist.
xmin
() <<
" "
<< hist.
ymin
() <<
endl
;
19
20
Assert
(hist.
fill
(0.5,3.5));
21
vector<double>
dat
= hist.
popx
();
22
23
cerr <<
"dat size "
<< dat.size() <<
endl
;
24
25
Assert
(dat.size() == 4);
26
Assert
(dat[3] == 1.0);
27
Assert
(hist.
xmin
() == 1.0);
28
Assert
(hist.
ymin
() == 0.0);
29
30
31
}
WireCell::BufferedHistogram2D::fill
bool fill(double x, double y, double v=1.0)
Add v to the bin holding x,y. Return false if point is out of bounds.
Definition:
BufferedHistogram2D.cxx:31
WireCell::BufferedHistogram2D
Definition:
BufferedHistogram2D.h:12
wirecell.sigproc.paper.noise.dat
dat
Definition:
noise.py:64
ValidateOpDetSimulation.hist
hist
Definition:
ValidateOpDetSimulation.py:133
std
STL namespace.
WireCell::BufferedHistogram2D::ymin
double ymin() const
Definition:
BufferedHistogram2D.h:45
main
int main()
Definition:
test_bufferedhistogram2d.cxx:10
WireCell::BufferedHistogram2D::xmin
double xmin() const
Definition:
BufferedHistogram2D.h:44
Assert
#define Assert
Definition:
Testing.h:7
Testing.h
WireCell::BufferedHistogram2D::popx
std::vector< double > popx()
Definition:
BufferedHistogram2D.cxx:54
WireCell
Definition:
Main.h:22
BufferedHistogram2D.h
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11