64 deltaR_(iConfig.getParameter<double>(
"deltaR")),
65 ptCut_(iConfig.getParameter<double>(
"ptCut")),
66 makeNew_(iConfig.getUntrackedParameter<
bool>(
"createNewCollection",
true)),
67 fillDummy_(iConfig.getUntrackedParameter<
bool>(
"fillDummyEntries",
true)) {
69 produces<T2Collection>().setBranchAlias(
alias);
88 auto jets = std::make_unique<T2Collection>();
91 iEvent.getByToken(jetSrc_, genjets);
93 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);
T getParameter(std::string const &) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
HiGenCleaner(const edm::ParameterSet &)