test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoJets
FFTJetAlgorithms
src
LookupTable2d.cc
Go to the documentation of this file.
1
#include <cmath>
2
#include <cassert>
3
4
#include "
RecoJets/FFTJetAlgorithms/interface/LookupTable2d.h
"
5
6
namespace
fftjetcms {
7
LookupTable2d::LookupTable2d
(
unsigned
nx,
double
xmin
,
double
xmax
,
8
unsigned
ny,
double
ymin
,
double
ymax
,
9
const
std::vector<double>&
data
)
10
: data_(data),
11
nx_(nx),
12
ny_(ny),
13
xmin_(xmin),
14
xmax_(xmax),
15
ymin_(ymin),
16
ymax_(ymax),
17
bwx_((xmax - xmin)/nx),
18
bwy_((ymax - ymin)/ny)
19
{
20
assert
(
nx_
);
21
assert
(
ny_
);
22
assert
(
xmin_
<
xmax_
);
23
assert
(
ymin_
<
ymax_
);
24
assert
(
data_
.size() ==
nx_
*
ny_
);
25
}
26
27
double
LookupTable2d::closest
(
const
double
x,
const
double
y)
const
28
{
29
const
unsigned
ix = x <= xmin_ ? 0U : x >=
xmax_
-
bwx_
/2.0 ?
nx_
- 1U :
30
static_cast<
unsigned
>
((x -
xmin_
)/
bwx_
);
31
const
unsigned
iy = y <= ymin_ ? 0U : y >=
ymax_
-
bwy_
/2.0 ?
ny_
- 1U :
32
static_cast<
unsigned
>
((y -
ymin_
)/
bwy_
);
33
return
data_
[ix*
ny_
+ iy];
34
}
35
}
fftjetcms::LookupTable2d::LookupTable2d
LookupTable2d()
fftjetcms::LookupTable2d::ymax_
double ymax_
Definition:
LookupTable2d.h:37
fftjetcms::LookupTable2d::xmax_
double xmax_
Definition:
LookupTable2d.h:35
assert
assert(m_qm.get())
fftjetcms::LookupTable2d::xmin_
double xmin_
Definition:
LookupTable2d.h:34
fftjetcms::LookupTable2d::ymin_
double ymin_
Definition:
LookupTable2d.h:36
LookupTable2d.h
SiStripMonitorClusterAlca_cfi.ymax
tuple ymax
Definition:
SiStripMonitorClusterAlca_cfi.py:85
SiStripMonitorClusterAlca_cfi.xmin
tuple xmin
Definition:
SiStripMonitorClusterAlca_cfi.py:32
fftjetcms::LookupTable2d::closest
double closest(double x, double y) const
Definition:
LookupTable2d.cc:27
fftjetcms::LookupTable2d::ny_
unsigned ny_
Definition:
LookupTable2d.h:33
SiStripMonitorClusterAlca_cfi.ymin
tuple ymin
Definition:
SiStripMonitorClusterAlca_cfi.py:84
fftjetcms::LookupTable2d::bwx_
double bwx_
Definition:
LookupTable2d.h:38
SiStripMonitorClusterAlca_cfi.xmax
tuple xmax
Definition:
SiStripMonitorClusterAlca_cfi.py:33
fftjetcms::LookupTable2d::nx_
unsigned nx_
Definition:
LookupTable2d.h:32
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
fftjetcms::LookupTable2d::bwy_
double bwy_
Definition:
LookupTable2d.h:39
fftjetcms::LookupTable2d::data_
std::vector< double > data_
Definition:
LookupTable2d.h:31
Generated for CMSSW Reference Manual by
1.8.5