1 #ifndef DQM_L1TMonitor_L1ExtraDQM_h
2 #define DQM_L1TMonitor_L1ExtraDQM_h
67 #include "boost/lexical_cast.hpp"
86 template<
class CollectionType>
97 typedef typename CollectionType::const_iterator
CIterColl;
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);
200 std::vector<L1ExtraMonElement<l1extra::L1MuonParticleCollection>*>
203 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
205 std::vector<L1ExtraMonElement<l1extra::L1EmParticleCollection>*>
208 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
210 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
212 std::vector<L1ExtraMonElement<l1extra::L1JetParticleCollection>*>
215 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
218 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
221 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
224 std::vector<L1ExtraMonElement<l1extra::L1EtMissParticleCollection>*>
227 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
230 std::vector<L1ExtraMonElement<l1extra::L1HFRingsCollection>*>
236 template<
class CollectionType>
238 m_indexNrObjects(-1),
245 m_indexHfBitCounts(-1),
246 m_indexHfRingEtSums(-1) {
253 template<
class CollectionType>
261 template<
class CollectionType>
265 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi,
266 const bool bookEta) {
279 int indexHistogram = -1;
286 const int histNrBins = histLimits.
nrBins;
291 m_indexHfBitCounts = indexHistogram;
295 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
std::string>(iCount);
296 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
std::string>(iCount);
297 xAxisTitle = l1ExtraObject;
298 yAxisTitle =
"Entries";
300 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBins, histMinValue, histMaxValue));
301 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(xAxisTitle, 1);
302 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(yAxisTitle, 2);
313 quantity =
"NrObjects";
318 const int histNrBins = histLimits.
nrBins;
322 histName = l1ExtraObject +
"_NrObjectsPerEvent";
323 histTitle = l1ExtraObject +
": number of objects per event";
324 xAxisTitle =
"Nr_" + l1ExtraObject;
325 yAxisTitle =
"Entries";
327 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBins, histMinValue, histMaxValue));
330 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
331 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
332 m_indexNrObjects = indexHistogram;
340 std::string quantityLongName =
" transverse energy ";
344 quantityLongName =
" transverse momentum ";
350 const int histNrBinsET = histLimits.
nrBins;
353 const std::vector<float>& binThresholdsET = histLimits.
binThresholds;
355 float* binThresholdsETf;
356 size_t sizeBinThresholdsET = binThresholdsET.size();
357 binThresholdsETf =
new float[sizeBinThresholdsET];
358 copy(binThresholdsET.begin(), binThresholdsET.end(), binThresholdsETf);
360 LogDebug(
"L1ExtraDQM") <<
"\n PT/ET histogram for " << l1ExtraObject
361 <<
"\n histNrBinsET = " << histNrBinsET <<
"\n histMinValueET = "
362 << histMinValueET <<
"\n histMaxValueET = " << histMaxValueET
363 <<
"\n Last bin value represents the upper limit of the histogram"
365 for (
size_t iBin = 0; iBin < sizeBinThresholdsET; ++iBin) {
366 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": " << quantity <<
" = "
367 << binThresholdsETf[iBin] <<
" GeV" << std::endl;
371 histName = l1ExtraObject +
"_" + quantity;
372 histTitle = l1ExtraObject +
":" + quantityLongName + quantity +
" [GeV]";
373 xAxisTitle = l1ExtraObject +
"_" + quantity +
" [GeV]";
374 yAxisTitle =
"Entries";
379 m_indexHfRingEtSums = indexHistogram;
383 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
std::string>(iCount);
384 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
386 xAxisTitle = l1ExtraObject;
387 yAxisTitle =
"Entries";
389 m_monElement.push_back(ibooker.
book1D(histName, histTitle,
390 histNrBinsET, binThresholdsETf));
392 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(xAxisTitle,
394 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(yAxisTitle,
401 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsET, binThresholdsETf));
404 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
405 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
406 m_indexPt = indexHistogram;
407 m_indexEt = indexHistogram;
408 m_indexEtTotal = indexHistogram;
412 delete[] binThresholdsETf;
424 const int histNrBinsPhi = histLimits.
nrBins;
427 const std::vector<float>& binThresholdsPhi = histLimits.
binThresholds;
429 float* binThresholdsPhif;
430 size_t sizeBinThresholdsPhi = binThresholdsPhi.size();
431 binThresholdsPhif =
new float[sizeBinThresholdsPhi];
432 copy(binThresholdsPhi.begin(), binThresholdsPhi.end(), binThresholdsPhif);
434 LogDebug(
"L1ExtraDQM") <<
"\n phi histogram for " << l1ExtraObject
435 <<
"\n histNrBinsPhi = " << histNrBinsPhi
436 <<
"\n histMinValuePhi = " << histMinValuePhi
437 <<
"\n histMaxValuePhi = " << histMaxValuePhi
438 <<
"\n Last bin value represents the upper limit of the histogram"
440 for (
size_t iBin = 0; iBin < sizeBinThresholdsPhi; ++iBin) {
441 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": phi = " << binThresholdsPhif[iBin] <<
" deg" << std::endl;
445 histName = l1ExtraObject +
"_phi";
446 histTitle = l1ExtraObject +
": phi distribution ";
447 xAxisTitle = l1ExtraObject +
"_phi [deg]";
448 yAxisTitle =
"Entries";
450 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsPhi, histMinValuePhi, histMaxValuePhi));
453 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
454 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
455 m_indexPhi = indexHistogram;
457 delete[] binThresholdsPhif;
471 const int histNrBinsEta = histLimits.
nrBins;
474 const std::vector<float>& binThresholdsEta = histLimits.
binThresholds;
477 float* binThresholdsEtaf;
478 size_t sizeBinThresholdsEta = binThresholdsEta.size();
479 binThresholdsEtaf =
new float[sizeBinThresholdsEta];
480 copy(binThresholdsEta.begin(), binThresholdsEta.end(), binThresholdsEtaf);
482 LogDebug(
"L1ExtraDQM") <<
"\n eta histogram for " << l1ExtraObject
483 <<
"\n histNrBinsEta = " << histNrBinsEta
484 <<
"\n histMinValueEta = " << histMinValueEta
485 <<
"\n histMaxValueEta = " << histMaxValueEta
486 <<
"\n Last bin value represents the upper limit of the histogram"
488 for (
size_t iBin = 0; iBin < sizeBinThresholdsEta; ++iBin) {
489 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": eta = " << binThresholdsEtaf[iBin] << std::endl;
493 histName = l1ExtraObject +
"_eta";
494 histTitle = l1ExtraObject +
": eta distribution ";
495 xAxisTitle = l1ExtraObject +
"_eta";
496 yAxisTitle =
"Entries";
498 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsEta, binThresholdsEtaf));
501 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
502 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
503 m_indexEta = indexHistogram;
505 delete[] binThresholdsEtaf;
511 template<
class CollectionType>
513 const CollectionType* collType,
const bool validColl,
514 const bool isL1Coll,
const int bxInEvent) {
516 if (validColl && isL1Coll) {
518 for (
CIterColl iterColl = collType->begin(); iterColl
519 != collType->end(); ++iterColl) {
521 if (iterColl->bx() == bxInEvent) {
525 m_monElement[m_indexNrObjects]->Fill(collSize);
527 size_t collSize = collType->size();
528 m_monElement[m_indexNrObjects]->Fill(collSize);
532 template<
class CollectionType>
534 const CollectionType* collType,
const bool validColl,
535 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
538 for (
CIterColl iterColl = collType->begin(); iterColl
539 != collType->end(); ++iterColl) {
541 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
545 m_monElement[m_indexPt]->Fill(iterColl->pt());
549 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
553 m_monElement[m_indexEta]->Fill(iterColl->eta());
560 template<
class CollectionType>
562 const CollectionType* collType,
const bool validColl,
563 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
566 for (
CIterColl iterColl = collType->begin(); iterColl
567 != collType->end(); ++iterColl) {
569 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
573 m_monElement[m_indexEt]->Fill(iterColl->et());
577 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
581 m_monElement[m_indexEta]->Fill(iterColl->eta());
588 template<
class CollectionType>
590 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
593 for (
CIterColl iterColl = collType->begin(); iterColl
594 != collType->end(); ++iterColl) {
596 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
600 m_monElement[m_indexEtTotal]->Fill(iterColl->etTotal());
606 template<
class CollectionType>
608 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
611 for (
CIterColl iterColl = collType->begin(); iterColl
612 != collType->end(); ++iterColl) {
614 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
618 m_monElement[m_indexCharge]->Fill(iterColl->charge());
624 template<
class CollectionType>
626 const CollectionType* collType,
const bool validColl,
627 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
630 for (
CIterColl iterColl = collType->begin(); iterColl
631 != collType->end(); ++iterColl) {
633 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
637 m_monElement[m_indexHfBitCounts + countIndex]->Fill(
638 iterColl->hfBitCount(
645 template<
class CollectionType>
647 const CollectionType* collType,
const bool validColl,
648 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
651 for (
CIterColl iterColl = collType->begin(); iterColl
652 != collType->end(); ++iterColl) {
654 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
658 m_monElement[m_indexHfRingEtSums + countIndex]->Fill(
MonitorElement * book1D(Args &&...args)
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)