11 using namespace trigger;
17 LogDebug(
"FourVectorHLTOnline") <<
"constructor...." ;
21 LogInfo(
"FourVectorHLTOnline") <<
"unabel to get DQMStore service?";
31 dbe_->setCurrentFolder(dirname_);
50 std::vector<edm::ParameterSet>
paths =
51 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"paths");
53 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
59 custompathnamepairs_.push_back(
62 pathconf->getParameter<
std::string>(
"denompathname")
68 if (hltPaths_.size() > 0)
71 scalersSelect =
dbe_->book1D(
"selectedScalers",
"Selected Scalers", hltPaths_.size(), 0.0, (double)hltPaths_.size());
117 specialPaths_ = iConfig.
getParameter<std::vector<std::string > >(
"SpecialPaths");
124 pathsIndividualHLTPathsPerLSFolder_ = iConfig.
getUntrackedParameter (
"individualPathsPerLSFolder",
std::string(
"HLT/FourVector/PathsSummary/HLT LS/Paths/"));
128 ME_HLTAll_LS_ =
NULL;
130 ME_HLT_CUSTOM_BX_ =
NULL;
136 gsfElectronsToken_ = consumes<TriggerResults>(
std::string(
"gsfElectrons"));
137 caloRecoTauProducerToken_ = consumes<TriggerResults>(
std::string(
"caloRecoTauProducer"));
138 iterativeCone5CaloJetsToken_ = consumes<TriggerResults>(
std::string(
"iterativeCone5CaloJets"));
139 jetProbabilityBJetTagsToken_ = consumes<TriggerResults>(
std::string(
"jetProbabilityBJetTags"));
140 softMuonBJetTagsToken_ = consumes<TriggerResults>(
std::string(
"softMuonBJetTags"));
141 metToken_ = consumes<TriggerResults>(
std::string(
"met"));
142 photonsToken_ = consumes<TriggerResults>(
std::string(
"photons"));
143 pixelTracksToken_ = consumes<TriggerResults>(
std::string(
"pixelTracks"));
145 triggerResultsTokenFU_ = consumes<TriggerResults>(triggerResultsLabelFU);
146 edm::InputTag triggerSummaryLabelFU(triggerSummaryLabel_.label(),triggerSummaryLabel_.instance(),
"FU");
147 triggerSummaryLabelFUToken_ = consumes<trigger::TriggerEvent>(triggerSummaryLabelFU);
173 using namespace trigger;
175 LogDebug(
"FourVectorHLTOnline")<<
" analyze...." ;
184 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerResults not found, "
193 iEvent.
getByToken(triggerSummaryToken_, fTriggerObj);
194 if(!fTriggerObj.isValid()) {
196 iEvent.
getByToken(triggerSummaryLabelFUToken_, fTriggerObj);
198 if(!fTriggerObj.isValid()) {
200 edm::LogInfo(
"FourVectorHLTOnline") <<
"TriggerEvent not found, " "skipping event";
208 iEvent.
getByToken(muonRecoCollectionNameToken_, muonHandle);
209 if(!muonHandle.isValid()) {
211 edm::LogInfo(
"FourVectorHLTOnline") <<
"muonHandle not found, ";
221 edm::LogInfo(
"FourVectorHLTOnline") <<
"gsfElectrons not found, ";
224 iEvent.
getByToken(caloRecoTauProducerToken_, tauHandle);
225 if(!tauHandle.isValid())
226 edm::LogInfo(
"FourVectorHLTOnline") <<
"tauHandle not found, ";
229 iEvent.
getByToken(iterativeCone5CaloJetsToken_, jetHandle);
230 if(!jetHandle.isValid())
231 edm::LogInfo(
"FourVectorHLTOnline") <<
"jetHandle not found, ";
235 iEvent.
getByToken(jetProbabilityBJetTagsToken_, bTagIPHandle);
236 if (!bTagIPHandle.isValid())
237 edm::LogInfo(
"FourVectorHLTOnline") <<
"mTagIPHandle trackCountingHighEffJetTags not found, ";
241 iEvent.
getByToken(softMuonBJetTagsToken_, bTagMuHandle);
242 if (!bTagMuHandle.isValid())
243 edm::LogInfo(
"FourVectorHLTOnline") <<
"bTagMuHandle not found, ";
247 if(!metHandle.isValid())
248 edm::LogInfo(
"FourVectorHLTOnline") <<
"metHandle not found, ";
251 iEvent.
getByToken(photonsToken_, photonHandle);
252 if(!photonHandle.isValid())
253 edm::LogInfo(
"FourVectorHLTOnline") <<
"photonHandle not found, ";
256 iEvent.
getByToken(pixelTracksToken_, trackHandle);
257 if(!trackHandle.isValid())
258 edm::LogInfo(
"FourVectorHLTOnline") <<
"trackHandle not found, ";
267 eleMon.setLimits(electronEtaMax_, electronEtMin_, electronDRMatch_);
279 muoMon.setLimits(muonEtaMax_, muonEtMin_, muonDRMatch_);
289 tauMon.setLimits(tauEtaMax_, tauEtMin_, tauDRMatch_);
300 phoMon.setLimits(photonEtaMax_, photonEtMin_, photonDRMatch_);
310 jetMon.setLimits(jetEtaMax_, jetEtMin_, jetDRMatch_);
324 btagIPMon.setLimits(bjetEtaMax_, bjetEtMin_, bjetDRMatch_);
336 btagMuMon.setLimits(bjetEtaMax_, bjetEtMin_, bjetDRMatch_);
351 metMon.setLimits(metEtaMax_, metMin_, metDRMatch_);
361 tetMon.setLimits(999., 10., 999.);
374 std::vector<BaseMonitor*> monitors;
378 monitors.push_back(&muoMon);
379 monitors.push_back(&eleMon);
380 monitors.push_back(&tauMon);
381 monitors.push_back(&phoMon);
382 monitors.push_back(&jetMon);
383 monitors.push_back(&btagMon);
384 monitors.push_back(&metMon);
385 monitors.push_back(&tetMon);
405 for(PathInfoCollection::iterator
v = hltPathsDiagonal_.begin();
v!= hltPathsDiagonal_.end(); ++
v ) {
407 LogTrace(
"FourVectorHLTOnline") <<
" unique path " <<
v->getPath() << std::endl;
409 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
412 if(pathByIndex >= triggerResults_->size() )
continue;
420 int pathBinNumber = ME_HLT_BX_->getTH2F()->GetYaxis()->FindBin(
v->getPath().c_str());
421 ME_HLT_BX_->Fill(bx,pathBinNumber-1);
423 if(hasHLTPassed(fCustomBXPath,triggerNames)) {
425 ME_HLT_CUSTOM_BX_->Fill(bx,pathBinNumber-1);
439 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
441 int binNumber =
v->getFiltersHisto()->getTH1()->GetXaxis()->FindBin(
v->filtersAndIndices[filt].first.c_str());
448 v->getFiltersHisto()->Fill(binNumber-1);
450 else if(
v->filtersAndIndices[filt].second < lastModule){
451 v->getFiltersHisto()->Fill(binNumber-1);
461 for(PathInfoCollection::iterator
v = hltPaths_.begin();
v!= hltPaths_.end(); ++
v ) {
463 LogTrace(
"FourVectorHLTOnline") <<
" path " <<
v->getPath() << std::endl;
465 if (
v->getPath().find(
"BTagIP") != std::string::npos ) btagMon = btagIPMon;
466 else btagMon = btagMuMon;
470 unsigned int pathByIndex = triggerNames.triggerIndex(
v->getPath());
472 if(pathByIndex >= triggerResults_->size() )
continue;
475 bool denompassed =
false;
477 for(
int i = 0;
i < npath; ++
i) {
479 if (triggerNames.triggerName(
i).find(
v->getDenomPath()) != std::string::npos &&
triggerResults->accept(
i))
496 for(std::vector<BaseMonitor*>::iterator mit = monitors.begin(); mit!= monitors.end(); ++mit ) {
498 if((*mit)->isTriggerType(
v->getObjectType())) {
511 if(!mon) mon = &defMon;
524 bool l1accept =
false;
526 const int l1Index = fTriggerObj->filterIndex(l1testTag);
528 if ( l1Index >= fTriggerObj->sizeFilters() ) {
530 LogTrace(
"FourVectorHLTOnline") <<
"Cannot find L1GTSeed of the path " <<
v->getPath() << std::endl;
531 LogTrace(
"FourVectorHLTOnline") <<
"\t L1GTSeed name = " <<
v->getl1Path() << std::endl;
532 LogTrace(
"FourVectorHLTOnline") <<
"\t tried with tag " << l1testTag << std::endl;
533 LogTrace(
"FourVectorHLTOnline") <<
"\t module index = "<< l1Index << std::endl;
542 bool numpassed =
false;
545 for(
int i = 0;
i < npath; ++
i) {
547 if (triggerNames.triggerName(
i) ==
v->getPath() &&
triggerResults->accept(
i)) numpassed =
true;
551 if (!numpassed)
continue;
556 <<
"This should not happen. HLT passed, but L1 Seed not passed for hlt path "<< std::endl
557 <<
"HLT path: " <<
v->getPath() <<
"\t HLTLevel1GTSeed: " <<
v->getl1Path();
567 if (
v->getLabel() ==
"dummy"){
568 const std::vector<std::string> filterLabels = hltConfig_.moduleLabels(
v->getPath());
571 for (std::vector<std::string>::const_iterator labelIter= filterLabels.begin(); labelIter!=filterLabels.end(); labelIter++) {
575 int testindex = fTriggerObj->filterIndex(testTag);
578 if ( !(testindex >= fTriggerObj->sizeFilters()) ) {
581 v->setLabel(*labelIter);}
587 const int hltIndex = fTriggerObj->filterIndex(filterTag);
588 if ( hltIndex >= fTriggerObj->sizeFilters() ) {
590 LogTrace(
"FourVectorHLTOnline") <<
"WTF no index of that name " << filterTag << std::endl;
617 dbe->setCurrentFolder(dirname_);
618 dbe->rmdir(dirname_);
623 dbe->setCurrentFolder(dirname_);
631 LogInfo(
"FourVectorHLTOnline") <<
"analyzed " << nev_ <<
" events";
639 LogDebug(
"FourVectorHLTOnline") <<
"beginRun, run " << run.
id();
644 if (!hltConfig_.init(run, c, processname_, changed)) {
647 if (!hltConfig_.init(run, c, processname_, changed)){
649 LogDebug(
"FourVectorHLTOnline") <<
"HLTConfigProvider failed to initialize.";
664 dbe->setCurrentFolder(dirname_);
667 const unsigned int n(hltConfig_.size());
670 for (
unsigned int j=0;
j!=
n; ++
j) {
674 std::string l1pathname = getL1ConditionModuleName(pathname);
676 int objectType = getTriggerTypeParsePathName(pathname);
678 for (
unsigned int i=0;
i!=
n; ++
i) {
681 int denomobjectType = getTriggerTypeParsePathName(denompathname);
688 if (plotAll_ && denomobjectType == objectType && objectType != 0)
690 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, filtername, processname_, objectType, ptMin, ptMax));
699 for (
unsigned int i=0;
i!=
n; ++
i) {
704 int objectType = getTriggerTypeParsePathName(pathname);
706 std::string l1pathname = getL1ConditionModuleName(pathname);
723 if (objectType != -1 && pathname.find(
"FinalPath") == std::string::npos){
725 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, filtername, processname_, objectType, ptMin, ptMax));
727 hltPathsDiagonal_.push_back(
PathInfo(denompathname, pathname, l1pathname, filtername, processname_, objectType, ptMin, ptMax));
736 for (std::vector<std::pair<std::string, std::string> >::iterator custompathnamepair = custompathnamepairs_.begin(); custompathnamepair != custompathnamepairs_.end(); ++custompathnamepair) {
738 std::string numpathname = custompathnamepair->first;
739 std::string denompathname = custompathnamepair->second;
741 if (numpathname != denompathname) {
744 bool founddenominator =
false;
745 for (
unsigned int k=0;
k!=
n; ++
k) {
749 if (n_pathname.find(denompathname) != std::string::npos) {
751 LogDebug(
"FourVectorHLTOnline") <<
"denompathname is selected to be = " << n_pathname << std::endl;;
752 founddenominator =
true;
759 if (!founddenominator) {
761 edm::LogInfo(
"FourVectorHLTOnline") <<
"denompathname not found, go to the next pair numearator-denominator" << std::endl;
769 bool foundnumerator =
false;
770 for (
unsigned int j=0;
j!=
n; ++
j) {
774 LogDebug(
"FourVectorHLTOnline") <<
"check if path " << pathname <<
" is numpathname = " << numpathname << std::endl;
775 if (hltConfig_.triggerName(
j).find(numpathname)!= std::string::npos) {
777 LogDebug(
"FourVectorHLTOnline") <<
"pathname is selected to be = " << denompathname << std::endl;;
778 foundnumerator =
true;
783 if (!foundnumerator) {
791 std::string l1pathname = getL1ConditionModuleName(pathname);
792 int objectType = getTriggerTypeParsePathName(pathname);
809 hltPaths_.push_back(
PathInfo(denompathname, pathname, l1pathname, filtername, processname_, objectType, ptMin, ptMax));
820 std::vector<std::string> muonPaths;
821 std::vector<std::string> egammaPaths;
822 std::vector<std::string> tauPaths;
823 std::vector<std::string> jetmetPaths;
824 std::vector<std::string> restPaths;
825 std::vector<std::string> allPaths;
827 for(PathInfoCollection::iterator
v = hltPathsDiagonal_.begin();
v!= hltPathsDiagonal_.end(); ++
v ) {
830 int objectType =
v->getObjectType();
832 std::vector<int> tempCount(5,0);
834 fPathTempCountPair.push_back(make_pair(pathName,0));
835 fPathBxTempCountPair.push_back(make_pair(pathName,tempCount));
837 allPaths.push_back(pathName);
839 switch (objectType) {
841 muonPaths.push_back(pathName);
846 egammaPaths.push_back(pathName);
850 tauPaths.push_back(pathName);
855 jetmetPaths.push_back(pathName);
859 restPaths.push_back(pathName);
864 fPathTempCountPair.push_back(make_pair(
"HLT_Any",0));
866 fGroupName.push_back(
"All");
867 fGroupName.push_back(
"Muon");
868 fGroupName.push_back(
"Egamma");
869 fGroupName.push_back(
"Tau");
870 fGroupName.push_back(
"JetMet");
871 fGroupName.push_back(
"Rest");
872 fGroupName.push_back(
"Special");
874 for(
unsigned int g=0;
g<fGroupName.size();
g++) {
881 dbe_->setCurrentFolder(pathsSummaryFolder_.c_str());
885 fGroupNamePathsPair.push_back(make_pair(
"All",allPaths));
887 fGroupNamePathsPair.push_back(make_pair(
"Muon",muonPaths));
889 fGroupNamePathsPair.push_back(make_pair(
"Egamma",egammaPaths));
891 fGroupNamePathsPair.push_back(make_pair(
"Tau",tauPaths));
893 fGroupNamePathsPair.push_back(make_pair(
"JetMet",jetmetPaths));
895 fGroupNamePathsPair.push_back(make_pair(
"Rest",restPaths));
897 fGroupNamePathsPair.push_back(make_pair(
"Special",specialPaths_));
900 std::vector<std::string>
datasetNames = hltConfig_.datasetNames() ;
901 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
903 std::vector<std::string> datasetPaths = hltConfig_.datasetContent(datasetNames[
i]);
905 fGroupNamePathsPair.push_back(make_pair(datasetNames[i],datasetPaths));
920 for (
unsigned int g=0;
g<fGroupNamePathsPair.size();
g++) {
922 fGroupTempCountPair.push_back(make_pair(fGroupNamePathsPair[
g].
first,0));
923 fGroupL1TempCountPair.push_back(make_pair(fGroupNamePathsPair[
g].first,0));
935 for(PathInfoCollection::iterator
v = hltPathsDiagonal_.begin();
v!= hltPathsDiagonal_.end(); ++
v ) {
944 std::vector<std::string> moduleNames = hltConfig_.moduleLabels(
v->getPath() );
948 unsigned int moduleIndex;
951 std::vector<std::string>::const_iterator iDumpModName;
952 for (iDumpModName = moduleNames.begin();iDumpModName != moduleNames.end();iDumpModName++) {
954 moduleName = *iDumpModName;
955 moduleType = hltConfig_.moduleType(moduleName);
956 moduleIndex = hltConfig_.moduleIndex(
v->getPath(),
moduleName);
958 LogTrace (
"FourVectorHLTOnline") <<
"Module " << numModule
959 <<
" is called " << moduleName
960 <<
" , type = " << moduleType
961 <<
" , index = " << moduleIndex
966 if((moduleType.find(
"Filter") != std::string::npos && moduleType.find(
"HLTTriggerTypeFilter") == std::string::npos ) ||
967 (moduleType.find(
"Associator") != std::string::npos) ||
968 (moduleType.find(
"HLTLevel1GTSeed") != std::string::npos) ||
969 (moduleType.find(
"HLTGlobalSumsCaloMET") != std::string::npos) ||
970 (moduleType.find(
"HLTPrescaler") != string::npos) ||
971 (hltConfig_.moduleEDMType(moduleName).find(
"EDFilter") != string::npos))
978 v->filtersAndIndices.push_back(make_pair(moduleName,moduleIndex));
986 dbe_->setCurrentFolder(pathsSummaryFilterCountsFolder_.c_str());
989 int nbin_sub =
v->filtersAndIndices.size()+2;
993 vector<string> datasetNames = hltConfig_.datasetNames();
997 for (
unsigned int k=0;
k<datasetNames.size();
k++) {
1000 std::string datasetFolder = pathsSummaryFilterCountsFolder_ + datasetNames[
k];
1001 vector<string> datasetPaths = hltConfig_.datasetContent(datasetNames[
k]);
1003 for (
unsigned int m=0;
m<datasetPaths.size();
m++){
1006 if(datasetPaths[
m]==pathName){
1007 dbe_->setCurrentFolder(datasetFolder.c_str());
1015 "Filters_" +
v->getPath(),
1016 nbin_sub+1, -0.5, 0.5+(double)nbin_sub);
1018 for(
unsigned int filt = 0; filt <
v->filtersAndIndices.size(); filt++){
1020 filters->
setBinLabel(filt+1, (
v->filtersAndIndices[filt]).first);
1025 dbe_->setCurrentFolder(pathsIndividualHLTPathsPerLSFolder_.c_str());
1027 v->getPath() +
" count per LS",
1031 v->setFilterHistos(filters);
1036 for(PathInfoCollection::iterator
v = hltPaths_.begin();
v!= hltPaths_.end(); ++
v ) {
1045 MonitorElement *NL1OffUM, *offEtL1OffUM, *offEtavsoffPhiL1OffUM=0;
1046 MonitorElement *NOnOffUM, *offEtOnOffUM, *offEtavsoffPhiOnOffUM=0;
1051 labelname =
v->getPath() +
"_wrt_" +
v->getDenomPath();
1054 double histEtaMax = 2.5;
1058 histEtaMax = muonEtaMax_;
1063 histEtaMax = electronEtaMax_;
1067 histEtaMax = tauEtaMax_;
1071 histEtaMax = jetEtaMax_;
1075 histEtaMax = bjetEtaMax_;
1079 histEtaMax = metEtaMax_;
1083 histEtaMax = photonEtaMax_;
1087 histEtaMax = trackEtaMax_;
1090 TString pathfolder = dirname_ + TString(
"/") +
v->getPath();
1091 dbe_->setCurrentFolder(pathfolder.Data());
1093 NOn = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1096 histoname = labelname+
"_NOff";
1097 title = labelname+
" N Off";
1098 NOff = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1100 histoname = labelname+
"_NL1";
1101 title = labelname+
" N L1";
1102 NL1 = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1104 histoname = labelname+
"_NL1On";
1105 title = labelname+
" N L1On";
1106 NL1On = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1108 histoname = labelname+
"_NL1Off";
1109 title = labelname+
" N L1Off";
1110 NL1Off = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1112 histoname = labelname+
"_NOnOff";
1113 title = labelname+
" N OnOff";
1114 NOnOff = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1117 histoname = labelname+
"_NL1OnUM";
1118 title = labelname+
" N L1OnUM";
1119 NL1OnUM = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1121 histoname = labelname+
"_NL1OffUM";
1122 title = labelname+
" N L1OffUM";
1123 NL1OffUM = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1125 histoname = labelname+
"_NOnOffUM";
1126 title = labelname+
" N OnOffUM";
1127 NOnOffUM = dbe->book1D(histoname.c_str(), title.c_str(),10, 0.5, 10.5);
1130 histoname = labelname+
"_onEtOn";
1131 title = labelname+
" onE_t online";
1132 onEtOn = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1134 histoname = labelname+
"_onOneOverEtOn";
1135 title = labelname+
" 1 / onE_t online";
1136 onOneOverEtOn = dbe->book1D(histoname.c_str(), title.c_str(),nBinsOneOverEt_, 0, 1);
1139 histoname = labelname+
"_offEtOff";
1140 title = labelname+
" offE_t offline";
1141 offEtOff = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1143 histoname = labelname+
"_l1EtL1";
1144 title = labelname+
" l1E_t L1";
1145 l1EtL1 = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1150 histoname = labelname+
"_onEtaonPhiOn";
1151 title = labelname+
" on#eta vs on#phi online";
1152 onEtavsonPhiOn = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1154 histoname = labelname+
"_offEtaoffPhiOff";
1155 title = labelname+
" off#eta vs off#phi offline";
1156 offEtavsoffPhiOff = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1158 histoname = labelname+
"_l1Etal1PhiL1";
1159 title = labelname+
" l1#eta vs l1#phi L1";
1160 l1Etavsl1PhiL1 = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1162 histoname = labelname+
"_l1EtL1On";
1163 title = labelname+
" l1E_t L1+online";
1164 l1EtL1On = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1166 histoname = labelname+
"_offEtL1Off";
1167 title = labelname+
" offE_t L1+offline";
1168 offEtL1Off = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1170 histoname = labelname+
"_offEtOnOff";
1171 title = labelname+
" offE_t online+offline";
1172 offEtOnOff = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1174 histoname = labelname+
"_l1Etal1PhiL1On";
1175 title = labelname+
" l1#eta vs l1#phi L1+online";
1176 l1Etavsl1PhiL1On = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1178 histoname = labelname+
"_offEtaoffPhiL1Off";
1179 title = labelname+
" off#eta vs off#phi L1+offline";
1180 offEtavsoffPhiL1Off = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1182 histoname = labelname+
"_offEtaoffPhiOnOff";
1183 title = labelname+
" off#eta vs off#phi online+offline";
1184 offEtavsoffPhiOnOff = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1186 histoname = labelname+
"_l1EtL1OnUM";
1187 title = labelname+
" l1E_t L1+onlineUM";
1188 l1EtL1OnUM = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1190 histoname = labelname+
"_offEtL1OffUM";
1191 title = labelname+
" offE_t L1+offlineUM";
1192 offEtL1OffUM = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1194 histoname = labelname+
"_offEtOnOffUM";
1195 title = labelname+
" offE_t online+offlineUM";
1196 offEtOnOffUM = dbe->book1D(histoname.c_str(), title.c_str(),nBins_,
v->getPtMin(),
v->getPtMax());
1198 histoname = labelname+
"_l1Etal1PhiL1OnUM";
1199 title = labelname+
" l1#eta vs l1#phi L1+onlineUM";
1200 l1Etavsl1PhiL1OnUM = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1202 histoname = labelname+
"_offEtaoffPhiL1OffUM";
1203 title = labelname+
" off#eta vs off#phi L1+offlineUM";
1204 offEtavsoffPhiL1OffUM = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1206 histoname = labelname+
"_offEtaoffPhiOnOffUM";
1207 title = labelname+
" off#eta vs off#phi online+offlineUM";
1208 offEtavsoffPhiOnOffUM = dbe->book2D(histoname.c_str(), title.c_str(), nBins2D,-histEtaMax,histEtaMax, nBins2D,-
TMath::Pi(),
TMath::Pi());
1213 histoname = labelname+
"_l1DRL1On";
1214 title = labelname+
" l1DR L1+online";
1215 l1DRL1On = dbe->book1D(histoname.c_str(), title.c_str(),nBins_, 0, 1.);
1217 histoname = labelname+
"_offDRL1Off";
1218 title = labelname+
" offDR L1+offline";
1219 offDRL1Off = dbe->book1D(histoname.c_str(), title.c_str(),nBins_, 0, 1.);
1221 histoname = labelname+
"_offDROnOff";
1222 title = labelname+
" offDR online+offline";
1223 offDROnOff = dbe->book1D(histoname.c_str(), title.c_str(),nBins_, 0, 1.);
1226 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
1234 dbe_->setCurrentFolder(pathsIndividualHLTPathsPerLSFolder_.c_str());
1236 "HLT_Any count per LS",
1250 LogDebug(
"FourVectorHLTOnline") <<
"endRun, run " << run.
id();
1258 LogDebug(
"FourVectorHLTOnline") <<
"cleanDRMatchSet(mmset& tempSet) " <<
"size of the set (before CLEANING) = " << tempSet.size() <<
" maps." << std::endl;
1260 if(tempSet.size() < 2)
return;
1262 if(tempSet.size() > 10) {
1264 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is too large. It will be truncated to 10." << std::endl;
1265 mmset::iterator it = tempSet.begin();
1266 for (
int i=0;
i<10;
i++) { it++; }
1267 tempSet.erase( it, tempSet.end());
1268 LogDebug(
"FourVectorHLTOnline") <<
"size of the set is now = " << tempSet.size() <<
" maps." << std::endl;
1272 bool cleanedOneMap =
false;
1276 while(! cleanedOneMap && tempSet.size() > 1) {
1278 cleanedOneMap=
false;
1283 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1285 fimmap tempMap_j = *setIter_i;
1290 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1301 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ ) {
1303 fimmap tempMap_i = *setIter_i;
1304 fimmap::iterator it = tempMap_i.begin();
1305 int topValue = (*it).second;
1309 mmset::iterator tempIter_i = setIter_i;
1313 for ( mmset::iterator setIter_j = ++tempIter_i; setIter_j != tempSet.end( ); setIter_j++ ) {
1315 fimmap tempMap_j = *setIter_j;
1318 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it)
1321 if(topValue == (*it).second) {
1324 tempMap_j.erase(it);
1325 cleanedOneMap =
true;
1334 tempSet.erase(setIter_j);
1337 if(! tempMap_j.empty()) tempSet.insert(tempMap_j);
1345 if(cleanedOneMap)
break;
1353 cleanedOneMap=
false;
1369 for ( mmset::iterator setIter_i = tempSet.begin( ); setIter_i != tempSet.end( ); setIter_i++ )
1372 fimmap tempMap_j = *setIter_i;
1377 for (fimmap::iterator it = tempMap_j.begin(); it != tempMap_j.end(); ++it) {
1394 paths.push_back(
"HLT_"+label+
"_L1_Any");
1395 paths.push_back(
"HLT_"+label+
"_Any");
1396 paths.push_back(
"HLT_Any");
1401 dbe_->setCurrentFolder(pathsSummaryFolder_.c_str());
1403 h_name=
"HLT_"+label+
"_PassPass";
1404 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass)";
1406 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1408 h_name=
"HLT_"+label+
"_Pass_Any";
1409 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1411 paths.size(), -0.5, paths.size()-0.5);
1413 dbe_->setCurrentFolder(pathsSummaryHLTCorrelationsFolder_.c_str());
1414 h_name=
"HLT_"+label+
"_PassPass_Normalized";
1415 h_title =
"HLT_"+label+
"_PassPass (x=Pass, y=Pass) normalized to xBin=Pass";
1417 paths.size(), -0.5, paths.size()-0.5, paths.size(), -0.5, paths.size()-0.5);
1418 h_name=
"HLT_"+label+
"_Pass_Normalized_Any";
1419 h_title =
"HLT_"+label+
"_Pass (x=Pass, Any=Pass) normalized to HLT_Any Pass";
1421 paths.size(), -0.5, paths.size()-0.5);
1423 dbe_->setCurrentFolder(pathsSummaryHLTPathsPerLSFolder_.c_str());
1424 h_name=
"HLT_"+label+
"_Total_LS";
1425 h_title = label+
" HLT paths total count combined per LS ";
1426 MonitorElement* ME_Total_LS =
dbe_->book1D(h_name.c_str(), h_title.c_str(), nLS_, 0, nLS_);
1429 h_name=
"HLT_"+label+
"_LS";
1430 h_title = label+
" HLT paths count per LS ";
1431 MonitorElement* ME_Group_LS =
dbe_->book2D(h_name.c_str(), h_title.c_str(), nLS_, 0, nLS_, paths.size(), -0.5, paths.size()-0.5);
1434 v_ME_HLTAll_LS_.push_back(ME_Group_LS);
1436 h_name=
"HLT_"+label+
"_L1_Total_LS";
1437 h_title = label+
" HLT paths total count combined per LS ";
1438 MonitorElement* ME_Total_L1_LS =
dbe_->book1D(h_name.c_str(), h_title.c_str(), nLS_, 0, nLS_);
1441 h_name=
"HLT_"+label+
"_L1_LS";
1442 h_title = label+
" HLT L1s count per LS ";
1443 MonitorElement* ME_Group_L1_LS =
dbe_->book2D(h_name.c_str(), h_title.c_str(), nLS_, 0, nLS_, paths.size(), -0.5, paths.size()-0.5);
1446 dbe_->setCurrentFolder(pathsSummaryHLTPathsPerBXFolder_.c_str());
1447 h_name=
"HLT_"+label+
"_BX_LS";
1448 h_title = label+
" HLT paths total count combined per BX ";
1449 MonitorElement* ME_Total_BX =
dbe_->book2D(h_name.c_str(), h_title.c_str(), nLS_, 0, nLS_, 5, -2.5, 2.5);
1452 for(
unsigned int i = 0;
i < paths.size();
i++){
1454 ME->
getTH2F()->GetXaxis()->SetBinLabel(
i+1, (paths[
i]).c_str());
1455 ME->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1456 ME_Group_LS->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1458 ME_Normalized->
getTH2F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1459 ME_Normalized->
getTH2F()->GetYaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1460 ME_Normalized_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1461 ME_Any->
getTH1F()->GetXaxis()->SetBinLabel(i+1, (paths[i]).c_str());
1472 for (
unsigned int mi=0;mi<fGroupNamePathsPair.size();mi++) {
1475 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+fGroupNamePathsPair[mi].first+
"_PassPass";
1477 fullPathToME =
"HLT/FourVector/PathsSummary/HLT_"+fGroupNamePathsPair[mi].first+
"_Pass_Any";
1479 if(!ME_2d || !ME_1d) {
1481 LogTrace(
"FourVectorHLTOnline") <<
" ME not valid although I gave full path" << std::endl;
1486 TH2F * hist_2d = ME_2d->
getTH2F();
1487 TH1F * hist_1d = ME_1d->
getTH1F();
1491 int anyBinNumber = hist_2d->GetXaxis()->FindBin(
"HLT_Any");
1493 if(triggerResults_->accept()){
1495 hist_2d->Fill(anyBinNumber-1,anyBinNumber-1);
1496 hist_1d->Fill(anyBinNumber-1);
1500 bool groupPassed =
false;
1501 bool groupL1Passed =
false;
1506 for (
int i=1;
i< hist_2d->GetNbinsX();
i++) {
1508 std::string hltpathname = hist_2d->GetXaxis()->GetBinLabel(
i);
1512 unsigned int pathByIndex = triggerNames.
triggerIndex(hltpathname);
1513 if(pathByIndex >= triggerResults_->size() )
continue;
1516 if(hasL1Passed(hltpathname,triggerNames)) groupL1Passed =
true;
1521 if(triggerResults_->accept(pathByIndex)){
1526 if(groupPassed && !groupL1Passed)
1528 hist_2d->Fill(
i-1,anyBinNumber-1);
1529 hist_2d->Fill(anyBinNumber-1,
i-1);
1533 for (
int j=1;
j< hist_2d->GetNbinsY();
j++) {
1535 unsigned int crosspathByIndex = triggerNames.
triggerIndex(hist_2d->GetXaxis()->GetBinLabel(
j));
1536 if(crosspathByIndex >= triggerResults_->size() )
continue;
1538 if(triggerResults_->accept(crosspathByIndex)){
1540 hist_2d->Fill(
i-1,
j-1);
1551 std::string groupBinLabel =
"HLT_"+fGroupNamePathsPair[mi].first+
"_Any";
1552 int groupBinNumber = hist_2d->GetXaxis()->FindBin(groupBinLabel.c_str());
1553 if(groupPassed) hist_1d->Fill(groupBinNumber-1);
1555 std::string groupL1BinLabel =
"HLT_"+fGroupNamePathsPair[mi].first+
"_L1_Any";
1556 int groupL1BinNumber = hist_2d->GetXaxis()->FindBin(groupL1BinLabel.c_str());
1558 if(groupL1Passed) hist_1d->Fill(groupL1BinNumber-1);
1568 dbe_->setCurrentFolder(pathsSummaryFolder_);
1571 unsigned int npaths = hltPathsDiagonal_.size();
1573 ME_HLT_BX_ =
dbe_->book2D(
"HLT_bx",
1574 "HLT counts vs Event bx",
1575 Nbx_+1, -0.5, Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1576 ME_HLT_CUSTOM_BX_ =
dbe_->book2D(
"HLT_Custom_bx",
1577 "HLT counts vs Event bx",
1578 Nbx_+1, -0.5, Nbx_+1-0.5, npaths, -0.5, npaths-0.5);
1579 ME_HLT_BX_->setAxisTitle(
"Bunch Crossing");
1580 ME_HLT_CUSTOM_BX_->setAxisTitle(
"Bunch Crossing");
1584 for(
unsigned int i = 0;
i < npaths;
i++){
1586 ME_HLT_BX_->getTH2F()->GetYaxis()->SetBinLabel(
i+1, (hltPathsDiagonal_[
i]).getPath().c_str());
1587 ME_HLT_CUSTOM_BX_->getTH2F()->GetYaxis()->SetBinLabel(i+1, (hltPathsDiagonal_[i]).getPath().c_str());
1597 unsigned int npaths = hltPathsDiagonal_.size();
1601 dbe_->setCurrentFolder(pathsSummaryHLTPathsPerLSFolder_);
1603 ME_HLTAll_LS_ =
dbe_->book2D(
"All_count_LS",
1604 "All paths per LS ",
1605 nLS_, 0, nLS_, npaths+1, -0.5, npaths+1-0.5);
1606 ME_HLTAll_LS_->setAxisTitle(
"Luminosity Section");
1609 for(
unsigned int i = 0;
i < npaths;
i++){
1611 ME_HLTAll_LS_->getTH2F()->GetYaxis()->SetBinLabel(
i+1, (hltPathsDiagonal_[
i]).getPath().c_str());
1615 unsigned int i = npaths;
1616 ME_HLTAll_LS_->getTH2F()->GetYaxis()->SetBinLabel(i+1,
"HLT_Any");
1618 int nBinsPerLSHisto = 20;
1619 int nLSHistos = npaths/nBinsPerLSHisto;
1620 for (
int nh=0;nh<nLSHistos+1;nh++) {
1625 sprintf(name,
"Group_%d_paths_count_LS",nLSHistos-nh);
1626 sprintf(title,
"Group %d, paths count per LS",nLSHistos-nh);
1629 nLS_, 0, nLS_, nBinsPerLSHisto+3, -0.5, nBinsPerLSHisto+3-0.5);
1634 for(
int i = nh*nBinsPerLSHisto; i < (nh+1)*nBinsPerLSHisto; i++){
1636 if (i ==
int(npaths))
break;
1646 bin = i % nBinsPerLSHisto;
1650 tempME->
setBinLabel(bin+1, hltPathsDiagonal_[i].getPath().c_str(), 2);
1654 tempME->
setBinLabel(nBinsPerLSHisto+3,
"HLT_Any", 2);
1655 tempME->
setBinLabel(nBinsPerLSHisto+2,
"HLT_PhysicsDeclared", 2);
1657 v_ME_HLTAll_LS_.push_back(tempME);
1677 LogTrace(
"FourVectorHLTOnline") <<
" end lumiSection number " << lumi << std::endl;
1690 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupBXHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1692 TH2F * hist_2d_bx = ME_HLT_BX_->getTH2F();
1694 for (std::vector<std::pair<
std::string, std::vector<int> > >::iterator ip = fPathBxTempCountPair.begin(); ip != fPathBxTempCountPair.end(); ++ip) {
1698 std::vector<int> prevCount = ip->second;
1701 std::vector<int> currCount (5,0);
1702 std::vector<int> diffCount (5,0);
1705 int pathBin = hist_2d_bx->GetYaxis()->FindBin(pathname.c_str());
1707 if(pathBin > hist_2d_bx->GetNbinsY()) {
1709 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1714 for (
unsigned int j =0;
j<currCount.size();
j++) {
1718 if(bunch < 1) bunch += Nbx_ ;
1719 int bxBin = bunch +1;
1722 currCount[
j] = int(hist_2d_bx->GetBinContent(bxBin, pathBin));
1724 LogTrace(
"FourVectorHLTOnline") <<
"currCount = " << currCount[
j] << std::endl;
1727 diffCount[
j] = currCount[
j] - prevCount[
j];
1729 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
"bxOffset = " << bxOffset <<
" count = " << diffCount[
j] << std::endl;
1732 ip->second = currCount;
1739 LogTrace(
"FourVectorHLTOnline") <<
"Find " << pathname << std::endl;
1740 for(
unsigned int i=0;
i<fGroupName.size();
i++){
1742 bool isMember =
false;
1744 for (
unsigned int j=0;
j<fGroupNamePathsPair.size();
j++) {
1746 LogTrace(
"FourVectorHLTOnline") <<
" ---- Group " << fGroupNamePathsPair[
j].first << std::endl;
1747 if(fGroupNamePathsPair[
j].
first != fGroupName[
i])
continue;
1749 for (
unsigned int k = 0;
k<(fGroupNamePathsPair[
j].second).
size();
k++) {
1751 LogTrace(
"FourVectorHLTOnline") <<
" comparing to " << fGroupNamePathsPair[
j].second[
k] << std::endl;
1753 if(fGroupNamePathsPair[
j].
second[
k] == pathname) {
1766 LogTrace(
"FourVectorHLTOnline") <<
"Could not find a group to which the path belongs, path = " << pathname <<
" group = " << fGroupName[
i] << std::endl;
1771 std::string fullPathToME = pathsSummaryHLTPathsPerBXFolder_ +
"HLT_"+fGroupName[
i] +
"_BX_LS";
1776 TH2F* hist_All = ME_2d->
getTH2F();
1778 for (
unsigned int j = 0;
j<diffCount.size();
j++) {
1784 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,binNumber));
1785 int updatedLumiCount = currentLumiCount + diffCount[
j];
1786 hist_All->SetBinContent(lumi+1,binNumber,updatedLumiCount);
1792 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_2d" << ME_2d->
getName() << std::endl;
1806 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupL1HitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1809 for(
unsigned int i=0;
i<fGroupNamePathsPair.size();
i++){
1812 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" + fGroupNamePathsPair[
i].first+
"_Pass_Any";
1817 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1823 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1825 TH1F * hist_1d = ME_1d->
getTH1F();
1827 for (std::vector<std::pair<std::string, int> >::iterator ip = fGroupL1TempCountPair.begin(); ip != fGroupL1TempCountPair.end(); ++ip) {
1831 int prevCount = ip->second;
1835 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1837 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1839 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1842 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1847 int currCount = int(hist_1d->GetBinContent(pathBin));
1850 int diffCount = currCount - prevCount;
1852 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1855 ip->second = currCount;
1861 std::string fullPathToME_count = pathsSummaryHLTPathsPerLSFolder_ +
"HLT_" + pathname +
"_L1_Total_LS";
1866 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1867 int updatedLumiCount = currentLumiCount + diffCount;
1868 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1873 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1887 LogTrace(
"FourVectorHLTOnline") <<
" countHLTGroupHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1889 for(
unsigned int i=0;
i<fGroupNamePathsPair.size();
i++){
1893 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_" + fGroupNamePathsPair[
i].first +
"_Pass_Any";
1898 LogTrace(
"FourVectorHLTOnline") <<
" could not find 1d matrix " << fullPathToME << std::endl;
1904 LogTrace(
"FourVectorHLTOnline") <<
" Looking in histogram " << fullPathToME << std::endl;
1906 TH1F * hist_1d = ME_1d->
getTH1F();
1908 for (std::vector<std::pair<std::string, int> >::iterator ip = fGroupTempCountPair.begin(); ip != fGroupTempCountPair.end(); ++ip) {
1912 int prevCount = ip->second;
1916 LogTrace(
"FourVectorHLTOnline") <<
" Looking for binLabel = " << binLabel << std::endl;
1918 int pathBin = hist_1d->GetXaxis()->FindBin(binLabel.c_str());
1920 LogTrace(
"FourVectorHLTOnline") <<
" pathBin = " << pathBin <<
" out of histogram total number of bins " << hist_1d->GetNbinsX() << std::endl;
1923 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1928 int currCount = int(hist_1d->GetBinContent(pathBin));
1931 int diffCount = currCount - prevCount;
1933 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
1936 ip->second = currCount;
1942 std::string fullPathToME_count = pathsSummaryHLTPathsPerLSFolder_ +
"HLT_" + pathname +
"_Total_LS";
1947 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
1948 int updatedLumiCount = currentLumiCount + diffCount;
1949 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
1954 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
1968 LogTrace(
"FourVectorHLTOnline") <<
" countHLTPathHitsEndLumiBlock() lumiSection number " << lumi << std::endl;
1970 std::string fullPathToME =
"HLT/FourVector/PathsSummary/HLT_All_PassPass";
1975 LogTrace(
"FourVectorHLTOnline") <<
" could not fine 2d matrix " << fullPathToME << std::endl;
1981 TH2F * hist_2d = ME_2d->
getTH2F();
1983 for (std::vector<std::pair<std::string, int> >::iterator ip = fPathTempCountPair.begin(); ip != fPathTempCountPair.end(); ++ip) {
1987 int prevCount = ip->second;
1990 int pathBin = hist_2d->GetXaxis()->FindBin(pathname.c_str());
1992 if(pathBin > hist_2d->GetNbinsX()) {
1994 LogTrace(
"FourVectorHLTOnline") <<
" Cannot find the bin for path " << pathname << std::endl;
1999 int currCount = int(hist_2d->GetBinContent(pathBin, pathBin));
2002 int diffCount = currCount - prevCount;
2004 LogTrace(
"FourVectorHLTOnline") <<
" lumi = " << lumi <<
" path " << pathname <<
" count " << diffCount << std::endl;
2007 ip->second = currCount;
2012 if ( ME_HLTAll_LS_) {
2014 TH2F* hist_All = ME_HLTAll_LS_->getTH2F();
2017 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2020 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2021 int updatedLumiCount = currentLumiCount + diffCount;
2022 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2027 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME_HLTAll_LS_" << std::endl;
2031 for (
unsigned int i=0 ;
i< v_ME_HLTAll_LS_.size();
i++) {
2037 TH2F* hist_All = tempME->
getTH2F();
2040 int pathBinNumber = hist_All->GetYaxis()->FindBin(pathname.c_str());
2042 int currentLumiCount = int(hist_All->GetBinContent(lumi+1,pathBinNumber));
2043 int updatedLumiCount = currentLumiCount + diffCount;
2044 hist_All->SetBinContent(lumi+1,pathBinNumber,updatedLumiCount);
2049 LogDebug(
"FourVectorHLTOnline") <<
" cannot find tempME " << std::endl;
2059 std::string fullPathToME_count = pathsIndividualHLTPathsPerLSFolder_ + pathname +
"_count_per_LS";
2064 int currentLumiCount = int(ME_1d->
getTH1()->GetBinContent(lumi+1));
2065 int updatedLumiCount = currentLumiCount + diffCount;
2066 ME_1d->
getTH1()->SetBinContent(lumi+1,updatedLumiCount);
2071 LogDebug(
"FourVectorHLTOnline") <<
" cannot find ME " << fullPathToME_count << std::endl;
2084 if (pathname.find(
"MET") != std::string::npos)
2086 if (pathname.find(
"SumET") != std::string::npos)
2088 if (pathname.find(
"HT") != std::string::npos)
2090 if (pathname.find(
"Jet") != std::string::npos)
2092 if (pathname.find(
"Mu") != std::string::npos)
2094 if (pathname.find(
"Ele") != std::string::npos)
2096 if (pathname.find(
"Photon") != std::string::npos)
2098 if (pathname.find(
"Tau") != std::string::npos)
2100 if (pathname.find(
"IsoTrack") != std::string::npos)
2102 if (pathname.find(
"BTag") != std::string::npos)
2116 std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
2118 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2119 numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2121 if (hltConfig_.moduleType(*numpathmodule) ==
"HLTLevel1GTSeed") {
2123 l1pathname = *numpathmodule;
2140 std::string l1ModuleName = getL1ConditionModuleName(pathname);
2141 int l1ModuleIndex = hltConfig_.moduleIndex(pathname, l1ModuleName);
2143 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2144 if(pathByIndex >= triggerResults_->size() )
return rc;
2147 int lastModule = triggerResults_->index(pathByIndex);
2151 rc = (l1ModuleIndex < lastModule);
2162 unsigned int pathByIndex = triggerNames.
triggerIndex(pathname);
2163 if(pathByIndex >= triggerResults_->size() )
return rc;
2165 rc = triggerResults_->accept(pathByIndex);
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
const std::string getL1ConditionModuleName(const std::string &pathname)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)=0
virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)=0
void setupHltMatrix(std::string label, std::vector< std::string > paths)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
void countHLTGroupBXHitsEndLumiBlock(const int &lumi)
void fillHltMatrix(const edm::TriggerNames &triggerNames)
int bunchCrossing() const
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::multimap< float, int > fimmap
void countHLTPathHitsEndLumiBlock(const int &lumi)
void cleanDRMatchSet(mmset &tempSet)
Clean DR Match Set.
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::vector< TPRegexp > filters
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::set< fimmap, std::less< fimmap > > mmset
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
U second(std::pair< T, U > const &p)
std::string moduleName(Provenance const &provenance)
unsigned int triggerIndex(std::string const &name) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setLimits(float etaMax, float etMin, float drMatch)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
virtual void clearSets(void)=0
void countHLTGroupL1HitsEndLumiBlock(const int &lumi)
bool hasL1Passed(const std::string &pathname, const edm::TriggerNames &triggerNames)
static std::string const triggerResults("TriggerResults")
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)=0
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
FourVectorHLTOnline(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
int getTriggerTypeParsePathName(const std::string &pathname)
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
TH2F * getTH2F(void) const
T first(std::pair< T, U > const &p)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setReco(edm::Handle< T > offColl)
tuple size
Write out results.
void setBJetsFlag(bool flag)