CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1GetHistLimits Class Reference

#include <L1GetHistLimits.h>

Classes

struct  L1HistLimits
 
struct  Tokens
 

Public Member Functions

 L1GetHistLimits (const Tokens &, const edm::EventSetup &evSetup)
 
const std::vector< float > & l1HistBinThresholds (const L1GtObject &l1GtObject, const std::string &quantity)
 
const L1HistLimitsl1HistLimits (const L1GtObject &l1GtObject, const std::string &quantity)
 
const L1HistLimitsl1HistLimits (const L1GtObject &l1GtObject, const std::string &quantity, const double histMinValue, const double histMaxValue)
 
const double l1HistLowerBinValue (const L1GtObject &l1GtObject, const std::string &quantity)
 
const int l1HistNrBins (const L1GtObject &l1GtObject, const std::string &quantity)
 
const double l1HistUpperBinValue (const L1GtObject &l1GtObject, const std::string &quantity)
 
virtual ~L1GetHistLimits ()
 

Private Member Functions

void getHistLimits (const L1GtObject &l1GtObject, const std::string &quantity)
 

Private Attributes

const edm::EventSetupm_evSetup
 
L1HistLimits m_l1HistLimits
 all limits for a histogram More...
 
const Tokensm_tokens
 

Detailed Description

Description: use L1 scales to define histogram limits for L1 trigger objects.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 52 of file L1GetHistLimits.h.

Constructor & Destructor Documentation

◆ L1GetHistLimits()

L1GetHistLimits::L1GetHistLimits ( const Tokens tokens,
const edm::EventSetup evSetup 
)
explicit

Definition at line 47 of file L1GetHistLimits.cc.

48  : m_tokens(tokens), m_evSetup(evSetup) {
49  //
50 }
const edm::EventSetup & m_evSetup
const Tokens & m_tokens

◆ ~L1GetHistLimits()

L1GetHistLimits::~L1GetHistLimits ( )
virtual

Definition at line 53 of file L1GetHistLimits.cc.

53  {
54  // empty
55 }

Member Function Documentation

◆ getHistLimits()

void L1GetHistLimits::getHistLimits ( const L1GtObject l1GtObject,
const std::string &  quantity 
)
private

for a L1 trigger object and a given quantity, compute the number of bins, the lower limit of the first bin, the upper limit of the last bin and the vector of bin thresholds

Definition at line 57 of file L1GetHistLimits.cc.

References L1GetHistLimits::L1HistLimits::binThresholds, BPTX, Castor, CenJet, L1CaloGeometry::emJetPhiBinHighEdge(), L1CaloGeometry::emJetPhiBinLowEdge(), ETM, L1CaloGeometry::etSumPhiBinHighEdge(), L1CaloGeometry::etSumPhiBinLowEdge(), ETT, ForJet, edm::EventSetup::getData(), L1MuTriggerScales::getGMTEtaScale(), L1GctJetFinderParams::getHtLsbGeV(), L1MuScale::getNBins(), L1MuTriggerScales::getPhiScale(), L1MuTriggerPtScale::getPtScale(), L1MuScale::getScaleMax(), L1MuScale::getScaleMin(), L1CaloEtScale::getThresholds(), L1MuScale::getValue(), L1CaloGeometry::globalEtaBinHighEdge(), L1CaloGeometry::globalEtaBinLowEdge(), HfBitCounts, HfRingEtSums, HTM, L1CaloGeometry::htSumPhiBinHighEdge(), L1CaloGeometry::htSumPhiBinLowEdge(), HTT, IsoEG, dqmiolumiharvest::j, JetCounts, wplusjetsAnalysis_cfi::jetScale, L1GctEtHad::kEtHadMaxValue, L1GctEtMiss::kEtMissMaxValue, L1GctEtTotal::kEtTotalMaxValue, L1CaloEtScale::linearLsb(), LogDebug, L1GetHistLimits::L1HistLimits::lowerBinValue, L1GetHistLimits::Tokens::m_caloGeomESHToken, L1GetHistLimits::Tokens::m_etScaleToken, m_evSetup, L1GetHistLimits::Tokens::m_hfRingEtScaleToken, L1GetHistLimits::Tokens::m_htMissScaleToken, L1GetHistLimits::Tokens::m_jetFinderParamsToken, L1GetHistLimits::Tokens::m_jetScaleToken, m_l1HistLimits, L1GetHistLimits::Tokens::m_muPTScaleToken, L1GetHistLimits::Tokens::m_muScalesToken, m_tokens, Mu, NoIsoEG, L1GetHistLimits::L1HistLimits::nrBins, L1CaloGeometry::numberGctCentralEtaBinsPerHalf(), L1CaloGeometry::numberGctEmJetPhiBins(), L1CaloGeometry::numberGctEtSumPhiBins(), L1CaloGeometry::numberGctForwardEtaBinsPerHalf(), L1CaloGeometry::numberGctHtSumPhiBins(), MjjMonitor_cfi::quantity, R3BINS, R3MAX, R3MIN, rad2deg(), TauJet, TechTrig, and L1GetHistLimits::L1HistLimits::upperBinValue.

Referenced by l1HistBinThresholds(), l1HistLimits(), l1HistLowerBinValue(), l1HistNrBins(), and l1HistUpperBinValue().

57  {
62 
63  // number of objects is independent of the object type
64  // and hardcoded in the actual version
65  if (quantity == "NrObjects") {
69 
71 
72  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
76  }
77 
78  // set last bin upper edge
80 
81  return;
82  }
83 
84  switch (l1GtObject) {
85  case Mu: {
86  if (quantity == "PT") {
88 
89  m_l1HistLimits.nrBins = muPtScale.getPtScale()->getNBins();
92 
94 
95  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
96  m_l1HistLimits.binThresholds[iBin] = muPtScale.getPtScale()->getValue(iBin);
97  }
98 
99  // last limit for muon is set too high (10^6) - resize the last bin
100 
102 
103  // limit the size of the last bin to maximum 200 GeV
104  float maxLaxtBinsize = 200;
105  if (lastBinSize >= maxLaxtBinsize) {
109  LogDebug("L1GetHistLimits") << "\n L1ExtraMuon: PT histogram"
110  << "\nm_l1HistLimits.upperBinValue truncated to = "
111  << m_l1HistLimits.upperBinValue << std::endl;
112  }
113 
114  // set last bin upper edge
116 
117  } else if (quantity == "eta" || quantity == "phi") {
119 
120  if (quantity == "eta") {
121  // eta scale defined for positive values - need to be symmetrized
122  int histNrBinsHalf = muScales.getGMTEtaScale()->getNBins();
125 
126  m_l1HistLimits.nrBins = 2 * histNrBinsHalf;
128 
130 
131  int iBin = 0;
132  for (int j = histNrBinsHalf; j > 0; j--, iBin++) {
133  m_l1HistLimits.binThresholds[iBin] = (-1) * muScales.getGMTEtaScale()->getValue(j);
134  }
135  for (int j = 0; j <= histNrBinsHalf; j++, iBin++) {
137  }
138 
139  // set last bin upper edge
141 
142  } else {
143  m_l1HistLimits.nrBins = muScales.getPhiScale()->getNBins();
146 
148 
149  for (int iBin = 0; iBin <= m_l1HistLimits.nrBins; iBin++) {
150  m_l1HistLimits.binThresholds[iBin] = rad2deg(muScales.getPhiScale()->getValue(iBin));
151  }
152 
153  // set last bin upper edge
155  }
156  }
157 
158  } break;
159  case NoIsoEG:
160  case IsoEG: {
161  // common scales for NoIsoEG and IsoEG
162  if (quantity == "ET") {
164 
165  std::vector<double> emThresholds = emScale.getThresholds();
166  m_l1HistLimits.nrBins = emThresholds.size();
167  m_l1HistLimits.lowerBinValue = emThresholds.at(0);
168 
169  // FIXME high edge retrieval in the scale definition
170  // now, last bin has the same width like the last but one
172  emThresholds[m_l1HistLimits.nrBins - 1] +
173  (emThresholds[m_l1HistLimits.nrBins - 1] - emThresholds[m_l1HistLimits.nrBins - 2]);
174 
176 
177  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
178  m_l1HistLimits.binThresholds[iBin] = static_cast<float>(emThresholds[iBin]);
179  }
180 
181  // set last bin upper edge
183 
184  } else if (quantity == "eta" || quantity == "phi") {
185  const L1CaloGeometry* caloGeomScales = &m_evSetup.getData(m_tokens.m_caloGeomESHToken);
186 
187  if (quantity == "eta") {
189  2 * (caloGeomScales->numberGctCentralEtaBinsPerHalf() + caloGeomScales->numberGctForwardEtaBinsPerHalf());
190  m_l1HistLimits.lowerBinValue = caloGeomScales->globalEtaBinLowEdge(0);
192 
194 
195  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
196  m_l1HistLimits.binThresholds[iBin] = caloGeomScales->globalEtaBinLowEdge(iBin);
197  }
198 
199  // set last bin upper edge
201 
202  } else {
203  m_l1HistLimits.nrBins = caloGeomScales->numberGctEmJetPhiBins();
205 
206  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
207  m_l1HistLimits.binThresholds[iBin] = rad2deg(caloGeomScales->emJetPhiBinLowEdge(iBin));
208 
209  // treat correctly the 10 deg anti-clockwise rotation
210  if (rad2deg(caloGeomScales->emJetPhiBinHighEdge(iBin)) < m_l1HistLimits.binThresholds[iBin]) {
212  }
213  }
214 
216 
217  // last bin upper limit
219 
221  }
222  }
223 
224  } break;
225  case CenJet:
226  case ForJet:
227  case TauJet: {
228  // common scales for all jets
229  if (quantity == "ET") {
231 
232  std::vector<double> jetThresholds = jetScale.getThresholds();
233  m_l1HistLimits.nrBins = jetThresholds.size();
234  m_l1HistLimits.lowerBinValue = jetThresholds.at(0);
235 
236  // FIXME high edge retrieval in the scale definition
237  // now, last bin has the same width like the last but one
239  jetThresholds[m_l1HistLimits.nrBins - 1] +
240  (jetThresholds[m_l1HistLimits.nrBins - 1] - jetThresholds[m_l1HistLimits.nrBins - 2]);
241 
243 
244  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
245  m_l1HistLimits.binThresholds[iBin] = static_cast<float>(jetThresholds[iBin]);
246  }
247 
248  // set last bin upper edge
250 
251  } else if (quantity == "eta" || quantity == "phi") {
252  const L1CaloGeometry* caloGeomScales = &m_evSetup.getData(m_tokens.m_caloGeomESHToken);
253 
254  if (quantity == "eta") {
256  2 * (caloGeomScales->numberGctCentralEtaBinsPerHalf() + caloGeomScales->numberGctForwardEtaBinsPerHalf());
257  m_l1HistLimits.lowerBinValue = caloGeomScales->globalEtaBinLowEdge(0);
259 
261 
262  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
263  m_l1HistLimits.binThresholds[iBin] = caloGeomScales->globalEtaBinLowEdge(iBin);
264  }
265 
266  // set last bin upper edge
268 
269  } else {
270  m_l1HistLimits.nrBins = caloGeomScales->numberGctEmJetPhiBins();
272 
273  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
274  m_l1HistLimits.binThresholds[iBin] = rad2deg(caloGeomScales->emJetPhiBinLowEdge(iBin));
275 
276  // treat correctly the 10 deg anti-clockwise rotation
277  if (rad2deg(caloGeomScales->emJetPhiBinHighEdge(iBin)) < m_l1HistLimits.binThresholds[iBin]) {
279  }
280  }
281 
283 
284  // last bin upper limit
286 
288  }
289  }
290  } break;
291  case ETM: {
292  if (quantity == "ET") {
294 
295  const double etSumLSB = etMissScale.linearLsb();
296 
298 
301 
303 
304  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
305  m_l1HistLimits.binThresholds[iBin] = iBin * etSumLSB;
306  }
307 
308  // set last bin upper edge
310 
311  } else if (quantity == "eta" || quantity == "phi") {
312  const L1CaloGeometry* caloGeomScales = &m_evSetup.getData(m_tokens.m_caloGeomESHToken);
313 
314  if (quantity == "eta") {
315  // do nothing, eta is not defined for ETM
316 
317  } else {
318  m_l1HistLimits.nrBins = caloGeomScales->numberGctEtSumPhiBins();
321 
323 
324  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
325  m_l1HistLimits.binThresholds[iBin] = rad2deg(caloGeomScales->etSumPhiBinLowEdge(iBin));
326  }
327 
328  // last bin upper limit
330  }
331  }
332 
333  } break;
334  case ETT: {
335  if (quantity == "ET") {
337 
338  const double etSumLSB = etMissScale.linearLsb();
339 
341 
344 
346 
347  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
348  m_l1HistLimits.binThresholds[iBin] = iBin * etSumLSB;
349  }
350 
351  // set last bin upper edge
353 
354  } else if (quantity == "eta" || quantity == "phi") {
355  // do nothing, eta and phi are not defined for ETT
356  }
357 
358  } break;
359  case HTT: {
360  if (quantity == "ET") {
362  double htSumLSB = jetFinderParams.getHtLsbGeV();
363 
365 
368 
370 
371  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
372  m_l1HistLimits.binThresholds[iBin] = iBin * htSumLSB;
373  }
374 
375  // set last bin upper edge
377 
378  } else if (quantity == "eta" || quantity == "phi") {
379  // do nothing, eta and phi are not defined for HTT
380  }
381  } break;
382  case HTM: {
383  if (quantity == "ET") {
385 
386  const std::vector<double>& htThresholds = htMissScale.getThresholds();
387  m_l1HistLimits.nrBins = htThresholds.size();
388  m_l1HistLimits.lowerBinValue = htThresholds[0];
389 
390  // FIXME high edge retrieval in the scale definition
391  // now, last bin has the same width like the last but one
393  htThresholds[m_l1HistLimits.nrBins - 1] +
394  (htThresholds[m_l1HistLimits.nrBins - 1] - htThresholds[m_l1HistLimits.nrBins - 2]);
395 
397 
398  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
399  m_l1HistLimits.binThresholds[iBin] = static_cast<float>(htThresholds[iBin]);
400  }
401 
402  // set last bin upper edge
404 
405  } else if (quantity == "eta" || quantity == "phi") {
406  const L1CaloGeometry* caloGeomScales = &m_evSetup.getData(m_tokens.m_caloGeomESHToken);
407 
408  if (quantity == "eta") {
409  // do nothing, eta is not defined for HTM
410 
411  } else {
412  m_l1HistLimits.nrBins = caloGeomScales->numberGctHtSumPhiBins();
415 
417 
418  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
419  m_l1HistLimits.binThresholds[iBin] = rad2deg(caloGeomScales->htSumPhiBinLowEdge(iBin));
420  }
421 
422  // last bin upper limit
424  }
425  }
426  } break;
427  case JetCounts: {
428  } break;
429  case HfBitCounts: {
430  // there are no scales for HfBitCounts, so one implements a fixed scale
431  // use same values as GCT for 3 bits
432  const unsigned int R3BINS = 8;
433  const float R3MIN = -0.5;
434  const float R3MAX = 7.5;
435 
439 
441 
442  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
443  m_l1HistLimits.binThresholds[iBin] = R3MIN + iBin * (R3MAX - R3MIN) / R3BINS;
444  }
445 
446  // last bin upper limit
448 
449  } break;
450  case HfRingEtSums: {
451  if (quantity == "ET") {
453 
454  const std::vector<double>& hfRingEtThresholds = hfRingEtScale.getThresholds();
455  m_l1HistLimits.nrBins = hfRingEtThresholds.size();
456  m_l1HistLimits.lowerBinValue = hfRingEtThresholds[0];
457 
458  // FIXME high edge retrieval in the scale definition
459  // now, last bin has the same width like the last but one
461  hfRingEtThresholds[m_l1HistLimits.nrBins - 1] +
462  (hfRingEtThresholds[m_l1HistLimits.nrBins - 1] - hfRingEtThresholds[m_l1HistLimits.nrBins - 2]);
463 
465 
466  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
467  m_l1HistLimits.binThresholds[iBin] = static_cast<float>(hfRingEtThresholds[iBin]);
468  }
469 
470  // set last bin upper edge
472 
473  } else if (quantity == "eta" || quantity == "phi") {
474  // do nothing, eta and phi are not defined for HfRingEtSums
475  }
476  } break;
477  case TechTrig:
478  case Castor:
479  case BPTX:
480  default: {
481  // do nothing, for these cases ET/PT, eta and phi are not defined
482 
483  } break;
484  }
485 }
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
const edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > m_muPTScaleToken
virtual float getScaleMax() const =0
get the upper edge of the last bin
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66
const edm::ESGetToken< L1GctJetFinderParams, L1GctJetFinderParamsRcd > m_jetFinderParamsToken
const edm::EventSetup & m_evSetup
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Definition: L1GtObject.h:38
double emJetPhiBinHighEdge(unsigned int phiIndex) const
L1HistLimits m_l1HistLimits
all limits for a histogram
const edm::ESGetToken< L1CaloEtScale, L1HfRingEtScaleRcd > m_hfRingEtScaleToken
Definition: L1GtObject.h:35
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_caloGeomESHToken
const L1MuScale * getPhiScale() const
get the phi scale
const L1MuScale * getPtScale() const
get the Pt scale
Definition: L1GtObject.h:37
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_muScalesToken
unsigned int numberGctEtSumPhiBins() const
const unsigned int R3BINS
Definition: L1TGCT.cc:44
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
virtual float getScaleMin() const =0
get the lower edge of the first bin
unsigned int numberGctEmJetPhiBins() const
double etSumPhiBinLowEdge(unsigned int phiIndex) const
double globalEtaBinHighEdge(unsigned int globalEtaIndex) const
double globalEtaBinLowEdge(unsigned int globalEtaIndex) const
std::vector< float > binThresholds
const double rad2deg(const double &)
convert phi from rad (-pi, pi] to deg (0, 360)
Definition: L1GtObject.h:29
unsigned int numberGctForwardEtaBinsPerHalf() const
virtual unsigned getNBins() const =0
get number of bins
double htSumPhiBinLowEdge(unsigned int phiIndex) const
Definition: L1GtObject.h:36
const Tokens & m_tokens
unsigned int numberGctHtSumPhiBins() const
const edm::ESGetToken< L1CaloEtScale, L1HtMissScaleRcd > m_htMissScaleToken
unsigned int numberGctCentralEtaBinsPerHalf() const
const float R3MAX
Definition: L1TGCT.cc:46
double etSumPhiBinHighEdge(unsigned int phiIndex) const
const edm::ESGetToken< L1CaloEtScale, L1EmEtScaleRcd > m_etScaleToken
double htSumPhiBinHighEdge(unsigned int phiIndex) const
double emJetPhiBinLowEdge(unsigned int phiIndex) const
const float R3MIN
Definition: L1TGCT.cc:45
#define LogDebug(id)
const edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcd > m_jetScaleToken

◆ l1HistBinThresholds()

const std::vector< float > & L1GetHistLimits::l1HistBinThresholds ( const L1GtObject l1GtObject,
const std::string &  quantity 
)

for a L1 trigger object and a given quantity, return the vector of bin thresholds

Definition at line 615 of file L1GetHistLimits.cc.

References L1GetHistLimits::L1HistLimits::binThresholds, getHistLimits(), m_l1HistLimits, and MjjMonitor_cfi::quantity.

616  {
617  getHistLimits(l1GtObject, quantity);
619 }
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram
std::vector< float > binThresholds

◆ l1HistLimits() [1/2]

const L1GetHistLimits::L1HistLimits & L1GetHistLimits::l1HistLimits ( const L1GtObject l1GtObject,
const std::string &  quantity 
)

for a L1 trigger object and a given quantity, return all limits for a histogram

Definition at line 487 of file L1GetHistLimits.cc.

References L1GetHistLimits::L1HistLimits::binThresholds, getHistLimits(), edm::isDebugEnabled(), LogDebug, LogTrace, L1GetHistLimits::L1HistLimits::lowerBinValue, m_l1HistLimits, L1GetHistLimits::L1HistLimits::nrBins, MjjMonitor_cfi::quantity, and L1GetHistLimits::L1HistLimits::upperBinValue.

Referenced by L1ExtraDQM::L1ExtraMonElement< CollectionType >::bookhistograms().

488  {
489  getHistLimits(l1GtObject, quantity);
490 
491  if (edm::isDebugEnabled()) {
492  LogDebug("L1GetHistLimits") << "\n Histogram limits for L1GtObject " << l1GtObject << " and quantity " << quantity
493  << "\n Number of bins: " << m_l1HistLimits.nrBins
494  << "\n Lower limit of first bin: " << m_l1HistLimits.lowerBinValue
495  << "\n Upper limit of last bin: " << m_l1HistLimits.upperBinValue << std::endl;
496 
497  int binThreshSize = static_cast<int>(m_l1HistLimits.binThresholds.size());
498 
499  if (binThreshSize != (m_l1HistLimits.nrBins + 1)) {
500  LogTrace("L1GetHistLimits") << "\n Warning: inconsistent nrBins and binThresholds size"
501  << "\n Number of bins nrBins = " << m_l1HistLimits.nrBins
502  << "\n binThresholds size = " << binThreshSize
503  << "\n Please fix the L1GetLimits class.\n\n"
504  << std::endl;
505  }
506 
507  for (int iBin = 0; iBin < binThreshSize; ++iBin) {
508  LogTrace("L1GetHistLimits") << " Bin " << std::right << std::setw(5) << iBin << ": "
509  << m_l1HistLimits.binThresholds[iBin] << std::endl;
510  }
511  }
512 
513  return m_l1HistLimits;
514 }
bool isDebugEnabled()
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram
#define LogTrace(id)
std::vector< float > binThresholds
#define LogDebug(id)

◆ l1HistLimits() [2/2]

const L1GetHistLimits::L1HistLimits & L1GetHistLimits::l1HistLimits ( const L1GtObject l1GtObject,
const std::string &  quantity,
const double  histMinValue,
const double  histMaxValue 
)

for a L1 trigger object and a given quantity, return the real limits for a histogram given an arbitrary range

Definition at line 516 of file L1GetHistLimits.cc.

References L1GetHistLimits::L1HistLimits::binThresholds, getHistLimits(), edm::isDebugEnabled(), LogDebug, LogTrace, L1GetHistLimits::L1HistLimits::lowerBinValue, m_l1HistLimits, L1GetHistLimits::L1HistLimits::nrBins, MjjMonitor_cfi::quantity, and L1GetHistLimits::L1HistLimits::upperBinValue.

519  {
520  getHistLimits(l1GtObject, quantity);
521 
522  bool foundLowerBinValue = false;
523  bool foundUpperBinValue = false;
524 
525  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
526  if (m_l1HistLimits.binThresholds[iBin] <= histMinValue) {
528  foundLowerBinValue = true;
529  break;
530  }
531  }
532 
533  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
534  if (m_l1HistLimits.binThresholds[iBin] > histMaxValue) {
536  foundUpperBinValue = true;
537  break;
538  }
539  }
540 
541  if (foundLowerBinValue && foundUpperBinValue) {
542  int countBins = -1;
543  std::vector<float> binThresh;
544  binThresh.reserve(m_l1HistLimits.binThresholds.size());
545 
546  for (int iBin = 0; iBin < m_l1HistLimits.nrBins; ++iBin) {
547  if ((m_l1HistLimits.binThresholds[iBin] >= histMinValue) && m_l1HistLimits.binThresholds[iBin] < histMaxValue) {
549 
550  countBins++;
551  binThresh.push_back(m_l1HistLimits.binThresholds[iBin]);
552  }
553  }
554 
555  m_l1HistLimits.nrBins = countBins;
557  m_l1HistLimits.binThresholds = binThresh;
558 
559  // FIXME last bin untested.
560 
561  } else {
566 
567  LogDebug("L1GetHistLimits") << "\n Histogram limits for L1GtObject" << l1GtObject << " and quantity " << quantity
568  << " within the required range [" << histMinValue << ", " << histMaxValue
569  << "] not found."
570  << "\n The range is not included in the original histogram range." << std::endl;
571 
572  return m_l1HistLimits;
573  }
574 
575  if (edm::isDebugEnabled()) {
576  LogDebug("L1GetHistLimits") << "\n Histogram limits for L1GtObject" << l1GtObject << " and quantity " << quantity
577  << "\n Number of bins: " << m_l1HistLimits.nrBins
578  << "\n Lower limit of first bin: " << m_l1HistLimits.lowerBinValue
579  << "\n Upper limit of last bin: " << m_l1HistLimits.upperBinValue << std::endl;
580 
581  int binThreshSize = static_cast<int>(m_l1HistLimits.binThresholds.size());
582 
583  if (binThreshSize != (m_l1HistLimits.nrBins + 1)) {
584  LogTrace("L1GetHistLimits") << "\n Warning: inconsistent nrBins and binThresholds size"
585  << "\n Number of bins nrBins = " << m_l1HistLimits.nrBins
586  << "\n binThresholds size = " << binThreshSize
587  << "\n Please fix the L1GetLimits class.\n\n"
588  << std::endl;
589  }
590 
591  for (int iBin = 0; iBin < binThreshSize; ++iBin) {
592  LogTrace("L1GetHistLimits") << " Bin " << std::right << std::setw(5) << iBin << ": "
593  << m_l1HistLimits.binThresholds[iBin] << std::endl;
594  }
595  }
596 
597  return m_l1HistLimits;
598 }
bool isDebugEnabled()
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram
#define LogTrace(id)
std::vector< float > binThresholds
#define LogDebug(id)

◆ l1HistLowerBinValue()

const double L1GetHistLimits::l1HistLowerBinValue ( const L1GtObject l1GtObject,
const std::string &  quantity 
)

for a L1 trigger object and a given quantity, return the lower limit of the first bin in the histogram

Definition at line 605 of file L1GetHistLimits.cc.

References getHistLimits(), L1GetHistLimits::L1HistLimits::lowerBinValue, m_l1HistLimits, and MjjMonitor_cfi::quantity.

605  {
606  getHistLimits(l1GtObject, quantity);
608 }
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram

◆ l1HistNrBins()

const int L1GetHistLimits::l1HistNrBins ( const L1GtObject l1GtObject,
const std::string &  quantity 
)

for a L1 trigger object and a given quantity, return the numbers of bins for a given histogram

Definition at line 600 of file L1GetHistLimits.cc.

References getHistLimits(), m_l1HistLimits, L1GetHistLimits::L1HistLimits::nrBins, and MjjMonitor_cfi::quantity.

600  {
601  getHistLimits(l1GtObject, quantity);
602  return m_l1HistLimits.nrBins;
603 }
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram

◆ l1HistUpperBinValue()

const double L1GetHistLimits::l1HistUpperBinValue ( const L1GtObject l1GtObject,
const std::string &  quantity 
)

for a L1 trigger object and a given quantity, return the upper limit of the last bin in the histogram

Definition at line 610 of file L1GetHistLimits.cc.

References getHistLimits(), m_l1HistLimits, MjjMonitor_cfi::quantity, and L1GetHistLimits::L1HistLimits::upperBinValue.

610  {
611  getHistLimits(l1GtObject, quantity);
613 }
void getHistLimits(const L1GtObject &l1GtObject, const std::string &quantity)
L1HistLimits m_l1HistLimits
all limits for a histogram

Member Data Documentation

◆ m_evSetup

const edm::EventSetup& L1GetHistLimits::m_evSetup
private

Definition at line 121 of file L1GetHistLimits.h.

Referenced by getHistLimits().

◆ m_l1HistLimits

L1HistLimits L1GetHistLimits::m_l1HistLimits
private

all limits for a histogram

Definition at line 124 of file L1GetHistLimits.h.

Referenced by getHistLimits(), l1HistBinThresholds(), l1HistLimits(), l1HistLowerBinValue(), l1HistNrBins(), and l1HistUpperBinValue().

◆ m_tokens

const Tokens& L1GetHistLimits::m_tokens
private

Definition at line 120 of file L1GetHistLimits.h.

Referenced by getHistLimits().