48 dropJetVars_(iConfig.getParameter<
std::
string>(
"dropJetVars")),
49 dropDaughters_(iConfig.getParameter<
std::
string>(
"dropDaughters")),
50 rekeyDaughters_(iConfig.getParameter<
std::
string>(
"rekeyDaughters")),
51 dropTrackRefs_(iConfig.getParameter<
std::
string>(
"dropTrackRefs")),
52 dropSpecific_(iConfig.getParameter<
std::
string>(
"dropSpecific")),
53 dropTagInfos_(iConfig.getParameter<
std::
string>(
"dropTagInfos")),
54 modifyJet_(iConfig.getParameter<
bool>(
"modifyJets")),
55 mayNeedDaughterMap_(iConfig.getParameter<
std::
string>(
"dropDaughters") !=
"1" &&
56 iConfig.getParameter<
std::
string>(
"rekeyDaughters") !=
"0"),
57 mixedDaughters_(iConfig.getParameter<
bool>(
"mixedDaughters")) {
63 pf2pc_ = consumes<edm::Association<pat::PackedCandidateCollection>>(
69 jetModifier_ = std::make_unique<pat::ObjectModifier<pat::Jet>>(mod_config, consumesCollector());
71 produces<std::vector<pat::Jet>>();
76 jetModifier_->setEventContent(iSetup);
87 if (mayNeedDaughterMap_) {
88 if (mixedDaughters_) {
89 iEvent.getByToken(pf2pcAny_, pf2pcAny);
91 iEvent.getByToken(pf2pc_, pf2pc);
95 auto out = std::make_unique<std::vector<pat::Jet>>();
99 jetModifier_->setEvent(
iEvent);
107 jetModifier_->modify(
jet);
110 if (dropTagInfos_(*it)) {
111 jet.tagInfoLabels_.clear();
112 jet.tagInfos_.clear();
113 jet.tagInfosFwdPtr_.clear();
115 if (dropJetVars_(*it)) {
120 if (dropTrackRefs_(*it)) {
123 if (dropDaughters_(*it)) {
124 jet.clearDaughters();
125 jet.pfCandidatesFwdPtr_.clear();
126 jet.caloTowersFwdPtr_.clear();
127 }
else if (rekeyDaughters_(*it)) {
130 jet.clearDaughters();
131 if (mixedDaughters_) {
132 std::vector<reco::CandidatePtr> ptrs;
134 ptrs.push_back((*pf2pcAny)[oldptr]);
136 std::sort(ptrs.begin(), ptrs.end());
138 jet.addDaughter(newptr);
141 std::map<unsigned int, reco::CandidatePtr> ptrs;
142 for (
unsigned int i = 0;
i < old.size();
i++) {
146 for (std::map<unsigned int, reco::CandidatePtr>::iterator itp = ptrs.begin(); itp != ptrs.end();
149 jet.addDaughter(itp->second);
153 if (dropSpecific_(*it)) {
155 jet.specificCalo_.clear();
156 jet.specificPF_.clear();