2 #include "Math/GenVector/VectorUtil.h" 14 maxInvMassPairOnly_(iConfig.getParameter<
bool>(
"maxInvMassPairOnly")),
15 removeMaxInvMassPair_(iConfig.getParameter<
bool>(
"removeMaxInvMassPair")) {
16 produces<reco::PFJetCollection>();
29 if (
jets->size() > 1) {
30 for (
unsigned i = 0;
i <
jets->size();
i++) {
31 for (
unsigned j =
i + 1;
j <
jets->size();
j++) {
32 double test = ((*jets)[
i].p4() + (*jets)[
j].p4()).M2();
33 if (
test > m2jj_max) {
42 addPFJets->push_back((*
jets)[iCan]);
43 addPFJets->push_back((*
jets)[jCan]);
45 for (
unsigned i = 0;
i <
jets->size();
i++) {
46 if (
i != iCan &&
i != jCan)
47 addPFJets->push_back((*
jets)[
i]);
58 desc.add<
bool>(
"maxInvMassPairOnly",
true)->setComment(
"Add only max mjj pair");
59 desc.add<
bool>(
"removeMaxInvMassPair",
false)->setComment(
"Remove max mjj pair and keep all other jets");
61 "This module produces a collection of PFJets that are cross-cleaned with respect to PFTaus passing a HLT " 63 descriptions.
add(
"PFJetsMaxInvMassModule",
desc);
bool removeMaxInvMassPair_
#define DEFINE_FWK_MODULE(type)
void setComment(std::string const &value)
PFJetsMaxInvMassModule(const edm::ParameterSet &)
const edm::EDGetTokenT< reco::PFJetCollection > pfJetSrc_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override