12 using namespace trigger;
16 resetMe_(
true), currentRun_(-99)
19 LogDebug(
"FourVectorHLTOnline") <<
"constructor...." ;
23 LogInfo(
"FourVectorHLTOnline") <<
"unabel to get DQMStore service?";
52 std::vector<edm::ParameterSet> paths =
53 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"paths");
55 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
63 pathconf->getParameter<std::string>(
"pathname"),
64 pathconf->getParameter<std::string>(
"denompathname")
158 using namespace trigger;
160 LogDebug(
"FourVectorHLTOnline")<<
" analyze...." ;
192 if(!triggerResults.isValid()) {
194 iEvent.
getByLabel(triggerResultsLabelFU,triggerResults);
195 if(!triggerResults.isValid()) {
196 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerResults not found, "
203 int npath = triggerResults->
size();
213 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerEvent not found, " "skipping event";
222 if(!muonHandle.isValid()) {
224 edm::LogInfo(
"FourVectorHLTOnline") <<
"muonHandle not found, ";
234 edm::LogInfo(
"FourVectorHLTOnline") <<
"gsfElectrons not found, ";
237 iEvent.
getByLabel(
"caloRecoTauProducer",tauHandle);
238 if(!tauHandle.isValid())
239 edm::LogInfo(
"FourVectorHLTOnline") <<
"tauHandle not found, ";
242 iEvent.
getByLabel(
"iterativeCone5CaloJets",jetHandle);
243 if(!jetHandle.isValid())
244 edm::LogInfo(
"FourVectorHLTOnline") <<
"jetHandle not found, ";
248 iEvent.
getByLabel(
"jetProbabilityBJetTags", bTagIPHandle);
249 if (!bTagIPHandle.isValid())
250 edm::LogInfo(
"FourVectorHLTOnline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
254 iEvent.
getByLabel(
"softMuonBJetTags", bTagMuHandle);
255 if (!bTagMuHandle.isValid())
256 edm::LogInfo(
"FourVectorHLTOnline") <<
"bTagMuHandle not found, ";
260 if(!metHandle.isValid())
261 edm::LogInfo(
"FourVectorHLTOnline") <<
"metHandle not found, ";
265 if(!photonHandle.isValid())
266 edm::LogInfo(
"FourVectorHLTOnline") <<
"photonHandle not found, ";
270 if(!trackHandle.isValid())
271 edm::LogInfo(
"FourVectorHLTOnline") <<
"trackHandle not found, ";
374 tetMon.setLimits(999., 10., 999.);
387 std::vector<BaseMonitor*> monitors;
391 monitors.push_back(&muoMon);
392 monitors.push_back(&eleMon);
393 monitors.push_back(&tauMon);
394 monitors.push_back(&phoMon);
395 monitors.push_back(&jetMon);
396 monitors.push_back(&btagMon);
397 monitors.push_back(&metMon);
398 monitors.push_back(&tetMon);
420 LogTrace(
"FourVectorHLTOnline") <<
" unique path " <<
v->getPath() << std::endl;
422 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
431 if(triggerResults->accept(pathByIndex)){
446 unsigned int lastModule = triggerResults->index(pathByIndex);
449 bool hltPathPassed = triggerResults->accept(pathByIndex);
452 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
454 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
461 v->getFiltersHisto()->Fill(binNumber-1);
463 else if(
v->filtersAndIndices[filt].second < lastModule){
464 v->getFiltersHisto()->Fill(binNumber-1);
476 LogTrace(
"FourVectorHLTOnline") <<
" path " <<
v->getPath() << std::endl;
478 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
479 else btagMon = btagMuMon;
483 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
488 bool denompassed =
false;
490 for(
int i = 0;
i < npath; ++
i) {
492 if (triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos && triggerResults->accept(
i))
509 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
511 if((*mit)->isTriggerType(
v->getObjectType())) {
524 if(!mon) mon = &defMon;
533 triggertype =
v->getObjectType();
537 bool l1accept =
false;
539 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
543 LogTrace(
"FourVectorHLTOnline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << std::endl;
544 LogTrace(
"FourVectorHLTOnline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << std::endl;
545 LogTrace(
"FourVectorHLTOnline") <<
"\t tried with tag " << l1testTag << std::endl;
546 LogTrace(
"FourVectorHLTOnline") <<
"\t module index = "<< l1Index << std::endl;
555 bool numpassed =
false;
558 for(
int i = 0;
i < npath; ++
i) {
560 if (triggerNames.triggerName(
i) ==
v->getPath() && triggerResults->accept(
i)) numpassed =
true;
564 if (!numpassed)
continue;
569 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< std::endl
570 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
580 if (
v->getLabel() ==
"dummy"){
584 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
591 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
594 v->setLabel(*labelIter);}
600 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
603 LogTrace(
"FourVectorHLTOnline") <<
"WTF no index "<<
index <<
" of that name " << filterTag << std::endl;
644 LogInfo(
"FourVectorHLTOnline") <<
"analyzed " <<
nev_ <<
" events";
653 LogDebug(
"FourVectorHLTOnline") <<
"beginRun, run " << run.
id();
664 LogDebug(
"FourVectorHLTOnline") <<
"HLTConfigProvider failed to initialize.";
685 for (
unsigned int j=0;
j!=
n; ++
j) {
693 for (
unsigned int i=0;
i!=
n; ++
i) {
700 std::string filtername(
"dummy");
703 if (
plotAll_ && denomobjectType == objectType && objectType != 0)
714 for (
unsigned int i=0;
i!=
n; ++
i) {
716 std::string denompathname =
"";
723 std::string filtername(
"dummy");
738 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
753 std::string numpathname = custompathnamepair->first;
754 std::string denompathname = custompathnamepair->second;
756 if (numpathname != denompathname) {
759 bool founddenominator =
false;
760 for (
unsigned int k=0;
k!=
n; ++
k) {
764 if (n_pathname.find(denompathname) != std::string::npos) {
766 LogDebug(
"FourVectorHLTOnline") <<
"denompathname is selected to be = " << n_pathname << std::endl;;
767 founddenominator =
true;
774 if (!founddenominator) {
776 edm::LogInfo(
"FourVectorHLTOnline") <<
"denompathname not found, go to the next pair numearator-denominator" << std::endl;
784 bool foundnumerator =
false;
785 for (
unsigned int j=0;
j!=
n; ++
j) {
789 LogDebug(
"FourVectorHLTOnline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << std::endl;
792 LogDebug(
"FourVectorHLTOnline") <<
"pathname is selected to be = " << denompathname << std::endl;;
793 foundnumerator =
true;
798 if (!foundnumerator) {
800 edm::LogInfo(
"FourVectorHLTOnline") <<
"pathname not found, ignoring " << pathname;
809 std::string filtername(
"dummy");
835 std::vector<std::string> muonPaths;
836 std::vector<std::string> egammaPaths;
837 std::vector<std::string> tauPaths;
838 std::vector<std::string> jetmetPaths;
839 std::vector<std::string> restPaths;
840 std::vector<std::string> allPaths;
845 int objectType =
v->getObjectType();
847 std::vector<int> tempCount(5,0);
852 allPaths.push_back(pathName);
854 switch (objectType) {
856 muonPaths.push_back(pathName);
861 egammaPaths.push_back(pathName);
865 tauPaths.push_back(pathName);
870 jetmetPaths.push_back(pathName);
874 restPaths.push_back(pathName);
916 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
961 std::string moduleName, moduleType;
962 unsigned int moduleIndex;
965 std::vector<std::string>::const_iterator iDumpModName;
966 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
968 moduleName = *iDumpModName;
972 LogTrace (
"FourVectorHLTOnline") <<
"Module " << numModule
973 <<
" is called " << moduleName
974 <<
" , type = " << moduleType
975 <<
" , index = " << moduleIndex
980 if((moduleType.find(
"Filter") != std::string::npos && moduleType.find(
"HLTTriggerTypeFilter") == std::string::npos ) ||
981 (moduleType.find(
"Associator") != std::string::npos) ||
982 (moduleType.find(
"HLTLevel1GTSeed") != std::string::npos) ||
983 (moduleType.find(
"HLTGlobalSumsCaloMET") != std::string::npos) ||
984 (moduleType.find(
"HLTPrescaler") != std::string::npos) ) {
990 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1000 int nbin_sub =
v->filtersAndIndices.size()+2;
1004 "Filters_" +
v->getPath(),
1005 nbin_sub+1, -0.5, 0.5+(double)nbin_sub);
1007 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1009 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1016 v->getPath() +
" count per LS",
1020 v->setFilterHistos(filters);
1034 MonitorElement *NL1OffUM, *offEtL1OffUM, *offEtavsoffPhiL1OffUM=0;
1035 MonitorElement *NOnOffUM, *offEtOnOffUM, *offEtavsoffPhiOnOffUM=0;
1039 std::string labelname(
"dummy");
1040 labelname =
v->getPath() +
"_wrt_" +
v->getDenomPath();
1041 std::string histoname(labelname+
"_NOn");
1042 std::string
title(labelname+
" N online");
1043 double histEtaMax = 2.5;
1079 TString pathfolder =
dirname_ + TString(
"/") +
v->getPath();
1082 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1085 histoname = labelname+
"_NOff";
1086 title = labelname+
" N Off";
1087 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1089 histoname = labelname+
"_NL1";
1090 title = labelname+
" N L1";
1091 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1093 histoname = labelname+
"_NL1On";
1094 title = labelname+
" N L1On";
1095 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1097 histoname = labelname+
"_NL1Off";
1098 title = labelname+
" N L1Off";
1099 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1101 histoname = labelname+
"_NOnOff";
1102 title = labelname+
" N OnOff";
1103 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1106 histoname = labelname+
"_NL1OnUM";
1107 title = labelname+
" N L1OnUM";
1108 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1110 histoname = labelname+
"_NL1OffUM";
1111 title = labelname+
" N L1OffUM";
1112 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1114 histoname = labelname+
"_NOnOffUM";
1115 title = labelname+
" N OnOffUM";
1116 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1119 histoname = labelname+
"_onEtOn";
1120 title = labelname+
" onE_t online";
1121 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1123 histoname = labelname+
"_onOneOverEtOn";
1124 title = labelname+
" 1 / onE_t online";
1128 histoname = labelname+
"_offEtOff";
1129 title = labelname+
" offE_t offline";
1130 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1132 histoname = labelname+
"_l1EtL1";
1133 title = labelname+
" l1E_t L1";
1134 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1139 histoname = labelname+
"_onEtaonPhiOn";
1140 title = labelname+
" on#eta vs on#phi online";
1141 onEtavsonPhiOn = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1143 histoname = labelname+
"_offEtaoffPhiOff";
1144 title = labelname+
" off#eta vs off#phi offline";
1145 offEtavsoffPhiOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1147 histoname = labelname+
"_l1Etal1PhiL1";
1148 title = labelname+
" l1#eta vs l1#phi L1";
1149 l1Etavsl1PhiL1 = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1151 histoname = labelname+
"_l1EtL1On";
1152 title = labelname+
" l1E_t L1+online";
1153 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1155 histoname = labelname+
"_offEtL1Off";
1156 title = labelname+
" offE_t L1+offline";
1157 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1159 histoname = labelname+
"_offEtOnOff";
1160 title = labelname+
" offE_t online+offline";
1161 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1163 histoname = labelname+
"_l1Etal1PhiL1On";
1164 title = labelname+
" l1#eta vs l1#phi L1+online";
1165 l1Etavsl1PhiL1On = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1167 histoname = labelname+
"_offEtaoffPhiL1Off";
1168 title = labelname+
" off#eta vs off#phi L1+offline";
1169 offEtavsoffPhiL1Off = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1171 histoname = labelname+
"_offEtaoffPhiOnOff";
1172 title = labelname+
" off#eta vs off#phi online+offline";
1173 offEtavsoffPhiOnOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1175 histoname = labelname+
"_l1EtL1OnUM";
1176 title = labelname+
" l1E_t L1+onlineUM";
1177 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1179 histoname = labelname+
"_offEtL1OffUM";
1180 title = labelname+
" offE_t L1+offlineUM";
1181 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1183 histoname = labelname+
"_offEtOnOffUM";
1184 title = labelname+
" offE_t online+offlineUM";
1185 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1187 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1188 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1189 l1Etavsl1PhiL1OnUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1191 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1192 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1193 offEtavsoffPhiL1OffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1195 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1196 title = labelname+
" off#eta vs off#phi online+offlineUM";
1197 offEtavsoffPhiOnOffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1202 histoname = labelname+
"_l1DRL1On";
1203 title = labelname+
" l1DR L1+online";
1204 l1DRL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1206 histoname = labelname+
"_offDRL1Off";
1207 title = labelname+
" offDR L1+offline";
1208 offDRL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1210 histoname = labelname+
"_offDROnOff";
1211 title = labelname+
" offDR online+offline";
1212 offDROnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1215 v->setHistos( NOn, onEtOn, onOneOverEtOn, onEtavsonPhiOn, NOff, offEtOff, offEtavsoffPhiOff, NL1, l1EtL1, l1Etavsl1PhiL1, NL1On, l1EtL1On, l1Etavsl1PhiL1On, NL1Off, offEtL1Off, offEtavsoffPhiL1Off, NOnOff, offEtOnOff, offEtavsoffPhiOnOff, NL1OnUM, l1EtL1OnUM, l1Etavsl1PhiL1OnUM, NL1OffUM, offEtL1OffUM, offEtavsoffPhiL1OffUM, NOnOffUM, offEtOnOffUM, offEtavsoffPhiOnOffUM, offDRL1Off, offDROnOff, l1DRL1On
1225 "HLT_Any count per LS",
1239 LogDebug(
"FourVectorHLTOnline") <<
"endRun, run " << run.
id();
1247 LogDebug(
"FourVectorHLTOnline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << std::endl;
1249 if(tempSet.size() < 2)
return;
1251 if(tempSet.size() > 10) {
1253 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is too large. It will be truncated to 10." << std::endl;
1254 mmset::iterator it = tempSet.begin();
1255 for (
int i=0;
i<10;
i++) { it++; }
1256 tempSet.erase( it, tempSet.end());
1257 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << std::endl;
1261 bool cleanedOneMap =
false;
1265 while(! cleanedOneMap && tempSet.size() > 1) {
1267 cleanedOneMap=
false;
1272 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1274 fimmap tempMap_j = *setIter_i;
1279 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1290 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1292 fimmap tempMap_i = *setIter_i;
1293 fimmap::iterator it = tempMap_i.begin();
1294 int topValue = (*it).second;
1298 mmset::iterator tempIter_i = setIter_i;
1302 for ( mmset::iterator setIter_j = ++tempIter_i; setIter_j != tempSet.end( ); setIter_j++ ) {
1304 fimmap tempMap_j = *setIter_j;
1307 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it)
1310 if(topValue == (*it).second) {
1313 tempMap_j.erase(it);
1314 cleanedOneMap =
true;
1323 tempSet.erase(setIter_j);
1326 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1334 if(cleanedOneMap)
break;
1342 cleanedOneMap=
false;
1358 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1361 fimmap tempMap_j = *setIter_i;
1366 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1384 paths.push_back(
"HLT_"+label+
"_L1_Any");
1385 paths.push_back(
"HLT_"+label+
"_Any");
1386 paths.push_back(
"HLT_Any");
1389 std::string h_title;
1393 h_name=
"HLT_"+label+
"_PassPass";
1394 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1396 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1398 h_name=
"HLT_"+label+
"_Pass_Any";
1399 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1401 paths.size(), -0.5, paths.size()-0.5);
1404 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1405 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1407 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1408 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1409 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1411 paths.size(), -0.5, paths.size()-0.5);
1414 h_name=
"HLT_"+label+
"_Total_LS";
1415 h_title = label+
" HLT paths total count combined per LS ";
1419 h_name=
"HLT_"+label+
"_LS";
1420 h_title = label+
" HLT paths count per LS ";
1426 h_name=
"HLT_"+label+
"_L1_Total_LS";
1427 h_title = label+
" HLT paths total count combined per LS ";
1431 h_name=
"HLT_"+label+
"_L1_LS";
1432 h_title = label+
" HLT L1s count per LS ";
1437 h_name=
"HLT_"+label+
"_BX_LS";
1438 h_title = label+
" HLT paths total count combined per BX ";
1442 for(
unsigned int i = 0;
i < paths.size();
i++){
1444 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1445 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1446 ME_Group_LS->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1448 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1449 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1450 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1451 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1459 std::string fullPathToME;
1465 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1467 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1469 if(!ME_2d || !ME_1d) {
1471 LogTrace(
"FourVectorHLTOnline") <<
" ME not valid although I gave full path" << std::endl;
1476 TH2F * hist_2d = ME_2d->
getTH2F();
1477 TH1F * hist_1d = ME_1d->
getTH1F();
1481 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1485 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1486 hist_1d->Fill(anyBinNumber-1);
1490 bool groupPassed =
false;
1491 bool groupL1Passed =
false;
1496 for (
int i=1;
i< hist_2d->GetNbinsX();
i++) {
1498 std::string hltpathname = hist_2d->GetXaxis()->GetBinLabel(
i);
1502 unsigned int pathByIndex = triggerNames.
triggerIndex(hltpathname);
1506 if(
hasL1Passed(hltpathname,triggerNames)) groupL1Passed =
true;
1516 if(groupPassed && !groupL1Passed)
1518 hist_2d->Fill(
i-1,anyBinNumber-1);
1519 hist_2d->Fill(anyBinNumber-1,
i-1);
1523 for (
int j=1;
j< hist_2d->GetNbinsY();
j++) {
1525 unsigned int crosspathByIndex = triggerNames.
triggerIndex(hist_2d->GetXaxis()->GetBinLabel(
j));
1530 hist_2d->Fill(
i-1,
j-1);
1542 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1543 if(groupPassed) hist_1d->Fill(groupBinNumber-1);
1546 int groupL1BinNumber = hist_2d->GetXaxis()->FindBin(groupL1BinLabel.c_str());
1548 if(groupL1Passed) hist_1d->Fill(groupL1BinNumber-1);
1564 "HLT counts vs Event bx",
1565 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1567 "HLT counts vs Event bx",
1568 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1574 for(
unsigned int i = 0;
i < npaths;
i++){
1594 "All paths per LS ",
1595 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1599 for(
unsigned int i = 0;
i < npaths;
i++){
1605 unsigned int i = npaths;
1608 int nBinsPerLSHisto = 20;
1609 int nLSHistos = npaths/nBinsPerLSHisto;
1610 for (
int nh=0;nh<nLSHistos+1;nh++) {
1615 sprintf(name,
"Group_%d_paths_count_LS",nLSHistos-nh);
1616 sprintf(title,
"Group %d, paths count per LS",nLSHistos-nh);
1619 nLS_, 0,
nLS_, nBinsPerLSHisto+3, -0.5, nBinsPerLSHisto+3-0.5);
1624 for(
int i = nh*nBinsPerLSHisto; i < (nh+1)*nBinsPerLSHisto; i++){
1626 if (i ==
int(npaths))
break;
1636 bin = i % nBinsPerLSHisto;
1644 tempME->
setBinLabel(nBinsPerLSHisto+3,
"HLT_Any", 2);
1645 tempME->
setBinLabel(nBinsPerLSHisto+2,
"HLT_PhysicsDeclared", 2);
1667 LogTrace(
"FourVectorHLTOnline") <<
" end lumiSection number " << lumi << std::endl;
1680 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1687 std::string pathname = ip->first;
1688 std::vector<int> prevCount = ip->second;
1691 std::vector<int> currCount (5,0);
1692 std::vector<int> diffCount (5,0);
1695 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1697 if(pathBin > hist_2d_bx->GetNbinsY()) {
1699 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1704 for (
unsigned int j =0;
j<currCount.size();
j++) {
1708 if(bunch < 1) bunch +=
Nbx_ ;
1709 int bxBin = bunch +1;
1712 currCount[
j] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1714 LogTrace(
"FourVectorHLTOnline") <<
"currCount = " << currCount[
j] << std::endl;
1717 diffCount[
j] = currCount[
j] - prevCount[
j];
1719 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
j] << std::endl;
1722 ip->second = currCount;
1729 LogTrace(
"FourVectorHLTOnline") <<
"Find " << pathname << std::endl;
1732 bool isMember =
false;
1756 LogTrace(
"FourVectorHLTOnline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupName[
i] << std::endl;
1766 TH2F* hist_All = ME_2d->
getTH2F();
1768 for (
unsigned int j = 0;
j<diffCount.size();
j++) {
1771 int binNumber =
j+1;
1774 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1775 int updatedLumiCount = currentLumiCount + diffCount[
j];
1776 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount);
1782 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_2d" << ME_2d->
getName() << std::endl;
1796 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1802 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1807 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1813 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1815 TH1F * hist_1d = ME_1d->
getTH1F();
1820 std::string pathname = ip->first;
1821 int prevCount = ip->second;
1823 std::string binLabel =
"HLT_"+pathname+
"_L1_Any";
1825 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1827 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1829 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1832 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1837 int currCount = int(hist_1d->GetBinContent(pathBin));
1840 int diffCount = currCount - prevCount;
1842 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1845 ip->second = currCount;
1856 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1857 int updatedLumiCount = currentLumiCount + diffCount;
1858 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1863 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1877 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1883 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
1888 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1894 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1896 TH1F * hist_1d = ME_1d->
getTH1F();
1901 std::string pathname = ip->first;
1902 int prevCount = ip->second;
1904 std::string binLabel =
"HLT_"+pathname+
"_Any";
1906 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1908 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1910 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1913 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1918 int currCount = int(hist_1d->GetBinContent(pathBin));
1921 int diffCount = currCount - prevCount;
1923 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1926 ip->second = currCount;
1937 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1938 int updatedLumiCount = currentLumiCount + diffCount;
1939 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1944 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1958 LogTrace(
"FourVectorHLTOnline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1960 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
1965 LogTrace(
"FourVectorHLTOnline") <<
" could not fine 2d matrix " << fullPathToME << std::endl;
1971 TH2F * hist_2d = ME_2d->
getTH2F();
1976 std::string pathname = ip->first;
1977 int prevCount = ip->second;
1980 int pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
1982 if(pathBin > hist_2d->GetNbinsX()) {
1984 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1989 int currCount = int(hist_2d->GetBinContent(pathBin, pathBin));
1992 int diffCount = currCount - prevCount;
1994 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1997 ip->second = currCount;
2007 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2010 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2011 int updatedLumiCount = currentLumiCount + diffCount;
2012 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2017 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_HLTAll_LS_" << std::endl;
2027 TH2F* hist_All = tempME->
getTH2F();
2030 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2032 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2033 int updatedLumiCount = currentLumiCount + diffCount;
2034 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2039 LogDebug(
"FourVectorHLTOnline") <<
" cannot find tempME " << std::endl;
2054 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
2055 int updatedLumiCount = currentLumiCount + diffCount;
2056 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2061 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
2074 if (pathname.find(
"MET") != std::string::npos)
2076 if (pathname.find(
"SumET") != std::string::npos)
2078 if (pathname.find(
"HT") != std::string::npos)
2080 if (pathname.find(
"Jet") != std::string::npos)
2082 if (pathname.find(
"Mu") != std::string::npos)
2084 if (pathname.find(
"Ele") != std::string::npos)
2086 if (pathname.find(
"Photon") != std::string::npos)
2088 if (pathname.find(
"Tau") != std::string::npos)
2090 if (pathname.find(
"IsoTrack") != std::string::npos)
2092 if (pathname.find(
"BTag") != std::string::npos)
2104 std::string l1pathname =
"dummy";
2108 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2109 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2113 l1pathname = *numpathmodule;
2133 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2141 rc = (l1ModuleIndex < lastModule);
2152 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
unsigned int size() const
number of trigger paths in trigger table
LuminosityBlockID id() const
T getParameter(std::string const &) const
edm::Handle< trigger::TriggerEvent > fTriggerObj
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
PathInfoCollection hltPathsDiagonal_
const std::string getL1ConditionModuleName(const std::string &pathname)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
edm::InputTag triggerSummaryLabel_
std::string pathsSummaryHLTPathsPerBXFolder_
const std::string moduleType(const std::string &module) const
C++ class name of module.
virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)=0
MonitorElement * scalersSelect
const std::string & triggerName(unsigned int triggerIndex) const
std::vector< std::pair< std::string, std::vector< int > > > fPathBxTempCountPair
virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)=0
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
std::string pathsSummaryFolder_
void setupHltMatrix(std::string label, std::vector< std::string > paths)
enum start value shifted to 81 so as to avoid clashes with PDG codes
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
void countHLTGroupBXHitsEndLumiBlock(const int &lumi)
void fillHltMatrix(const edm::TriggerNames &triggerNames)
int bunchCrossing() const
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::multimap< float, int > fimmap
edm::Handle< edm::TriggerResults > triggerResults_
void countHLTPathHitsEndLumiBlock(const int &lumi)
Strings::size_type size() const
std::vector< std::pair< std::string, int > > fPathTempCountPair
void cleanDRMatchSet(mmset &tempSet)
Clean DR Match Set.
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::vector< TPRegexp > filters
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::string pathsIndividualHLTPathsPerLSFolder_
PathInfoCollection hltPaths_
std::set< fimmap, std::less< fimmap > > mmset
U second(std::pair< T, U > const &p)
const std::string * pathName() const
std::string pathsSummaryHLTPathsPerLSFolder_
unsigned int referenceBX_
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
unsigned int triggerIndex(std::string const &name) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setLimits(float etaMax, float etMin, float drMatch)
std::vector< std::pair< std::string, int > > fGroupTempCountPair
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
std::vector< MonitorElement * > v_ME_HLTAll_LS_
MonitorElement * ME_HLT_BX_
void setVerbose(unsigned level)
MonitorElement * ME_HLT_CUSTOM_BX_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int nBinsOneOverEt_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
virtual void clearSets(void)=0
void countHLTGroupL1HitsEndLumiBlock(const int &lumi)
HLTConfigProvider hltConfig_
std::string muonRecoCollectionName_
std::string pathsSummaryFilterCountsFolder_
MonitorElement * ME_HLTAll_LS_
std::vector< std::string > specialPaths_
bool hasL1Passed(const std::string &pathname, const edm::TriggerNames &triggerNames)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
std::vector< std::string > fGroupName
std::string fCustomBXPath
std::vector< std::pair< std::string, std::vector< std::string > > > fGroupNamePathsPair
virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)=0
std::vector< std::pair< std::string, int > > fGroupL1TempCountPair
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
FourVectorHLTOnline(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
int getTriggerTypeParsePathName(const std::string &pathname)
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setReco(edm::Handle< T > offColl)
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
std::string pathsSummaryHLTCorrelationsFolder_
const std::vector< std::string > & datasetNames() const
edm::InputTag triggerResultsLabel_
void setBJetsFlag(bool flag)