18 typedef std::pair<double, double>
Range;
56 m_histograms( m_size ),
62 m_histograms[
i].reset(
new Histogram( 0, 0, bins_x, x.first, x.second, bins_y, y.first, y.second ));
63 m_histograms[
i]->SetMinimum( 0. );
64 m_histograms[
i]->SetMaximum( max[
i] );
66 m_normalization.reset(
new Histogram( 0, 0, bins_x, x.first, x.second, bins_y, y.first, y.second ));
67 m_colormap.reset(
new ColorMap( 0, 0, bins_x, x.first, x.second, bins_y, y.first, y.second ));
68 m_colormap->SetMinimum( 0 );
69 m_colormap->SetMaximum( zones );
74 void fill(
double x,
double y,
const std::vector<double> &
weight,
double norm );
77 void fill(
double x,
double y,
const std::vector<double> & weight,
double norm,
unsigned int colour );
80 void fill(
const Range& x,
const Range& y,
const std::vector<double> & weight,
double norm );
83 void fill(
const Range& x,
const Range& y,
const std::vector<double> & weight,
double norm,
unsigned int colour );
89 Histogram *
get(
size_t h = 0)
const 92 return (Histogram *) m_histograms[
h]->Clone(0);
100 return (Histogram *) m_normalization->Clone(0);
106 return (ColorMap *) m_colormap->Clone(0);
124 position(
double f_,
double x_,
double y_) : f(f_), x(x_), y(y_) { }
132 std::vector<position>
splitSegment( Range x, Range y )
const;
138 if (weight.size() !=
m_size)
139 throw std::invalid_argument(
"weight: wrong number of elements");
144 #endif // XHistogram_h
ColorMap * colormap(void) const
access the colormap
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
XHistogram(size_t size, size_t bins_x, size_t bins_y, Range x, Range y, size_t zones, const std::vector< double > &max)
std::vector< position > splitSegment(Range x, Range y) const
split a segment into a vector of points
void check_weight(const std::vector< double > &weight) noexcept(false)
check the weights passed as an std::vector have the correct size
position(double f_, double x_, double y_)
std::shared_ptr< ColorMap > m_colormap
std::shared_ptr< Histogram > m_normalization
bool operator<(const position &other) const
XHistogram(void)
default CTOR
std::shared_ptr< Histogram > m_dummy
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
Histogram * normalization(void) const
access the normalization
std::vector< std::shared_ptr< Histogram > > m_histograms