Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
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
(
8
unsigned
nx,
double
xmin
,
double
xmax
,
unsigned
ny,
double
ymin
,
double
ymax
,
const
std::vector<double>&
data
)
9
: data_(data),
10
nx_(nx),
11
ny_(ny),
12
xmin_(xmin),
13
xmax_(xmax),
14
ymin_(ymin),
15
ymax_(ymax),
16
bwx_((xmax - xmin) / nx),
17
bwy_((ymax - ymin) / ny) {
18
assert
(
nx_
);
19
assert
(
ny_
);
20
assert
(
xmin_
<
xmax_
);
21
assert
(
ymin_
<
ymax_
);
22
assert
(
data_
.size() ==
nx_
*
ny_
);
23
}
24
25
double
LookupTable2d::closest
(
const
double
x,
const
double
y)
const
{
26
const
unsigned
ix = x <=
xmin_
? 0U
27
: x >=
xmax_
-
bwx_
/ 2.0 ?
nx_
- 1U
28
:
static_cast<
unsigned
>
((x -
xmin_
) /
bwx_
);
29
const
unsigned
iy = y <=
ymin_
? 0U
30
: y >=
ymax_
-
bwy_
/ 2.0 ?
ny_
- 1U
31
:
static_cast<
unsigned
>
((y -
ymin_
) /
bwy_
);
32
return
data_
[ix *
ny_
+ iy];
33
}
34
}
// namespace fftjetcms
fftjetcms::LookupTable2d::ymax_
double ymax_
Definition:
LookupTable2d.h:33
fftjetcms::LookupTable2d::xmax_
double xmax_
Definition:
LookupTable2d.h:31
fftjetcms::LookupTable2d::xmin_
double xmin_
Definition:
LookupTable2d.h:30
fftjetcms::LookupTable2d::ymin_
double ymin_
Definition:
LookupTable2d.h:32
LookupTable2d.h
SiStrip_OfflineMonitoring_cff.ymax
tuple ymax
Definition:
SiStrip_OfflineMonitoring_cff.py:53
cms::cuda::assert
assert(be >=bs)
fftjetcms::LookupTable2d::closest
double closest(double x, double y) const
Definition:
LookupTable2d.cc:25
fftjetcms::LookupTable2d::LookupTable2d
LookupTable2d()=delete
fftjetcms::LookupTable2d::ny_
unsigned ny_
Definition:
LookupTable2d.h:29
SiStrip_OfflineMonitoring_cff.ymin
tuple ymin
Definition:
SiStrip_OfflineMonitoring_cff.py:52
hlt_dqm_clientPB-live_cfg.xmax
tuple xmax
Definition:
hlt_dqm_clientPB-live_cfg.py:51
fftjetcms::LookupTable2d::bwx_
double bwx_
Definition:
LookupTable2d.h:34
fftjetcms::LookupTable2d::nx_
unsigned nx_
Definition:
LookupTable2d.h:28
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
fftjetcms::LookupTable2d::bwy_
double bwy_
Definition:
LookupTable2d.h:35
fftjetcms::LookupTable2d::data_
std::vector< double > data_
Definition:
LookupTable2d.h:27
hlt_dqm_clientPB-live_cfg.xmin
tuple xmin
Definition:
hlt_dqm_clientPB-live_cfg.py:50
Generated for CMSSW Reference Manual by
1.8.5