1 #ifndef DQM_L1TMonitor_L1ExtraDQM_h
2 #define DQM_L1TMonitor_L1ExtraDQM_h
67 #include "boost/lexical_cast.hpp"
85 template<
class CollectionType>
96 typedef typename CollectionType::const_iterator
CIterColl;
100 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi =
101 true,
const bool bookEta =
true);
105 const bool validColl,
const bool isL1Coll,
const int bxInEvent);
108 void fillPtPhiEta(
const CollectionType* collType,
const bool validColl,
109 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
110 const int bxInEvent);
113 void fillEtPhiEta(
const CollectionType* collType,
const bool validColl,
114 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
115 const int bxInEvent);
118 void fillEtTotal(
const CollectionType* collType,
const bool validColl,
119 const bool isL1Coll,
const int bxInEvent);
122 void fillCharge(
const CollectionType* collType,
const bool validColl,
123 const bool isL1Coll,
const int bxInEvent);
127 const bool validColl,
const int countIndex,
128 const bool isL1Coll,
const int bxInEvent);
132 const bool validColl,
const int countIndex,
133 const bool isL1Coll,
const int bxInEvent);
204 std::vector<L1ExtraMonElement<l1extra::L1MuonParticleCollection>*>
207 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
209 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
212 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
214 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
216 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
219 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
222 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
225 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
228 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
231 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
234 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
240 template<
class CollectionType>
243 m_indexNrObjects(-1),
250 m_indexHfBitCounts(-1),
251 m_indexHfRingEtSums(-1) {
258 template<
class CollectionType>
266 template<
class CollectionType>
270 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi,
271 const bool bookEta) {
284 int indexHistogram = -1;
292 const int histNrBins = histLimits.
nrBins;
297 m_indexHfBitCounts = indexHistogram;
301 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
303 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
305 xAxisTitle = l1ExtraObject;
306 yAxisTitle =
"Entries";
308 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBins,
309 histMinValue, histMaxValue));
310 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(xAxisTitle,
312 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(yAxisTitle,
322 if ((gtObj ==
Mu) || (gtObj ==
IsoEG) || (gtObj ==
NoIsoEG) || (gtObj
325 quantity =
"NrObjects";
331 const int histNrBins = histLimits.
nrBins;
335 histName = l1ExtraObject +
"_NrObjectsPerEvent";
336 histTitle = l1ExtraObject +
": number of objects per event";
337 xAxisTitle =
"Nr_" + l1ExtraObject;
338 yAxisTitle =
"Entries";
340 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBins,
341 histMinValue, histMaxValue));
344 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
345 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
346 m_indexNrObjects = indexHistogram;
354 std::string quantityLongName =
" transverse energy ";
358 quantityLongName =
" transverse momentum ";
365 const int histNrBinsET = histLimits.
nrBins;
368 const std::vector<float>& binThresholdsET = histLimits.
binThresholds;
370 float* binThresholdsETf;
371 size_t sizeBinThresholdsET = binThresholdsET.size();
372 binThresholdsETf =
new float[sizeBinThresholdsET];
373 copy(binThresholdsET.begin(), binThresholdsET.end(), binThresholdsETf);
375 LogDebug(
"L1ExtraDQM") <<
"\n PT/ET histogram for " << l1ExtraObject
376 <<
"\n histNrBinsET = " << histNrBinsET <<
"\n histMinValueET = "
377 << histMinValueET <<
"\n histMaxValueET = " << histMaxValueET
378 <<
"\n Last bin value represents the upper limit of the histogram"
380 for (
size_t iBin = 0; iBin < sizeBinThresholdsET; ++iBin) {
381 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": " << quantity <<
" = "
382 << binThresholdsETf[iBin] <<
" GeV" << std::endl;
386 histName = l1ExtraObject +
"_" + quantity;
387 histTitle = l1ExtraObject +
":" + quantityLongName + quantity +
" [GeV]";
388 xAxisTitle = l1ExtraObject +
"_" + quantity +
" [GeV]";
389 yAxisTitle =
"Entries";
394 m_indexHfRingEtSums = indexHistogram;
398 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
400 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
402 xAxisTitle = l1ExtraObject;
403 yAxisTitle =
"Entries";
405 m_monElement.push_back(dbe->
book1D(histName, histTitle,
406 histNrBinsET, binThresholdsETf));
408 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(xAxisTitle,
410 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(yAxisTitle,
417 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsET,
421 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
422 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
423 m_indexPt = indexHistogram;
424 m_indexEt = indexHistogram;
425 m_indexEtTotal = indexHistogram;
429 delete[] binThresholdsETf;
442 const int histNrBinsPhi = histLimits.
nrBins;
445 const std::vector<float>& binThresholdsPhi = histLimits.
binThresholds;
447 float* binThresholdsPhif;
448 size_t sizeBinThresholdsPhi = binThresholdsPhi.size();
449 binThresholdsPhif =
new float[sizeBinThresholdsPhi];
450 copy(binThresholdsPhi.begin(), binThresholdsPhi.end(),
453 LogDebug(
"L1ExtraDQM") <<
"\n phi histogram for " << l1ExtraObject
454 <<
"\n histNrBinsPhi = " << histNrBinsPhi
455 <<
"\n histMinValuePhi = " << histMinValuePhi
456 <<
"\n histMaxValuePhi = " << histMaxValuePhi
457 <<
"\n Last bin value represents the upper limit of the histogram"
459 for (
size_t iBin = 0; iBin < sizeBinThresholdsPhi; ++iBin) {
460 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": phi = "
461 << binThresholdsPhif[iBin] <<
" deg" << std::endl;
465 histName = l1ExtraObject +
"_phi";
466 histTitle = l1ExtraObject +
": phi distribution ";
467 xAxisTitle = l1ExtraObject +
"_phi [deg]";
468 yAxisTitle =
"Entries";
470 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsPhi,
471 histMinValuePhi, histMaxValuePhi));
474 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
475 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
476 m_indexPhi = indexHistogram;
478 delete[] binThresholdsPhif;
493 const int histNrBinsEta = histLimits.
nrBins;
496 const std::vector<float>& binThresholdsEta = histLimits.
binThresholds;
499 float* binThresholdsEtaf;
500 size_t sizeBinThresholdsEta = binThresholdsEta.size();
501 binThresholdsEtaf =
new float[sizeBinThresholdsEta];
502 copy(binThresholdsEta.begin(), binThresholdsEta.end(),
505 LogDebug(
"L1ExtraDQM") <<
"\n eta histogram for " << l1ExtraObject
506 <<
"\n histNrBinsEta = " << histNrBinsEta
507 <<
"\n histMinValueEta = " << histMinValueEta
508 <<
"\n histMaxValueEta = " << histMaxValueEta
509 <<
"\n Last bin value represents the upper limit of the histogram"
511 for (
size_t iBin = 0; iBin < sizeBinThresholdsEta; ++iBin) {
512 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": eta = "
513 << binThresholdsEtaf[iBin] << std::endl;
517 histName = l1ExtraObject +
"_eta";
518 histTitle = l1ExtraObject +
": eta distribution ";
519 xAxisTitle = l1ExtraObject +
"_eta";
520 yAxisTitle =
"Entries";
522 m_monElement.push_back(dbe->
book1D(histName, histTitle, histNrBinsEta,
526 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
527 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
528 m_indexEta = indexHistogram;
530 delete[] binThresholdsEtaf;
536 template<
class CollectionType>
538 const CollectionType* collType,
const bool validColl,
539 const bool isL1Coll,
const int bxInEvent) {
541 if (validColl && isL1Coll) {
543 for (
CIterColl iterColl = collType->begin(); iterColl
544 != collType->end(); ++iterColl) {
546 if (iterColl->bx() == bxInEvent) {
550 m_monElement[m_indexNrObjects]->Fill(collSize);
552 size_t collSize = collType->size();
553 m_monElement[m_indexNrObjects]->Fill(collSize);
557 template<
class CollectionType>
559 const CollectionType* collType,
const bool validColl,
560 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
563 for (
CIterColl iterColl = collType->begin(); iterColl
564 != collType->end(); ++iterColl) {
566 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
570 m_monElement[m_indexPt]->Fill(iterColl->pt());
574 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
578 m_monElement[m_indexEta]->Fill(iterColl->eta());
585 template<
class CollectionType>
587 const CollectionType* collType,
const bool validColl,
588 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
591 for (
CIterColl iterColl = collType->begin(); iterColl
592 != collType->end(); ++iterColl) {
594 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
598 m_monElement[m_indexEt]->Fill(iterColl->et());
602 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
606 m_monElement[m_indexEta]->Fill(iterColl->eta());
613 template<
class CollectionType>
615 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
618 for (
CIterColl iterColl = collType->begin(); iterColl
619 != collType->end(); ++iterColl) {
621 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
625 m_monElement[m_indexEtTotal]->Fill(iterColl->etTotal());
631 template<
class CollectionType>
633 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
636 for (
CIterColl iterColl = collType->begin(); iterColl
637 != collType->end(); ++iterColl) {
639 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
643 m_monElement[m_indexCharge]->Fill(iterColl->charge());
649 template<
class CollectionType>
651 const CollectionType* collType,
const bool validColl,
652 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
655 for (
CIterColl iterColl = collType->begin(); iterColl
656 != collType->end(); ++iterColl) {
658 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
662 m_monElement[m_indexHfBitCounts + countIndex]->Fill(
663 iterColl->hfBitCount(
670 template<
class CollectionType>
672 const CollectionType* collType,
const bool validColl,
673 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
676 for (
CIterColl iterColl = collType->begin(); iterColl
677 != collType->end(); ++iterColl) {
679 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
683 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)