11 using namespace trigger;
15 resetMe_(
true), currentRun_(-99)
18 LogDebug(
"FourVectorHLTOnline") <<
"constructor...." ;
22 LogInfo(
"FourVectorHLTOnline") <<
"unabel to get DQMStore service?";
51 std::vector<edm::ParameterSet>
paths =
52 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"paths");
54 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
63 pathconf->getParameter<
std::string>(
"denompathname")
174 using namespace trigger;
176 LogDebug(
"FourVectorHLTOnline")<<
" analyze...." ;
185 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerResults not found, "
201 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerEvent not found, " "skipping event";
210 if(!muonHandle.isValid()) {
212 edm::LogInfo(
"FourVectorHLTOnline") <<
"muonHandle not found, ";
222 edm::LogInfo(
"FourVectorHLTOnline") <<
"gsfElectrons not found, ";
226 if(!tauHandle.isValid())
227 edm::LogInfo(
"FourVectorHLTOnline") <<
"tauHandle not found, ";
231 if(!jetHandle.isValid())
232 edm::LogInfo(
"FourVectorHLTOnline") <<
"jetHandle not found, ";
237 if (!bTagIPHandle.isValid())
238 edm::LogInfo(
"FourVectorHLTOnline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
243 if (!bTagMuHandle.isValid())
244 edm::LogInfo(
"FourVectorHLTOnline") <<
"bTagMuHandle not found, ";
248 if(!metHandle.isValid())
249 edm::LogInfo(
"FourVectorHLTOnline") <<
"metHandle not found, ";
253 if(!photonHandle.isValid())
254 edm::LogInfo(
"FourVectorHLTOnline") <<
"photonHandle not found, ";
258 if(!trackHandle.isValid())
259 edm::LogInfo(
"FourVectorHLTOnline") <<
"trackHandle not found, ";
362 tetMon.setLimits(999., 10., 999.);
375 std::vector<BaseMonitor*> monitors;
379 monitors.push_back(&muoMon);
380 monitors.push_back(&eleMon);
381 monitors.push_back(&tauMon);
382 monitors.push_back(&phoMon);
383 monitors.push_back(&jetMon);
384 monitors.push_back(&btagMon);
385 monitors.push_back(&metMon);
386 monitors.push_back(&tetMon);
408 LogTrace(
"FourVectorHLTOnline") <<
" unique path " <<
v->getPath() << std::endl;
410 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
440 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
442 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
449 v->getFiltersHisto()->Fill(binNumber-1);
451 else if(
v->filtersAndIndices[filt].second < lastModule){
452 v->getFiltersHisto()->Fill(binNumber-1);
464 LogTrace(
"FourVectorHLTOnline") <<
" path " <<
v->getPath() << std::endl;
466 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
467 else btagMon = btagMuMon;
471 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
476 bool denompassed =
false;
478 for(
int i = 0;
i < npath; ++
i) {
480 if (triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos &&
triggerResults->accept(
i))
497 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
499 if((*mit)->isTriggerType(
v->getObjectType())) {
512 if(!mon) mon = &defMon;
525 bool l1accept =
false;
527 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
531 LogTrace(
"FourVectorHLTOnline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << std::endl;
532 LogTrace(
"FourVectorHLTOnline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << std::endl;
533 LogTrace(
"FourVectorHLTOnline") <<
"\t tried with tag " << l1testTag << std::endl;
534 LogTrace(
"FourVectorHLTOnline") <<
"\t module index = "<< l1Index << std::endl;
543 bool numpassed =
false;
546 for(
int i = 0;
i < npath; ++
i) {
548 if (triggerNames.triggerName(
i) ==
v->getPath() &&
triggerResults->accept(
i)) numpassed =
true;
552 if (!numpassed)
continue;
557 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< std::endl
558 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
568 if (
v->getLabel() ==
"dummy"){
572 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
579 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
582 v->setLabel(*labelIter);}
588 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
591 LogTrace(
"FourVectorHLTOnline") <<
"WTF no index of that name " << filterTag << std::endl;
632 LogInfo(
"FourVectorHLTOnline") <<
"analyzed " <<
nev_ <<
" events";
640 LogDebug(
"FourVectorHLTOnline") <<
"beginRun, run " << run.
id();
650 LogDebug(
"FourVectorHLTOnline") <<
"HLTConfigProvider failed to initialize.";
671 for (
unsigned int j=0;
j!=
n; ++
j) {
679 for (
unsigned int i=0;
i!=
n; ++
i) {
689 if (
plotAll_ && denomobjectType == objectType && objectType != 0)
700 for (
unsigned int i=0;
i!=
n; ++
i) {
724 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
739 std::string numpathname = custompathnamepair->first;
740 std::string denompathname = custompathnamepair->second;
742 if (numpathname != denompathname) {
745 bool founddenominator =
false;
746 for (
unsigned int k=0;
k!=
n; ++
k) {
750 if (n_pathname.find(denompathname) != std::string::npos) {
752 LogDebug(
"FourVectorHLTOnline") <<
"denompathname is selected to be = " << n_pathname << std::endl;;
753 founddenominator =
true;
760 if (!founddenominator) {
762 edm::LogInfo(
"FourVectorHLTOnline") <<
"denompathname not found, go to the next pair numearator-denominator" << std::endl;
770 bool foundnumerator =
false;
771 for (
unsigned int j=0;
j!=
n; ++
j) {
775 LogDebug(
"FourVectorHLTOnline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << std::endl;
778 LogDebug(
"FourVectorHLTOnline") <<
"pathname is selected to be = " << denompathname << std::endl;;
779 foundnumerator =
true;
784 if (!foundnumerator) {
821 std::vector<std::string> muonPaths;
822 std::vector<std::string> egammaPaths;
823 std::vector<std::string> tauPaths;
824 std::vector<std::string> jetmetPaths;
825 std::vector<std::string> restPaths;
826 std::vector<std::string> allPaths;
831 int objectType =
v->getObjectType();
833 std::vector<int> tempCount(5,0);
838 allPaths.push_back(pathName);
840 switch (objectType) {
842 muonPaths.push_back(pathName);
847 egammaPaths.push_back(pathName);
851 tauPaths.push_back(pathName);
856 jetmetPaths.push_back(pathName);
860 restPaths.push_back(pathName);
902 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
949 unsigned int moduleIndex;
952 std::vector<std::string>::const_iterator iDumpModName;
953 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
955 moduleName = *iDumpModName;
959 LogTrace (
"FourVectorHLTOnline") <<
"Module " << numModule
960 <<
" is called " << moduleName
961 <<
" , type = " << moduleType
962 <<
" , index = " << moduleIndex
967 if((moduleType.find(
"Filter") != std::string::npos && moduleType.find(
"HLTTriggerTypeFilter") == std::string::npos ) ||
968 (moduleType.find(
"Associator") != std::string::npos) ||
969 (moduleType.find(
"HLTLevel1GTSeed") != std::string::npos) ||
970 (moduleType.find(
"HLTGlobalSumsCaloMET") != std::string::npos) ||
971 (moduleType.find(
"HLTPrescaler") != string::npos) ||
979 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
990 int nbin_sub =
v->filtersAndIndices.size()+2;
998 for (
unsigned int k=0;
k<datasetNames.size();
k++) {
1004 for (
unsigned int m=0;
m<datasetPaths.size();
m++){
1007 if(datasetPaths[
m]==pathName){
1016 "Filters_" +
v->getPath(),
1017 nbin_sub+1, -0.5, 0.5+(double)nbin_sub);
1019 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1021 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1028 v->getPath() +
" count per LS",
1032 v->setFilterHistos(filters);
1046 MonitorElement *NL1OffUM, *offEtL1OffUM, *offEtavsoffPhiL1OffUM=0;
1047 MonitorElement *NOnOffUM, *offEtOnOffUM, *offEtavsoffPhiOnOffUM=0;
1052 labelname =
v->getPath() +
"_wrt_" +
v->getDenomPath();
1055 double histEtaMax = 2.5;
1091 TString pathfolder =
dirname_ + TString(
"/") +
v->getPath();
1094 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1097 histoname = labelname+
"_NOff";
1098 title = labelname+
" N Off";
1099 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1101 histoname = labelname+
"_NL1";
1102 title = labelname+
" N L1";
1103 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1105 histoname = labelname+
"_NL1On";
1106 title = labelname+
" N L1On";
1107 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1109 histoname = labelname+
"_NL1Off";
1110 title = labelname+
" N L1Off";
1111 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1113 histoname = labelname+
"_NOnOff";
1114 title = labelname+
" N OnOff";
1115 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1118 histoname = labelname+
"_NL1OnUM";
1119 title = labelname+
" N L1OnUM";
1120 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1122 histoname = labelname+
"_NL1OffUM";
1123 title = labelname+
" N L1OffUM";
1124 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1126 histoname = labelname+
"_NOnOffUM";
1127 title = labelname+
" N OnOffUM";
1128 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1131 histoname = labelname+
"_onEtOn";
1132 title = labelname+
" onE_t online";
1133 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1135 histoname = labelname+
"_onOneOverEtOn";
1136 title = labelname+
" 1 / onE_t online";
1140 histoname = labelname+
"_offEtOff";
1141 title = labelname+
" offE_t offline";
1142 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1144 histoname = labelname+
"_l1EtL1";
1145 title = labelname+
" l1E_t L1";
1146 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1151 histoname = labelname+
"_onEtaonPhiOn";
1152 title = labelname+
" on#eta vs on#phi online";
1153 onEtavsonPhiOn = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1155 histoname = labelname+
"_offEtaoffPhiOff";
1156 title = labelname+
" off#eta vs off#phi offline";
1157 offEtavsoffPhiOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1159 histoname = labelname+
"_l1Etal1PhiL1";
1160 title = labelname+
" l1#eta vs l1#phi L1";
1161 l1Etavsl1PhiL1 = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1163 histoname = labelname+
"_l1EtL1On";
1164 title = labelname+
" l1E_t L1+online";
1165 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1167 histoname = labelname+
"_offEtL1Off";
1168 title = labelname+
" offE_t L1+offline";
1169 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1171 histoname = labelname+
"_offEtOnOff";
1172 title = labelname+
" offE_t online+offline";
1173 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1175 histoname = labelname+
"_l1Etal1PhiL1On";
1176 title = labelname+
" l1#eta vs l1#phi L1+online";
1177 l1Etavsl1PhiL1On = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1179 histoname = labelname+
"_offEtaoffPhiL1Off";
1180 title = labelname+
" off#eta vs off#phi L1+offline";
1181 offEtavsoffPhiL1Off = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1183 histoname = labelname+
"_offEtaoffPhiOnOff";
1184 title = labelname+
" off#eta vs off#phi online+offline";
1185 offEtavsoffPhiOnOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1187 histoname = labelname+
"_l1EtL1OnUM";
1188 title = labelname+
" l1E_t L1+onlineUM";
1189 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1191 histoname = labelname+
"_offEtL1OffUM";
1192 title = labelname+
" offE_t L1+offlineUM";
1193 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1195 histoname = labelname+
"_offEtOnOffUM";
1196 title = labelname+
" offE_t online+offlineUM";
1197 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1199 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1200 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1201 l1Etavsl1PhiL1OnUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1203 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1204 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1205 offEtavsoffPhiL1OffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1207 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1208 title = labelname+
" off#eta vs off#phi online+offlineUM";
1209 offEtavsoffPhiOnOffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1214 histoname = labelname+
"_l1DRL1On";
1215 title = labelname+
" l1DR L1+online";
1216 l1DRL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1218 histoname = labelname+
"_offDRL1Off";
1219 title = labelname+
" offDR L1+offline";
1220 offDRL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1222 histoname = labelname+
"_offDROnOff";
1223 title = labelname+
" offDR online+offline";
1224 offDROnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1227 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
1237 "HLT_Any count per LS",
1251 LogDebug(
"FourVectorHLTOnline") <<
"endRun, run " << run.
id();
1259 LogDebug(
"FourVectorHLTOnline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << std::endl;
1261 if(tempSet.size() < 2)
return;
1263 if(tempSet.size() > 10) {
1265 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is too large. It will be truncated to 10." << std::endl;
1266 mmset::iterator it = tempSet.begin();
1267 for (
int i=0;
i<10;
i++) { it++; }
1268 tempSet.erase( it, tempSet.end());
1269 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << std::endl;
1273 bool cleanedOneMap =
false;
1277 while(! cleanedOneMap && tempSet.size() > 1) {
1279 cleanedOneMap=
false;
1284 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1286 fimmap tempMap_j = *setIter_i;
1291 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1302 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1304 fimmap tempMap_i = *setIter_i;
1305 fimmap::iterator it = tempMap_i.begin();
1306 int topValue = (*it).second;
1310 mmset::iterator tempIter_i = setIter_i;
1314 for ( mmset::iterator setIter_j = ++tempIter_i; setIter_j != tempSet.end( ); setIter_j++ ) {
1316 fimmap tempMap_j = *setIter_j;
1319 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it)
1322 if(topValue == (*it).second) {
1325 tempMap_j.erase(it);
1326 cleanedOneMap =
true;
1335 tempSet.erase(setIter_j);
1338 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1346 if(cleanedOneMap)
break;
1354 cleanedOneMap=
false;
1370 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1373 fimmap tempMap_j = *setIter_i;
1378 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1395 paths.push_back(
"HLT_"+label+
"_L1_Any");
1396 paths.push_back(
"HLT_"+label+
"_Any");
1397 paths.push_back(
"HLT_Any");
1404 h_name=
"HLT_"+label+
"_PassPass";
1405 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1407 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1409 h_name=
"HLT_"+label+
"_Pass_Any";
1410 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1412 paths.size(), -0.5, paths.size()-0.5);
1415 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1416 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1418 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1419 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1420 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1422 paths.size(), -0.5, paths.size()-0.5);
1425 h_name=
"HLT_"+label+
"_Total_LS";
1426 h_title = label+
" HLT paths total count combined per LS ";
1430 h_name=
"HLT_"+label+
"_LS";
1431 h_title = label+
" HLT paths count per LS ";
1437 h_name=
"HLT_"+label+
"_L1_Total_LS";
1438 h_title = label+
" HLT paths total count combined per LS ";
1442 h_name=
"HLT_"+label+
"_L1_LS";
1443 h_title = label+
" HLT L1s count per LS ";
1448 h_name=
"HLT_"+label+
"_BX_LS";
1449 h_title = label+
" HLT paths total count combined per BX ";
1453 for(
unsigned int i = 0;
i < paths.size();
i++){
1455 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1456 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1457 ME_Group_LS->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1459 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1460 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1461 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1462 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1476 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1478 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1480 if(!ME_2d || !ME_1d) {
1482 LogTrace(
"FourVectorHLTOnline") <<
" ME not valid although I gave full path" << std::endl;
1487 TH2F * hist_2d = ME_2d->
getTH2F();
1488 TH1F * hist_1d = ME_1d->
getTH1F();
1492 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1496 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1497 hist_1d->Fill(anyBinNumber-1);
1501 bool groupPassed =
false;
1502 bool groupL1Passed =
false;
1507 for (
int i=1;
i< hist_2d->GetNbinsX();
i++) {
1509 std::string hltpathname = hist_2d->GetXaxis()->GetBinLabel(
i);
1513 unsigned int pathByIndex = triggerNames.
triggerIndex(hltpathname);
1517 if(
hasL1Passed(hltpathname,triggerNames)) groupL1Passed =
true;
1527 if(groupPassed && !groupL1Passed)
1529 hist_2d->Fill(
i-1,anyBinNumber-1);
1530 hist_2d->Fill(anyBinNumber-1,
i-1);
1534 for (
int j=1;
j< hist_2d->GetNbinsY();
j++) {
1536 unsigned int crosspathByIndex = triggerNames.
triggerIndex(hist_2d->GetXaxis()->GetBinLabel(
j));
1541 hist_2d->Fill(
i-1,
j-1);
1553 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1554 if(groupPassed) hist_1d->Fill(groupBinNumber-1);
1557 int groupL1BinNumber = hist_2d->GetXaxis()->FindBin(groupL1BinLabel.c_str());
1559 if(groupL1Passed) hist_1d->Fill(groupL1BinNumber-1);
1575 "HLT counts vs Event bx",
1576 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1578 "HLT counts vs Event bx",
1579 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1585 for(
unsigned int i = 0;
i < npaths;
i++){
1605 "All paths per LS ",
1606 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1610 for(
unsigned int i = 0;
i < npaths;
i++){
1616 unsigned int i = npaths;
1619 int nBinsPerLSHisto = 20;
1620 int nLSHistos = npaths/nBinsPerLSHisto;
1621 for (
int nh=0;nh<nLSHistos+1;nh++) {
1626 sprintf(name,
"Group_%d_paths_count_LS",nLSHistos-nh);
1627 sprintf(title,
"Group %d, paths count per LS",nLSHistos-nh);
1630 nLS_, 0,
nLS_, nBinsPerLSHisto+3, -0.5, nBinsPerLSHisto+3-0.5);
1635 for(
int i = nh*nBinsPerLSHisto; i < (nh+1)*nBinsPerLSHisto; i++){
1637 if (i ==
int(npaths))
break;
1647 bin = i % nBinsPerLSHisto;
1655 tempME->
setBinLabel(nBinsPerLSHisto+3,
"HLT_Any", 2);
1656 tempME->
setBinLabel(nBinsPerLSHisto+2,
"HLT_PhysicsDeclared", 2);
1678 LogTrace(
"FourVectorHLTOnline") <<
" end lumiSection number " << lumi << std::endl;
1691 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1699 std::vector<int> prevCount = ip->second;
1702 std::vector<int> currCount (5,0);
1703 std::vector<int> diffCount (5,0);
1706 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1708 if(pathBin > hist_2d_bx->GetNbinsY()) {
1710 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1715 for (
unsigned int j =0;
j<currCount.size();
j++) {
1719 if(bunch < 1) bunch +=
Nbx_ ;
1720 int bxBin = bunch +1;
1723 currCount[
j] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1725 LogTrace(
"FourVectorHLTOnline") <<
"currCount = " << currCount[
j] << std::endl;
1728 diffCount[
j] = currCount[
j] - prevCount[
j];
1730 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
j] << std::endl;
1733 ip->second = currCount;
1740 LogTrace(
"FourVectorHLTOnline") <<
"Find " << pathname << std::endl;
1743 bool isMember =
false;
1767 LogTrace(
"FourVectorHLTOnline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupName[
i] << std::endl;
1777 TH2F* hist_All = ME_2d->
getTH2F();
1779 for (
unsigned int j = 0;
j<diffCount.size();
j++) {
1785 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1786 int updatedLumiCount = currentLumiCount + diffCount[
j];
1787 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount);
1793 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_2d" << ME_2d->
getName() << std::endl;
1807 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1818 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1824 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1826 TH1F * hist_1d = ME_1d->
getTH1F();
1832 int prevCount = ip->second;
1836 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1838 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1840 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1843 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1848 int currCount = int(hist_1d->GetBinContent(pathBin));
1851 int diffCount = currCount - prevCount;
1853 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1856 ip->second = currCount;
1867 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1868 int updatedLumiCount = currentLumiCount + diffCount;
1869 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1874 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1888 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1899 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1905 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1907 TH1F * hist_1d = ME_1d->
getTH1F();
1913 int prevCount = ip->second;
1917 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1919 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1921 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1924 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1929 int currCount = int(hist_1d->GetBinContent(pathBin));
1932 int diffCount = currCount - prevCount;
1934 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1937 ip->second = currCount;
1948 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1949 int updatedLumiCount = currentLumiCount + diffCount;
1950 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1955 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1969 LogTrace(
"FourVectorHLTOnline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1971 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
1976 LogTrace(
"FourVectorHLTOnline") <<
" could not fine 2d matrix " << fullPathToME << std::endl;
1982 TH2F * hist_2d = ME_2d->
getTH2F();
1988 int prevCount = ip->second;
1991 int pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
1993 if(pathBin > hist_2d->GetNbinsX()) {
1995 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
2000 int currCount = int(hist_2d->GetBinContent(pathBin, pathBin));
2003 int diffCount = currCount - prevCount;
2005 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
2008 ip->second = currCount;
2018 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2021 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2022 int updatedLumiCount = currentLumiCount + diffCount;
2023 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2028 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_HLTAll_LS_" << std::endl;
2038 TH2F* hist_All = tempME->
getTH2F();
2041 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2043 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2044 int updatedLumiCount = currentLumiCount + diffCount;
2045 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2050 LogDebug(
"FourVectorHLTOnline") <<
" cannot find tempME " << std::endl;
2065 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
2066 int updatedLumiCount = currentLumiCount + diffCount;
2067 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2072 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
2085 if (pathname.find(
"MET") != std::string::npos)
2087 if (pathname.find(
"SumET") != std::string::npos)
2089 if (pathname.find(
"HT") != std::string::npos)
2091 if (pathname.find(
"Jet") != std::string::npos)
2093 if (pathname.find(
"Mu") != std::string::npos)
2095 if (pathname.find(
"Ele") != std::string::npos)
2097 if (pathname.find(
"Photon") != std::string::npos)
2099 if (pathname.find(
"Tau") != std::string::npos)
2101 if (pathname.find(
"IsoTrack") != std::string::npos)
2103 if (pathname.find(
"BTag") != std::string::npos)
2119 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2120 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2124 l1pathname = *numpathmodule;
2144 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2152 rc = (l1ModuleIndex < lastModule);
2163 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_
edm::EDGetTokenT< edm::TriggerResults > jetProbabilityBJetTagsToken_
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
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)
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)
std::string pathsSummaryHLTPathsPerLSFolder_
unsigned int referenceBX_
std::string moduleName(Provenance const &provenance)
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
edm::EDGetTokenT< edm::TriggerResults > softMuonBJetTagsToken_
unsigned int triggerIndex(std::string const &name) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::TriggerResults > metToken_
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)
edm::EDGetTokenT< edm::TriggerResults > muonRecoCollectionNameToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsTokenFU_
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)
static std::string const triggerResults
MonitorElement * ME_HLT_CUSTOM_BX_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryLabelFUToken_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
unsigned int nBinsOneOverEt_
edm::EDGetTokenT< edm::TriggerResults > gsfElectronsToken_
edm::EDGetTokenT< edm::TriggerResults > caloRecoTauProducerToken_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
edm::EDGetTokenT< edm::TriggerResults > pixelTracksToken_
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)
d'tor
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)
edm::EDGetTokenT< edm::TriggerResults > iterativeCone5CaloJetsToken_
tuple size
Write out results.
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
void setCurrentFolder(const std::string &fullpath)
std::string pathsSummaryHLTCorrelationsFolder_
const std::vector< std::string > & datasetNames() const
edm::InputTag triggerResultsLabel_
edm::EDGetTokenT< edm::TriggerResults > photonsToken_
void setBJetsFlag(bool flag)