Skip to content

Commit

Permalink
modified StringCutObjectSelector<pat::Jet> to be called per job
Browse files Browse the repository at this point in the history
  • Loading branch information
bbilin committed Feb 2, 2016
1 parent b44f90a commit d2af7e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions DQM/Physics/src/TopSingleLeptonDQM_miniAOD.cc
Expand Up @@ -33,6 +33,7 @@ MonitorEnsemble::MonitorEnsemble(const char* label,
muonIso_(nullptr),
muonSelect_(nullptr),
jetIDSelect_(nullptr),
jetSelect(nullptr),
includeBTag_(false),
lowerEdge_(-1.),
upperEdge_(-1.),
Expand Down Expand Up @@ -139,6 +140,7 @@ MonitorEnsemble::MonitorEnsemble(const char* label,
// CaloJets at the moment)
if (jetExtras.existsAs<std::string>("select")) {
jetSelect_ = jetExtras.getParameter<std::string>("select");
jetSelect.reset(new StringCutObjectSelector<pat::Jet> (jetSelect_));
}
}

Expand Down Expand Up @@ -537,8 +539,8 @@ void MonitorEnsemble::fill(const edm::Event& event,

pat::Jet sel = *jet;

StringCutObjectSelector<pat::Jet> jetSelect(jetSelect_);
if (!jetSelect(sel)) continue;
if(!(*jetSelect)(sel))continue;
// if (!jetSelect(sel)) continue;

// prepare jet to fill monitor histograms
pat::Jet monitorJet = *jet;
Expand Down
2 changes: 1 addition & 1 deletion DQM/Physics/src/TopSingleLeptonDQM_miniAOD.h
Expand Up @@ -136,6 +136,7 @@ class MonitorEnsemble {
/// extra selection on jets (here given as std::string as it depends
/// on the the jet type, which selections are valid and which not)
std::string jetSelect_;
std::unique_ptr<StringCutObjectSelector<pat::Jet> > jetSelect;
/// include btag information or not
/// to be determined from the cfg
bool includeBTag_;
Expand All @@ -153,7 +154,6 @@ class MonitorEnsemble {
/// histogram container
std::map<std::string, MonitorElement*> hists_;
edm::EDConsumerBase tmpConsumerBase;

std::string directory_;
};

Expand Down

0 comments on commit d2af7e8

Please sign in to comment.