51 iConfig.getParameter<
edm::
InputTag>(
"packedGenParticles"))),
52 cut_(iConfig.getParameter<
std::
string>(
"cut")),
53 cutLoose_(iConfig.getParameter<
std::
string>(
"cutLoose")),
54 nLoose_(iConfig.getParameter<unsigned>(
"nLoose")),
55 clearDaughters_(iConfig.getParameter<
bool>(
"clearDaughters")),
56 dropSpecific_(iConfig.getParameter<
bool>(
"dropSpecific")) {
57 produces<std::vector<reco::GenJet> >();
58 produces<edm::Association<std::vector<reco::GenJet> > >(
"slimmedGenJetAssociation");
68 auto out = std::make_unique<vector<reco::GenJet> >();
72 iEvent.getByToken(gp2pgp_, gp2pgp);
74 auto genJetSlimmedGenJetAssociation = make_unique<edm::Association<std::vector<reco::GenJet> > >();
76 auto mapping = std::make_unique<std::vector<int> >();
82 bool selectedLoose =
false;
83 if (nLoose_ > 0 && nl < nLoose_ && cutLoose_(*it)) {
88 bool pass = cut_(*it) || selectedLoose;
99 if (clearDaughters_) {
100 jet.clearDaughters();
105 jet.clearDaughters();
106 std::map<unsigned int, reco::CandidatePtr> ptrs;
107 for (
unsigned int i = 0;
i < old.size();
i++) {
111 ptrs[((*gp2pgp)[old[
i]]).
key()] =
refToPtr((*gp2pgp)[old[
i]]);
113 for (std::map<unsigned int, reco::CandidatePtr>::iterator itp = ptrs.begin(); itp != ptrs.end();
116 jet.addDaughter(itp->second);
126 auto asso = std::make_unique<edm::Association<std::vector<reco::GenJet> > >(orphanHandle);
129 slimmedAssoFiller.fill();