Skip to content

Commit

Permalink
Use vector<bool> to track if path has already been plotted
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr15Jones committed Dec 29, 2018
1 parent a06dff9 commit 576b9cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions DQM/HLTEvF/plugins/HLTObjectsMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <memory>
#include <sys/time.h>
#include <cstdlib>
#include <unordered_set>
#include <unordered_map>

// user include files
Expand Down Expand Up @@ -347,16 +346,16 @@ HLTObjectsMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet

// loop over path
int ibin = -1;
std::unordered_set<int> plottedPathNameIndices;
std::vector<bool> plottedPathIndices(plotNamesToBins_.size(),false);
for (auto & plot : hltPlots_) {
ibin++;
if ( plot.pathIDX <= 0 ) continue;

if ( triggerResults->accept(plot.pathIDX) ) {
//We only want to fill this once per pathNAME per event
auto index = plotNamesToBins_[plot.pathNAME];
if(plottedPathNameIndices.end() == plottedPathNameIndices.find(index)) {
plottedPathNameIndices.insert(index);
if(not plottedPathIndices[index]) {
plottedPathIndices[index] = true;
if ( debug_ )
std::cout << plot.pathNAME << " --> bin: " << ibin << std::endl;
eventsPlot_->Fill(index);
Expand Down

0 comments on commit 576b9cb

Please sign in to comment.