27 m_retrieveL1Extra(paramSet.getParameter<
edm::
ParameterSet>(
"L1ExtraInputTags"), consumesCollector()),
28 L1ExtraIsoTauJetSource(paramSet.getParameter<
edm::
InputTag>(
"L1ExtraIsoTauJetSource_")),
29 m_dirName(paramSet.getParameter<
std::
string>(
"DirName")),
30 m_stage1_layer2_(paramSet.getParameter<
bool>(
"stage1_layer2_")),
32 m_nrBxInEventGmt(paramSet.getParameter<
int>(
"NrBxInEventGmt")),
33 m_nrBxInEventGct(paramSet.getParameter<
int>(
"NrBxInEventGct")),
41 m_histTokens(consumesCollector(),
true) {
46 edm::LogInfo(
"L1ExtraDQM") <<
"\nWARNING: Number of bunch crossing to be monitored for GMT rounded to: " 54 edm::LogInfo(
"L1ExtraDQM") <<
"\nWARNING: Number of bunch crossing to be monitored for GCT rounded to: " 111 bool isL1Coll =
true;
132 bool isL1Coll =
true;
154 bool isL1Coll =
true;
175 bool isL1Coll =
true;
196 bool isL1Coll =
true;
217 bool isL1Coll =
true;
219 bool m_validL1ExtraIsoTauJet;
226 if (collL1ExtraIsoTauJet.
isValid()) {
227 m_validL1ExtraIsoTauJet =
true;
228 m_l1ExtraIsoTauJet = collL1ExtraIsoTauJet.
product();
230 LogDebug(
"L1RetrieveL1Extra") <<
"\n l1extra::L1JetParticleCollection with input tag \n " 231 <<
"m_tagL1ExtraIsoTauJet" 232 <<
"\n not found in the event.\n" 233 <<
"\n Return pointer 0 and false validity tag." << std::endl;
235 m_validL1ExtraIsoTauJet =
false;
236 m_l1ExtraIsoTauJet =
nullptr;
242 ->fillNrObjects(m_l1ExtraIsoTauJet, m_validL1ExtraIsoTauJet, isL1Coll, bxInEvent);
244 ->fillEtPhiEta(m_l1ExtraIsoTauJet, m_validL1ExtraIsoTauJet, bookPhi, bookEta, isL1Coll, bxInEvent);
249 bool isL1Coll =
true;
261 bool bookEta =
false;
263 bool isL1Coll =
true;
275 bool isL1Coll =
true;
287 bool bookEta =
false;
289 bool isL1Coll =
true;
301 bool isL1Coll =
true;
318 bool isL1Coll =
true;
339 std::vector<L1GtObject> l1Obj;
347 int nrMonElements = 5;
354 int bxInEventHex = (bxInEvent + 16) % 16;
356 std::stringstream
ss;
358 ss << std::uppercase << std::hex << bxInEventHex;
359 ss >> bxInEventHexString;
368 l1Obj.push_back(
IsoEG);
376 int bxInEventHex = (bxInEvent + 16) % 16;
378 std::stringstream
ss;
380 ss << std::uppercase << std::hex << bxInEventHex;
381 ss >> bxInEventHexString;
398 int bxInEventHex = (bxInEvent + 16) % 16;
400 std::stringstream
ss;
402 ss << std::uppercase << std::hex << bxInEventHex;
403 ss >> bxInEventHexString;
422 int bxInEventHex = (bxInEvent + 16) % 16;
424 std::stringstream
ss;
426 ss << std::uppercase << std::hex << bxInEventHex;
427 ss >> bxInEventHexString;
443 int bxInEventHex = (bxInEvent + 16) % 16;
445 std::stringstream
ss;
447 ss << std::uppercase << std::hex << bxInEventHex;
448 ss >> bxInEventHexString;
464 int bxInEventHex = (bxInEvent + 16) % 16;
466 std::stringstream
ss;
468 ss << std::uppercase << std::hex << bxInEventHex;
469 ss >> bxInEventHexString;
486 int bxInEventHex = (bxInEvent + 16) % 16;
488 std::stringstream
ss;
490 ss << std::uppercase << std::hex << bxInEventHex;
491 ss >> bxInEventHexString;
501 l1Obj.push_back(
ETT);
504 bool bookPhi =
false;
505 bool bookEta =
false;
512 int bxInEventHex = (bxInEvent + 16) % 16;
514 std::stringstream
ss;
516 ss << std::uppercase << std::hex << bxInEventHex;
517 ss >> bxInEventHexString;
521 (
m_meAnalysisL1ExtraETT.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_ETT", l1Obj, bookPhi, bookEta);
526 l1Obj.push_back(
ETM);
536 int bxInEventHex = (bxInEvent + 16) % 16;
538 std::stringstream
ss;
540 ss << std::uppercase << std::hex << bxInEventHex;
541 ss >> bxInEventHexString;
545 (
m_meAnalysisL1ExtraETM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_ETM", l1Obj, bookPhi, bookEta);
550 l1Obj.push_back(
HTT);
560 int bxInEventHex = (bxInEvent + 16) % 16;
562 std::stringstream
ss;
564 ss << std::uppercase << std::hex << bxInEventHex;
565 ss >> bxInEventHexString;
569 (
m_meAnalysisL1ExtraHTT.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTT", l1Obj, bookPhi, bookEta);
574 l1Obj.push_back(
HTM);
584 int bxInEventHex = (bxInEvent + 16) % 16;
586 std::stringstream
ss;
588 ss << std::uppercase << std::hex << bxInEventHex;
589 ss >> bxInEventHexString;
594 (
m_meAnalysisL1ExtraHTM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTM", l1Obj, bookPhi, bookEta);
596 (
m_meAnalysisL1ExtraHTM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTMHTT", l1Obj, bookPhi, bookEta);
612 int bxInEventHex = (bxInEvent + 16) % 16;
614 std::stringstream
ss;
616 ss << std::uppercase << std::hex << bxInEventHex;
617 ss >> bxInEventHexString;
622 ->bookhistograms(evSetup, ibooker,
"L1_HfBitCounts", l1Obj, bookPhi, bookEta);
637 int bxInEventHex = (bxInEvent + 16) % 16;
639 std::stringstream
ss;
641 ss << std::uppercase << std::hex << bxInEventHex;
642 ss >> bxInEventHexString;
648 ->bookhistograms(evSetup, ibooker,
"L1_HfRingEtSums", l1Obj, bookPhi, bookEta);
652 ->bookhistograms(evSetup, ibooker,
"L1_IsoTau_replace_Hf", l1Obj, bookPhi, bookEta);
781 LogDebug(
"L1ExtraDQM") <<
"\n\n endRun: " <<
run.id()
782 <<
"\n Number of events analyzed in this run: " <<
m_nrEvRun 783 <<
"\n Total number of events analyzed in this job: " <<
m_nrEvJob <<
"\n" 788 template <
class CollectionType>
790 const int nrElements)
792 m_indexNrObjects(-1),
799 m_indexHfBitCounts(-1),
800 m_indexHfRingEtSums(-1) {
805 template <
class CollectionType>
810 template <
class CollectionType>
814 const std::vector<L1GtObject>& l1GtObj,
816 const bool bookEta) {
828 int indexHistogram = -1;
834 const int histNrBins = histLimits.
nrBins;
839 m_indexHfBitCounts = indexHistogram;
847 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBins, histMinValue, histMaxValue));
848 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(
xAxisTitle, 1);
849 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(
yAxisTitle, 2);
863 const int histNrBins = histLimits.
nrBins;
867 histName = l1ExtraObject +
"_NrObjectsPerEvent";
868 histTitle = l1ExtraObject +
": number of objects per event";
872 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBins, histMinValue, histMaxValue));
875 m_monElement[indexHistogram]->setAxisTitle(
xAxisTitle, 1);
876 m_monElement[indexHistogram]->setAxisTitle(
yAxisTitle, 2);
877 m_indexNrObjects = indexHistogram;
883 std::string quantityLongName =
" transverse energy ";
887 quantityLongName =
" transverse momentum ";
893 const int histNrBinsET = histLimits.
nrBins;
896 const std::vector<float>& binThresholdsET = histLimits.
binThresholds;
898 float* binThresholdsETf;
899 size_t sizeBinThresholdsET = binThresholdsET.size();
900 binThresholdsETf =
new float[sizeBinThresholdsET];
901 copy(binThresholdsET.begin(), binThresholdsET.end(), binThresholdsETf);
903 LogDebug(
"L1ExtraDQM") <<
"\n PT/ET histogram for " << l1ExtraObject <<
"\n histNrBinsET = " << histNrBinsET
904 <<
"\n histMinValueET = " << histMinValueET <<
"\n histMaxValueET = " << histMaxValueET
905 <<
"\n Last bin value represents the upper limit of the histogram" << std::endl;
906 for (
size_t iBin = 0; iBin < sizeBinThresholdsET; ++iBin) {
907 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": " <<
quantity <<
" = " << binThresholdsETf[iBin] <<
" GeV" 911 histName = l1ExtraObject +
"_" +
quantity;
918 m_indexHfRingEtSums = indexHistogram;
926 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBinsET, binThresholdsETf));
928 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(
xAxisTitle, 1);
929 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(
yAxisTitle, 2);
933 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBinsET, binThresholdsETf));
936 m_monElement[indexHistogram]->setAxisTitle(
xAxisTitle, 1);
937 m_monElement[indexHistogram]->setAxisTitle(
yAxisTitle, 2);
938 m_indexPt = indexHistogram;
939 m_indexEt = indexHistogram;
940 m_indexEtTotal = indexHistogram;
943 delete[] binThresholdsETf;
954 const int histNrBinsPhi = histLimits.
nrBins;
957 const std::vector<float>& binThresholdsPhi = histLimits.
binThresholds;
959 float* binThresholdsPhif;
960 size_t sizeBinThresholdsPhi = binThresholdsPhi.size();
961 binThresholdsPhif =
new float[sizeBinThresholdsPhi];
962 copy(binThresholdsPhi.begin(), binThresholdsPhi.end(), binThresholdsPhif);
964 LogDebug(
"L1ExtraDQM") <<
"\n phi histogram for " << l1ExtraObject <<
"\n histNrBinsPhi = " << histNrBinsPhi
965 <<
"\n histMinValuePhi = " << histMinValuePhi <<
"\n histMaxValuePhi = " << histMaxValuePhi
966 <<
"\n Last bin value represents the upper limit of the histogram" << std::endl;
967 for (
size_t iBin = 0; iBin < sizeBinThresholdsPhi; ++iBin) {
968 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": phi = " << binThresholdsPhif[iBin] <<
" deg" << std::endl;
971 histName = l1ExtraObject +
"_phi";
972 histTitle = l1ExtraObject +
": phi distribution ";
976 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBinsPhi, histMinValuePhi, histMaxValuePhi));
979 m_monElement[indexHistogram]->setAxisTitle(
xAxisTitle, 1);
980 m_monElement[indexHistogram]->setAxisTitle(
yAxisTitle, 2);
981 m_indexPhi = indexHistogram;
983 delete[] binThresholdsPhif;
995 const int histNrBinsEta = histLimits.
nrBins;
998 const std::vector<float>& binThresholdsEta = histLimits.
binThresholds;
1001 float* binThresholdsEtaf;
1002 size_t sizeBinThresholdsEta = binThresholdsEta.size();
1003 binThresholdsEtaf =
new float[sizeBinThresholdsEta];
1004 copy(binThresholdsEta.begin(), binThresholdsEta.end(), binThresholdsEtaf);
1006 LogDebug(
"L1ExtraDQM") <<
"\n eta histogram for " << l1ExtraObject <<
"\n histNrBinsEta = " << histNrBinsEta
1007 <<
"\n histMinValueEta = " << histMinValueEta <<
"\n histMaxValueEta = " << histMaxValueEta
1008 <<
"\n Last bin value represents the upper limit of the histogram" << std::endl;
1009 for (
size_t iBin = 0; iBin < sizeBinThresholdsEta; ++iBin) {
1010 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": eta = " << binThresholdsEtaf[iBin] << std::endl;
1013 histName = l1ExtraObject +
"_eta";
1014 histTitle = l1ExtraObject +
": eta distribution ";
1018 m_monElement.push_back(ibooker.
book1D(histName,
histTitle, histNrBinsEta, binThresholdsEtaf));
1021 m_monElement[indexHistogram]->setAxisTitle(
xAxisTitle, 1);
1022 m_monElement[indexHistogram]->setAxisTitle(
yAxisTitle, 2);
1023 m_indexEta = indexHistogram;
1025 delete[] binThresholdsEtaf;
1029 template <
class CollectionType>
1031 const bool validColl,
1032 const bool isL1Coll,
1033 const int bxInEvent) {
1034 if (validColl && isL1Coll) {
1035 size_t collSize = 0;
1036 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1037 if (iterColl->bx() == bxInEvent) {
1041 m_monElement[m_indexNrObjects]->Fill(collSize);
1043 size_t collSize = collType->size();
1044 m_monElement[m_indexNrObjects]->Fill(collSize);
1048 template <
class CollectionType>
1050 const bool validColl,
1053 const bool isL1Coll,
1054 const int bxInEvent) {
1056 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1057 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1061 m_monElement[m_indexPt]->Fill(iterColl->pt());
1065 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
1069 m_monElement[m_indexEta]->Fill(iterColl->eta());
1075 template <
class CollectionType>
1077 const bool validColl,
1080 const bool isL1Coll,
1081 const int bxInEvent) {
1083 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1084 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1088 m_monElement[m_indexEt]->Fill(iterColl->et());
1092 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
1096 m_monElement[m_indexEta]->Fill(iterColl->eta());
1102 template <
class CollectionType>
1104 const bool validColl,
1105 const bool isL1Coll,
1106 const int bxInEvent) {
1108 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1109 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1113 m_monElement[m_indexEtTotal]->Fill(iterColl->etTotal());
1118 template <
class CollectionType>
1120 const bool validColl,
1121 const bool isL1Coll,
1122 const int bxInEvent) {
1124 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1125 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1129 m_monElement[m_indexCharge]->Fill(iterColl->charge());
1134 template <
class CollectionType>
1136 const bool validColl,
1137 const int countIndex,
1138 const bool isL1Coll,
1139 const int bxInEvent) {
1141 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1142 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1146 m_monElement[m_indexHfBitCounts + countIndex]->Fill(
1152 template <
class CollectionType>
1154 const bool validColl,
1155 const int countIndex,
1156 const bool isL1Coll,
1157 const int bxInEvent) {
1159 for (
CIterColl iterColl = collType->begin(); iterColl != collType->end(); ++iterColl) {
1160 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1164 m_monElement[m_indexHfRingEtSums + countIndex]->Fill(
T getParameter(std::string const &) const
virtual void setCurrentFolder(std::string const &fullpath)
T const * product() const
static std::string to_string(const XMLCh *ch)
Log< level::Info, false > LogInfo
std::vector< float > binThresholds
const double rad2deg(const double &)
convert phi from rad (-pi, pi] to deg (0, 360)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const L1HistLimits & l1HistLimits(const L1GtObject &l1GtObject, const std::string &quantity)