CMS 3D CMS Logo

L1TFillWithinLimits.cc
Go to the documentation of this file.
2 
4 
5 namespace dqmoffline {
6  namespace l1t {
7 
12  void fillWithinLimits(MonitorElement* mon, double value, double weight) {
13  double min(mon->getAxisMin(1));
14  double max(mon->getAxisMax(1));
15 
16  double fillValue = getFillValueWithinLimits(value, min, max);
17  mon->Fill(fillValue, weight);
18  }
19  void fill2DWithinLimits(MonitorElement* mon, double valueX, double valueY, double weight) {
20  double minX(mon->getAxisMin(1));
21  double minY(mon->getAxisMin(2));
22 
23  double maxX(mon->getAxisMax(1));
24  double maxY(mon->getAxisMax(2));
25 
26  double fillValueX = getFillValueWithinLimits(valueX, minX, maxX);
27  double fillValueY = getFillValueWithinLimits(valueY, minY, maxY);
28  mon->Fill(fillValueX, fillValueY, weight);
29  }
30 
31  double getFillValueWithinLimits(double value, double min, double max) {
32  if (value < min)
33  return min;
34 
35  // histograms are [min, max), hence fill with a slightly smaller value
36  if (value > max)
37  return max - 1e-6 * max;
38 
39  return value;
40  }
41 
42  } // namespace l1t
43 } // namespace dqmoffline
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
MessageLogger.h
min
T min(T a, T b)
Definition: MathUtil.h:58
HGVHistoProducerAlgoBlock_cfi.minX
minX
Definition: HGVHistoProducerAlgoBlock_cfi.py:168
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
L1TFillWithinLimits.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
dqmoffline::l1t::fillWithinLimits
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
Definition: L1TFillWithinLimits.cc:12
l1t
delete x;
Definition: CaloConfig.h:22
dqmoffline
Definition: HistDefinition.h:48
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:173
dqmoffline::l1t::fill2DWithinLimits
void fill2DWithinLimits(MonitorElement *mon, double valueX, double valueY, double weight=1.)
Definition: L1TFillWithinLimits.cc:19
value
Definition: value.py:1
dqmoffline::l1t::getFillValueWithinLimits
double getFillValueWithinLimits(double value, double min, double max)
Definition: L1TFillWithinLimits.cc:31
relativeConstraints.value
value
Definition: relativeConstraints.py:53
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:174
weight
Definition: weight.py:1
HGVHistoProducerAlgoBlock_cfi.maxX
maxX
Definition: HGVHistoProducerAlgoBlock_cfi.py:169
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37