30 init(nbx, xmin, xmax, nby, ymin, ymax);
36 mContainer =
src.mContainer;
37 init(gsl::span<const T>(mContainer.data(), mContainer.size()));
46 if (!rhs.canFill() && rhs.getNBins()) {
47 throw std::runtime_error(
"trying to copy read-only histogram");
50 mContainer = rhs.mContainer;
51 init(gsl::span<const T>(mContainer.data(), mContainer.size()));
59 assert(ext.size() > NServiceSlots);
68 if (!(getNBinsX() ==
other.getNBinsX() && getXMin() ==
other.getXMin() && getXMax() ==
other.getXMax() &&
69 getNBinsY() ==
other.getNBinsY() && getYMin() ==
other.getYMin() && getYMax() ==
other.getYMax() &&
71 throw std::runtime_error(
"adding incompatible histos or destination histo is const");
73 for (uint32_t
i = getNBins();
i--;) {
74 mDataPtr[
i] +=
other.mDataPtr[
i];
81 if (!(getNBinsX() ==
other.getNBinsX() && getXMin() ==
other.getXMin() && getXMax() ==
other.getXMax() &&
82 getNBinsY() ==
other.getNBinsY() && getYMin() ==
other.getYMin() && getYMax() ==
other.getYMax() &&
84 throw std::runtime_error(
"subtracting incompatible histos or destination histo is const");
86 for (uint32_t
i = getNBins();
i--;) {
87 mDataPtr[
i] -=
other.mDataPtr[
i];
95 for (uint32_t
i = getNBins();
i--;) {
96 sum += getBinContent(
i);
104 assert(ext.size() > NServiceSlots);
105 mContainerView = ext;
106 mDataPtr =
const_cast<T*
>(&ext[NServiceSlots]);
107 mNBinsX = (uint32_t)ext[NBinsX];
108 mNBinsY = (uint32_t)ext[NBinsY];
113 mBinSizeX = ext[BinSizeX];
114 mBinSizeY = ext[BinSizeY];
115 mBinSizeXInv = 1. / mBinSizeX;
116 mBinSizeYInv = 1. / mBinSizeY;
122 assert(nbx > 0 && xmin < xmax);
123 assert(nby > 0 && ymin < ymax);
124 mContainer.resize(nbx * nby + NServiceSlots, 0.);
125 mContainer[NBinsX] = nbx;
126 mContainer[NBinsY] = nby;
127 mContainer[XMin] = xmin;
128 mContainer[XMax] = xmax;
129 mContainer[YMin] = ymin;
130 mContainer[YMax] = ymax;
131 mContainer[BinSizeX] = (xmax - xmin) / nbx;
132 mContainer[BinSizeY] = (ymax - ymin) / nby;
133 init(gsl::span<const T>(mContainer.data(), mContainer.size()));
139 auto h = std::make_unique<TH2F>(
name.c_str(),
name.c_str(), getNBinsX(), getXMin(), getXMax(), getNBinsY(), getYMin(), getYMax());
140 for (uint32_t
i = getNBinsX();
i--;) {
141 for (uint32_t
j = getNBinsY();
j--;) {
142 auto w = getBinContent(
i,
j);
144 h->SetBinContent(
i + 1,
j + 1,
w);
154 auto h = std::make_unique<TH1F>(
name.c_str(),
name.c_str(), getNBinsY(), getYMin(), getYMax());
155 if (binX < getNBinsX()) {
156 for (uint32_t
i = getNBinsY();
i--;) {
157 h->SetBinContent(
i + 1, getBinContent(binX,
i));
166 auto h = std::make_unique<TH1F>(
name.c_str(),
name.c_str(), getNBinsX(), getXMin(), getXMax());
167 if (binY < getNBinsY()) {
168 for (uint32_t
i = getNBinsX();
i--;) {
169 h->SetBinContent(
i + 1, getBinContent(
i, binY));
2D messeageable histo class
Class for time synchronization of RawReader instances.
float sum(float s, o2::dcs::DataPointValue v)
GLuint const GLchar * name
GLubyte GLubyte GLubyte GLubyte w
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other