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") != string::npos) ||
992 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1002 int nbin_sub =
v->filtersAndIndices.size()+2;
1006 "Filters_" +
v->getPath(),
1007 nbin_sub+1, -0.5, 0.5+(double)nbin_sub);
1009 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1011 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1018 v->getPath() +
" count per LS",
1022 v->setFilterHistos(filters);
1036 MonitorElement *NL1OffUM, *offEtL1OffUM, *offEtavsoffPhiL1OffUM=0;
1037 MonitorElement *NOnOffUM, *offEtOnOffUM, *offEtavsoffPhiOnOffUM=0;
1041 std::string labelname(
"dummy");
1042 labelname =
v->getPath() +
"_wrt_" +
v->getDenomPath();
1043 std::string histoname(labelname+
"_NOn");
1044 std::string
title(labelname+
" N online");
1045 double histEtaMax = 2.5;
1081 TString pathfolder =
dirname_ + TString(
"/") +
v->getPath();
1084 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1087 histoname = labelname+
"_NOff";
1088 title = labelname+
" N Off";
1089 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1091 histoname = labelname+
"_NL1";
1092 title = labelname+
" N L1";
1093 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1095 histoname = labelname+
"_NL1On";
1096 title = labelname+
" N L1On";
1097 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1099 histoname = labelname+
"_NL1Off";
1100 title = labelname+
" N L1Off";
1101 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1103 histoname = labelname+
"_NOnOff";
1104 title = labelname+
" N OnOff";
1105 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1108 histoname = labelname+
"_NL1OnUM";
1109 title = labelname+
" N L1OnUM";
1110 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1112 histoname = labelname+
"_NL1OffUM";
1113 title = labelname+
" N L1OffUM";
1114 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1116 histoname = labelname+
"_NOnOffUM";
1117 title = labelname+
" N OnOffUM";
1118 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1121 histoname = labelname+
"_onEtOn";
1122 title = labelname+
" onE_t online";
1123 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1125 histoname = labelname+
"_onOneOverEtOn";
1126 title = labelname+
" 1 / onE_t online";
1130 histoname = labelname+
"_offEtOff";
1131 title = labelname+
" offE_t offline";
1132 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1134 histoname = labelname+
"_l1EtL1";
1135 title = labelname+
" l1E_t L1";
1136 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1141 histoname = labelname+
"_onEtaonPhiOn";
1142 title = labelname+
" on#eta vs on#phi online";
1143 onEtavsonPhiOn = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1145 histoname = labelname+
"_offEtaoffPhiOff";
1146 title = labelname+
" off#eta vs off#phi offline";
1147 offEtavsoffPhiOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1149 histoname = labelname+
"_l1Etal1PhiL1";
1150 title = labelname+
" l1#eta vs l1#phi L1";
1151 l1Etavsl1PhiL1 = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1153 histoname = labelname+
"_l1EtL1On";
1154 title = labelname+
" l1E_t L1+online";
1155 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1157 histoname = labelname+
"_offEtL1Off";
1158 title = labelname+
" offE_t L1+offline";
1159 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1161 histoname = labelname+
"_offEtOnOff";
1162 title = labelname+
" offE_t online+offline";
1163 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1165 histoname = labelname+
"_l1Etal1PhiL1On";
1166 title = labelname+
" l1#eta vs l1#phi L1+online";
1167 l1Etavsl1PhiL1On = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1169 histoname = labelname+
"_offEtaoffPhiL1Off";
1170 title = labelname+
" off#eta vs off#phi L1+offline";
1171 offEtavsoffPhiL1Off = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1173 histoname = labelname+
"_offEtaoffPhiOnOff";
1174 title = labelname+
" off#eta vs off#phi online+offline";
1175 offEtavsoffPhiOnOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1177 histoname = labelname+
"_l1EtL1OnUM";
1178 title = labelname+
" l1E_t L1+onlineUM";
1179 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1181 histoname = labelname+
"_offEtL1OffUM";
1182 title = labelname+
" offE_t L1+offlineUM";
1183 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1185 histoname = labelname+
"_offEtOnOffUM";
1186 title = labelname+
" offE_t online+offlineUM";
1187 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1189 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1190 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1191 l1Etavsl1PhiL1OnUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1193 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1194 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1195 offEtavsoffPhiL1OffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1197 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1198 title = labelname+
" off#eta vs off#phi online+offlineUM";
1199 offEtavsoffPhiOnOffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1204 histoname = labelname+
"_l1DRL1On";
1205 title = labelname+
" l1DR L1+online";
1206 l1DRL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1208 histoname = labelname+
"_offDRL1Off";
1209 title = labelname+
" offDR L1+offline";
1210 offDRL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1212 histoname = labelname+
"_offDROnOff";
1213 title = labelname+
" offDR online+offline";
1214 offDROnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1217 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
1227 "HLT_Any count per LS",
1241 LogDebug(
"FourVectorHLTOnline") <<
"endRun, run " << run.
id();
1249 LogDebug(
"FourVectorHLTOnline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << std::endl;
1251 if(tempSet.size() < 2)
return;
1253 if(tempSet.size() > 10) {
1255 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is too large. It will be truncated to 10." << std::endl;
1256 mmset::iterator it = tempSet.begin();
1257 for (
int i=0;
i<10;
i++) { it++; }
1258 tempSet.erase( it, tempSet.end());
1259 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << std::endl;
1263 bool cleanedOneMap =
false;
1267 while(! cleanedOneMap && tempSet.size() > 1) {
1269 cleanedOneMap=
false;
1274 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1276 fimmap tempMap_j = *setIter_i;
1281 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1292 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1294 fimmap tempMap_i = *setIter_i;
1295 fimmap::iterator it = tempMap_i.begin();
1296 int topValue = (*it).second;
1300 mmset::iterator tempIter_i = setIter_i;
1304 for ( mmset::iterator setIter_j = ++tempIter_i; setIter_j != tempSet.end( ); setIter_j++ ) {
1306 fimmap tempMap_j = *setIter_j;
1309 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it)
1312 if(topValue == (*it).second) {
1315 tempMap_j.erase(it);
1316 cleanedOneMap =
true;
1325 tempSet.erase(setIter_j);
1328 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1336 if(cleanedOneMap)
break;
1344 cleanedOneMap=
false;
1360 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1363 fimmap tempMap_j = *setIter_i;
1368 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1386 paths.push_back(
"HLT_"+label+
"_L1_Any");
1387 paths.push_back(
"HLT_"+label+
"_Any");
1388 paths.push_back(
"HLT_Any");
1391 std::string h_title;
1395 h_name=
"HLT_"+label+
"_PassPass";
1396 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1398 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1400 h_name=
"HLT_"+label+
"_Pass_Any";
1401 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1403 paths.size(), -0.5, paths.size()-0.5);
1406 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1407 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1409 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1410 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1411 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1413 paths.size(), -0.5, paths.size()-0.5);
1416 h_name=
"HLT_"+label+
"_Total_LS";
1417 h_title = label+
" HLT paths total count combined per LS ";
1421 h_name=
"HLT_"+label+
"_LS";
1422 h_title = label+
" HLT paths count per LS ";
1428 h_name=
"HLT_"+label+
"_L1_Total_LS";
1429 h_title = label+
" HLT paths total count combined per LS ";
1433 h_name=
"HLT_"+label+
"_L1_LS";
1434 h_title = label+
" HLT L1s count per LS ";
1439 h_name=
"HLT_"+label+
"_BX_LS";
1440 h_title = label+
" HLT paths total count combined per BX ";
1444 for(
unsigned int i = 0;
i < paths.size();
i++){
1446 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1447 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1448 ME_Group_LS->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1450 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1451 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1452 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1453 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1461 std::string fullPathToME;
1467 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1469 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1471 if(!ME_2d || !ME_1d) {
1473 LogTrace(
"FourVectorHLTOnline") <<
" ME not valid although I gave full path" << std::endl;
1478 TH2F * hist_2d = ME_2d->
getTH2F();
1479 TH1F * hist_1d = ME_1d->
getTH1F();
1483 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1487 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1488 hist_1d->Fill(anyBinNumber-1);
1492 bool groupPassed =
false;
1493 bool groupL1Passed =
false;
1498 for (
int i=1;
i< hist_2d->GetNbinsX();
i++) {
1500 std::string hltpathname = hist_2d->GetXaxis()->GetBinLabel(
i);
1504 unsigned int pathByIndex = triggerNames.
triggerIndex(hltpathname);
1508 if(
hasL1Passed(hltpathname,triggerNames)) groupL1Passed =
true;
1518 if(groupPassed && !groupL1Passed)
1520 hist_2d->Fill(
i-1,anyBinNumber-1);
1521 hist_2d->Fill(anyBinNumber-1,
i-1);
1525 for (
int j=1;
j< hist_2d->GetNbinsY();
j++) {
1527 unsigned int crosspathByIndex = triggerNames.
triggerIndex(hist_2d->GetXaxis()->GetBinLabel(
j));
1532 hist_2d->Fill(
i-1,
j-1);
1544 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1545 if(groupPassed) hist_1d->Fill(groupBinNumber-1);
1548 int groupL1BinNumber = hist_2d->GetXaxis()->FindBin(groupL1BinLabel.c_str());
1550 if(groupL1Passed) hist_1d->Fill(groupL1BinNumber-1);
1566 "HLT counts vs Event bx",
1567 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1569 "HLT counts vs Event bx",
1570 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1576 for(
unsigned int i = 0;
i < npaths;
i++){
1596 "All paths per LS ",
1597 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1601 for(
unsigned int i = 0;
i < npaths;
i++){
1607 unsigned int i = npaths;
1610 int nBinsPerLSHisto = 20;
1611 int nLSHistos = npaths/nBinsPerLSHisto;
1612 for (
int nh=0;nh<nLSHistos+1;nh++) {
1617 sprintf(name,
"Group_%d_paths_count_LS",nLSHistos-nh);
1618 sprintf(title,
"Group %d, paths count per LS",nLSHistos-nh);
1621 nLS_, 0,
nLS_, nBinsPerLSHisto+3, -0.5, nBinsPerLSHisto+3-0.5);
1626 for(
int i = nh*nBinsPerLSHisto; i < (nh+1)*nBinsPerLSHisto; i++){
1628 if (i ==
int(npaths))
break;
1638 bin = i % nBinsPerLSHisto;
1646 tempME->
setBinLabel(nBinsPerLSHisto+3,
"HLT_Any", 2);
1647 tempME->
setBinLabel(nBinsPerLSHisto+2,
"HLT_PhysicsDeclared", 2);
1669 LogTrace(
"FourVectorHLTOnline") <<
" end lumiSection number " << lumi << std::endl;
1682 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1689 std::string pathname = ip->first;
1690 std::vector<int> prevCount = ip->second;
1693 std::vector<int> currCount (5,0);
1694 std::vector<int> diffCount (5,0);
1697 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1699 if(pathBin > hist_2d_bx->GetNbinsY()) {
1701 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1706 for (
unsigned int j =0;
j<currCount.size();
j++) {
1710 if(bunch < 1) bunch +=
Nbx_ ;
1711 int bxBin = bunch +1;
1714 currCount[
j] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1716 LogTrace(
"FourVectorHLTOnline") <<
"currCount = " << currCount[
j] << std::endl;
1719 diffCount[
j] = currCount[
j] - prevCount[
j];
1721 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
j] << std::endl;
1724 ip->second = currCount;
1731 LogTrace(
"FourVectorHLTOnline") <<
"Find " << pathname << std::endl;
1734 bool isMember =
false;
1758 LogTrace(
"FourVectorHLTOnline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupName[
i] << std::endl;
1768 TH2F* hist_All = ME_2d->
getTH2F();
1770 for (
unsigned int j = 0;
j<diffCount.size();
j++) {
1773 int binNumber =
j+1;
1776 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1777 int updatedLumiCount = currentLumiCount + diffCount[
j];
1778 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount);
1784 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_2d" << ME_2d->
getName() << std::endl;
1798 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1804 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1809 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1815 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1817 TH1F * hist_1d = ME_1d->
getTH1F();
1822 std::string pathname = ip->first;
1823 int prevCount = ip->second;
1825 std::string binLabel =
"HLT_"+pathname+
"_L1_Any";
1827 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1829 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1831 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1834 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1839 int currCount = int(hist_1d->GetBinContent(pathBin));
1842 int diffCount = currCount - prevCount;
1844 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1847 ip->second = currCount;
1858 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1859 int updatedLumiCount = currentLumiCount + diffCount;
1860 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1865 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1879 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1885 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
1890 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1896 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1898 TH1F * hist_1d = ME_1d->
getTH1F();
1903 std::string pathname = ip->first;
1904 int prevCount = ip->second;
1906 std::string binLabel =
"HLT_"+pathname+
"_Any";
1908 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1910 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1912 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1915 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1920 int currCount = int(hist_1d->GetBinContent(pathBin));
1923 int diffCount = currCount - prevCount;
1925 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1928 ip->second = currCount;
1939 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1940 int updatedLumiCount = currentLumiCount + diffCount;
1941 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1946 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1960 LogTrace(
"FourVectorHLTOnline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1962 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
1967 LogTrace(
"FourVectorHLTOnline") <<
" could not fine 2d matrix " << fullPathToME << std::endl;
1973 TH2F * hist_2d = ME_2d->
getTH2F();
1978 std::string pathname = ip->first;
1979 int prevCount = ip->second;
1982 int pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
1984 if(pathBin > hist_2d->GetNbinsX()) {
1986 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1991 int currCount = int(hist_2d->GetBinContent(pathBin, pathBin));
1994 int diffCount = currCount - prevCount;
1996 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1999 ip->second = currCount;
2009 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2012 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2013 int updatedLumiCount = currentLumiCount + diffCount;
2014 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2019 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_HLTAll_LS_" << std::endl;
2029 TH2F* hist_All = tempME->
getTH2F();
2032 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2034 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2035 int updatedLumiCount = currentLumiCount + diffCount;
2036 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2041 LogDebug(
"FourVectorHLTOnline") <<
" cannot find tempME " << std::endl;
2056 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
2057 int updatedLumiCount = currentLumiCount + diffCount;
2058 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2063 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
2076 if (pathname.find(
"MET") != std::string::npos)
2078 if (pathname.find(
"SumET") != std::string::npos)
2080 if (pathname.find(
"HT") != std::string::npos)
2082 if (pathname.find(
"Jet") != std::string::npos)
2084 if (pathname.find(
"Mu") != std::string::npos)
2086 if (pathname.find(
"Ele") != std::string::npos)
2088 if (pathname.find(
"Photon") != std::string::npos)
2090 if (pathname.find(
"Tau") != std::string::npos)
2092 if (pathname.find(
"IsoTrack") != std::string::npos)
2094 if (pathname.find(
"BTag") != std::string::npos)
2106 std::string l1pathname =
"dummy";
2110 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2111 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2115 l1pathname = *numpathmodule;
2135 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2143 rc = (l1ModuleIndex < lastModule);
2154 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
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
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)