65 deltaR_(iConfig.getParameter<double>(
"deltaR")),
66 ptCut_(iConfig.getParameter<double>(
"ptCut")),
67 makeNew_(iConfig.getUntrackedParameter<
bool>(
"createNewCollection",
true)),
68 fillDummy_(iConfig.getUntrackedParameter<
bool>(
"fillDummyEntries",
true)) {
70 produces<T2Collection>().setBranchAlias(
alias);
89 auto jets = std::make_unique<T2Collection>();
92 iEvent.getByToken(jetSrc_, genjets);
94 int jetsize = genjets->size();
97 for (
int ijet = 0; ijet < jetsize; ++ijet) {
101 vector<int> selectedIndices;
102 vector<int> removedIndices;
104 for (
int ijet = 0; ijet < jetsize; ++ijet) {
105 const T2* jet1 = &((*genjets)[ijet]);
109 for (
int ijet2 = 0; ijet2 < jetsize; ++ijet2) {
113 const T2* jet2 = &((*genjets)[ijet2]);
115 if (
Geom::deltaR(jet1->momentum(), jet2->momentum()) < deltaR_) {
116 if (jet1->et() < jet2->et()) {
118 removedIndices.push_back(ijet);
122 removedIndices.push_back(ijet2);
128 double etjet = ((*genjets)[ijet]).
et();
130 if (
selection[ijet] == 1 && etjet > ptCut_) {
131 selectedIndices.push_back(ijet);
132 jets->push_back(*jet1);