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++) {
64 pathconf->getParameter<
std::string>(
"denompathname")
158 using namespace trigger;
160 LogDebug(
"FourVectorHLTOnline")<<
" analyze...." ;
198 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerResults not found, "
215 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerEvent not found, " "skipping event";
224 if(!muonHandle.isValid()) {
226 edm::LogInfo(
"FourVectorHLTOnline") <<
"muonHandle not found, ";
236 edm::LogInfo(
"FourVectorHLTOnline") <<
"gsfElectrons not found, ";
239 iEvent.
getByLabel(
"caloRecoTauProducer",tauHandle);
240 if(!tauHandle.isValid())
241 edm::LogInfo(
"FourVectorHLTOnline") <<
"tauHandle not found, ";
244 iEvent.
getByLabel(
"iterativeCone5CaloJets",jetHandle);
245 if(!jetHandle.isValid())
246 edm::LogInfo(
"FourVectorHLTOnline") <<
"jetHandle not found, ";
250 iEvent.
getByLabel(
"jetProbabilityBJetTags", bTagIPHandle);
251 if (!bTagIPHandle.isValid())
252 edm::LogInfo(
"FourVectorHLTOnline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
256 iEvent.
getByLabel(
"softMuonBJetTags", bTagMuHandle);
257 if (!bTagMuHandle.isValid())
258 edm::LogInfo(
"FourVectorHLTOnline") <<
"bTagMuHandle not found, ";
262 if(!metHandle.isValid())
263 edm::LogInfo(
"FourVectorHLTOnline") <<
"metHandle not found, ";
267 if(!photonHandle.isValid())
268 edm::LogInfo(
"FourVectorHLTOnline") <<
"photonHandle not found, ";
272 if(!trackHandle.isValid())
273 edm::LogInfo(
"FourVectorHLTOnline") <<
"trackHandle not found, ";
376 tetMon.setLimits(999., 10., 999.);
389 std::vector<BaseMonitor*> monitors;
393 monitors.push_back(&muoMon);
394 monitors.push_back(&eleMon);
395 monitors.push_back(&tauMon);
396 monitors.push_back(&phoMon);
397 monitors.push_back(&jetMon);
398 monitors.push_back(&btagMon);
399 monitors.push_back(&metMon);
400 monitors.push_back(&tetMon);
422 LogTrace(
"FourVectorHLTOnline") <<
" unique path " <<
v->getPath() << std::endl;
424 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
454 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
456 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
463 v->getFiltersHisto()->Fill(binNumber-1);
465 else if(
v->filtersAndIndices[filt].second < lastModule){
466 v->getFiltersHisto()->Fill(binNumber-1);
478 LogTrace(
"FourVectorHLTOnline") <<
" path " <<
v->getPath() << std::endl;
480 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
481 else btagMon = btagMuMon;
485 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
490 bool denompassed =
false;
492 for(
int i = 0;
i < npath; ++
i) {
494 if (triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos &&
triggerResults->accept(
i))
511 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
513 if((*mit)->isTriggerType(
v->getObjectType())) {
526 if(!mon) mon = &defMon;
539 bool l1accept =
false;
541 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
545 LogTrace(
"FourVectorHLTOnline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << std::endl;
546 LogTrace(
"FourVectorHLTOnline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << std::endl;
547 LogTrace(
"FourVectorHLTOnline") <<
"\t tried with tag " << l1testTag << std::endl;
548 LogTrace(
"FourVectorHLTOnline") <<
"\t module index = "<< l1Index << std::endl;
557 bool numpassed =
false;
560 for(
int i = 0;
i < npath; ++
i) {
562 if (triggerNames.triggerName(
i) ==
v->getPath() &&
triggerResults->accept(
i)) numpassed =
true;
566 if (!numpassed)
continue;
571 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< std::endl
572 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
582 if (
v->getLabel() ==
"dummy"){
586 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
593 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
596 v->setLabel(*labelIter);}
602 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
605 LogTrace(
"FourVectorHLTOnline") <<
"WTF no index of that name " << filterTag << std::endl;
646 LogInfo(
"FourVectorHLTOnline") <<
"analyzed " <<
nev_ <<
" events";
654 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) {
703 if (
plotAll_ && denomobjectType == objectType && objectType != 0)
714 for (
unsigned int i=0;
i!=
n; ++
i) {
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) {
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++) {
963 unsigned int moduleIndex;
966 std::vector<std::string>::const_iterator iDumpModName;
967 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
969 moduleName = *iDumpModName;
973 LogTrace (
"FourVectorHLTOnline") <<
"Module " << numModule
974 <<
" is called " << moduleName
975 <<
" , type = " << moduleType
976 <<
" , index = " << moduleIndex
981 if((moduleType.find(
"Filter") != std::string::npos && moduleType.find(
"HLTTriggerTypeFilter") == std::string::npos ) ||
982 (moduleType.find(
"Associator") != std::string::npos) ||
983 (moduleType.find(
"HLTLevel1GTSeed") != std::string::npos) ||
984 (moduleType.find(
"HLTGlobalSumsCaloMET") != std::string::npos) ||
985 (moduleType.find(
"HLTPrescaler") != string::npos) ||
993 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1004 int nbin_sub =
v->filtersAndIndices.size()+2;
1012 for (
unsigned int k=0;
k<datasetNames.size();
k++) {
1018 for (
unsigned int m=0;
m<datasetPaths.size();
m++){
1021 if(datasetPaths[
m]==pathName){
1030 "Filters_" +
v->getPath(),
1031 nbin_sub+1, -0.5, 0.5+(double)nbin_sub);
1033 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1035 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1042 v->getPath() +
" count per LS",
1046 v->setFilterHistos(filters);
1060 MonitorElement *NL1OffUM, *offEtL1OffUM, *offEtavsoffPhiL1OffUM=0;
1061 MonitorElement *NOnOffUM, *offEtOnOffUM, *offEtavsoffPhiOnOffUM=0;
1066 labelname =
v->getPath() +
"_wrt_" +
v->getDenomPath();
1069 double histEtaMax = 2.5;
1105 TString pathfolder =
dirname_ + TString(
"/") +
v->getPath();
1108 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1111 histoname = labelname+
"_NOff";
1112 title = labelname+
" N Off";
1113 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1115 histoname = labelname+
"_NL1";
1116 title = labelname+
" N L1";
1117 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1119 histoname = labelname+
"_NL1On";
1120 title = labelname+
" N L1On";
1121 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1123 histoname = labelname+
"_NL1Off";
1124 title = labelname+
" N L1Off";
1125 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1127 histoname = labelname+
"_NOnOff";
1128 title = labelname+
" N OnOff";
1129 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1132 histoname = labelname+
"_NL1OnUM";
1133 title = labelname+
" N L1OnUM";
1134 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1136 histoname = labelname+
"_NL1OffUM";
1137 title = labelname+
" N L1OffUM";
1138 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1140 histoname = labelname+
"_NOnOffUM";
1141 title = labelname+
" N OnOffUM";
1142 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1145 histoname = labelname+
"_onEtOn";
1146 title = labelname+
" onE_t online";
1147 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1149 histoname = labelname+
"_onOneOverEtOn";
1150 title = labelname+
" 1 / onE_t online";
1154 histoname = labelname+
"_offEtOff";
1155 title = labelname+
" offE_t offline";
1156 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1158 histoname = labelname+
"_l1EtL1";
1159 title = labelname+
" l1E_t L1";
1160 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1165 histoname = labelname+
"_onEtaonPhiOn";
1166 title = labelname+
" on#eta vs on#phi online";
1167 onEtavsonPhiOn = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1169 histoname = labelname+
"_offEtaoffPhiOff";
1170 title = labelname+
" off#eta vs off#phi offline";
1171 offEtavsoffPhiOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1173 histoname = labelname+
"_l1Etal1PhiL1";
1174 title = labelname+
" l1#eta vs l1#phi L1";
1175 l1Etavsl1PhiL1 = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1177 histoname = labelname+
"_l1EtL1On";
1178 title = labelname+
" l1E_t L1+online";
1179 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1181 histoname = labelname+
"_offEtL1Off";
1182 title = labelname+
" offE_t L1+offline";
1183 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1185 histoname = labelname+
"_offEtOnOff";
1186 title = labelname+
" offE_t online+offline";
1187 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1189 histoname = labelname+
"_l1Etal1PhiL1On";
1190 title = labelname+
" l1#eta vs l1#phi L1+online";
1191 l1Etavsl1PhiL1On = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1193 histoname = labelname+
"_offEtaoffPhiL1Off";
1194 title = labelname+
" off#eta vs off#phi L1+offline";
1195 offEtavsoffPhiL1Off = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1197 histoname = labelname+
"_offEtaoffPhiOnOff";
1198 title = labelname+
" off#eta vs off#phi online+offline";
1199 offEtavsoffPhiOnOff = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1201 histoname = labelname+
"_l1EtL1OnUM";
1202 title = labelname+
" l1E_t L1+onlineUM";
1203 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1205 histoname = labelname+
"_offEtL1OffUM";
1206 title = labelname+
" offE_t L1+offlineUM";
1207 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1209 histoname = labelname+
"_offEtOnOffUM";
1210 title = labelname+
" offE_t online+offlineUM";
1211 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1213 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1214 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1215 l1Etavsl1PhiL1OnUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1217 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1218 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1219 offEtavsoffPhiL1OffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1221 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1222 title = labelname+
" off#eta vs off#phi online+offlineUM";
1223 offEtavsoffPhiOnOffUM = dbe->
book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1228 histoname = labelname+
"_l1DRL1On";
1229 title = labelname+
" l1DR L1+online";
1230 l1DRL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1232 histoname = labelname+
"_offDRL1Off";
1233 title = labelname+
" offDR L1+offline";
1234 offDRL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1236 histoname = labelname+
"_offDROnOff";
1237 title = labelname+
" offDR online+offline";
1238 offDROnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_, 0, 1.);
1241 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
1251 "HLT_Any count per LS",
1265 LogDebug(
"FourVectorHLTOnline") <<
"endRun, run " << run.
id();
1273 LogDebug(
"FourVectorHLTOnline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << std::endl;
1275 if(tempSet.size() < 2)
return;
1277 if(tempSet.size() > 10) {
1279 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is too large. It will be truncated to 10." << std::endl;
1280 mmset::iterator it = tempSet.begin();
1281 for (
int i=0;
i<10;
i++) { it++; }
1282 tempSet.erase( it, tempSet.end());
1283 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << std::endl;
1287 bool cleanedOneMap =
false;
1291 while(! cleanedOneMap && tempSet.size() > 1) {
1293 cleanedOneMap=
false;
1298 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1300 fimmap tempMap_j = *setIter_i;
1305 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1316 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1318 fimmap tempMap_i = *setIter_i;
1319 fimmap::iterator it = tempMap_i.begin();
1320 int topValue = (*it).second;
1324 mmset::iterator tempIter_i = setIter_i;
1328 for ( mmset::iterator setIter_j = ++tempIter_i; setIter_j != tempSet.end( ); setIter_j++ ) {
1330 fimmap tempMap_j = *setIter_j;
1333 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it)
1336 if(topValue == (*it).second) {
1339 tempMap_j.erase(it);
1340 cleanedOneMap =
true;
1349 tempSet.erase(setIter_j);
1352 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1360 if(cleanedOneMap)
break;
1368 cleanedOneMap=
false;
1384 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1387 fimmap tempMap_j = *setIter_i;
1392 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1410 paths.push_back(
"HLT_"+label+
"_L1_Any");
1411 paths.push_back(
"HLT_"+label+
"_Any");
1412 paths.push_back(
"HLT_Any");
1419 h_name=
"HLT_"+label+
"_PassPass";
1420 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1422 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1424 h_name=
"HLT_"+label+
"_Pass_Any";
1425 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1427 paths.size(), -0.5, paths.size()-0.5);
1430 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1431 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1433 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1434 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1435 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1437 paths.size(), -0.5, paths.size()-0.5);
1440 h_name=
"HLT_"+label+
"_Total_LS";
1441 h_title = label+
" HLT paths total count combined per LS ";
1445 h_name=
"HLT_"+label+
"_LS";
1446 h_title = label+
" HLT paths count per LS ";
1452 h_name=
"HLT_"+label+
"_L1_Total_LS";
1453 h_title = label+
" HLT paths total count combined per LS ";
1457 h_name=
"HLT_"+label+
"_L1_LS";
1458 h_title = label+
" HLT L1s count per LS ";
1463 h_name=
"HLT_"+label+
"_BX_LS";
1464 h_title = label+
" HLT paths total count combined per BX ";
1468 for(
unsigned int i = 0;
i < paths.size();
i++){
1470 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1471 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1472 ME_Group_LS->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1474 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1475 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1476 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1477 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1491 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1493 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1495 if(!ME_2d || !ME_1d) {
1497 LogTrace(
"FourVectorHLTOnline") <<
" ME not valid although I gave full path" << std::endl;
1502 TH2F * hist_2d = ME_2d->
getTH2F();
1503 TH1F * hist_1d = ME_1d->
getTH1F();
1507 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1511 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1512 hist_1d->Fill(anyBinNumber-1);
1516 bool groupPassed =
false;
1517 bool groupL1Passed =
false;
1522 for (
int i=1;
i< hist_2d->GetNbinsX();
i++) {
1524 std::string hltpathname = hist_2d->GetXaxis()->GetBinLabel(
i);
1528 unsigned int pathByIndex = triggerNames.
triggerIndex(hltpathname);
1532 if(
hasL1Passed(hltpathname,triggerNames)) groupL1Passed =
true;
1542 if(groupPassed && !groupL1Passed)
1544 hist_2d->Fill(
i-1,anyBinNumber-1);
1545 hist_2d->Fill(anyBinNumber-1,
i-1);
1549 for (
int j=1;
j< hist_2d->GetNbinsY();
j++) {
1551 unsigned int crosspathByIndex = triggerNames.
triggerIndex(hist_2d->GetXaxis()->GetBinLabel(
j));
1556 hist_2d->Fill(
i-1,
j-1);
1568 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1569 if(groupPassed) hist_1d->Fill(groupBinNumber-1);
1572 int groupL1BinNumber = hist_2d->GetXaxis()->FindBin(groupL1BinLabel.c_str());
1574 if(groupL1Passed) hist_1d->Fill(groupL1BinNumber-1);
1590 "HLT counts vs Event bx",
1591 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1593 "HLT counts vs Event bx",
1594 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1600 for(
unsigned int i = 0;
i < npaths;
i++){
1620 "All paths per LS ",
1621 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1625 for(
unsigned int i = 0;
i < npaths;
i++){
1631 unsigned int i = npaths;
1634 int nBinsPerLSHisto = 20;
1635 int nLSHistos = npaths/nBinsPerLSHisto;
1636 for (
int nh=0;nh<nLSHistos+1;nh++) {
1641 sprintf(name,
"Group_%d_paths_count_LS",nLSHistos-nh);
1642 sprintf(title,
"Group %d, paths count per LS",nLSHistos-nh);
1645 nLS_, 0,
nLS_, nBinsPerLSHisto+3, -0.5, nBinsPerLSHisto+3-0.5);
1650 for(
int i = nh*nBinsPerLSHisto; i < (nh+1)*nBinsPerLSHisto; i++){
1652 if (i ==
int(npaths))
break;
1662 bin = i % nBinsPerLSHisto;
1670 tempME->
setBinLabel(nBinsPerLSHisto+3,
"HLT_Any", 2);
1671 tempME->
setBinLabel(nBinsPerLSHisto+2,
"HLT_PhysicsDeclared", 2);
1693 LogTrace(
"FourVectorHLTOnline") <<
" end lumiSection number " << lumi << std::endl;
1706 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1714 std::vector<int> prevCount = ip->second;
1717 std::vector<int> currCount (5,0);
1718 std::vector<int> diffCount (5,0);
1721 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1723 if(pathBin > hist_2d_bx->GetNbinsY()) {
1725 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1730 for (
unsigned int j =0;
j<currCount.size();
j++) {
1734 if(bunch < 1) bunch +=
Nbx_ ;
1735 int bxBin = bunch +1;
1738 currCount[
j] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1740 LogTrace(
"FourVectorHLTOnline") <<
"currCount = " << currCount[
j] << std::endl;
1743 diffCount[
j] = currCount[
j] - prevCount[
j];
1745 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
j] << std::endl;
1748 ip->second = currCount;
1755 LogTrace(
"FourVectorHLTOnline") <<
"Find " << pathname << std::endl;
1758 bool isMember =
false;
1782 LogTrace(
"FourVectorHLTOnline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupName[
i] << std::endl;
1792 TH2F* hist_All = ME_2d->
getTH2F();
1794 for (
unsigned int j = 0;
j<diffCount.size();
j++) {
1800 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1801 int updatedLumiCount = currentLumiCount + diffCount[
j];
1802 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount);
1808 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_2d" << ME_2d->
getName() << std::endl;
1822 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1833 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1839 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1841 TH1F * hist_1d = ME_1d->
getTH1F();
1847 int prevCount = ip->second;
1851 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1853 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1855 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1858 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1863 int currCount = int(hist_1d->GetBinContent(pathBin));
1866 int diffCount = currCount - prevCount;
1868 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1871 ip->second = currCount;
1882 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1883 int updatedLumiCount = currentLumiCount + diffCount;
1884 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1889 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1903 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1914 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1920 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1922 TH1F * hist_1d = ME_1d->
getTH1F();
1928 int prevCount = ip->second;
1932 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1934 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1936 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1939 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1944 int currCount = int(hist_1d->GetBinContent(pathBin));
1947 int diffCount = currCount - prevCount;
1949 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1952 ip->second = currCount;
1963 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1964 int updatedLumiCount = currentLumiCount + diffCount;
1965 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1970 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1984 LogTrace(
"FourVectorHLTOnline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1986 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
1991 LogTrace(
"FourVectorHLTOnline") <<
" could not fine 2d matrix " << fullPathToME << std::endl;
1997 TH2F * hist_2d = ME_2d->
getTH2F();
2003 int prevCount = ip->second;
2006 int pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
2008 if(pathBin > hist_2d->GetNbinsX()) {
2010 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
2015 int currCount = int(hist_2d->GetBinContent(pathBin, pathBin));
2018 int diffCount = currCount - prevCount;
2020 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
2023 ip->second = currCount;
2033 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2036 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2037 int updatedLumiCount = currentLumiCount + diffCount;
2038 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2043 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_HLTAll_LS_" << std::endl;
2053 TH2F* hist_All = tempME->
getTH2F();
2056 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2058 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2059 int updatedLumiCount = currentLumiCount + diffCount;
2060 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2065 LogDebug(
"FourVectorHLTOnline") <<
" cannot find tempME " << std::endl;
2080 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
2081 int updatedLumiCount = currentLumiCount + diffCount;
2082 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2087 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
2100 if (pathname.find(
"MET") != std::string::npos)
2102 if (pathname.find(
"SumET") != std::string::npos)
2104 if (pathname.find(
"HT") != std::string::npos)
2106 if (pathname.find(
"Jet") != std::string::npos)
2108 if (pathname.find(
"Mu") != std::string::npos)
2110 if (pathname.find(
"Ele") != std::string::npos)
2112 if (pathname.find(
"Photon") != std::string::npos)
2114 if (pathname.find(
"Tau") != std::string::npos)
2116 if (pathname.find(
"IsoTrack") != std::string::npos)
2118 if (pathname.find(
"BTag") != std::string::npos)
2134 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2135 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2139 l1pathname = *numpathmodule;
2159 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2167 rc = (l1ModuleIndex < lastModule);
2178 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)
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_
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)
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)
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)