1 #ifndef DQM_L1TMonitor_L1ExtraDQM_h
2 #define DQM_L1TMonitor_L1ExtraDQM_h
68 #include "boost/lexical_cast.hpp"
86 template<
class CollectionType>
97 typedef typename CollectionType::const_iterator
CIterColl;
100 const std::string& l1ExtraObject,
101 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi =
102 true,
const bool bookEta =
true);
106 const bool validColl,
const bool isL1Coll,
const int bxInEvent);
109 void fillPtPhiEta(
const CollectionType* collType,
const bool validColl,
110 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
111 const int bxInEvent);
114 void fillEtPhiEta(
const CollectionType* collType,
const bool validColl,
115 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
116 const int bxInEvent);
119 void fillEtTotal(
const CollectionType* collType,
const bool validColl,
120 const bool isL1Coll,
const int bxInEvent);
123 void fillCharge(
const CollectionType* collType,
const bool validColl,
124 const bool isL1Coll,
const int bxInEvent);
128 const bool validColl,
const int countIndex,
129 const bool isL1Coll,
const int bxInEvent);
133 const bool validColl,
const int countIndex,
134 const bool isL1Coll,
const int bxInEvent);
205 std::vector<L1ExtraMonElement<l1extra::L1MuonParticleCollection>*>
208 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
210 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
213 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
215 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
217 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
220 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
223 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
226 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
229 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
232 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
235 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
241 template<
class CollectionType>
244 m_indexNrObjects(-1),
251 m_indexHfBitCounts(-1),
252 m_indexHfRingEtSums(-1) {
259 template<
class CollectionType>
267 template<
class CollectionType>
270 const std::string& l1ExtraObject,
271 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi,
272 const bool bookEta) {
278 std::string histName;
279 std::string histTitle;
280 std::string xAxisTitle;
281 std::string yAxisTitle;
283 std::string quantity =
"";
285 int indexHistogram = -1;
293 const int histNrBins = histLimits.
nrBins;
298 m_indexHfBitCounts = indexHistogram;
302 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
303 std::string>(iCount);
304 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
305 std::string>(iCount);
306 xAxisTitle = l1ExtraObject;
307 yAxisTitle =
"Entries";
309 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBins,
310 histMinValue, histMaxValue));
311 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(xAxisTitle,
313 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(yAxisTitle,
323 if ((gtObj ==
Mu) || (gtObj ==
IsoEG) || (gtObj ==
NoIsoEG) || (gtObj
326 quantity =
"NrObjects";
332 const int histNrBins = histLimits.
nrBins;
336 histName = l1ExtraObject +
"_NrObjectsPerEvent";
337 histTitle = l1ExtraObject +
": number of objects per event";
338 xAxisTitle =
"Nr_" + l1ExtraObject;
339 yAxisTitle =
"Entries";
341 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBins,
342 histMinValue, histMaxValue));
345 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
346 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
347 m_indexNrObjects = indexHistogram;
355 std::string quantityLongName =
" transverse energy ";
359 quantityLongName =
" transverse momentum ";
366 const int histNrBinsET = histLimits.
nrBins;
369 const std::vector<float>& binThresholdsET = histLimits.
binThresholds;
371 float* binThresholdsETf;
372 size_t sizeBinThresholdsET = binThresholdsET.size();
373 binThresholdsETf =
new float[sizeBinThresholdsET];
374 copy(binThresholdsET.begin(), binThresholdsET.end(), binThresholdsETf);
376 LogDebug(
"L1ExtraDQM") <<
"\n PT/ET histogram for " << l1ExtraObject
377 <<
"\n histNrBinsET = " << histNrBinsET <<
"\n histMinValueET = "
378 << histMinValueET <<
"\n histMaxValueET = " << histMaxValueET
379 <<
"\n Last bin value represents the upper limit of the histogram"
381 for (
size_t iBin = 0; iBin < sizeBinThresholdsET; ++iBin) {
382 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": " << quantity <<
" = "
383 << binThresholdsETf[iBin] <<
" GeV" << std::endl;
387 histName = l1ExtraObject +
"_" + quantity;
388 histTitle = l1ExtraObject +
":" + quantityLongName + quantity +
" [GeV]";
389 xAxisTitle = l1ExtraObject +
"_" + quantity +
" [GeV]";
390 yAxisTitle =
"Entries";
395 m_indexHfRingEtSums = indexHistogram;
399 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
400 std::string>(iCount);
401 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
402 std::string>(iCount);
403 xAxisTitle = l1ExtraObject;
404 yAxisTitle =
"Entries";
406 m_monElement.push_back(dbe->
book1D(histName, histTitle,
407 histNrBinsET, binThresholdsETf));
409 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(xAxisTitle,
411 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(yAxisTitle,
418 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsET,
422 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
423 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
424 m_indexPt = indexHistogram;
425 m_indexEt = indexHistogram;
426 m_indexEtTotal = indexHistogram;
430 delete[] binThresholdsETf;
443 const int histNrBinsPhi = histLimits.
nrBins;
446 const std::vector<float>& binThresholdsPhi = histLimits.
binThresholds;
448 float* binThresholdsPhif;
449 size_t sizeBinThresholdsPhi = binThresholdsPhi.size();
450 binThresholdsPhif =
new float[sizeBinThresholdsPhi];
451 copy(binThresholdsPhi.begin(), binThresholdsPhi.end(),
454 LogDebug(
"L1ExtraDQM") <<
"\n phi histogram for " << l1ExtraObject
455 <<
"\n histNrBinsPhi = " << histNrBinsPhi
456 <<
"\n histMinValuePhi = " << histMinValuePhi
457 <<
"\n histMaxValuePhi = " << histMaxValuePhi
458 <<
"\n Last bin value represents the upper limit of the histogram"
460 for (
size_t iBin = 0; iBin < sizeBinThresholdsPhi; ++iBin) {
461 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": phi = "
462 << binThresholdsPhif[iBin] <<
" deg" << std::endl;
466 histName = l1ExtraObject +
"_phi";
467 histTitle = l1ExtraObject +
": phi distribution ";
468 xAxisTitle = l1ExtraObject +
"_phi [deg]";
469 yAxisTitle =
"Entries";
471 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsPhi,
472 histMinValuePhi, histMaxValuePhi));
475 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
476 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
477 m_indexPhi = indexHistogram;
479 delete[] binThresholdsPhif;
494 const int histNrBinsEta = histLimits.
nrBins;
497 const std::vector<float>& binThresholdsEta = histLimits.
binThresholds;
500 float* binThresholdsEtaf;
501 size_t sizeBinThresholdsEta = binThresholdsEta.size();
502 binThresholdsEtaf =
new float[sizeBinThresholdsEta];
503 copy(binThresholdsEta.begin(), binThresholdsEta.end(),
506 LogDebug(
"L1ExtraDQM") <<
"\n eta histogram for " << l1ExtraObject
507 <<
"\n histNrBinsEta = " << histNrBinsEta
508 <<
"\n histMinValueEta = " << histMinValueEta
509 <<
"\n histMaxValueEta = " << histMaxValueEta
510 <<
"\n Last bin value represents the upper limit of the histogram"
512 for (
size_t iBin = 0; iBin < sizeBinThresholdsEta; ++iBin) {
513 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": eta = "
514 << binThresholdsEtaf[iBin] << std::endl;
518 histName = l1ExtraObject +
"_eta";
519 histTitle = l1ExtraObject +
": eta distribution ";
520 xAxisTitle = l1ExtraObject +
"_eta";
521 yAxisTitle =
"Entries";
523 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsEta,
527 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
528 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
529 m_indexEta = indexHistogram;
531 delete[] binThresholdsEtaf;
537 template<
class CollectionType>
539 const CollectionType* collType,
const bool validColl,
540 const bool isL1Coll,
const int bxInEvent) {
542 if (validColl && isL1Coll) {
544 for (
CIterColl iterColl = collType->begin(); iterColl
545 != collType->end(); ++iterColl) {
547 if (iterColl->bx() == bxInEvent) {
551 m_monElement[m_indexNrObjects]->Fill(collSize);
553 size_t collSize = collType->size();
554 m_monElement[m_indexNrObjects]->Fill(collSize);
558 template<
class CollectionType>
560 const CollectionType* collType,
const bool validColl,
561 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
564 for (
CIterColl iterColl = collType->begin(); iterColl
565 != collType->end(); ++iterColl) {
567 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
571 m_monElement[m_indexPt]->Fill(iterColl->pt());
575 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.e-6);
579 m_monElement[m_indexEta]->Fill(iterColl->eta());
586 template<
class CollectionType>
588 const CollectionType* collType,
const bool validColl,
589 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
592 for (
CIterColl iterColl = collType->begin(); iterColl
593 != collType->end(); ++iterColl) {
595 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
599 m_monElement[m_indexEt]->Fill(iterColl->et());
603 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.e-6);
607 m_monElement[m_indexEta]->Fill(iterColl->eta());
614 template<
class CollectionType>
616 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
619 for (
CIterColl iterColl = collType->begin(); iterColl
620 != collType->end(); ++iterColl) {
622 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
626 m_monElement[m_indexEtTotal]->Fill(iterColl->etTotal());
632 template<
class CollectionType>
634 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
637 for (
CIterColl iterColl = collType->begin(); iterColl
638 != collType->end(); ++iterColl) {
640 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
644 m_monElement[m_indexCharge]->Fill(iterColl->charge());
650 template<
class CollectionType>
652 const CollectionType* collType,
const bool validColl,
653 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
656 for (
CIterColl iterColl = collType->begin(); iterColl
657 != collType->end(); ++iterColl) {
659 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
663 m_monElement[m_indexHfBitCounts + countIndex]->Fill(
664 iterColl->hfBitCount(
671 template<
class CollectionType>
673 const CollectionType* collType,
const bool validColl,
674 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
677 for (
CIterColl iterColl = collType->begin(); iterColl
678 != collType->end(); ++iterColl) {
680 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
684 m_monElement[m_indexHfRingEtSums + countIndex]->Fill(
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< float > binThresholds
const double rad2deg(const double &)
convert phi from rad (-pi, pi] to deg (0, 360)
const L1HistLimits & l1HistLimits(const L1GtObject &l1GtObject, const std::string &quantity)