41 ptThreshold_(iConfig.getParameter<double>(
"ptThreshold")),
42 minEtaThreshold_(iConfig.getParameter<double>(
"minEtaThreshold")),
43 maxEtaThreshold_(iConfig.getParameter<double>(
"maxEtaThreshold")),
44 userawPt_(iConfig.getParameter<
bool>(
"userawPt")) {
45 produces<std::vector<pat::Jet>>(
"good");
46 produces<std::vector<pat::Jet>>(
"bad");
54 auto goodJets = std::make_unique<std::vector<pat::Jet>>();
55 auto badJets = std::make_unique<std::vector<pat::Jet>>();
58 iEvent.getByToken(jetsrc_, jetcandidates);
60 int njets = jetcandidates->size();
63 for (
int jetindex = 0; jetindex <
njets; ++jetindex) {
67 double ptJet = userawPt_ ? candjet->
correctedJet(
"Uncorrected").
pt() : candjet->
pt();
70 if (ptJet > ptThreshold_ || absEtaJet < minEtaThreshold_ || absEtaJet > maxEtaThreshold_) {
75 badJets->emplace_back(candjet);
85 desc.add<
bool>(
"userawPt",
true);
86 desc.add<
double>(
"ptThreshold", 50.0);
87 desc.add<
double>(
"minEtaThreshold", 2.65);
88 desc.add<
double>(
"maxEtaThreshold", 3.139);
90 descriptions.
add(
"BadPFCandidateJetsEEnoiseProducer",
desc);
double pt() const final
transverse momentum
#define DEFINE_FWK_MODULE(type)
~BadPFCandidateJetsEEnoiseProducer() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Abs< T >::type abs(const T &t)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
BadPFCandidateJetsEEnoiseProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< pat::Jet > > jetsrc_
double eta() const final
momentum pseudorapidity