9 double deltaX = rangeX.second - rangeX.first;
10 double deltaY = rangeY.second - rangeY.first;
11 double length = hypot(deltaX, deltaY);
15 int min_i, max_i, min_j, max_j;
16 if (rangeX.first < rangeX.second) {
17 min_i = (int) ceil(rangeX.first / stepX);
18 max_i = (int) floor(rangeX.second / stepX) + 1;
20 min_i = (int) ceil(rangeX.second / stepX);
21 max_i = (int) floor(rangeX.first / stepX) + 1;
23 if (rangeY.first < rangeY.second) {
24 min_j = (int) ceil(rangeY.first / stepY);
25 max_j = (int) floor(rangeY.second / stepY) + 1;
27 min_j = (int) ceil(rangeY.second / stepY);
28 max_j = (int) floor(rangeY.first / stepY) + 1;
31 int steps = max_i-min_i + max_j-min_j + 2;
32 std::vector<position>
v;
36 v.push_back(
position(0., rangeX.first, rangeY.first) );
38 for (
int i = min_i;
i < max_i; ++
i) {
40 y = rangeY.first + (x - rangeX.first) * deltaY / deltaX;
41 f = std::fabs( (x - rangeX.first) / deltaX );
44 for (
int i = min_j;
i < max_j; ++
i) {
46 x = rangeX.first + (y - rangeY.first) * deltaX / deltaY;
47 f = std::fabs( (y - rangeY.first) / deltaY );
50 v.push_back(
position(1., rangeX.second, rangeY.second) );
56 std::vector<position>
result;
57 result.push_back( v.front() );
58 for (
int i = 1,
s = v.size();
i <
s; ++
i) {
59 double mx = (v[
i].x + v[
i-1].x) / 2.;
60 double my = (v[
i].y + v[
i-1].y) / 2.;
61 double df = (v[
i].f - v[
i-1].f);
64 result.push_back(
position( df, mx, my ) );
97 for (
size_t i = 0,
s = v.size();
i <
s; ++
i) {
110 for (
size_t i = 0,
s = v.size();
i <
s; ++
i) {
125 (*m_normalization)[
i] = 1.;
boost::shared_ptr< ColorMap > m_colormap
std::vector< position > splitSegment(Range x, Range y) const
split a segment into a vector of points
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void check_weight(const std::vector< double > &weight)
check the weights passed as an std::vector have the correct size
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::vector< boost::shared_ptr< Histogram > > m_histograms
boost::shared_ptr< Histogram > m_normalization
static int position[264][3]
void fill(double x, double y, const std::vector< double > &weight, double norm)
fill one point
void normalize(void)
normalize the histograms
std::pair< double, double > Range