Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for the pMSSMFilter - backport of #28593 to 102X #29234

Merged
merged 3 commits into from Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,8 +1,8 @@
/*
Package: GeneralInterface/GenFilters/pMSSMFilter
Class: pMSSMFilter
Package: GeneralInterface/GenFilters/ModelpMSSMFilter
Class: ModelpMSSMFilter

class pMSSMFilter pMSSMFilter.cc GeneratorInterface/GenFilters/src/pMSSMFilter.cc
class ModelpMSSMFilter ModelpMSSMFilter.cc GeneratorInterface/GenFilters/plugins/ModelpMSSMFilter.cc

Description: EDFilter which checks the event passes a baseline selection for the run-II pMSSM effort.

Expand Down Expand Up @@ -33,7 +33,7 @@ Original Author: Malte Mrowietz
#include <memory>
#include <vector>
//User include files
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/global/EDFilter.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -46,13 +46,13 @@ Original Author: Malte Mrowietz
#include "DataFormats/JetReco/interface/GenJetCollection.h"

//Class declaration
class pMSSMFilter : public edm::EDFilter {
class ModelpMSSMFilter : public edm::global::EDFilter<> {
public:
explicit pMSSMFilter(const edm::ParameterSet&);
~pMSSMFilter() override;
explicit ModelpMSSMFilter(const edm::ParameterSet&);
~ModelpMSSMFilter() override;

private:
bool filter(edm::Event&, const edm::EventSetup&) override;
bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;

//Member data
edm::EDGetTokenT<reco::GenParticleCollection> token_;
Expand All @@ -62,7 +62,7 @@ class pMSSMFilter : public edm::EDFilter {
};

//Constructor
pMSSMFilter::pMSSMFilter(const edm::ParameterSet& params)
ModelpMSSMFilter::ModelpMSSMFilter(const edm::ParameterSet& params)
: token_(consumes<reco::GenParticleCollection>(params.getParameter<edm::InputTag>("gpssrc"))),
token2_(consumes<reco::GenJetCollection>(params.getParameter<edm::InputTag>("jetsrc"))),
muPtCut_(params.getParameter<double>("muPtCut")),
Expand All @@ -82,20 +82,20 @@ pMSSMFilter::pMSSMFilter(const edm::ParameterSet& params)
genHTcut_(params.getParameter<double>("genHTcut")) {}

//Destructor
pMSSMFilter::~pMSSMFilter() {}
ModelpMSSMFilter::~ModelpMSSMFilter() {}

bool pMSSMFilter::filter(edm::Event& evt, const edm::EventSetup& params) {
bool ModelpMSSMFilter::filter(edm::StreamID, edm::Event& evt, const edm::EventSetup& params) const {
using namespace std;
using namespace edm;
using namespace reco;
edm::Handle<reco::GenParticleCollection> gps;
evt.getByToken(token_, gps);
edm::Handle<reco::GenJetCollection> generatedJets;
evt.getByToken(token2_, generatedJets);
int looseel_ = 0;
int loosemu_ = 0;
int loosegamma_ = 0;
int veryloosegamma_ = 0;
int looseel = 0;
int loosemu = 0;
int loosegamma = 0;
int veryloosegamma = 0;
float decaylength;
for (std::vector<reco::GenParticle>::const_iterator it = gps->begin(); it != gps->end(); ++it) {
const reco::GenParticle& gp = *it;
Expand All @@ -110,26 +110,26 @@ bool pMSSMFilter::filter(edm::Event& evt, const edm::EventSetup& params) {
return true;
}
if (gp.pt() > loosemuPtCut_ && fabs(gp.eta()) < muEtaCut_) {
loosemu_ += 1;
loosemu += 1;
}
}
if (fabs(gp.pdgId()) == 11) {
if (gp.pt() > elPtCut_ && fabs(gp.eta()) < elEtaCut_) {
return true;
}
if (gp.pt() > looseelPtCut_ && fabs(gp.eta()) < elEtaCut_) {
looseel_ += 1;
looseel += 1;
}
}
if (fabs(gp.pdgId()) == 22) {
if (gp.pt() > gammaPtCut_ && fabs(gp.eta()) < gammaEtaCut_) {
return true;
}
if (gp.pt() > loosegammaPtCut_ && fabs(gp.eta()) < gammaEtaCut_) {
loosegamma_ += 1;
loosegamma += 1;
} else {
if (gp.pt() > veryloosegammaPtCut_ && fabs(gp.eta()) < gammaEtaCut_) {
veryloosegamma_ += 1;
veryloosegamma += 1;
}
}
}
Expand All @@ -145,10 +145,10 @@ bool pMSSMFilter::filter(edm::Event& evt, const edm::EventSetup& params) {
}
}
}
if (looseel_ + loosemu_ + loosegamma_ > 1) {
if (looseel + loosemu + loosegamma > 1) {
return true;
}
if (loosegamma_ > 0 && veryloosegamma_ > 0) {
if (loosegamma > 0 && veryloosegamma > 0) {
return true;
}
double genHT = 0.0;
Expand All @@ -163,4 +163,4 @@ bool pMSSMFilter::filter(edm::Event& evt, const edm::EventSetup& params) {
}

// Define module as a plug-in
DEFINE_FWK_MODULE(pMSSMFilter);
DEFINE_FWK_MODULE(ModelpMSSMFilter);
@@ -1,10 +1,10 @@
#Configuration file fragment used for pMSSMFilter module (GeneratorInterface/GenFilters/src/pMSSMFilter.cc) initalisation
#pMSSMFilter_cfi GeneratorInterface/GenFilters/python/pMSSMFilter_cfi.py
#Configuration file fragment used for ModelpMSSMFilter module (GeneratorInterface/GenFilters/plugins/ModelpMSSMFilter.cc) initalisation
#ModelpMSSMFilter_cfi GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py

import FWCore.ParameterSet.Config as cms


pMSSMFilter = cms.EDFilter("pMSSMFilter",
ModelpMSSMFilter = cms.EDFilter("ModelpMSSMFilter",
gpssrc = cms.InputTag("genParticles"), # input genParticle collection
jetsrc = cms.InputTag("ak4GenJets"), # input genJets collection
genHTcut = cms.double(140.0), # genHT cut
Expand Down