11 using namespace trigger;
18 LogDebug(
"FourVectorHLTOffline") <<
"constructor...." ;
32 LogInfo(
"FourVectorHLTOffline") <<
"unabel to get DQMStore service?";
69 std::vector<edm::ParameterSet>
paths =
70 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"paths");
72 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
80 pathconf->getParameter<std::string>(
"pathname"),
81 pathconf->getParameter<std::string>(
"denompathname")
243 using namespace trigger;
245 LogDebug(
"FourVectorHLTOffline")<<
" analyze...." ;
277 if(!triggerResults.isValid()) {
279 iEvent.
getByLabel(triggerResultsLabelFU,triggerResults);
280 if(!triggerResults.isValid()) {
281 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerResults not found, "
288 int npath = triggerResults->
size();
298 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerEvent not found, " "skipping event";
312 if(!muonHandle.isValid())
313 edm::LogInfo(
"FourVectorHLTOffline") <<
"muonHandle not found, ";
319 edm::LogInfo(
"FourVectorHLTOffline") <<
"gsfElectrons not found, ";
324 iEvent.
getByLabel(
"caloRecoTauProducer",tauHandle);
325 if(!tauHandle.isValid())
326 edm::LogInfo(
"FourVectorHLTOffline") <<
"tauHandle not found, ";
331 iEvent.
getByLabel(
"iterativeCone5CaloJets",jetHandle);
332 if(!jetHandle.isValid())
333 edm::LogInfo(
"FourVectorHLTOffline") <<
"jetHandle not found, ";
338 iEvent.
getByLabel(
"jetProbabilityBJetTags", bTagIPHandle);
339 if (!bTagIPHandle.isValid())
340 edm::LogInfo(
"FourVectorHLTOffline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
344 iEvent.
getByLabel(
"softMuonBJetTags", bTagMuHandle);
345 if (!bTagMuHandle.isValid())
346 edm::LogInfo(
"FourVectorHLTOffline") <<
"bTagMuHandle not found, ";
350 if(!metHandle.isValid())
351 edm::LogInfo(
"FourVectorHLTOffline") <<
"metHandle not found, ";
356 if(!photonHandle.isValid())
357 edm::LogInfo(
"FourVectorHLTOffline") <<
"photonHandle not found, ";
362 if(!trackHandle.isValid())
363 edm::LogInfo(
"FourVectorHLTOffline") <<
"trackHandle not found, ";
447 btagIPMon.setBJetsFlag(
true);
460 btagMuMon.setBJetsFlag(
true);
501 std::vector<BaseMonitor*> monitors;
505 monitors.push_back(&muoMon);
506 monitors.push_back(&eleMon);
507 monitors.push_back(&tauMon);
508 monitors.push_back(&phoMon);
509 monitors.push_back(&jetMon);
510 monitors.push_back(&btagMon);
511 monitors.push_back(&metMon);
512 monitors.push_back(&tetMon);
536 LogTrace(
"FourVectorHLTOffline") <<
" unique path " <<
v->getPath() << endl;
538 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
562 unsigned int lastModule = triggerResults->index(pathByIndex);
565 bool hltPathPassed = triggerResults->accept(pathByIndex);
568 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
570 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
577 v->getFiltersHisto()->Fill(binNumber-1);
579 else if(
v->filtersAndIndices[filt].second < lastModule){
580 v->getFiltersHisto()->Fill(binNumber-1);
591 LogTrace(
"FourVectorHLTOffline") <<
" path " <<
v->getPath() << endl;
593 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
594 else btagMon = btagMuMon;
597 if (
v->getPath().find(
"L2Mu") != std::string::npos ||
v->getPath().find(
"L1Mu") != std::string::npos ) muoMon.setL2MuFlag(
true);
598 else muoMon.setL2MuFlag(
false);
603 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
608 bool denompassed =
false;
610 for(
int i = 0;
i < npath; ++
i) {
612 if (triggerResults->accept(
i) && triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos && triggerNames.triggerName(
i).find(
"HLT_Mult") == std::string::npos )
629 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
631 if((*mit)->isTriggerType(
v->getObjectType())) {
644 if(!mon) mon = &defMon;
653 triggertype =
v->getObjectType();
661 bool l1accept =
false;
663 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
667 LogTrace(
"FourVectorHLTOffline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << endl;
668 LogTrace(
"FourVectorHLTOffline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << endl;
669 LogTrace(
"FourVectorHLTOffline") <<
"\t tried with tag " << l1testTag << endl;
670 LogTrace(
"FourVectorHLTOffline") <<
"\t module index = "<< l1Index << endl;
682 bool numpassed =
false;
685 for(
int i = 0;
i < npath; ++
i) {
687 if ( triggerResults->accept(
i) && triggerNames.triggerName(
i) ==
v->getPath() ) numpassed =
true;
691 if (!numpassed)
continue;
696 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< endl
697 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
707 if (
v->getLabel() ==
"dummy"){
711 for (vector<string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
718 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
721 v->setLabel(*labelIter);}
727 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
730 LogTrace(
"FourVectorHLTOffline") <<
"WTF no index "<< hltIndex <<
" of that name " << filterTag << endl;
771 LogInfo(
"FourVectorHLTOffline") <<
"analyzed " <<
nev_ <<
" events";
780 LogDebug(
"FourVectorHLTOffline") <<
"beginRun, run " << run.
id();
793 LogDebug(
"FourVectorHLTOffline") <<
"HLTConfigProvider failed to initialize.";
815 for (
unsigned int j=0;
j!=
n; ++
j) {
825 for (
unsigned int i=0;
i!=
n; ++
i) {
832 std::string filtername(
"dummy");
835 if (
plotAll_ && denomobjectType == objectType && objectType != 0) {
839 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
850 for (
unsigned int i=0;
i!=
n; ++
i) {
852 std::string denompathname =
"";
860 std::string filtername(
"dummy");
875 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
880 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
882 hltPathsDiagonal_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
892 std::string numpathname = custompathnamepair->first;
893 std::string denompathname = custompathnamepair->second;
895 if (numpathname != denompathname) {
898 bool founddenominator =
false;
899 for (
unsigned int k=0;
k!=
n; ++
k) {
903 if (n_pathname.find(denompathname) != std::string::npos) {
905 LogDebug(
"FourVectorHLTOffline") <<
"denompathname is selected to be = " << n_pathname << endl;;
906 founddenominator =
true;
913 if (!founddenominator) {
915 edm::LogInfo(
"FourVectorHLTOffline") <<
"denompathname not found, go to the next pair numearator-denominator" << endl;
923 for (
unsigned int j=0;
j!=
n; ++
j) {
924 bool foundnumerator =
false;
928 LogDebug(
"FourVectorHLTOffline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << endl;
931 LogDebug(
"FourVectorHLTOffline") <<
"pathname is selected to be = " << denompathname << endl;;
932 foundnumerator =
true;
937 if (!foundnumerator) {
939 edm::LogInfo(
"FourVectorHLTOffline") <<
"pathname not found, ignoring " << pathname;
948 std::string filtername(
"dummy");
963 if (objectType != 0) {
966 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
979 vector<string> allPaths;
989 vector<int> tempCount(5,0);
994 allPaths.push_back(pathName);
1015 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
1050 string moduleName, moduleType, moduleEDMType;
1051 unsigned int moduleIndex;
1054 vector<string>::const_iterator iDumpModName;
1055 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
1057 moduleName = *iDumpModName;
1062 LogTrace (
"FourVectorHLTOffline") <<
"Module " << numModule
1063 <<
" is called " << moduleName
1064 <<
" , type = " << moduleType
1065 <<
" , EDMtype = " << moduleEDMType
1066 <<
" , index = " << moduleIndex
1071 if((moduleType.find(
"Filter") != string::npos && moduleType.find(
"HLTTriggerTypeFilter") == string::npos ) ||
1072 (moduleType.find(
"Associator") != string::npos) ||
1073 (moduleType.find(
"HLTLevel1GTSeed") != string::npos) ||
1074 (moduleType.find(
"HLTGlobalSumsCaloMET") != string::npos) ||
1075 (moduleType.find(
"HLTPrescaler") != string::npos) ||
1076 (moduleEDMType.find(
"EDFilter") != string::npos) ) {
1082 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1092 int nbin_sub =
v->filtersAndIndices.size()+2;
1099 "Filters_" + pathName,
1100 nbin_sub+1, -0.5, 0.5+(
double)nbin_sub);
1102 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1105 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1117 v->setFilterHistos(filters);
1157 std::string labelname(
"dummy");
1158 labelname = pathName +
"_wrt_" +
v->getDenomPath();
1160 std::string histoname(labelname+
"_NOn");
1161 std::string
title(labelname+
" N online");
1162 double histEtaMax = 2.5;
1201 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1204 histoname = labelname+
"_NOff";
1205 title = labelname+
" N Off";
1206 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1208 histoname = labelname+
"_NL1";
1209 title = labelname+
" N L1";
1210 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1212 histoname = labelname+
"_NL1On";
1213 title = labelname+
" N L1On";
1214 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1216 histoname = labelname+
"_NL1Off";
1217 title = labelname+
" N L1Off";
1218 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1220 histoname = labelname+
"_NOnOff";
1221 title = labelname+
" N OnOff";
1222 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1224 histoname = labelname+
"_onEtOn";
1225 title = labelname+
" onE_t online";
1226 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1228 histoname = labelname+
"_onOneOverEtOn";
1229 title = labelname+
" 1 / onE_t online";
1233 histoname = labelname+
"_offEtOff";
1234 title = labelname+
" offE_t offline";
1235 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1237 histoname = labelname+
"_l1EtL1";
1238 title = labelname+
" l1E_t L1";
1239 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1241 histoname = labelname+
"_onEtaonPhiOn";
1242 title = labelname+
" on#eta vs on#phi online";
1245 histoname = labelname+
"_offEtaoffPhiOff";
1246 title = labelname+
" off#eta vs off#phi offline";
1249 histoname = labelname+
"_l1Etal1PhiL1";
1250 title = labelname+
" l1#eta vs l1#phi L1";
1253 histoname = labelname+
"_l1EtL1On";
1254 title = labelname+
" l1E_t L1+online";
1255 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1257 histoname = labelname+
"_offEtL1Off";
1258 title = labelname+
" offE_t L1+offline";
1259 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1261 histoname = labelname+
"_offEtOnOff";
1262 title = labelname+
" offE_t online+offline";
1263 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1265 histoname = labelname+
"_l1Etal1PhiL1On";
1266 title = labelname+
" l1#eta vs l1#phi L1+online";
1269 histoname = labelname+
"_offEtaoffPhiL1Off";
1270 title = labelname+
" off#eta vs off#phi L1+offline";
1273 histoname = labelname+
"_offEtaoffPhiOnOff";
1274 title = labelname+
" off#eta vs off#phi online+offline";
1279 histoname = labelname+
"_NL1OnUM";
1280 title = labelname+
" N L1OnUM";
1281 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1283 histoname = labelname+
"_NL1OffUM";
1284 title = labelname+
" N L1OffUM";
1285 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1287 histoname = labelname+
"_NOnOffUM";
1288 title = labelname+
" N OnOffUM";
1289 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1291 histoname = labelname+
"_l1EtL1OnUM";
1292 title = labelname+
" l1E_t L1+onlineUM";
1293 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1295 histoname = labelname+
"_offEtL1OffUM";
1296 title = labelname+
" offE_t L1+offlineUM";
1297 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1299 histoname = labelname+
"_offEtOnOffUM";
1300 title = labelname+
" offE_t online+offlineUM";
1301 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1303 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1304 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1307 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1308 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1311 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1312 title = labelname+
" off#eta vs off#phi online+offlineUM";
1317 histoname = labelname+
"_l1DRL1On";
1318 title = labelname+
" l1DR L1+online";
1321 histoname = labelname+
"_offDRL1Off";
1322 title = labelname+
" offDR L1+offline";
1325 histoname = labelname+
"_offDROnOff";
1326 title = labelname+
" offDR online+offline";
1330 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
1356 LogDebug(
"FourVectorHLTOffline") <<
"endRun, run " << run.
id();
1364 LogDebug(
"FourVectorHLTOffline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << endl;
1366 if(tempSet.size() < 2)
return;
1368 if(tempSet.size() > 10) {
1370 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is too large. It will be truncated to 10." << endl;
1371 mmset::iterator it = tempSet.begin();
1372 for (
int i=0;
i<10;
i++) { it++; }
1373 tempSet.erase( it, tempSet.end());
1374 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << endl;
1378 bool cleanedOneMap =
false;
1382 while(! cleanedOneMap && tempSet.size() > 1) {
1384 cleanedOneMap=
false;
1389 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1391 fimmap tempMap_j = *setIter_i;
1396 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1407 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1409 fimmap tempMap_i = *setIter_i;
1410 fimmap::iterator it = tempMap_i.begin();
1411 int topValue = (*it).second;
1415 mmset::iterator tempIter_i = setIter_i;
1419 mmset::iterator setIter_j = ++tempIter_i;
1420 while ( setIter_j != tempSet.end( ) ) {
1422 fimmap tempMap_j = *setIter_j;
1425 fimmap::iterator it = tempMap_j.begin();
1426 while ( it != tempMap_j.end() ) {
1428 if(topValue == (*it).second) {
1431 fimmap::iterator tempIt = it;
1433 tempMap_j.erase(tempIt);
1434 cleanedOneMap =
true;
1445 mmset::iterator tempIt = setIter_j;
1447 tempSet.erase(tempIt);
1450 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1461 if(cleanedOneMap)
break;
1469 cleanedOneMap=
false;
1485 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1488 fimmap tempMap_j = *setIter_i;
1493 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1511 paths.push_back(
"HLT_"+label+
"_L1_Any");
1512 paths.push_back(
"HLT_"+label+
"_Any");
1513 paths.push_back(
"HLT_Any");
1525 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1526 h_name=
"HLT_"+label+
"_PassPass";
1527 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1528 ME =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1529 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1531 h_name=
"HLT_"+label+
"_Pass_Any";
1532 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1533 ME_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1534 paths.size(), -0.5, paths.size()-0.5);
1537 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1538 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1539 ME_Normalized =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1540 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1541 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1542 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1543 ME_Normalized_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1544 paths.size(), -0.5, paths.size()-0.5);
1547 if (label !=
"All" && label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor")
1550 h_name=
"HLT_"+label+
"_Total_LS";
1551 h_title = label+
" HLT paths total count combined per LS ";
1582 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1583 for(
unsigned int i = 0;
i < paths.size();
i++){
1586 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1587 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1591 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1592 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1594 if (ME_Normalized_Any)
1595 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1598 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1607 string fullPathToME;
1613 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1615 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1617 if(!ME_2d || !ME_1d) {
1619 LogTrace(
"FourVectorHLTOffline") <<
" ME not valid although I gave full path" << endl;
1624 TH2F * hist_2d = ME_2d->
getTH2F();
1625 TH1F * hist_1d = ME_1d->
getTH1F();
1629 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1632 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1637 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1638 hist_1d->Fill(anyBinNumber-1);
1642 bool groupPassed =
false;
1643 bool groupL1Passed =
false;
1671 groupL1Passed =
true;
1673 hist_2d->Fill(i,anyBinNumber-1);
1674 hist_2d->Fill(anyBinNumber-1,i);
1676 hist_2d->Fill(i,groupBinNumber-1);
1677 hist_2d->Fill(groupBinNumber-1,i);
1709 hist_1d->Fill(groupBinNumber-1);
1710 hist_1d->Fill(groupBinNumber-2);
1711 hist_2d->Fill(groupBinNumber-1,groupBinNumber-1);
1712 hist_2d->Fill(anyBinNumber-1,groupBinNumber-1);
1713 hist_2d->Fill(groupBinNumber-1,anyBinNumber-1);
1738 "HLT counts vs Event bx",
1739 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1750 for(
unsigned int i = 0;
i < npaths;
i++){
1771 "All paths per LS ",
1772 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1776 for(
unsigned int i = 0;
i < npaths;
i++){
1782 unsigned int i = npaths;
1803 LogTrace(
"FourVectorHLTOffline") <<
" end lumiSection number " << lumi << endl;
1817 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << endl;
1824 std::string pathname = ip->first;
1825 vector<int> prevCount = ip->second;
1828 vector<int> currCount (5,0);
1829 vector<int> diffCount (5,0);
1832 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1834 if(pathBin > hist_2d_bx->GetNbinsY()) {
1836 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1841 for (
unsigned int b =0;
b<currCount.size();
b++) {
1845 if(bunch < 1) bunch +=
Nbx_ ;
1846 int bxBin = bunch +1;
1849 currCount[
b] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1851 LogTrace(
"FourVectorHLTOffline") <<
"currCount = " << currCount[
b] << endl;
1854 diffCount[
b] = currCount[
b] - prevCount[
b];
1856 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
b] << endl;
1861 ip->second = currCount;
1866 LogTrace(
"FourVectorHLTOffline") <<
"Find " << pathname << endl;
1871 bool isMember =
false;
1891 LogTrace(
"FourVectorHLTOffline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupNamePathsPair[
j].first << endl;
1905 vector<int> updatedLumiCount(5,0);
1907 float entireBXWindowUpdatedLumiCount = 0;
1909 TH2F* hist_All = ME_2d->
getTH2F();
1911 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1914 int binNumber =
b+1;
1917 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1918 updatedLumiCount[
b] = currentLumiCount + diffCount[
b];
1919 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount[
b]);
1921 entireBXWindowUpdatedLumiCount += updatedLumiCount[
b];
1934 TH2F* hist_All_Norm = ME_2d_Norm->
getTH2F();
1936 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1939 int binNumber =
b+1;
1942 if(entireBXWindowUpdatedLumiCount != 0)
1943 hist_All_Norm->SetBinContent(lumi+1,binNumber,
float(updatedLumiCount[
b])/entireBXWindowUpdatedLumiCount);
1956 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << endl;
1961 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1966 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
1972 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
1974 TH1F * hist_1d = ME_1d->
getTH1F();
1979 string pathname = ip->first;
1980 float prevCount = ip->second;
1982 string binLabel =
"HLT_"+pathname+
"_L1_Any";
1984 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
1986 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1988 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
1991 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1996 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
1999 float diffCount = currCount - prevCount;
2001 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2004 ip->second = currCount;
2015 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2016 float updatedLumiCount = currentLumiCount + diffCount;
2017 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2021 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2035 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << endl;
2039 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
2044 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
2050 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
2052 TH1F * hist_1d = ME_1d->
getTH1F();
2057 string pathname = ip->first;
2058 float prevCount = ip->second;
2060 string binLabel =
"HLT_"+pathname+
"_Any";
2062 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
2064 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
2066 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
2069 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2074 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
2077 float diffCount = currCount - prevCount;
2079 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2082 ip->second = currCount;
2093 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2094 float updatedLumiCount = currentLumiCount + diffCount;
2095 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2100 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2114 LogTrace(
"FourVectorHLTOffline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << endl;
2116 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
2121 LogTrace(
"FourVectorHLTOffline") <<
" could not fine 2d matrix " << fullPathToME << endl;
2127 TH2F * hist_2d = ME_2d->
getTH2F();
2132 std::string pathname = ip->first;
2133 float prevCount = ip->second;
2136 float pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
2138 if(pathBin > hist_2d->GetNbinsX()) {
2140 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2145 float currCount = hist_2d->GetBinContent(pathBin, pathBin)/
LSsize_;
2148 float diffCount = currCount - prevCount;
2150 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2153 ip->second = currCount;
2163 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2166 float currentLumiCount = hist_All->GetBinContent(lumi+1,pathBinNumber);
2167 float updatedLumiCount = currentLumiCount + diffCount;
2168 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2173 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME_HLTAll_LS" << endl;
2231 if (pathname.find(
"MET") != std::string::npos)
2233 if (pathname.find(
"SumET") != std::string::npos || pathname.find(
"SumEt") != std::string::npos || pathname.find(
"ETT") != std::string::npos)
2235 if (pathname.find(
"HT") != std::string::npos)
2237 if (pathname.find(
"Jet") != std::string::npos)
2239 if (pathname.find(
"Mu") != std::string::npos)
2241 if (pathname.find(
"Ele") != std::string::npos)
2243 if (pathname.find(
"Photon") != std::string::npos)
2245 if (pathname.find(
"EG") != std::string::npos)
2247 if (pathname.find(
"Tau") != std::string::npos)
2249 if (pathname.find(
"IsoTrack") != std::string::npos)
2251 if (pathname.find(
"BTag") != std::string::npos)
2263 string l1pathname =
"dummy";
2267 for(vector<string>::iterator numpathmodule = numpathmodules.begin();
2268 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2272 l1pathname = *numpathmodule;
2288 int l1ModuleIndex = 999;
2292 if(
v->getPath() == pathname ) l1ModuleIndex =
v->getL1ModuleIndex();
2296 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2304 rc = (l1ModuleIndex < lastModule);
2315 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2331 for( reco::MuonCollection::const_iterator iter = muonHandle->begin(), iend = muonHandle->end(); iter != iend; ++iter )
2360 for( reco::GsfElectronCollection::const_iterator iter = eleHandle->begin(), iend = eleHandle->end(); iter != iend; ++iter )
2374 float eleMaxOver3x3 = ( lazyTool.
eMax(*bc) / lazyTool.
e3x3(*bc) );
2381 if(! iter->ecalDriven() )
continue;
2406 else if(iter->isEE()) {
2443 for( reco::PhotonCollection::const_iterator iter = phoHandle->begin(), iend = phoHandle->end(); iter != iend; ++iter )
2449 iter->sigmaIetaIeta() > 0.002 &&
2450 iter->maxEnergyXtal() / iter->e3x3() < 0.9
2475 for( reco::CaloJetCollection::const_iterator iter = jetHandle->begin(), iend = jetHandle->end(); iter != iend; ++iter )
2505 for( reco::CaloMETCollection::const_iterator iter = metHandle->begin(), iend = metHandle->end(); iter != iend; ++iter )
2528 iEvent.
getByLabel(
"hpsPFTauProducer",tauHandle);
2540 for(
unsigned int i=0;
i<tauHandle->size();++
i) {
2545 float outputDiscmnt1 = (*dscrmt1H)[pfTauRef];
2546 float outputDiscmnt2 = (*dscrmt2H)[pfTauRef];
2547 float outputDiscmnt3 = (*dscrmt3H)[pfTauRef];
2549 if(outputDiscmnt1>0.5 && outputDiscmnt2>0.5 && outputDiscmnt3 >0.5) {
2569 std::string pathname =
name;
2574 if(pathname.find(
"L1") != std::string::npos) pathname.replace(pathname.find(
"L1"),2,
"");
2576 if(pathname.find(
"L2") != std::string::npos) pathname.replace(pathname.find(
"L2"),2,
"");
2578 if(pathname.find(
"8E29") != std::string::npos) pathname.replace(pathname.find(
"8E29"),4,
"");
2580 int digitLocation=0;
2581 for (
unsigned int i=0;
i < pathname.length();
i++)
2583 if (isdigit(pathname.at(
i))) {
2592 string hltThresholdString = pathname.substr(digitLocation);
2594 int hltThreshold = 0;
2597 sscanf (hltThresholdString.c_str(),
"%d%*s",&hltThreshold);
2600 return hltThreshold;
2619 double normalizedChi2 = gm->normalizedChi2();
2620 int trackerHits = tk->hitPattern().numberOfValidTrackerHits();
2621 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
2622 int muonHits = gm->hitPattern().numberOfValidMuonHits();
2625 if (fabs(dxy)>
dxyCut_) {
return 0; quality=0;}
2644 for (
int ii = 100; ii > 0; ii--) {
2651 size_t pos = histVersion.find(version);
2652 if (pos != std::string::npos)
2653 histVersion.erase(pos,version.size());
float sigmaIetaIetaSpikesEC_
unsigned int size() const
number of trigger paths in trigger table
void setupHltMatrix(const std::string &label, std::vector< std::string > &paths)
reco::helper::JetIDHelper * jetID
LuminosityBlockID id() const
T getParameter(std::string const &) const
float dr04EcalRecHitSumEtEC_
T getUntrackedParameter(std::string const &, T const &) const
bool hasL1Passed(const std::string &pathname, const edm::TriggerNames &triggerNames)
virtual void fillL1Match(FourVectorHLTOffline *fv)=0
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void selectPhotons(const edm::Handle< reco::PhotonCollection > &phoHandle)
std::vector< PFTau > PFTauCollection
collection of PFTau objects
const std::string moduleType(const std::string &module) const
C++ class name of module.
void countHLTPathHitsEndLumiBlock(const int &lumi)
virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)=0
void countHLTGroupBXHitsEndLumiBlock(const int &lumi)
edm::Handle< reco::GsfElectronCollection > fSelElectronsHandle
edm::Handle< reco::CaloMETCollection > fSelMetHandle
const std::string & triggerName(unsigned int triggerIndex) const
float deltaPhiSuperClusterTrackAtVtxEC_
virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)=0
float sigmaIetaIetaSpikesEB_
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_
reco::CaloMETCollection * fSelectedMet
PathInfoCollection hltPaths_
virtual TrackRef innerTrack() const
enum start value shifted to 81 so as to avoid clashes with PDG codes
std::string muonRecoCollectionName_
reco::PFTauCollection * fSelectedTaus
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::string pathsSummaryHLTPathsPerLSFolder_
bool isTrackerMuon() const
int getTriggerTypeParsePathName(const std::string &pathname)
void fillHltMatrix(const edm::TriggerNames &triggerNames)
std::vector< std::pair< std::string, std::vector< int > > > fPathBxTempCountPair
std::vector< std::string > specialPaths_
FourVectorHLTOffline(const edm::ParameterSet &)
void cleanDRMatchSet(mmset &tempSet)
Clean DR Match Set.
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< reco::MuonCollection > fSelMuonsHandle
Strings::size_type size() const
edm::Handle< reco::BeamSpot > fBeamSpotHandle
double normalizedChi2Cut_
virtual void monitorOffline(void)=0
edm::Handle< reco::PFTauCollection > fSelTausHandle
float emEnergyFractionJet_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< TPRegexp > filters
edm::InputTag triggerSummaryLabel_
void countHLTGroupL1HitsEndLumiBlock(const int &lumi)
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
void setRecoB(edm::Handle< reco::JetTagCollection > offCollB)
PathInfoCollection hltPathsDiagonal_
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
std::vector< Muon > MuonCollection
collection of Muon objects
std::set< fimmap, std::less< fimmap > > mmset
edm::Handle< reco::PhotonCollection > fSelPhotonsHandle
reco::GsfElectronCollection * fSelectedElectrons
U second(std::pair< T, U > const &p)
const std::string * pathName() const
float deltaEtaSuperClusterTrackAtVtxEC_
const std::string getL1ConditionModuleName(const std::string &pathname)
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
unsigned int referenceBX_
float deltaEtaSuperClusterTrackAtVtxEB_
unsigned int triggerIndex(std::string const &name) const
void setLimits(float etaMax, float etMin, float drMatch)
edm::Handle< edm::TriggerResults > fTriggerResults
void selectJets(const edm::Event &iEvent, const edm::Handle< reco::CaloJetCollection > &jetHandle)
std::vector< MonitorElement * > v_ME_Total_BX
std::vector< std::pair< std::string, float > > fPathTempCountPair
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HLTConfigProvider hltConfig_
std::string fCustomBXPath
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setVerbose(unsigned level)
reco::PhotonCollection * fSelectedPhotons
std::vector< MonitorElement * > v_ME_Total_BX_Norm
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void selectTaus(const edm::Event &iEvent)
bool isVBTFMuon(const reco::Muon &muon)
MonitorElement * ME_HLT_BX
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double electronL1DRMatch_
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
void selectElectrons(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::Handle< reco::GsfElectronCollection > &eleHandle)
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
reco::MuonCollection * fSelectedMuons
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
edm::InputTag triggerResultsLabel_
std::string tauDscrmtrLabel2_
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
virtual void clearSets(void)=0
DetId seed() const
return DetId of seed
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
MonitorElement * ME_HLT_CUSTOM_BX
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
edm::Handle< reco::CaloJetCollection > fSelJetsHandle
float dr04EcalRecHitSumEtEB_
TH1F * getTH1F(void) const
float dr04HcalTowerSumEtEB_
LuminosityBlockNumber_t luminosityBlock() const
std::vector< Photon > PhotonCollection
collectin of Photon objects
std::vector< std::pair< std::string, float > > fGroupTempCountPair
std::vector< std::pair< std::string, std::vector< std::string > > > fGroupNamePathsPair
std::string removeVersions(std::string histVersion)
unsigned int nBinsOneOverEt_
virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)=0
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
std::string pathsSummaryHLTCorrelationsFolder_
std::string pathsSummaryFilterCountsFolder_
void selectMet(const edm::Handle< reco::CaloMETCollection > &metHandle)
float dr04HcalTowerSumEtEC_
edm::InputTag recHitsEBTag_
std::string tauDscrmtrLabel1_
MonitorElement * ME_HLTAll_LS
std::vector< std::string > fGroupName
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
std::string tauDscrmtrLabel3_
std::vector< std::pair< std::string, float > > fGroupL1TempCountPair
edm::InputTag recHitsEETag_
reco::CaloJetCollection * fSelectedJets
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.
int getHltThresholdFromName(const std::string &pathname)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::Handle< trigger::TriggerEvent > fTriggerObj
void setReco(edm::Handle< T > offColl)
MonitorElement * scalersSelect
float deltaPhiSuperClusterTrackAtVtxEB_
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
const std::vector< std::string > & datasetNames() const
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Provenance const * provenance() const
void selectMuons(const edm::Handle< reco::MuonCollection > &muonHandle)
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector