#include <DTTimeEvolutionHisto.h>
Public Member Functions | |
void | accumulateValueTimeSlot (float value) |
DTTimeEvolutionHisto (DQMStore *dbe, const std::string &name, const std::string &title, int nbins, int firstLS, int lsPrescale, bool sliding, int mode=0) | |
DTTimeEvolutionHisto (DQMStore *dbe, const std::string &name, const std::string &title, int nbins, int lsPrescale, bool sliding, int mode=0) | |
DTTimeEvolutionHisto (DQMStore *dbe, const std::string &name) | |
retrieve the monitor element from DQMStore | |
void | normalizeTo (const MonitorElement *histForNorm) |
void | setTimeSlotValue (float value, int timeSlot) |
void | updateTimeSlot (int ls, int nEventsInLS) |
virtual | ~DTTimeEvolutionHisto () |
Destructor. | |
Private Attributes | |
bool | doSlide |
int | firstLSinTimeSlot |
MonitorElement * | histo |
int | nBookedBins |
int | nEventsInLastTimeSlot |
int | nLSinTimeSlot |
int | theFirstLS |
int | theLSPrescale |
int | theMode |
float | valueLastTimeSlot |
No description available.
Definition at line 18 of file DTTimeEvolutionHisto.h.
DTTimeEvolutionHisto::DTTimeEvolutionHisto | ( | DQMStore * | dbe, |
const std::string & | name, | ||
const std::string & | title, | ||
int | nbins, | ||
int | lsPrescale, | ||
bool | sliding, | ||
int | mode = 0 |
||
) |
Constructor Parameters are:
DTTimeEvolutionHisto::DTTimeEvolutionHisto | ( | DQMStore * | dbe, |
const std::string & | name, | ||
const std::string & | title, | ||
int | nbins, | ||
int | firstLS, | ||
int | lsPrescale, | ||
bool | sliding, | ||
int | mode = 0 |
||
) |
DTTimeEvolutionHisto::DTTimeEvolutionHisto | ( | DQMStore * | dbe, |
const std::string & | name | ||
) |
retrieve the monitor element from DQMStore
DTTimeEvolutionHisto::~DTTimeEvolutionHisto | ( | ) | [virtual] |
void DTTimeEvolutionHisto::accumulateValueTimeSlot | ( | float | value | ) |
Definition at line 180 of file DTTimeEvolutionHisto.cc.
References relativeConstraints::value, and valueLastTimeSlot.
Referenced by DTBlockedROChannelsTest::performClientDiagnostic().
{ valueLastTimeSlot += value; }
void DTTimeEvolutionHisto::normalizeTo | ( | const MonitorElement * | histForNorm | ) |
Definition at line 246 of file DTTimeEvolutionHisto.cc.
References newFWLiteAna::bin, MonitorElement::getBinContent(), MonitorElement::getNbinsX(), histo, and MonitorElement::setBinContent().
Referenced by DTSegmentAnalysisTest::endRun().
{ if(histo == 0) { LogWarning("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << "[DTTimeEvolutionHisto]***Error: pointer to ME is NULL" << endl; return; } int nBins = histo->getNbinsX(); if(histForNorm->getNbinsX() != nBins) { LogWarning("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << "[DTTimeEvolutionHisto]***Error: normalizing histos with != # of bins" << endl; return; } for(int bin = 1; bin <= nBins; ++bin) { // loop over bins if(histForNorm->getBinContent(bin) != 0) { double normValue = histo->getBinContent(bin)/histForNorm->getBinContent(bin); LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << "[DTTimeEvolutionHisto] Normalizing bin: " << bin << " to: " << histo->getBinContent(bin) << " / " << histForNorm->getBinContent(bin) << " = " << normValue << endl; histo->setBinContent(bin, normValue); } else { histo->setBinContent(bin, 0); } } }
void DTTimeEvolutionHisto::setTimeSlotValue | ( | float | value, |
int | timeSlot | ||
) |
Definition at line 155 of file DTTimeEvolutionHisto.cc.
References newFWLiteAna::bin, doSlide, MonitorElement::Fill(), MonitorElement::getBinContent(), MonitorElement::getBinError(), MonitorElement::getTH1F(), histo, nBookedBins, MonitorElement::setBinContent(), MonitorElement::setBinError(), and MonitorElement::setBinLabel().
Referenced by updateTimeSlot().
{ // LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") // << "[DTTimeEvolutionHisto] ME name: " << histo->getName() << endl; if(!doSlide) { // LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") // << " fill bin: " << timeSlot << " with value: " << value << endl; histo->Fill(timeSlot,value); } else { for(int bin = 1; bin != nBookedBins; ++bin) { float value = histo->getBinContent(bin); // LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") // << " bin: " << bin << " has value: " << value << endl; if(bin == 1) { // average of previous time slots (fixme) histo->setBinContent(bin, (value + histo->getBinContent(bin+1))/2.); } else if(bin != nBookedBins) { histo->setBinContent(bin, histo->getBinContent(bin+1)); histo->setBinError(bin, histo->getBinError(bin+1)); histo->setBinLabel(bin, histo->getTH1F()->GetXaxis()->GetBinLabel(bin+1),1); } } histo->setBinContent(nBookedBins, value); } }
void DTTimeEvolutionHisto::updateTimeSlot | ( | int | ls, |
int | nEventsInLS | ||
) |
Definition at line 186 of file DTTimeEvolutionHisto.cc.
References doSlide, firstLSinTimeSlot, MonitorElement::getBinContent(), histo, python::rootplot::utilities::ls(), nBookedBins, nEventsInLastTimeSlot, nLSinTimeSlot, MonitorElement::setBinLabel(), setTimeSlotValue(), theFirstLS, theLSPrescale, theMode, relativeConstraints::value, and valueLastTimeSlot.
Referenced by DTSegmentAnalysisTask::endLuminosityBlock(), and DTBlockedROChannelsTest::performClientDiagnostic().
{ if(doSlide) { // sliding bins // count LS in this time-slot nLSinTimeSlot++; nEventsInLastTimeSlot += nEventsInLS; if(nLSinTimeSlot == 1) firstLSinTimeSlot = ls; if(nLSinTimeSlot%theLSPrescale ==0) { // update the value of the slot and reset the counters LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << "[DTTimeEvolutionHisto] Update time-slot, # entries: " << valueLastTimeSlot << " # events: " << nEventsInLastTimeSlot << endl; // set the bin content float value = 0; if(theMode == 0) { if(nEventsInLastTimeSlot != 0) value = valueLastTimeSlot/(float)nEventsInLastTimeSlot; } else if(theMode == 1) { value = valueLastTimeSlot; } else if(theMode == 2) { value = nEventsInLastTimeSlot; } else if(theMode == 3) { value = valueLastTimeSlot/theLSPrescale; } setTimeSlotValue(value, nBookedBins); LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << " updated value: " << histo->getBinContent(nBookedBins) << endl; // set the bin label stringstream binLabel; binLabel << "LS " << firstLSinTimeSlot; if(nLSinTimeSlot > 1) binLabel << "-" << ls; histo->setBinLabel(nBookedBins,binLabel.str(),1); // reset the counters for the time slot nLSinTimeSlot = 0; nEventsInLastTimeSlot = 0; valueLastTimeSlot = 0; } } else { int binN = (int)ls-(theFirstLS-1)/(int)theLSPrescale; // set the bin content float value = 0; if(theMode == 1) { value = valueLastTimeSlot; } else if(theMode == 2) { value = nEventsInLS; } else if(theMode == 3) { value = valueLastTimeSlot/theLSPrescale; } LogVerbatim("DTDQM|DTMonitorModule|DTMonitorClient|DTTimeEvolutionHisto") << "[DTTimeEvolutionHisto] Update time-slot: "<< binN << " with value: " << value << endl; setTimeSlotValue(value,binN); } }
bool DTTimeEvolutionHisto::doSlide [private] |
Definition at line 74 of file DTTimeEvolutionHisto.h.
Referenced by setTimeSlotValue(), and updateTimeSlot().
int DTTimeEvolutionHisto::firstLSinTimeSlot [private] |
Definition at line 77 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
MonitorElement* DTTimeEvolutionHisto::histo [private] |
Definition at line 79 of file DTTimeEvolutionHisto.h.
Referenced by normalizeTo(), setTimeSlotValue(), and updateTimeSlot().
int DTTimeEvolutionHisto::nBookedBins [private] |
Definition at line 76 of file DTTimeEvolutionHisto.h.
Referenced by setTimeSlotValue(), and updateTimeSlot().
int DTTimeEvolutionHisto::nEventsInLastTimeSlot [private] |
Definition at line 71 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
int DTTimeEvolutionHisto::nLSinTimeSlot [private] |
Definition at line 75 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
int DTTimeEvolutionHisto::theFirstLS [private] |
Definition at line 72 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
int DTTimeEvolutionHisto::theLSPrescale [private] |
Definition at line 73 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
int DTTimeEvolutionHisto::theMode [private] |
Definition at line 78 of file DTTimeEvolutionHisto.h.
Referenced by updateTimeSlot().
float DTTimeEvolutionHisto::valueLastTimeSlot [private] |
Definition at line 70 of file DTTimeEvolutionHisto.h.
Referenced by accumulateValueTimeSlot(), and updateTimeSlot().