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")
242 using namespace trigger;
244 LogDebug(
"FourVectorHLTOffline")<<
" analyze...." ;
280 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerResults not found, "
297 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerEvent not found, " "skipping event";
311 if(!muonHandle.isValid())
312 edm::LogInfo(
"FourVectorHLTOffline") <<
"muonHandle not found, ";
318 edm::LogInfo(
"FourVectorHLTOffline") <<
"gsfElectrons not found, ";
323 iEvent.
getByLabel(
"caloRecoTauProducer",tauHandle);
324 if(!tauHandle.isValid())
325 edm::LogInfo(
"FourVectorHLTOffline") <<
"tauHandle not found, ";
330 iEvent.
getByLabel(
"iterativeCone5CaloJets",jetHandle);
331 if(!jetHandle.isValid())
332 edm::LogInfo(
"FourVectorHLTOffline") <<
"jetHandle not found, ";
337 iEvent.
getByLabel(
"jetProbabilityBJetTags", bTagIPHandle);
338 if (!bTagIPHandle.isValid())
339 edm::LogInfo(
"FourVectorHLTOffline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
343 iEvent.
getByLabel(
"softMuonBJetTags", bTagMuHandle);
344 if (!bTagMuHandle.isValid())
345 edm::LogInfo(
"FourVectorHLTOffline") <<
"bTagMuHandle not found, ";
349 if(!metHandle.isValid())
350 edm::LogInfo(
"FourVectorHLTOffline") <<
"metHandle not found, ";
355 if(!photonHandle.isValid())
356 edm::LogInfo(
"FourVectorHLTOffline") <<
"photonHandle not found, ";
361 if(!trackHandle.isValid())
362 edm::LogInfo(
"FourVectorHLTOffline") <<
"trackHandle not found, ";
446 btagIPMon.setBJetsFlag(
true);
459 btagMuMon.setBJetsFlag(
true);
500 std::vector<BaseMonitor*> monitors;
504 monitors.push_back(&muoMon);
505 monitors.push_back(&eleMon);
506 monitors.push_back(&tauMon);
507 monitors.push_back(&phoMon);
508 monitors.push_back(&jetMon);
509 monitors.push_back(&btagMon);
510 monitors.push_back(&metMon);
511 monitors.push_back(&tetMon);
535 LogTrace(
"FourVectorHLTOffline") <<
" unique path " <<
v->getPath() << endl;
537 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
567 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
569 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
576 v->getFiltersHisto()->Fill(binNumber-1);
578 else if(
v->filtersAndIndices[filt].second < lastModule){
579 v->getFiltersHisto()->Fill(binNumber-1);
590 LogTrace(
"FourVectorHLTOffline") <<
" path " <<
v->getPath() << endl;
592 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
593 else btagMon = btagMuMon;
596 if (
v->getPath().find(
"L2Mu") != std::string::npos ||
v->getPath().find(
"L1Mu") != std::string::npos ) muoMon.setL2MuFlag(
true);
597 else muoMon.setL2MuFlag(
false);
602 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
607 bool denompassed =
false;
609 for(
int i = 0;
i < npath; ++
i) {
611 if (
triggerResults->accept(
i) && triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos && triggerNames.triggerName(
i).find(
"HLT_Mult") == std::string::npos )
628 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
630 if((*mit)->isTriggerType(
v->getObjectType())) {
643 if(!mon) mon = &defMon;
659 bool l1accept =
false;
661 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
665 LogTrace(
"FourVectorHLTOffline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << endl;
666 LogTrace(
"FourVectorHLTOffline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << endl;
667 LogTrace(
"FourVectorHLTOffline") <<
"\t tried with tag " << l1testTag << endl;
668 LogTrace(
"FourVectorHLTOffline") <<
"\t module index = "<< l1Index << endl;
680 bool numpassed =
false;
683 for(
int i = 0;
i < npath; ++
i) {
685 if (
triggerResults->accept(
i) && triggerNames.triggerName(
i) ==
v->getPath() ) numpassed =
true;
689 if (!numpassed)
continue;
694 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< endl
695 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
705 if (
v->getLabel() ==
"dummy"){
709 for (vector<string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
716 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
719 v->setLabel(*labelIter);}
725 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
728 LogTrace(
"FourVectorHLTOffline") <<
"WTF no index "<< hltIndex <<
" of that name " << filterTag << endl;
769 LogInfo(
"FourVectorHLTOffline") <<
"analyzed " <<
nev_ <<
" events";
778 LogDebug(
"FourVectorHLTOffline") <<
"beginRun, run " << run.
id();
791 LogDebug(
"FourVectorHLTOffline") <<
"HLTConfigProvider failed to initialize.";
813 for (
unsigned int j=0;
j!=
n; ++
j) {
823 for (
unsigned int i=0;
i!=
n; ++
i) {
833 if (
plotAll_ && denomobjectType == objectType && objectType != 0) {
837 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
848 for (
unsigned int i=0;
i!=
n; ++
i) {
873 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
878 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
880 hltPathsDiagonal_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
890 std::string numpathname = custompathnamepair->first;
891 std::string denompathname = custompathnamepair->second;
893 if (numpathname != denompathname) {
896 bool founddenominator =
false;
897 for (
unsigned int k=0;
k!=
n; ++
k) {
901 if (n_pathname.find(denompathname) != std::string::npos) {
903 LogDebug(
"FourVectorHLTOffline") <<
"denompathname is selected to be = " << n_pathname << endl;;
904 founddenominator =
true;
911 if (!founddenominator) {
913 edm::LogInfo(
"FourVectorHLTOffline") <<
"denompathname not found, go to the next pair numearator-denominator" << endl;
921 for (
unsigned int j=0;
j!=
n; ++
j) {
922 bool foundnumerator =
false;
926 LogDebug(
"FourVectorHLTOffline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << endl;
929 LogDebug(
"FourVectorHLTOffline") <<
"pathname is selected to be = " << denompathname << endl;;
930 foundnumerator =
true;
935 if (!foundnumerator) {
961 if (objectType != 0) {
964 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
977 vector<string> allPaths;
987 vector<int> tempCount(5,0);
992 allPaths.push_back(pathName);
1013 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
1048 string moduleName, moduleType, moduleEDMType;
1049 unsigned int moduleIndex;
1052 vector<string>::const_iterator iDumpModName;
1053 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
1055 moduleName = *iDumpModName;
1060 LogTrace (
"FourVectorHLTOffline") <<
"Module " << numModule
1061 <<
" is called " << moduleName
1062 <<
" , type = " << moduleType
1063 <<
" , EDMtype = " << moduleEDMType
1064 <<
" , index = " << moduleIndex
1069 if((moduleType.find(
"Filter") != string::npos && moduleType.find(
"HLTTriggerTypeFilter") == string::npos ) ||
1070 (moduleType.find(
"Associator") != string::npos) ||
1071 (moduleType.find(
"HLTLevel1GTSeed") != string::npos) ||
1072 (moduleType.find(
"HLTGlobalSumsCaloMET") != string::npos) ||
1073 (moduleType.find(
"HLTPrescaler") != string::npos) ||
1074 (moduleEDMType.find(
"EDFilter") != string::npos) ) {
1080 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1090 int nbin_sub =
v->filtersAndIndices.size()+2;
1097 "Filters_" + pathName,
1098 nbin_sub+1, -0.5, 0.5+(
double)nbin_sub);
1100 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1103 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1115 v->setFilterHistos(filters);
1156 labelname = pathName +
"_wrt_" +
v->getDenomPath();
1160 double histEtaMax = 2.5;
1199 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1202 histoname = labelname+
"_NOff";
1203 title = labelname+
" N Off";
1204 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1206 histoname = labelname+
"_NL1";
1207 title = labelname+
" N L1";
1208 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1210 histoname = labelname+
"_NL1On";
1211 title = labelname+
" N L1On";
1212 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1214 histoname = labelname+
"_NL1Off";
1215 title = labelname+
" N L1Off";
1216 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1218 histoname = labelname+
"_NOnOff";
1219 title = labelname+
" N OnOff";
1220 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1222 histoname = labelname+
"_onEtOn";
1223 title = labelname+
" onE_t online";
1224 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1226 histoname = labelname+
"_onOneOverEtOn";
1227 title = labelname+
" 1 / onE_t online";
1231 histoname = labelname+
"_offEtOff";
1232 title = labelname+
" offE_t offline";
1233 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1235 histoname = labelname+
"_l1EtL1";
1236 title = labelname+
" l1E_t L1";
1237 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1239 histoname = labelname+
"_onEtaonPhiOn";
1240 title = labelname+
" on#eta vs on#phi online";
1243 histoname = labelname+
"_offEtaoffPhiOff";
1244 title = labelname+
" off#eta vs off#phi offline";
1247 histoname = labelname+
"_l1Etal1PhiL1";
1248 title = labelname+
" l1#eta vs l1#phi L1";
1251 histoname = labelname+
"_l1EtL1On";
1252 title = labelname+
" l1E_t L1+online";
1253 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1255 histoname = labelname+
"_offEtL1Off";
1256 title = labelname+
" offE_t L1+offline";
1257 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1259 histoname = labelname+
"_offEtOnOff";
1260 title = labelname+
" offE_t online+offline";
1261 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1263 histoname = labelname+
"_l1Etal1PhiL1On";
1264 title = labelname+
" l1#eta vs l1#phi L1+online";
1267 histoname = labelname+
"_offEtaoffPhiL1Off";
1268 title = labelname+
" off#eta vs off#phi L1+offline";
1271 histoname = labelname+
"_offEtaoffPhiOnOff";
1272 title = labelname+
" off#eta vs off#phi online+offline";
1277 histoname = labelname+
"_NL1OnUM";
1278 title = labelname+
" N L1OnUM";
1279 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1281 histoname = labelname+
"_NL1OffUM";
1282 title = labelname+
" N L1OffUM";
1283 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1285 histoname = labelname+
"_NOnOffUM";
1286 title = labelname+
" N OnOffUM";
1287 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1289 histoname = labelname+
"_l1EtL1OnUM";
1290 title = labelname+
" l1E_t L1+onlineUM";
1291 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1293 histoname = labelname+
"_offEtL1OffUM";
1294 title = labelname+
" offE_t L1+offlineUM";
1295 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1297 histoname = labelname+
"_offEtOnOffUM";
1298 title = labelname+
" offE_t online+offlineUM";
1299 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1301 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1302 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1305 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1306 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1309 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1310 title = labelname+
" off#eta vs off#phi online+offlineUM";
1315 histoname = labelname+
"_l1DRL1On";
1316 title = labelname+
" l1DR L1+online";
1319 histoname = labelname+
"_offDRL1Off";
1320 title = labelname+
" offDR L1+offline";
1323 histoname = labelname+
"_offDROnOff";
1324 title = labelname+
" offDR online+offline";
1328 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
1354 LogDebug(
"FourVectorHLTOffline") <<
"endRun, run " << run.
id();
1362 LogDebug(
"FourVectorHLTOffline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << endl;
1364 if(tempSet.size() < 2)
return;
1366 if(tempSet.size() > 10) {
1368 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is too large. It will be truncated to 10." << endl;
1369 mmset::iterator it = tempSet.begin();
1370 for (
int i=0;
i<10;
i++) { it++; }
1371 tempSet.erase( it, tempSet.end());
1372 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << endl;
1376 bool cleanedOneMap =
false;
1380 while(! cleanedOneMap && tempSet.size() > 1) {
1382 cleanedOneMap=
false;
1387 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1389 fimmap tempMap_j = *setIter_i;
1394 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1405 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1407 fimmap tempMap_i = *setIter_i;
1408 fimmap::iterator it = tempMap_i.begin();
1409 int topValue = (*it).second;
1413 mmset::iterator tempIter_i = setIter_i;
1417 mmset::iterator setIter_j = ++tempIter_i;
1418 while ( setIter_j != tempSet.end( ) ) {
1420 fimmap tempMap_j = *setIter_j;
1423 fimmap::iterator it = tempMap_j.begin();
1424 while ( it != tempMap_j.end() ) {
1426 if(topValue == (*it).second) {
1429 fimmap::iterator tempIt = it;
1431 tempMap_j.erase(tempIt);
1432 cleanedOneMap =
true;
1443 mmset::iterator tempIt = setIter_j;
1445 tempSet.erase(tempIt);
1448 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1459 if(cleanedOneMap)
break;
1467 cleanedOneMap=
false;
1483 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1486 fimmap tempMap_j = *setIter_i;
1491 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1509 paths.push_back(
"HLT_"+label+
"_L1_Any");
1510 paths.push_back(
"HLT_"+label+
"_Any");
1511 paths.push_back(
"HLT_Any");
1523 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1524 h_name=
"HLT_"+label+
"_PassPass";
1525 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1526 ME =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1527 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1529 h_name=
"HLT_"+label+
"_Pass_Any";
1530 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1531 ME_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1532 paths.size(), -0.5, paths.size()-0.5);
1535 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1536 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1537 ME_Normalized =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1538 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1539 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1540 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1541 ME_Normalized_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1542 paths.size(), -0.5, paths.size()-0.5);
1545 if (label !=
"All" && label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor")
1548 h_name=
"HLT_"+label+
"_Total_LS";
1549 h_title = label+
" HLT paths total count combined per LS ";
1580 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1581 for(
unsigned int i = 0;
i < paths.size();
i++){
1584 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1585 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1589 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1590 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1592 if (ME_Normalized_Any)
1593 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1596 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1605 string fullPathToME;
1611 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1613 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1615 if(!ME_2d || !ME_1d) {
1617 LogTrace(
"FourVectorHLTOffline") <<
" ME not valid although I gave full path" << endl;
1622 TH2F * hist_2d = ME_2d->
getTH2F();
1623 TH1F * hist_1d = ME_1d->
getTH1F();
1627 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1630 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1635 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1636 hist_1d->Fill(anyBinNumber-1);
1640 bool groupPassed =
false;
1671 hist_2d->Fill(i,anyBinNumber-1);
1672 hist_2d->Fill(anyBinNumber-1,i);
1674 hist_2d->Fill(i,groupBinNumber-1);
1675 hist_2d->Fill(groupBinNumber-1,i);
1707 hist_1d->Fill(groupBinNumber-1);
1708 hist_1d->Fill(groupBinNumber-2);
1709 hist_2d->Fill(groupBinNumber-1,groupBinNumber-1);
1710 hist_2d->Fill(anyBinNumber-1,groupBinNumber-1);
1711 hist_2d->Fill(groupBinNumber-1,anyBinNumber-1);
1736 "HLT counts vs Event bx",
1737 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1748 for(
unsigned int i = 0;
i < npaths;
i++){
1769 "All paths per LS ",
1770 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1774 for(
unsigned int i = 0;
i < npaths;
i++){
1780 unsigned int i = npaths;
1801 LogTrace(
"FourVectorHLTOffline") <<
" end lumiSection number " << lumi << endl;
1815 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << endl;
1823 vector<int> prevCount = ip->second;
1826 vector<int> currCount (5,0);
1827 vector<int> diffCount (5,0);
1830 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1832 if(pathBin > hist_2d_bx->GetNbinsY()) {
1834 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1839 for (
unsigned int b =0;
b<currCount.size();
b++) {
1843 if(bunch < 1) bunch +=
Nbx_ ;
1844 int bxBin = bunch +1;
1847 currCount[
b] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1849 LogTrace(
"FourVectorHLTOffline") <<
"currCount = " << currCount[
b] << endl;
1852 diffCount[
b] = currCount[
b] - prevCount[
b];
1854 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
b] << endl;
1859 ip->second = currCount;
1864 LogTrace(
"FourVectorHLTOffline") <<
"Find " << pathname << endl;
1869 bool isMember =
false;
1889 LogTrace(
"FourVectorHLTOffline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupNamePathsPair[
j].first << endl;
1903 vector<int> updatedLumiCount(5,0);
1905 float entireBXWindowUpdatedLumiCount = 0;
1907 TH2F* hist_All = ME_2d->
getTH2F();
1909 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1915 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1916 updatedLumiCount[
b] = currentLumiCount + diffCount[
b];
1917 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount[
b]);
1919 entireBXWindowUpdatedLumiCount += updatedLumiCount[
b];
1932 TH2F* hist_All_Norm = ME_2d_Norm->
getTH2F();
1934 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1940 if(entireBXWindowUpdatedLumiCount != 0)
1941 hist_All_Norm->SetBinContent(lumi+1,binNumber,
float(updatedLumiCount[
b])/entireBXWindowUpdatedLumiCount);
1954 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << endl;
1959 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1964 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
1970 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
1972 TH1F * hist_1d = ME_1d->
getTH1F();
1978 float prevCount = ip->second;
1980 string binLabel =
"HLT_"+pathname+
"_L1_Any";
1982 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
1984 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1986 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
1989 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1994 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
1997 float diffCount = currCount - prevCount;
1999 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2002 ip->second = currCount;
2013 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2014 float updatedLumiCount = currentLumiCount + diffCount;
2015 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2019 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2033 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << endl;
2037 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
2042 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
2048 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
2050 TH1F * hist_1d = ME_1d->
getTH1F();
2056 float prevCount = ip->second;
2058 string binLabel =
"HLT_"+pathname+
"_Any";
2060 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
2062 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
2064 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
2067 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2072 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
2075 float diffCount = currCount - prevCount;
2077 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2080 ip->second = currCount;
2091 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2092 float updatedLumiCount = currentLumiCount + diffCount;
2093 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2098 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2112 LogTrace(
"FourVectorHLTOffline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << endl;
2114 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
2119 LogTrace(
"FourVectorHLTOffline") <<
" could not fine 2d matrix " << fullPathToME << endl;
2125 TH2F * hist_2d = ME_2d->
getTH2F();
2131 float prevCount = ip->second;
2134 float pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
2136 if(pathBin > hist_2d->GetNbinsX()) {
2138 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2143 float currCount = hist_2d->GetBinContent(pathBin, pathBin)/
LSsize_;
2146 float diffCount = currCount - prevCount;
2148 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2151 ip->second = currCount;
2161 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2164 float currentLumiCount = hist_All->GetBinContent(lumi+1,pathBinNumber);
2165 float updatedLumiCount = currentLumiCount + diffCount;
2166 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2171 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME_HLTAll_LS" << endl;
2229 if (pathname.find(
"MET") != std::string::npos)
2231 if (pathname.find(
"SumET") != std::string::npos || pathname.find(
"SumEt") != std::string::npos || pathname.find(
"ETT") != std::string::npos)
2233 if (pathname.find(
"HT") != std::string::npos)
2235 if (pathname.find(
"Jet") != std::string::npos)
2237 if (pathname.find(
"Mu") != std::string::npos)
2239 if (pathname.find(
"Ele") != std::string::npos)
2241 if (pathname.find(
"Photon") != std::string::npos)
2243 if (pathname.find(
"EG") != std::string::npos)
2245 if (pathname.find(
"Tau") != std::string::npos)
2247 if (pathname.find(
"IsoTrack") != std::string::npos)
2249 if (pathname.find(
"BTag") != std::string::npos)
2261 string l1pathname =
"dummy";
2265 for(vector<string>::iterator numpathmodule = numpathmodules.begin();
2266 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2270 l1pathname = *numpathmodule;
2286 int l1ModuleIndex = 999;
2290 if(
v->getPath() ==
pathname ) l1ModuleIndex =
v->getL1ModuleIndex();
2294 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2302 rc = (l1ModuleIndex < lastModule);
2313 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2329 for( reco::MuonCollection::const_iterator iter = muonHandle->begin(), iend = muonHandle->end(); iter != iend; ++iter )
2358 for( reco::GsfElectronCollection::const_iterator iter = eleHandle->begin(), iend = eleHandle->end(); iter != iend; ++iter )
2372 float eleMaxOver3x3 = ( lazyTool.
eMax(*bc) / lazyTool.
e3x3(*bc) );
2379 if(! iter->ecalDriven() )
continue;
2404 else if(iter->isEE()) {
2441 for( reco::PhotonCollection::const_iterator iter = phoHandle->begin(), iend = phoHandle->end(); iter != iend; ++iter )
2447 iter->sigmaIetaIeta() > 0.002 &&
2448 iter->maxEnergyXtal() / iter->e3x3() < 0.9
2473 for( reco::CaloJetCollection::const_iterator iter = jetHandle->begin(), iend = jetHandle->end(); iter != iend; ++iter )
2503 for( reco::CaloMETCollection::const_iterator iter = metHandle->begin(), iend = metHandle->end(); iter != iend; ++iter )
2526 iEvent.
getByLabel(
"hpsPFTauProducer",tauHandle);
2538 for(
unsigned int i=0;
i<tauHandle->size();++
i) {
2543 float outputDiscmnt1 = (*dscrmt1H)[pfTauRef];
2544 float outputDiscmnt2 = (*dscrmt2H)[pfTauRef];
2545 float outputDiscmnt3 = (*dscrmt3H)[pfTauRef];
2547 if(outputDiscmnt1>0.5 && outputDiscmnt2>0.5 && outputDiscmnt3 >0.5) {
2572 if(pathname.find(
"L1") != std::string::npos) pathname.replace(pathname.find(
"L1"),2,
"");
2574 if(pathname.find(
"L2") != std::string::npos) pathname.replace(pathname.find(
"L2"),2,
"");
2576 if(pathname.find(
"8E29") != std::string::npos) pathname.replace(pathname.find(
"8E29"),4,
"");
2578 int digitLocation=0;
2579 for (
unsigned int i=0;
i < pathname.length();
i++)
2581 if (isdigit(pathname.at(
i))) {
2590 string hltThresholdString = pathname.substr(digitLocation);
2592 int hltThreshold = 0;
2595 sscanf (hltThresholdString.c_str(),
"%d%*s",&hltThreshold);
2598 return hltThreshold;
2615 double normalizedChi2 = gm->normalizedChi2();
2616 int trackerHits = tk->hitPattern().numberOfValidTrackerHits();
2617 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
2618 int muonHits = gm->hitPattern().numberOfValidMuonHits();
2621 if (fabs(dxy)>
dxyCut_) {
return 0;}
2640 for (
int ii = 100;
ii >= 0;
ii--) {
2647 size_t pos = histVersion.find(version);
2648 if (pos != std::string::npos)
2649 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
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)
float deltaEtaSuperClusterTrackAtVtxEC_
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
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
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
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)
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)
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