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++) {
81 pathconf->getParameter<
std::string>(
"denompathname")
243 using namespace trigger;
245 LogDebug(
"FourVectorHLTOffline")<<
" analyze...." ;
281 edm::LogInfo(
"FourVectorHLTOffline") <<
"TriggerResults not found, "
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());
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;
660 bool l1accept =
false;
662 const int l1Index =
fTriggerObj->filterIndex(l1testTag);
666 LogTrace(
"FourVectorHLTOffline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << endl;
667 LogTrace(
"FourVectorHLTOffline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << endl;
668 LogTrace(
"FourVectorHLTOffline") <<
"\t tried with tag " << l1testTag << endl;
669 LogTrace(
"FourVectorHLTOffline") <<
"\t module index = "<< l1Index << endl;
681 bool numpassed =
false;
684 for(
int i = 0;
i < npath; ++
i) {
686 if (
triggerResults->accept(
i) && triggerNames.triggerName(
i) ==
v->getPath() ) numpassed =
true;
690 if (!numpassed)
continue;
695 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< endl
696 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
706 if (
v->getLabel() ==
"dummy"){
710 for (vector<string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
717 if ( !(testindex >=
fTriggerObj->sizeFilters()) ) {
720 v->setLabel(*labelIter);}
726 const int hltIndex =
fTriggerObj->filterIndex(filterTag);
729 LogTrace(
"FourVectorHLTOffline") <<
"WTF no index "<< hltIndex <<
" of that name " << filterTag << endl;
770 LogInfo(
"FourVectorHLTOffline") <<
"analyzed " <<
nev_ <<
" events";
779 LogDebug(
"FourVectorHLTOffline") <<
"beginRun, run " << run.
id();
792 LogDebug(
"FourVectorHLTOffline") <<
"HLTConfigProvider failed to initialize.";
814 for (
unsigned int j=0;
j!=
n; ++
j) {
824 for (
unsigned int i=0;
i!=
n; ++
i) {
834 if (
plotAll_ && denomobjectType == objectType && objectType != 0) {
838 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
849 for (
unsigned int i=0;
i!=
n; ++
i) {
874 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
879 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
881 hltPathsDiagonal_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
891 std::string numpathname = custompathnamepair->first;
892 std::string denompathname = custompathnamepair->second;
894 if (numpathname != denompathname) {
897 bool founddenominator =
false;
898 for (
unsigned int k=0;
k!=
n; ++
k) {
902 if (n_pathname.find(denompathname) != std::string::npos) {
904 LogDebug(
"FourVectorHLTOffline") <<
"denompathname is selected to be = " << n_pathname << endl;;
905 founddenominator =
true;
912 if (!founddenominator) {
914 edm::LogInfo(
"FourVectorHLTOffline") <<
"denompathname not found, go to the next pair numearator-denominator" << endl;
922 for (
unsigned int j=0;
j!=
n; ++
j) {
923 bool foundnumerator =
false;
927 LogDebug(
"FourVectorHLTOffline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << endl;
930 LogDebug(
"FourVectorHLTOffline") <<
"pathname is selected to be = " << denompathname << endl;;
931 foundnumerator =
true;
936 if (!foundnumerator) {
962 if (objectType != 0) {
965 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, l1ModuleIndex, filtername,
processname_, objectType, ptMin, ptMax, hltThreshold, l1Threshold));
978 vector<string> allPaths;
988 vector<int> tempCount(5,0);
993 allPaths.push_back(pathName);
1014 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
1049 string moduleName, moduleType, moduleEDMType;
1050 unsigned int moduleIndex;
1053 vector<string>::const_iterator iDumpModName;
1054 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
1056 moduleName = *iDumpModName;
1061 LogTrace (
"FourVectorHLTOffline") <<
"Module " << numModule
1062 <<
" is called " << moduleName
1063 <<
" , type = " << moduleType
1064 <<
" , EDMtype = " << moduleEDMType
1065 <<
" , index = " << moduleIndex
1070 if((moduleType.find(
"Filter") != string::npos && moduleType.find(
"HLTTriggerTypeFilter") == string::npos ) ||
1071 (moduleType.find(
"Associator") != string::npos) ||
1072 (moduleType.find(
"HLTLevel1GTSeed") != string::npos) ||
1073 (moduleType.find(
"HLTGlobalSumsCaloMET") != string::npos) ||
1074 (moduleType.find(
"HLTPrescaler") != string::npos) ||
1075 (moduleEDMType.find(
"EDFilter") != string::npos) ) {
1081 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
1091 int nbin_sub =
v->filtersAndIndices.size()+2;
1098 "Filters_" + pathName,
1099 nbin_sub+1, -0.5, 0.5+(
double)nbin_sub);
1101 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1104 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1116 v->setFilterHistos(filters);
1157 labelname = pathName +
"_wrt_" +
v->getDenomPath();
1161 double histEtaMax = 2.5;
1200 NOn = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1203 histoname = labelname+
"_NOff";
1204 title = labelname+
" N Off";
1205 NOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1207 histoname = labelname+
"_NL1";
1208 title = labelname+
" N L1";
1209 NL1 = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1211 histoname = labelname+
"_NL1On";
1212 title = labelname+
" N L1On";
1213 NL1On = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1215 histoname = labelname+
"_NL1Off";
1216 title = labelname+
" N L1Off";
1217 NL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1219 histoname = labelname+
"_NOnOff";
1220 title = labelname+
" N OnOff";
1221 NOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1223 histoname = labelname+
"_onEtOn";
1224 title = labelname+
" onE_t online";
1225 onEtOn = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1227 histoname = labelname+
"_onOneOverEtOn";
1228 title = labelname+
" 1 / onE_t online";
1232 histoname = labelname+
"_offEtOff";
1233 title = labelname+
" offE_t offline";
1234 offEtOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1236 histoname = labelname+
"_l1EtL1";
1237 title = labelname+
" l1E_t L1";
1238 l1EtL1 = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1240 histoname = labelname+
"_onEtaonPhiOn";
1241 title = labelname+
" on#eta vs on#phi online";
1244 histoname = labelname+
"_offEtaoffPhiOff";
1245 title = labelname+
" off#eta vs off#phi offline";
1248 histoname = labelname+
"_l1Etal1PhiL1";
1249 title = labelname+
" l1#eta vs l1#phi L1";
1252 histoname = labelname+
"_l1EtL1On";
1253 title = labelname+
" l1E_t L1+online";
1254 l1EtL1On = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1256 histoname = labelname+
"_offEtL1Off";
1257 title = labelname+
" offE_t L1+offline";
1258 offEtL1Off = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1260 histoname = labelname+
"_offEtOnOff";
1261 title = labelname+
" offE_t online+offline";
1262 offEtOnOff = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1264 histoname = labelname+
"_l1Etal1PhiL1On";
1265 title = labelname+
" l1#eta vs l1#phi L1+online";
1268 histoname = labelname+
"_offEtaoffPhiL1Off";
1269 title = labelname+
" off#eta vs off#phi L1+offline";
1272 histoname = labelname+
"_offEtaoffPhiOnOff";
1273 title = labelname+
" off#eta vs off#phi online+offline";
1278 histoname = labelname+
"_NL1OnUM";
1279 title = labelname+
" N L1OnUM";
1280 NL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1282 histoname = labelname+
"_NL1OffUM";
1283 title = labelname+
" N L1OffUM";
1284 NL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1286 histoname = labelname+
"_NOnOffUM";
1287 title = labelname+
" N OnOffUM";
1288 NOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1290 histoname = labelname+
"_l1EtL1OnUM";
1291 title = labelname+
" l1E_t L1+onlineUM";
1292 l1EtL1OnUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1294 histoname = labelname+
"_offEtL1OffUM";
1295 title = labelname+
" offE_t L1+offlineUM";
1296 offEtL1OffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1298 histoname = labelname+
"_offEtOnOffUM";
1299 title = labelname+
" offE_t online+offlineUM";
1300 offEtOnOffUM = dbe->
book1D(histoname.c_str(), title.c_str(),
nBins_,
v->getPtMin(),
v->getPtMax());
1302 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1303 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1306 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1307 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1310 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1311 title = labelname+
" off#eta vs off#phi online+offlineUM";
1316 histoname = labelname+
"_l1DRL1On";
1317 title = labelname+
" l1DR L1+online";
1320 histoname = labelname+
"_offDRL1Off";
1321 title = labelname+
" offDR L1+offline";
1324 histoname = labelname+
"_offDROnOff";
1325 title = labelname+
" offDR online+offline";
1329 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
1355 LogDebug(
"FourVectorHLTOffline") <<
"endRun, run " << run.
id();
1363 LogDebug(
"FourVectorHLTOffline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << endl;
1365 if(tempSet.size() < 2)
return;
1367 if(tempSet.size() > 10) {
1369 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is too large. It will be truncated to 10." << endl;
1370 mmset::iterator it = tempSet.begin();
1371 for (
int i=0;
i<10;
i++) { it++; }
1372 tempSet.erase( it, tempSet.end());
1373 LogDebug(
"FourVectorHLTOffline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << endl;
1377 bool cleanedOneMap =
false;
1381 while(! cleanedOneMap && tempSet.size() > 1) {
1383 cleanedOneMap=
false;
1388 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1390 fimmap tempMap_j = *setIter_i;
1395 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1406 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1408 fimmap tempMap_i = *setIter_i;
1409 fimmap::iterator it = tempMap_i.begin();
1410 int topValue = (*it).second;
1414 mmset::iterator tempIter_i = setIter_i;
1418 mmset::iterator setIter_j = ++tempIter_i;
1419 while ( setIter_j != tempSet.end( ) ) {
1421 fimmap tempMap_j = *setIter_j;
1424 fimmap::iterator it = tempMap_j.begin();
1425 while ( it != tempMap_j.end() ) {
1427 if(topValue == (*it).second) {
1430 fimmap::iterator tempIt = it;
1432 tempMap_j.erase(tempIt);
1433 cleanedOneMap =
true;
1444 mmset::iterator tempIt = setIter_j;
1446 tempSet.erase(tempIt);
1449 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1460 if(cleanedOneMap)
break;
1468 cleanedOneMap=
false;
1484 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1487 fimmap tempMap_j = *setIter_i;
1492 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1510 paths.push_back(
"HLT_"+label+
"_L1_Any");
1511 paths.push_back(
"HLT_"+label+
"_Any");
1512 paths.push_back(
"HLT_Any");
1524 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1525 h_name=
"HLT_"+label+
"_PassPass";
1526 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1527 ME =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1528 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1530 h_name=
"HLT_"+label+
"_Pass_Any";
1531 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1532 ME_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1533 paths.size(), -0.5, paths.size()-0.5);
1536 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1537 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1538 ME_Normalized =
dbe_->
book2D(h_name.c_str(), h_title.c_str(),
1539 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1540 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1541 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1542 ME_Normalized_Any =
dbe_->
book1D(h_name.c_str(), h_title.c_str(),
1543 paths.size(), -0.5, paths.size()-0.5);
1546 if (label !=
"All" && label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor")
1549 h_name=
"HLT_"+label+
"_Total_LS";
1550 h_title = label+
" HLT paths total count combined per LS ";
1581 if (label !=
"OfflineMonitor" && label !=
"OnlineHltMonitor" && label !=
"OnlineMonitor") {
1582 for(
unsigned int i = 0;
i < paths.size();
i++){
1585 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1586 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1590 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1591 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1593 if (ME_Normalized_Any)
1594 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1597 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1606 string fullPathToME;
1612 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_PassPass";
1614 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+
fGroupNamePathsPair[mi].first+
"_Pass_Any";
1616 if(!ME_2d || !ME_1d) {
1618 LogTrace(
"FourVectorHLTOffline") <<
" ME not valid although I gave full path" << endl;
1623 TH2F * hist_2d = ME_2d->
getTH2F();
1624 TH1F * hist_1d = ME_1d->
getTH1F();
1628 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1631 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1636 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1637 hist_1d->Fill(anyBinNumber-1);
1641 bool groupPassed =
false;
1672 hist_2d->Fill(i,anyBinNumber-1);
1673 hist_2d->Fill(anyBinNumber-1,i);
1675 hist_2d->Fill(i,groupBinNumber-1);
1676 hist_2d->Fill(groupBinNumber-1,i);
1708 hist_1d->Fill(groupBinNumber-1);
1709 hist_1d->Fill(groupBinNumber-2);
1710 hist_2d->Fill(groupBinNumber-1,groupBinNumber-1);
1711 hist_2d->Fill(anyBinNumber-1,groupBinNumber-1);
1712 hist_2d->Fill(groupBinNumber-1,anyBinNumber-1);
1737 "HLT counts vs Event bx",
1738 Nbx_+1, -0.5,
Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1749 for(
unsigned int i = 0;
i < npaths;
i++){
1770 "All paths per LS ",
1771 nLS_, 0,
nLS_, npaths+1, -0.5, npaths+1-0.5);
1775 for(
unsigned int i = 0;
i < npaths;
i++){
1781 unsigned int i = npaths;
1802 LogTrace(
"FourVectorHLTOffline") <<
" end lumiSection number " << lumi << endl;
1816 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << endl;
1824 vector<int> prevCount = ip->second;
1827 vector<int> currCount (5,0);
1828 vector<int> diffCount (5,0);
1831 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1833 if(pathBin > hist_2d_bx->GetNbinsY()) {
1835 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1840 for (
unsigned int b =0;
b<currCount.size();
b++) {
1844 if(bunch < 1) bunch +=
Nbx_ ;
1845 int bxBin = bunch +1;
1848 currCount[
b] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1850 LogTrace(
"FourVectorHLTOffline") <<
"currCount = " << currCount[
b] << endl;
1853 diffCount[
b] = currCount[
b] - prevCount[
b];
1855 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
b] << endl;
1860 ip->second = currCount;
1865 LogTrace(
"FourVectorHLTOffline") <<
"Find " << pathname << endl;
1870 bool isMember =
false;
1890 LogTrace(
"FourVectorHLTOffline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " <<
fGroupNamePathsPair[
j].first << endl;
1904 vector<int> updatedLumiCount(5,0);
1906 float entireBXWindowUpdatedLumiCount = 0;
1908 TH2F* hist_All = ME_2d->
getTH2F();
1910 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1916 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1917 updatedLumiCount[
b] = currentLumiCount + diffCount[
b];
1918 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount[
b]);
1920 entireBXWindowUpdatedLumiCount += updatedLumiCount[
b];
1933 TH2F* hist_All_Norm = ME_2d_Norm->
getTH2F();
1935 for (
unsigned int b = 0;
b<diffCount.size();
b++) {
1941 if(entireBXWindowUpdatedLumiCount != 0)
1942 hist_All_Norm->SetBinContent(lumi+1,binNumber,
float(updatedLumiCount[
b])/entireBXWindowUpdatedLumiCount);
1955 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << endl;
1960 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first+
"_Pass_Any";
1965 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
1971 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
1973 TH1F * hist_1d = ME_1d->
getTH1F();
1979 float prevCount = ip->second;
1981 string binLabel =
"HLT_"+pathname+
"_L1_Any";
1983 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
1985 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1987 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
1990 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
1995 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
1998 float diffCount = currCount - prevCount;
2000 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2003 ip->second = currCount;
2014 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2015 float updatedLumiCount = currentLumiCount + diffCount;
2016 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2020 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2034 LogTrace(
"FourVectorHLTOffline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << endl;
2038 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" +
fGroupNamePathsPair[
i].first +
"_Pass_Any";
2043 LogTrace(
"FourVectorHLTOffline") <<
" could not find 1d matrix " << fullPathToME << endl;
2049 LogTrace(
"FourVectorHLTOffline") <<
" Looking in histogram " << fullPathToME << endl;
2051 TH1F * hist_1d = ME_1d->
getTH1F();
2057 float prevCount = ip->second;
2059 string binLabel =
"HLT_"+pathname+
"_Any";
2061 LogTrace(
"FourVectorHLTOffline") <<
" Looking for binLabel = " << binLabel << endl;
2063 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
2065 LogTrace(
"FourVectorHLTOffline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << endl;
2068 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2073 float currCount = hist_1d->GetBinContent(pathBin)/
LSsize_;
2076 float diffCount = currCount - prevCount;
2078 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2081 ip->second = currCount;
2092 float currentLumiCount = ME_1d->
getTH1()->GetBinContent(lumi+1);
2093 float updatedLumiCount = currentLumiCount + diffCount;
2094 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2099 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME " << fullPathToME_count << endl;
2113 LogTrace(
"FourVectorHLTOffline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << endl;
2115 string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
2120 LogTrace(
"FourVectorHLTOffline") <<
" could not fine 2d matrix " << fullPathToME << endl;
2126 TH2F * hist_2d = ME_2d->
getTH2F();
2132 float prevCount = ip->second;
2135 float pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
2137 if(pathBin > hist_2d->GetNbinsX()) {
2139 LogTrace(
"FourVectorHLTOffline") <<
" Cannot find the bin for path " << pathname << endl;
2144 float currCount = hist_2d->GetBinContent(pathBin, pathBin)/
LSsize_;
2147 float diffCount = currCount - prevCount;
2149 LogTrace(
"FourVectorHLTOffline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << endl;
2152 ip->second = currCount;
2162 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2165 float currentLumiCount = hist_All->GetBinContent(lumi+1,pathBinNumber);
2166 float updatedLumiCount = currentLumiCount + diffCount;
2167 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2172 LogDebug(
"FourVectorHLTOffline") <<
" cannot find ME_HLTAll_LS" << endl;
2230 if (pathname.find(
"MET") != std::string::npos)
2232 if (pathname.find(
"SumET") != std::string::npos || pathname.find(
"SumEt") != std::string::npos || pathname.find(
"ETT") != std::string::npos)
2234 if (pathname.find(
"HT") != std::string::npos)
2236 if (pathname.find(
"Jet") != std::string::npos)
2238 if (pathname.find(
"Mu") != std::string::npos)
2240 if (pathname.find(
"Ele") != std::string::npos)
2242 if (pathname.find(
"Photon") != std::string::npos)
2244 if (pathname.find(
"EG") != std::string::npos)
2246 if (pathname.find(
"Tau") != std::string::npos)
2248 if (pathname.find(
"IsoTrack") != std::string::npos)
2250 if (pathname.find(
"BTag") != std::string::npos)
2262 string l1pathname =
"dummy";
2266 for(vector<string>::iterator numpathmodule = numpathmodules.begin();
2267 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2271 l1pathname = *numpathmodule;
2287 int l1ModuleIndex = 999;
2291 if(
v->getPath() ==
pathname ) l1ModuleIndex =
v->getL1ModuleIndex();
2295 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2303 rc = (l1ModuleIndex < lastModule);
2314 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2330 for( reco::MuonCollection::const_iterator iter = muonHandle->begin(), iend = muonHandle->end(); iter != iend; ++iter )
2359 for( reco::GsfElectronCollection::const_iterator iter = eleHandle->begin(), iend = eleHandle->end(); iter != iend; ++iter )
2373 float eleMaxOver3x3 = ( lazyTool.
eMax(*bc) / lazyTool.
e3x3(*bc) );
2380 if(! iter->ecalDriven() )
continue;
2405 else if(iter->isEE()) {
2442 for( reco::PhotonCollection::const_iterator iter = phoHandle->begin(), iend = phoHandle->end(); iter != iend; ++iter )
2448 iter->sigmaIetaIeta() > 0.002 &&
2449 iter->maxEnergyXtal() / iter->e3x3() < 0.9
2474 for( reco::CaloJetCollection::const_iterator iter = jetHandle->begin(), iend = jetHandle->end(); iter != iend; ++iter )
2504 for( reco::CaloMETCollection::const_iterator iter = metHandle->begin(), iend = metHandle->end(); iter != iend; ++iter )
2527 iEvent.
getByLabel(
"hpsPFTauProducer",tauHandle);
2539 for(
unsigned int i=0;
i<tauHandle->size();++
i) {
2544 float outputDiscmnt1 = (*dscrmt1H)[pfTauRef];
2545 float outputDiscmnt2 = (*dscrmt2H)[pfTauRef];
2546 float outputDiscmnt3 = (*dscrmt3H)[pfTauRef];
2548 if(outputDiscmnt1>0.5 && outputDiscmnt2>0.5 && outputDiscmnt3 >0.5) {
2573 if(pathname.find(
"L1") != std::string::npos) pathname.replace(pathname.find(
"L1"),2,
"");
2575 if(pathname.find(
"L2") != std::string::npos) pathname.replace(pathname.find(
"L2"),2,
"");
2577 if(pathname.find(
"8E29") != std::string::npos) pathname.replace(pathname.find(
"8E29"),4,
"");
2579 int digitLocation=0;
2580 for (
unsigned int i=0;
i < pathname.length();
i++)
2582 if (isdigit(pathname.at(
i))) {
2591 string hltThresholdString = pathname.substr(digitLocation);
2593 int hltThreshold = 0;
2596 sscanf (hltThresholdString.c_str(),
"%d%*s",&hltThreshold);
2599 return hltThreshold;
2616 double normalizedChi2 = gm->normalizedChi2();
2617 int trackerHits = tk->hitPattern().numberOfValidTrackerHits();
2618 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
2619 int muonHits = gm->hitPattern().numberOfValidMuonHits();
2622 if (fabs(dxy)>
dxyCut_) {
return 0;}
2641 for (
int ii = 100;
ii >= 0;
ii--) {
2648 size_t pos = histVersion.find(version);
2649 if (pos != std::string::npos)
2650 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)
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)
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