31 m_retrieveL1Extra(paramSet.getParameter<edm::
ParameterSet>(
"L1ExtraInputTags"),consumesCollector()),
32 L1ExtraIsoTauJetSource(paramSet.getParameter<edm::
InputTag>(
"L1ExtraIsoTauJetSource_")),
33 m_dirName(paramSet.getParameter<std::
string>(
"DirName")),
34 m_stage1_layer2_(paramSet.getParameter<bool>(
"stage1_layer2_")),
36 m_nrBxInEventGmt(paramSet.getParameter<int>(
"NrBxInEventGmt")),
37 m_nrBxInEventGct(paramSet.getParameter<int>(
"NrBxInEventGct")),
39 m_resetModule(
true), m_currentRun(-99),
51 <<
"\nWARNING: Number of bunch crossing to be monitored for GMT rounded to: "
53 <<
"\n The number must be an odd number!\n"
61 <<
"\nWARNING: Number of bunch crossing to be monitored for GCT rounded to: "
63 <<
"\n The number must be an odd number!\n"
102 bool isL1Coll =
true;
106 int bxInEvent = iBxInEvent + (m_nrBxInEventGmt + 1) / 2
115 isL1Coll, bxInEvent);
127 bool isL1Coll =
true;
131 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
140 isL1Coll, bxInEvent);
151 bool isL1Coll =
true;
155 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
164 isL1Coll, bxInEvent);
175 bool isL1Coll =
true;
179 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
188 isL1Coll, bxInEvent);
200 bool isL1Coll =
true;
204 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
213 isL1Coll, bxInEvent);
224 bool isL1Coll =
true;
228 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
237 isL1Coll, bxInEvent);
247 bool isL1Coll =
true;
249 bool m_validL1ExtraIsoTauJet;
256 if (collL1ExtraIsoTauJet.
isValid()) {
257 m_validL1ExtraIsoTauJet =
true;
258 m_l1ExtraIsoTauJet = collL1ExtraIsoTauJet.
product();
261 <<
"\n l1extra::L1JetParticleCollection with input tag \n "
262 <<
"m_tagL1ExtraIsoTauJet" <<
"\n not found in the event.\n"
263 <<
"\n Return pointer 0 and false validity tag."
266 m_validL1ExtraIsoTauJet =
false;
267 m_l1ExtraIsoTauJet = 0;
271 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
273 (
m_meAnalysisL1ExtraIsoTauJet.at(iBxInEvent))->fillEtPhiEta(m_l1ExtraIsoTauJet,m_validL1ExtraIsoTauJet, bookPhi, bookEta,isL1Coll, bxInEvent);
280 bool isL1Coll =
true;
284 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
298 bool bookEta =
false;
300 bool isL1Coll =
true;
304 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
309 isL1Coll, bxInEvent);
318 bool isL1Coll =
true;
322 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
335 bool bookEta =
false;
337 bool isL1Coll =
true;
341 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
346 isL1Coll, bxInEvent);
354 bool isL1Coll =
true;
358 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
365 isL1Coll, bxInEvent);
374 bool isL1Coll =
true;
378 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
385 isL1Coll, bxInEvent);
403 std::vector<L1GtObject> l1Obj;
411 int nrMonElements = 5;
418 int bxInEventHex = (bxInEvent+ 16) % 16;
420 std::stringstream
ss;
422 ss << std::uppercase << std::hex << bxInEventHex;
423 ss >> bxInEventHexString;
433 l1Obj.push_back(
IsoEG);
440 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
441 int bxInEventHex = (bxInEvent+ 16) % 16;
443 std::stringstream
ss;
445 ss << std::uppercase << std::hex << bxInEventHex;
446 ss >> bxInEventHexString;
462 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
463 int bxInEventHex = (bxInEvent+ 16) % 16;
465 std::stringstream
ss;
467 ss << std::uppercase << std::hex << bxInEventHex;
468 ss >> bxInEventHexString;
486 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
487 int bxInEventHex = (bxInEvent+ 16) % 16;
489 std::stringstream
ss;
491 ss << std::uppercase << std::hex << bxInEventHex;
492 ss >> bxInEventHexString;
507 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
508 int bxInEventHex = (bxInEvent+ 16) % 16;
510 std::stringstream
ss;
512 ss << std::uppercase << std::hex << bxInEventHex;
513 ss >> bxInEventHexString;
528 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
529 int bxInEventHex = (bxInEvent+ 16) % 16;
531 std::stringstream
ss;
533 ss << std::uppercase << std::hex << bxInEventHex;
534 ss >> bxInEventHexString;
551 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
552 int bxInEventHex = (bxInEvent+ 16) % 16;
554 std::stringstream
ss;
556 ss << std::uppercase << std::hex << bxInEventHex;
557 ss >> bxInEventHexString;
567 l1Obj.push_back(
ETT);
570 bool bookPhi =
false;
571 bool bookEta =
false;
577 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
578 int bxInEventHex = (bxInEvent+ 16) % 16;
580 std::stringstream
ss;
582 ss << std::uppercase << std::hex << bxInEventHex;
583 ss >> bxInEventHexString;
587 (
m_meAnalysisL1ExtraETT.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_ETT", l1Obj, bookPhi, bookEta);
592 l1Obj.push_back(
ETM);
600 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
601 int bxInEventHex = (bxInEvent+ 16) % 16;
603 std::stringstream
ss;
605 ss << std::uppercase << std::hex << bxInEventHex;
606 ss >> bxInEventHexString;
610 (
m_meAnalysisL1ExtraETM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_ETM", l1Obj, bookPhi, bookEta);
615 l1Obj.push_back(
HTT);
624 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
625 int bxInEventHex = (bxInEvent+ 16) % 16;
627 std::stringstream
ss;
629 ss << std::uppercase << std::hex << bxInEventHex;
630 ss >> bxInEventHexString;
634 (
m_meAnalysisL1ExtraHTT.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTT", l1Obj, bookPhi, bookEta);
639 l1Obj.push_back(
HTM);
648 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
649 int bxInEventHex = (bxInEvent+ 16) % 16;
651 std::stringstream
ss;
653 ss << std::uppercase << std::hex << bxInEventHex;
654 ss >> bxInEventHexString;
659 (
m_meAnalysisL1ExtraHTM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTM", l1Obj, bookPhi, bookEta);
661 (
m_meAnalysisL1ExtraHTM.at(iBxInEvent))->bookhistograms(evSetup, ibooker,
"L1_HTMHTT", l1Obj, bookPhi, bookEta);
677 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2 - m_nrBxInEventGct;
678 int bxInEventHex = (bxInEvent+ 16) % 16;
680 std::stringstream
ss;
682 ss << std::uppercase << std::hex << bxInEventHex;
683 ss >> bxInEventHexString;
702 evSetup, nrMonElements));
703 int bxInEvent = iBxInEvent + (m_nrBxInEventGct + 1) / 2
705 int bxInEventHex = (bxInEvent+ 16) % 16;
707 std::stringstream
ss;
709 ss << std::uppercase << std::hex << bxInEventHex;
710 ss >> bxInEventHexString;
869 LogDebug(
"L1ExtraDQM") <<
"\n\n endRun: " << run.
id()
870 <<
"\n Number of events analyzed in this run: " <<
m_nrEvRun
871 <<
"\n Total number of events analyzed in this job: " <<
m_nrEvJob
872 <<
"\n" << std::endl;
877 template<
class CollectionType>
879 m_indexNrObjects(-1),
886 m_indexHfBitCounts(-1),
887 m_indexHfRingEtSums(-1) {
894 template<
class CollectionType>
902 template<
class CollectionType>
906 const std::vector<L1GtObject>& l1GtObj,
const bool bookPhi,
907 const bool bookEta) {
920 int indexHistogram = -1;
927 const int histNrBins = histLimits.
nrBins;
932 m_indexHfBitCounts = indexHistogram;
936 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
std::string>(iCount);
937 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
std::string>(iCount);
938 xAxisTitle = l1ExtraObject;
939 yAxisTitle =
"Entries";
941 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBins, histMinValue, histMaxValue));
942 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(xAxisTitle, 1);
943 m_monElement[m_indexHfBitCounts + iCount]->setAxisTitle(yAxisTitle, 2);
954 quantity =
"NrObjects";
959 const int histNrBins = histLimits.
nrBins;
963 histName = l1ExtraObject +
"_NrObjectsPerEvent";
964 histTitle = l1ExtraObject +
": number of objects per event";
965 xAxisTitle =
"Nr_" + l1ExtraObject;
966 yAxisTitle =
"Entries";
968 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBins, histMinValue, histMaxValue));
971 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
972 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
973 m_indexNrObjects = indexHistogram;
981 std::string quantityLongName =
" transverse energy ";
985 quantityLongName =
" transverse momentum ";
991 const int histNrBinsET = histLimits.
nrBins;
994 const std::vector<float>& binThresholdsET = histLimits.
binThresholds;
996 float* binThresholdsETf;
997 size_t sizeBinThresholdsET = binThresholdsET.size();
998 binThresholdsETf =
new float[sizeBinThresholdsET];
999 copy(binThresholdsET.begin(), binThresholdsET.end(), binThresholdsETf);
1001 LogDebug(
"L1ExtraDQM") <<
"\n PT/ET histogram for " << l1ExtraObject
1002 <<
"\n histNrBinsET = " << histNrBinsET <<
"\n histMinValueET = "
1003 << histMinValueET <<
"\n histMaxValueET = " << histMaxValueET
1004 <<
"\n Last bin value represents the upper limit of the histogram"
1006 for (
size_t iBin = 0; iBin < sizeBinThresholdsET; ++iBin) {
1007 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": " << quantity <<
" = "
1008 << binThresholdsETf[iBin] <<
" GeV" << std::endl;
1012 histName = l1ExtraObject +
"_" + quantity;
1013 histTitle = l1ExtraObject +
":" + quantityLongName + quantity +
" [GeV]";
1014 xAxisTitle = l1ExtraObject +
"_" + quantity +
" [GeV]";
1015 yAxisTitle =
"Entries";
1020 m_indexHfRingEtSums = indexHistogram;
1024 histName = l1ExtraObject +
"_Count_" + boost::lexical_cast<
std::string>(iCount);
1025 histTitle = l1ExtraObject +
": count " + boost::lexical_cast<
std::string>(iCount);
1026 xAxisTitle = l1ExtraObject;
1027 yAxisTitle =
"Entries";
1029 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsET, binThresholdsETf));
1031 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(xAxisTitle, 1);
1032 m_monElement[m_indexHfRingEtSums + iCount]->setAxisTitle(yAxisTitle, 2);
1038 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsET, binThresholdsETf));
1041 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
1042 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
1043 m_indexPt = indexHistogram;
1044 m_indexEt = indexHistogram;
1045 m_indexEtTotal = indexHistogram;
1049 delete[] binThresholdsETf;
1061 const int histNrBinsPhi = histLimits.
nrBins;
1064 const std::vector<float>& binThresholdsPhi = histLimits.
binThresholds;
1066 float* binThresholdsPhif;
1067 size_t sizeBinThresholdsPhi = binThresholdsPhi.size();
1068 binThresholdsPhif =
new float[sizeBinThresholdsPhi];
1069 copy(binThresholdsPhi.begin(), binThresholdsPhi.end(), binThresholdsPhif);
1071 LogDebug(
"L1ExtraDQM") <<
"\n phi histogram for " << l1ExtraObject
1072 <<
"\n histNrBinsPhi = " << histNrBinsPhi
1073 <<
"\n histMinValuePhi = " << histMinValuePhi
1074 <<
"\n histMaxValuePhi = " << histMaxValuePhi
1075 <<
"\n Last bin value represents the upper limit of the histogram"
1077 for (
size_t iBin = 0; iBin < sizeBinThresholdsPhi; ++iBin) {
1078 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": phi = " << binThresholdsPhif[iBin] <<
" deg" << std::endl;
1082 histName = l1ExtraObject +
"_phi";
1083 histTitle = l1ExtraObject +
": phi distribution ";
1084 xAxisTitle = l1ExtraObject +
"_phi [deg]";
1085 yAxisTitle =
"Entries";
1087 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsPhi, histMinValuePhi, histMaxValuePhi));
1090 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
1091 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
1092 m_indexPhi = indexHistogram;
1094 delete[] binThresholdsPhif;
1108 const int histNrBinsEta = histLimits.
nrBins;
1111 const std::vector<float>& binThresholdsEta = histLimits.
binThresholds;
1114 float* binThresholdsEtaf;
1115 size_t sizeBinThresholdsEta = binThresholdsEta.size();
1116 binThresholdsEtaf =
new float[sizeBinThresholdsEta];
1117 copy(binThresholdsEta.begin(), binThresholdsEta.end(), binThresholdsEtaf);
1119 LogDebug(
"L1ExtraDQM") <<
"\n eta histogram for " << l1ExtraObject
1120 <<
"\n histNrBinsEta = " << histNrBinsEta
1121 <<
"\n histMinValueEta = " << histMinValueEta
1122 <<
"\n histMaxValueEta = " << histMaxValueEta
1123 <<
"\n Last bin value represents the upper limit of the histogram"
1125 for (
size_t iBin = 0; iBin < sizeBinThresholdsEta; ++iBin) {
1126 LogTrace(
"L1ExtraDQM") <<
"Bin " << iBin <<
": eta = " << binThresholdsEtaf[iBin] << std::endl;
1130 histName = l1ExtraObject +
"_eta";
1131 histTitle = l1ExtraObject +
": eta distribution ";
1132 xAxisTitle = l1ExtraObject +
"_eta";
1133 yAxisTitle =
"Entries";
1135 m_monElement.push_back(ibooker.
book1D(histName, histTitle, histNrBinsEta, binThresholdsEtaf));
1138 m_monElement[indexHistogram]->setAxisTitle(xAxisTitle, 1);
1139 m_monElement[indexHistogram]->setAxisTitle(yAxisTitle, 2);
1140 m_indexEta = indexHistogram;
1142 delete[] binThresholdsEtaf;
1148 template<
class CollectionType>
1150 const CollectionType* collType,
const bool validColl,
1151 const bool isL1Coll,
const int bxInEvent) {
1153 if (validColl && isL1Coll) {
1154 size_t collSize = 0;
1155 for (
CIterColl iterColl = collType->begin(); iterColl
1156 != collType->end(); ++iterColl) {
1158 if (iterColl->bx() == bxInEvent) {
1162 m_monElement[m_indexNrObjects]->Fill(collSize);
1164 size_t collSize = collType->size();
1165 m_monElement[m_indexNrObjects]->Fill(collSize);
1169 template<
class CollectionType>
1171 const CollectionType* collType,
const bool validColl,
1172 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
1175 for (
CIterColl iterColl = collType->begin(); iterColl
1176 != collType->end(); ++iterColl) {
1178 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1182 m_monElement[m_indexPt]->Fill(iterColl->pt());
1186 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
1190 m_monElement[m_indexEta]->Fill(iterColl->eta());
1197 template<
class CollectionType>
1199 const CollectionType* collType,
const bool validColl,
1200 const bool bookPhi,
const bool bookEta,
const bool isL1Coll,
const int bxInEvent) {
1203 for (
CIterColl iterColl = collType->begin(); iterColl
1204 != collType->end(); ++iterColl) {
1206 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1210 m_monElement[m_indexEt]->Fill(iterColl->et());
1214 m_monElement[m_indexPhi]->Fill(
rad2deg(iterColl->phi()) + 1.
e-6);
1218 m_monElement[m_indexEta]->Fill(iterColl->eta());
1225 template<
class CollectionType>
1227 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
1230 for (
CIterColl iterColl = collType->begin(); iterColl
1231 != collType->end(); ++iterColl) {
1233 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1237 m_monElement[m_indexEtTotal]->Fill(iterColl->etTotal());
1243 template<
class CollectionType>
1245 const CollectionType* collType,
const bool validColl,
const bool isL1Coll,
const int bxInEvent) {
1248 for (
CIterColl iterColl = collType->begin(); iterColl
1249 != collType->end(); ++iterColl) {
1251 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1255 m_monElement[m_indexCharge]->Fill(iterColl->charge());
1261 template<
class CollectionType>
1263 const CollectionType* collType,
const bool validColl,
1264 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
1267 for (
CIterColl iterColl = collType->begin(); iterColl
1268 != collType->end(); ++iterColl) {
1270 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1274 m_monElement[m_indexHfBitCounts + countIndex]->Fill(
1275 iterColl->hfBitCount(
1282 template<
class CollectionType>
1284 const CollectionType* collType,
const bool validColl,
1285 const int countIndex,
const bool isL1Coll,
const int bxInEvent) {
1288 for (
CIterColl iterColl = collType->begin(); iterColl
1289 != collType->end(); ++iterColl) {
1291 if (isL1Coll && (iterColl->bx() != bxInEvent)) {
1295 m_monElement[m_indexHfRingEtSums + countIndex]->Fill(
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MonitorElement * book1D(Args &&...args)
std::vector< float > binThresholds
const double rad2deg(const double &)
convert phi from rad (-pi, pi] to deg (0, 360)
void setCurrentFolder(const std::string &fullpath)
T const * product() const
const L1HistLimits & l1HistLimits(const L1GtObject &l1GtObject, const std::string &quantity)