47 dropJetVars_(iConfig.getParameter<
std::
string>(
"dropJetVars")),
48 dropDaughters_(iConfig.getParameter<
std::
string>(
"dropDaughters")),
49 rekeyDaughters_(iConfig.getParameter<
std::
string>(
"rekeyDaughters")),
50 dropTrackRefs_(iConfig.getParameter<
std::
string>(
"dropTrackRefs")),
51 dropSpecific_(iConfig.getParameter<
std::
string>(
"dropSpecific")),
52 dropTagInfos_(iConfig.getParameter<
std::
string>(
"dropTagInfos")),
53 modifyJet_(iConfig.getParameter<
bool>(
"modifyJets")),
54 mayNeedDaughterMap_(iConfig.getParameter<
std::
string>(
"dropDaughters") !=
"1" &&
55 iConfig.getParameter<
std::
string>(
"rekeyDaughters") !=
"0"),
56 mixedDaughters_(iConfig.getParameter<
bool>(
"mixedDaughters")) {
62 pf2pc_ = consumes<edm::Association<pat::PackedCandidateCollection>>(
68 jetModifier_ = std::make_unique<pat::ObjectModifier<pat::Jet>>(mod_config, consumesCollector());
70 produces<std::vector<pat::Jet>>();
78 jetModifier_->setEventContent(iSetup);
84 if (mayNeedDaughterMap_) {
85 if (mixedDaughters_) {
86 iEvent.getByToken(pf2pcAny_, pf2pcAny);
88 iEvent.getByToken(pf2pc_, pf2pc);
92 auto out = std::make_unique<std::vector<pat::Jet>>();
96 jetModifier_->setEvent(
iEvent);
104 jetModifier_->modify(
jet);
107 if (dropTagInfos_(*
it)) {
108 jet.tagInfoLabels_.clear();
109 jet.tagInfos_.clear();
110 jet.tagInfosFwdPtr_.clear();
112 if (dropJetVars_(*
it)) {
117 if (dropTrackRefs_(*
it)) {
120 if (dropDaughters_(*
it)) {
121 jet.clearDaughters();
122 jet.pfCandidatesFwdPtr_.clear();
123 jet.caloTowersFwdPtr_.clear();
124 }
else if (rekeyDaughters_(*
it)) {
127 jet.clearDaughters();
128 if (mixedDaughters_) {
129 std::vector<reco::CandidatePtr> ptrs;
131 ptrs.push_back((*pf2pcAny)[oldptr]);
135 jet.addDaughter(newptr);
138 std::map<unsigned int, reco::CandidatePtr> ptrs;
139 for (
unsigned int i = 0;
i < old.size();
i++) {
143 for (std::map<unsigned int, reco::CandidatePtr>::iterator itp = ptrs.begin(); itp != ptrs.end();
146 jet.addDaughter(itp->second);
150 if (dropSpecific_(*
it)) {
152 jet.specificCalo_.clear();
153 jet.specificPF_.clear();
std::unique_ptr< pat::ObjectModifier< pat::Jet > > jetModifier_
const StringCutObjectSelector< pat::Jet > dropDaughters_
~PATJetSlimmer() override
T getParameter(std::string const &) const
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
const StringCutObjectSelector< pat::Jet > dropTrackRefs_
edm::EDGetTokenT< edm::ValueMap< reco::CandidatePtr > > pf2pcAny_
const bool mayNeedDaughterMap_
const StringCutObjectSelector< pat::Jet > dropSpecific_
const StringCutObjectSelector< pat::Jet > dropTagInfos_
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
std::vector< CandidatePtr > daughters
collection of references to daughters
const StringCutObjectSelector< pat::Jet > rekeyDaughters_
Analysis-level calorimeter jet class.
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
PATJetSlimmer(const edm::ParameterSet &iConfig)
const StringCutObjectSelector< pat::Jet > dropJetVars_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const bool mixedDaughters_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Matcher of reconstructed objects to L1 Muons.