10 using namespace trigger;
17 LogDebug(
"FourVectorHLTOffline") <<
"constructor...." ;
31 LogInfo(
"FourVectorHLTOffline") <<
"unabel to get DQMStore service?";
68 std::vector<edm::ParameterSet>
paths =
69 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"paths");
71 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
80 pathconf->getParameter<
std::string>(
"denompathname")
258 using namespace trigger;
260 LogDebug(
"FourVectorHLTOffline")<<
" analyze...." ;
267 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerResults not found, "
283 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerEvent not found, " "skipping event";
297 if(!muonHandle.isValid())
298 edm::LogInfo(
"FourVectorHLTOffline") <<
"muonHandle not found, ";
304 edm::LogInfo(
"FourVectorHLTOffline") <<
"gsfElectrons not found, ";
310 if(!tauHandle.isValid())
311 edm::LogInfo(
"FourVectorHLTOffline") <<
"tauHandle not found, ";
317 if(!jetHandle.isValid())
318 edm::LogInfo(
"FourVectorHLTOffline") <<
"jetHandle not found, ";
324 if (!bTagIPHandle.isValid())
325 edm::LogInfo(
"FourVectorHLTOffline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
330 if (!bTagMuHandle.isValid())
331 edm::LogInfo(
"FourVectorHLTOffline") <<
"bTagMuHandle not found, ";
335 if(!metHandle.isValid())
336 edm::LogInfo(
"FourVectorHLTOffline") <<
"metHandle not found, ";
341 if(!photonHandle.isValid())
342 edm::LogInfo(
"FourVectorHLTOffline") <<
"photonHandle not found, ";
347 if(!trackHandle.isValid())
348 edm::LogInfo(
"FourVectorHLTOffline") <<
"trackHandle not found, ";
432 btagIPMon.setBJetsFlag(
true);
445 btagMuMon.setBJetsFlag(
true);
486 std::vector<BaseMonitor*> monitors;
490 monitors.push_back(&muoMon);
491 monitors.push_back(&eleMon);
492 monitors.push_back(&tauMon);
493 monitors.push_back(&phoMon);
494 monitors.push_back(&jetMon);
495 monitors.push_back(&btagMon);
496 monitors.push_back(&metMon);
497 monitors.push_back(&tetMon);
521 LogTrace(
"FourVectorHLTOffline") <<
" unique path " <<
v->getPath() << endl;
523 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
553 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
555 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
562 v->getFiltersHisto()->Fill(binNumber-1);
564 else if(
v->filtersAndIndices[filt].second < lastModule){
565 v->getFiltersHisto()->Fill(binNumber-1);
576 LogTrace(
"FourVectorHLTOffline") <<
" path " <<
v->getPath() << endl;
578 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
579 else btagMon = btagMuMon;
582 if (
v->getPath().find(
"L2Mu") != std::string::npos ||
v->getPath().find(
"L1Mu") != std::string::npos ) muoMon.setL2MuFlag(
true);
583 else muoMon.setL2MuFlag(
false);
588 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
593 bool denompassed =
false;
595 for(
int i = 0;
i < npath; ++
i) {
597 if (
triggerResults->accept(
i) && triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos && triggerNames.triggerName(
i).find(
"HLT_Mult") == std::string::npos )
614 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
616 if((*mit)->isTriggerType(
v->getObjectType())) {
629 if(!mon) mon = &defMon;
645 bool l1accept =
false;
647 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
651 LogTrace(
"FourVectorHLTOffline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << endl;
652 LogTrace(
"FourVectorHLTOffline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << endl;
653 LogTrace(
"FourVectorHLTOffline") <<
"\t tried with tag " << l1testTag << endl;
654 LogTrace(
"FourVectorHLTOffline") <<
"\t module index = "<< l1Index << endl;
666 bool numpassed =
false;
669 for(
int i = 0;
i < npath; ++
i) {
671 if (
triggerResults->accept(
i) && triggerNames.triggerName(
i) ==
v->getPath() ) numpassed =
true;
675 if (!numpassed)
continue;
680 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< endl
681 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
691 if (
v->getLabel() ==
"dummy"){
695 for (vector<string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
702 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
705 v->setLabel(*labelIter);}
711 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
714 LogTrace(
"FourVectorHLTOffline") <<
"WTF no index "<< hltIndex <<
" of that name " << filterTag << endl;
755 LogInfo(
"FourVectorHLTOffline") <<
"analyzed " <<
nev_ <<
" events";
764 LogDebug(
"FourVectorHLTOffline") <<
"beginRun, run " << run.
id();
777 LogDebug(
"FourVectorHLTOffline") <<
"HLTConfigProvider failed to initialize.";
799 for (
unsigned int j=0;
j!=
n; ++
j) {
809 for (
unsigned int i=0;
i!=
n; ++
i) {
819 if (
plotAll_ && denomobjectType == objectType && objectType != 0) {
823 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
834 for (
unsigned int i=0;
i!=
n; ++
i) {
859 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
864 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
866 hltPathsDiagonal_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
876 std::string numpathname = custompathnamepair->first;
877 std::string denompathname = custompathnamepair->second;
879 if (numpathname != denompathname) {
882 bool founddenominator =
false;
883 for (
unsigned int k=0;
k!=
n; ++
k) {
887 if (n_pathname.find(denompathname) != std::string::npos) {
889 LogDebug(
"FourVectorHLTOffline") <<
"denompathname is selected to be = " << n_pathname << endl;;
890 founddenominator =
true;
897 if (!founddenominator) {
899 edm::LogInfo(
"FourVectorHLTOffline") <<
"denompathname not found, go to the next pair numearator-denominator" << endl;
907 for (
unsigned int j=0;
j!=
n; ++
j) {
908 bool foundnumerator =
false;
912 LogDebug(
"FourVectorHLTOffline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << endl;
915 LogDebug(
"FourVectorHLTOffline") <<
"pathname is selected to be = " << denompathname << endl;;
916 foundnumerator =
true;
921 if (!foundnumerator) {
947 if (objectType != 0) {
950 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
963 vector<string> allPaths;
973 vector<int> tempCount(5,0);
978 allPaths.push_back(pathName);
999 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
1034 string moduleName, moduleType, moduleEDMType;
1035 unsigned int moduleIndex;
1038 vector<string>::const_iterator iDumpModName;
1039 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
1041 moduleName = *iDumpModName;
1046 LogTrace (
"FourVectorHLTOffline") <<
"Module " << numModule
1047 <<
" is called " << moduleName
1048 <<
" , type = " << moduleType
1049 <<
" , EDMtype = " << moduleEDMType
1050 <<
" , index = " << moduleIndex
1055 if((moduleType.find(
"Filter") != string::npos && moduleType.find(
"HLTTriggerTypeFilter") == string::npos ) ||
1056 (moduleType.find(
"Associator") != string::npos) ||
1057 (moduleType.find(
"HLTLevel1GTSeed") != string::npos) ||
1058 (moduleType.find(
"HLTGlobalSumsCaloMET") != string::npos) ||
1059 (moduleType.find(
"HLTPrescaler") != string::npos) ||
1060 (moduleEDMType.find(
"EDFilter") != string::npos) ) {
1066 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1076 int nbin_sub =
v->filtersAndIndices.size()+2;
1083 "Filters_" + pathName,
1084 nbin_sub+1, -0.5, 0.5+(
double)nbin_sub);
1086 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1089 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1101 v->setFilterHistos(filters);
1142 labelname = pathName +
"_wrt_" +
v->getDenomPath();
1146 double histEtaMax = 2.5;
1185 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1188 histoname = labelname+
"_NOff";
1189 title = labelname+
" N Off";
1190 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1192 histoname = labelname+
"_NL1";
1193 title = labelname+
" N L1";
1194 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1196 histoname = labelname+
"_NL1On";
1197 title = labelname+
" N L1On";
1198 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1200 histoname = labelname+
"_NL1Off";
1201 title = labelname+
" N L1Off";
1202 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1204 histoname = labelname+
"_NOnOff";
1205 title = labelname+
" N OnOff";
1206 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1208 histoname = labelname+
"_onEtOn";
1209 title = labelname+
" onE_t online";
1210 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1212 histoname = labelname+
"_onOneOverEtOn";
1213 title = labelname+
" 1 / onE_t online";
1217 histoname = labelname+
"_offEtOff";
1218 title = labelname+
" offE_t offline";
1219 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1221 histoname = labelname+
"_l1EtL1";
1222 title = labelname+
" l1E_t L1";
1223 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1225 histoname = labelname+
"_onEtaonPhiOn";
1226 title = labelname+
" on#eta vs on#phi online";
1229 histoname = labelname+
"_offEtaoffPhiOff";
1230 title = labelname+
" off#eta vs off#phi offline";
1233 histoname = labelname+
"_l1Etal1PhiL1";
1234 title = labelname+
" l1#eta vs l1#phi L1";
1237 histoname = labelname+
"_l1EtL1On";
1238 title = labelname+
" l1E_t L1+online";
1239 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1241 histoname = labelname+
"_offEtL1Off";
1242 title = labelname+
" offE_t L1+offline";
1243 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1245 histoname = labelname+
"_offEtOnOff";
1246 title = labelname+
" offE_t online+offline";
1247 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1249 histoname = labelname+
"_l1Etal1PhiL1On";
1250 title = labelname+
" l1#eta vs l1#phi L1+online";
1253 histoname = labelname+
"_offEtaoffPhiL1Off";
1254 title = labelname+
" off#eta vs off#phi L1+offline";
1257 histoname = labelname+
"_offEtaoffPhiOnOff";
1258 title = labelname+
" off#eta vs off#phi online+offline";
1263 histoname = labelname+
"_NL1OnUM";
1264 title = labelname+
" N L1OnUM";
1265 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1267 histoname = labelname+
"_NL1OffUM";
1268 title = labelname+
" N L1OffUM";
1269 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1271 histoname = labelname+
"_NOnOffUM";
1272 title = labelname+
" N OnOffUM";
1273 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1275 histoname = labelname+
"_l1EtL1OnUM";
1276 title = labelname+
" l1E_t L1+onlineUM";
1277 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1279 histoname = labelname+
"_offEtL1OffUM";
1280 title = labelname+
" offE_t L1+offlineUM";
1281 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1283 histoname = labelname+
"_offEtOnOffUM";
1284 title = labelname+
" offE_t online+offlineUM";
1285 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1287 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1288 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1291 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1292 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1295 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1296 title = labelname+
" off#eta vs off#phi online+offlineUM";
1301 histoname = labelname+
"_l1DRL1On";
1302 title = labelname+
" l1DR L1+online";
1305 histoname = labelname+
"_offDRL1Off";
1306 title = labelname+
" offDR L1+offline";
1309 histoname = labelname+
"_offDROnOff";
1310 title = labelname+
" offDR online+offline";
1314 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
1340 LogDebug(
"FourVectorHLTOffline") <<
"endRun, run " << run.
id();
1348 LogDebug(
"FourVectorHLTOffline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << endl;
1350 if(tempSet.size() < 2)
return;
1352 if(tempSet.size() > 10) {
1354 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is too large. It will be truncated to 10." << endl;
1355 mmset::iterator it = tempSet.begin();
1356 for (
int i=0;
i<10;
i++) { it++; }
1357 tempSet.erase( it, tempSet.end());
1358 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << endl;
1362 bool cleanedOneMap =
false;
1366 while(! cleanedOneMap && tempSet.size() > 1) {
1368 cleanedOneMap=
false;
1373 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1375 fimmap tempMap_j = *setIter_i;
1380 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1391 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1393 fimmap tempMap_i = *setIter_i;
1394 fimmap::iterator it = tempMap_i.begin();
1395 int topValue = (*it).second;
1399 mmset::iterator tempIter_i = setIter_i;
1403 mmset::iterator setIter_j = ++tempIter_i;
1404 while ( setIter_j != tempSet.end( ) ) {
1406 fimmap tempMap_j = *setIter_j;
1409 fimmap::iterator it = tempMap_j.begin();
1410 while ( it != tempMap_j.end() ) {
1412 if(topValue == (*it).second) {
1415 fimmap::iterator tempIt = it;
1417 tempMap_j.erase(tempIt);
1418 cleanedOneMap =
true;
1429 mmset::iterator tempIt = setIter_j;
1431 tempSet.erase(tempIt);
1434 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1445 if(cleanedOneMap)
break;
1453 cleanedOneMap=
false;
1469 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1472 fimmap tempMap_j = *setIter_i;
1477 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1495 paths.push_back(
"HLT_"+label+
"_L1_Any");
1496 paths.push_back(
"HLT_"+label+
"_Any");
1497 paths.push_back(
"HLT_Any");
1509 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1510 h_name=
"HLT_"+label+
"_PassPass";
1511 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1512 ME =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1513 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1515 h_name=
"HLT_"+label+
"_Pass_Any";
1516 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1517 ME_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1518 paths.size(), -0.5, paths.size()-0.5);
1521 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1522 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1523 ME_Normalized =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1524 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1525 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1526 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1527 ME_Normalized_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1528 paths.size(), -0.5, paths.size()-0.5);
1531 if (label !=
"All" && label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor")
1534 h_name=
"HLT_"+label+
"_Total_LS";
1535 h_title = label+
" HLT paths total count combined per LS ";
1566 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1567 for(
unsigned int i = 0;
i < paths.size();
i++){
1570 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1571 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1575 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1576 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1578 if (ME_Normalized_Any)
1579 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1582 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1591 string fullPathToME;
1597 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1599 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1601 if(!ME_2d || !ME_1d) {
1603 LogTrace(
"FourVectorHLTOffline") <<
" ME not valid although I gave full path" << endl;
1608 TH2F * hist_2d = ME_2d->
getTH2F();
1609 TH1F * hist_1d = ME_1d->
getTH1F();
1613 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1616 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1621 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1622 hist_1d->Fill(anyBinNumber-1);
1626 bool groupPassed =
false;
1657 hist_2d->Fill(i,anyBinNumber-1);
1658 hist_2d->Fill(anyBinNumber-1,i);
1660 hist_2d->Fill(i,groupBinNumber-1);
1661 hist_2d->Fill(groupBinNumber-1,i);
1693 hist_1d->Fill(groupBinNumber-1);
1694 hist_1d->Fill(groupBinNumber-2);
1695 hist_2d->Fill(groupBinNumber-1,groupBinNumber-1);
1696 hist_2d->Fill(anyBinNumber-1,groupBinNumber-1);
1697 hist_2d->Fill(groupBinNumber-1,anyBinNumber-1);
1722 "HLT counts vs Event bx",
1723 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1734 for(
unsigned int i = 0;
i < npaths;
i++){
1755 "All paths per LS ",
1756 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1760 for(
unsigned int i = 0;
i < npaths;
i++){
1766 unsigned int i = npaths;
1787 LogTrace(
"FourVectorHLTOffline") <<
" end lumiSection number " << lumi << endl;
1801 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << endl;
1809 vector<int> prevCount = ip->second;
1812 vector<int> currCount (5,0);
1813 vector<int> diffCount (5,0);
1816 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1818 if(pathBin > hist_2d_bx->GetNbinsY()) {
1820 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1825 for (
unsigned int b =0;
b<currCount.size();
b++) {
1829 if(bunch < 1) bunch +=
Nbx_ ;
1830 int bxBin = bunch +1;
1833 currCount[
b] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1835 LogTrace(
"FourVectorHLTOffline") <<
"currCount = " << currCount[
b] << endl;
1838 diffCount[
b] = currCount[
b] - prevCount[
b];
1840 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
b] << endl;
1845 ip->second = currCount;
1850 LogTrace(
"FourVectorHLTOffline") <<
"Find " << pathname << endl;
1855 bool isMember =
false;
1875 LogTrace(
"FourVectorHLTOffline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupNamePathsPair[
j].first << endl;
1889 vector<int> updatedLumiCount(5,0);
1891 float entireBXWindowUpdatedLumiCount = 0;
1893 TH2F* hist_All = ME_2d->
getTH2F();
1895 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1901 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1902 updatedLumiCount[
b] = currentLumiCount + diffCount[
b];
1903 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount[
b]);
1905 entireBXWindowUpdatedLumiCount += updatedLumiCount[
b];
1918 TH2F* hist_All_Norm = ME_2d_Norm->
getTH2F();
1920 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1926 if(entireBXWindowUpdatedLumiCount != 0)
1927 hist_All_Norm->SetBinContent(lumi+1,binNumber,
float(updatedLumiCount[
b])/entireBXWindowUpdatedLumiCount);
1940 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << endl;
1945 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1950 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
1956 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
1958 TH1F * hist_1d = ME_1d->
getTH1F();
1964 float prevCount = ip->second;
1966 string binLabel =
"HLT_"+pathname+
"_L1_Any";
1968 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
1970 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1972 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
1975 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1980 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
1983 float diffCount = currCount - prevCount;
1985 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
1988 ip->second = currCount;
1999 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2000 float updatedLumiCount = currentLumiCount + diffCount;
2001 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2005 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2019 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << endl;
2023 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
2028 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
2034 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
2036 TH1F * hist_1d = ME_1d->
getTH1F();
2042 float prevCount = ip->second;
2044 string binLabel =
"HLT_"+pathname+
"_Any";
2046 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
2048 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
2050 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
2053 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2058 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
2061 float diffCount = currCount - prevCount;
2063 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2066 ip->second = currCount;
2077 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2078 float updatedLumiCount = currentLumiCount + diffCount;
2079 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2084 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2098 LogTrace(
"FourVectorHLTOffline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << endl;
2100 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
2105 LogTrace(
"FourVectorHLTOffline") <<
" could not fine 2d matrix " << fullPathToME << endl;
2111 TH2F * hist_2d = ME_2d->
getTH2F();
2117 float prevCount = ip->second;
2120 float pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
2122 if(pathBin > hist_2d->GetNbinsX()) {
2124 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2129 float currCount = hist_2d->GetBinContent(pathBin, pathBin)/
LSsize_;
2132 float diffCount = currCount - prevCount;
2134 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2137 ip->second = currCount;
2147 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2150 float currentLumiCount = hist_All->GetBinContent(lumi+1,pathBinNumber);
2151 float updatedLumiCount = currentLumiCount + diffCount;
2152 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2157 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME_HLTAll_LS" << endl;
2215 if (pathname.find(
"MET") != std::string::npos)
2217 if (pathname.find(
"SumET") != std::string::npos || pathname.find(
"SumEt") != std::string::npos || pathname.find(
"ETT") != std::string::npos)
2219 if (pathname.find(
"HT") != std::string::npos)
2221 if (pathname.find(
"Jet") != std::string::npos)
2223 if (pathname.find(
"Mu") != std::string::npos)
2225 if (pathname.find(
"Ele") != std::string::npos)
2227 if (pathname.find(
"Photon") != std::string::npos)
2229 if (pathname.find(
"EG") != std::string::npos)
2231 if (pathname.find(
"Tau") != std::string::npos)
2233 if (pathname.find(
"IsoTrack") != std::string::npos)
2235 if (pathname.find(
"BTag") != std::string::npos)
2247 string l1pathname =
"dummy";
2251 for(vector<string>::iterator numpathmodule = numpathmodules.begin();
2252 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2256 l1pathname = *numpathmodule;
2272 int l1ModuleIndex = 999;
2276 if(
v->getPath() ==
pathname ) l1ModuleIndex =
v->getL1ModuleIndex();
2280 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2288 rc = (l1ModuleIndex < lastModule);
2299 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2315 for( reco::MuonCollection::const_iterator
iter = muonHandle->begin(), iend = muonHandle->end();
iter != iend; ++
iter )
2344 for( reco::GsfElectronCollection::const_iterator
iter = eleHandle->begin(), iend = eleHandle->end();
iter != iend; ++
iter )
2358 float eleMaxOver3x3 = ( lazyTool.eMax(*bc) / lazyTool.e3x3(*bc) );
2365 if(!
iter->ecalDriven() )
continue;
2390 else if(
iter->isEE()) {
2427 for( reco::PhotonCollection::const_iterator
iter = phoHandle->begin(), iend = phoHandle->end();
iter != iend; ++
iter )
2433 iter->sigmaIetaIeta() > 0.002 &&
2434 iter->maxEnergyXtal() /
iter->e3x3() < 0.9
2459 for( reco::CaloJetCollection::const_iterator
iter = jetHandle->begin(), iend = jetHandle->end();
iter != iend; ++
iter )
2489 for( reco::CaloMETCollection::const_iterator
iter = metHandle->begin(), iend = metHandle->end();
iter != iend; ++
iter )
2524 for(
unsigned int i=0;
i<tauHandle->size();++
i) {
2529 float outputDiscmnt1 = (*dscrmt1H)[pfTauRef];
2530 float outputDiscmnt2 = (*dscrmt2H)[pfTauRef];
2531 float outputDiscmnt3 = (*dscrmt3H)[pfTauRef];
2533 if(outputDiscmnt1>0.5 && outputDiscmnt2>0.5 && outputDiscmnt3 >0.5) {
2558 if(pathname.find(
"L1") != std::string::npos) pathname.replace(pathname.find(
"L1"),2,
"");
2560 if(pathname.find(
"L2") != std::string::npos) pathname.replace(pathname.find(
"L2"),2,
"");
2562 if(pathname.find(
"8E29") != std::string::npos) pathname.replace(pathname.find(
"8E29"),4,
"");
2564 int digitLocation=0;
2565 for (
unsigned int i=0;
i < pathname.length();
i++)
2567 if (isdigit(pathname.at(
i))) {
2576 string hltThresholdString = pathname.substr(digitLocation);
2578 int hltThreshold = 0;
2581 sscanf (hltThresholdString.c_str(),
"%d%*s",&hltThreshold);
2584 return hltThreshold;
2601 double normalizedChi2 = gm->normalizedChi2();
2602 int trackerHits = tk->hitPattern().numberOfValidTrackerHits();
2603 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
2604 int muonHits = gm->hitPattern().numberOfValidMuonHits();
2607 if (fabs(dxy)>
dxyCut_) {
return 0;}
2626 for (
int ii = 100;
ii >= 0;
ii--) {
2633 size_t pos = histVersion.find(version);
2634 if (pos != std::string::npos)
2635 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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
reco::PFTauCollection * fSelectedTaus
edm::EDGetTokenT< reco::PFTauDiscriminator > tauDscrmtr1Token
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
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit > > recHitsEBToken
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
edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::Handle< reco::BeamSpot > fBeamSpotHandle
double normalizedChi2Cut_
virtual void monitorOffline(void)=0
edm::Handle< reco::PFTauCollection > fSelTausHandle
edm::EDGetTokenT< reco::PFTauDiscriminator > tauDscrmtr2Token
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
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
U second(std::pair< T, U > const &p)
float deltaEtaSuperClusterTrackAtVtxEC_
edm::EDGetTokenT< reco::TrackCollection > pixelTrackToken
const std::string getL1ConditionModuleName(const std::string &pathname)
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)
unsigned int referenceBX_
float deltaEtaSuperClusterTrackAtVtxEB_
unsigned int triggerIndex(std::string const &name) const
edm::EDGetTokenT< reco::PhotonCollection > photonToken
void setLimits(float etaMax, float etMin, float drMatch)
edm::Handle< edm::TriggerResults > fTriggerResults
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< std::vector< reco::PFTau > > tauProdToken
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
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
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HLTConfigProvider hltConfig_
std::string fCustomBXPath
edm::EDGetTokenT< reco::CaloJetCollection > iC5calojetToken
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setVerbose(unsigned level)
reco::PhotonCollection * fSelectedPhotons
static std::string const triggerResults
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
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
edm::EDGetTokenT< reco::MuonCollection > muonRecoCollectionToken
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_
edm::EDGetTokenT< reco::PFTauDiscriminator > tauDscrmtr3Token
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
virtual void clearSets(void)=0
edm::EDGetTokenT< reco::CaloMETCollection > METToken
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
edm::EDGetTokenT< std::vector< reco::PFTau > > hpsPFTauProdToken
MonitorElement * ME_HLT_CUSTOM_BX
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
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)
edm::EDGetTokenT< reco::JetTagCollection > jlipBtagToken
std::string pathsSummaryHLTCorrelationsFolder_
std::string pathsSummaryFilterCountsFolder_
void selectMet(const edm::Handle< reco::CaloMETCollection > &metHandle)
float dr04HcalTowerSumEtEC_
edm::InputTag recHitsEBTag_
edm::EDGetTokenT< reco::JetTagCollection > softMuBtagToken
MonitorElement * ME_HLTAll_LS
std::vector< std::string > fGroupName
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
std::vector< std::pair< std::string, float > > fGroupL1TempCountPair
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit > > recHitsEEToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
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