13 :
MESetEcal(_fullPath, _otype, _btype, _kind, 1, _xaxis, _yaxis),
24 throw_(
"Unsupported MonitorElement kind");
29 :
MESetEcal(_orig), minutely_(_orig.minutely_), shiftAxis_(_orig.shiftAxis_), currentBin_(_orig.currentBin_) {}
32 MESetTrend const *pRhs(dynamic_cast<MESetTrend const *>(&_rhs));
62 time_t localTime(time(
nullptr));
64 gmtime_r(&localTime, &timeBuffer);
65 unsigned utcTime(mktime(&timeBuffer));
71 xaxis.
high = xaxis.
low + 200 * 60.;
82 for (
unsigned iME(0); iME <
mes_.size(); ++iME)
83 mes_[iME]->getTH1()->GetXaxis()->SetTimeDisplay(1);
98 fill_(iME, _t + 0.5, _wy, _w);
113 fill_(iME, _t + 0.5, _wy, _w);
125 fill_(iME, _t + 0.5, _wy, _w);
131 if (
mes_.size() != 1)
132 throw_(
"MESet type incompatible");
135 fill_(0, _t + 0.5, _wy, _w);
145 return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
158 return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
168 return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
174 if (
mes_.size() != 1)
175 throw_(
"MESet type incompatible");
177 return mes_[0]->getTH1()->FindBin(_t + 0.5, _y);
182 throw_(
"Cumulative flag set for a profile plot");
187 TAxis *tAxis(
mes_[0]->getTH1()->GetXaxis());
188 int nbinsX(tAxis->GetNbins());
189 unsigned tLow(tAxis->GetBinLowEdge(1));
190 unsigned tHigh(tAxis->GetBinUpEdge(nbinsX));
193 return _t >= tLow && _t < tHigh;
196 int unitsPerBin((tHigh - tLow) / nbinsX);
198 if (_t >= tLow && _t < tHigh) {
200 int thisBin(tAxis->FindBin(_t + 0.5));
204 for (
unsigned iME(0); iME <
mes_.size(); iME++) {
206 int nbinsY(me->
getTH1()->GetNbinsY());
207 for (
int iy(1); iy <= nbinsY; ++iy) {
222 }
else if (_t >= tHigh) {
223 dBin = (_t - tHigh) / unitsPerBin + 1;
226 }
else if (_t < tLow) {
232 for (
unsigned iME(0); iME <
mes_.size(); iME++) {
236 int iMax(nbinsX + 1);
237 while (--iMax > 0 && !filled) {
248 for (
int iy(1); iy <= me->
getNbinsY(); iy++) {
256 for (
int iy(1); iy <= me->
getNbinsY(); iy++) {
272 if (_t < tLow - (nbinsX - maxBin) * unitsPerBin)
275 dBin = (_t - tLow) / unitsPerBin - 1;
278 int start(dBin > 0 ? dBin + 1 : nbinsX + dBin);
279 int end(dBin > 0 ? nbinsX + 1 : 0);
280 int step(dBin > 0 ? 1 : -1);
282 tLow += dBin * unitsPerBin;
283 tHigh += dBin * unitsPerBin;
285 for (
unsigned iME(0); iME <
mes_.size(); iME++) {
288 me->
getTH1()->GetXaxis()->SetLimits(tLow, tHigh);
290 if ((end - start) / step < 0) {
301 for (; ix !=
end; ix +=
step) {
303 entries += binContent;
307 ix = end - dBin - 1 *
step;
310 for (ix += step; ix !=
end; ix +=
step) {
317 for (; ix !=
end; ix +=
step) {
320 entries += binEntries;
323 if (binEntries > 0) {
325 double sumw2((
rms *
rms + binContent * binContent) * binEntries);
331 for (; ix !=
end; ix +=
step) {
340 for (; ix !=
end; ix +=
step) {
341 for (
int iy(1); iy <= nbinsY; iy++) {
342 int orig(me->
getTH1()->GetBin(ix, iy));
343 int dest(me->
getTH1()->GetBin(ix - dBin, iy));
345 entries += binContent;
353 ix = end - dBin - 1 *
step;
354 std::vector<double> lastContent;
355 std::vector<double> lastError;
356 for (
int iy(1); iy <= nbinsY; iy++) {
360 for (ix += step; ix !=
end; ix +=
step) {
361 for (
int iy(1); iy <= nbinsY; iy++) {
371 for (; ix !=
end; ix +=
step) {
372 for (
int iy(1); iy <= nbinsY; iy++) {
373 int orig(me->
getTH1()->GetBin(ix, iy));
374 int dest(me->
getTH1()->GetBin(ix - dBin, iy));
377 entries += binEntries;
380 if (binEntries > 0) {
382 double sumw2((
rms *
rms + binContent * binContent) * binEntries);
389 for (; ix !=
end; ix +=
step) {
390 for (
int iy(1); iy <= nbinsY; iy++) {
MonitorElement::Kind kind_
virtual void setAxisTitle(std::string const &, int=1)
MESet & operator=(MESet const &) override
virtual int getNbinsY() const
get # of bins in Y-axis
MESet * clone(std::string const &="") const override
virtual void setEntries(double nentries)
set # of entries
constexpr unsigned int maxBin
virtual void checkME_(unsigned _iME) const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
void fill(EcalDQMSetupObjects const, DetId const &, double, double=1., double=1.) override
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
int findBin(EcalDQMSetupObjects const, DetId const &, double, double=0.) const override
void throw_(std::string const &_message) const
virtual double getBinContent(int binx) const
get content of bin (1-D)
EcalElectronicsMapping const * electronicsMap
void book(DQMStore::IBooker &, EcalElectronicsMapping const *) override
virtual void fill_(unsigned, int, double)
unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &)
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MESetTrend(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=nullptr, binning::AxisSpecs const *=nullptr)
virtual double getBinEntries(int bin) const
get # of bin entries (for profiles)
MESet & operator=(MESet const &) override
void book(DQMStore::IBooker &, EcalElectronicsMapping const *) override
binning::ObjectType otype_
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
binning::AxisSpecs const * xaxis_
virtual const_iterator end(EcalElectronicsMapping const *electronicsMap) const
binning::BinningType btype_
virtual TH1 * getTH1() const
std::vector< MonitorElement * > mes_