54 produces<std::vector<reco::GenJet> >();
55 produces< edm::Association<std::vector<reco::GenJet> > >(
"slimmedGenJetAssociation");
66 auto out = std::make_unique<vector<reco::GenJet> >();
67 out->reserve(src->size());
72 auto genJetSlimmedGenJetAssociation = make_unique< edm::Association<std::vector<reco::GenJet> > > ();
74 auto mapping = std::make_unique<std::vector<int> >();
75 mapping->reserve(src->size());
79 mapping->push_back(-1);
86 mapping->push_back(it-src->begin());
97 std::map<unsigned int,reco::CandidatePtr> ptrs;
98 for(
unsigned int i=0;
i<old.size();
i++)
105 for(std::map<unsigned int,reco::CandidatePtr>::iterator itp=ptrs.begin();itp!=ptrs.end();itp++)
120 auto asso = std::make_unique<edm::Association<std::vector<reco::GenJet> > >(orphanHandle);
122 slimmedAssoFiller.insert(src, mapping->begin(), mapping->end());
123 slimmedAssoFiller.fill();
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual ~PATGenJetSlimmer()
const bool clearDaughters_
reset daughters to an empty vector
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
Matcher of reconstructed objects to L1 Muons.
const StringCutObjectSelector< reco::GenJet > cut_
const edm::EDGetTokenT< edm::Association< std::vector< pat::PackedGenParticle > > > gp2pgp_
const bool dropSpecific_
drop the specific
Jets made from MC generator particles.
std::vector< CandidatePtr > daughters
collection of references to daughters
const edm::EDGetTokenT< edm::View< reco::GenJet > > src_
void clearDaughters()
clear daughter references
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void setSpecific(const Specific &spec)
set the specific (note: responsibility of keeping it consistent with the jet daughers belongs to the ...
const daughters & daughterPtrVector() const
references to daughtes
void addDaughter(const CandidatePtr &)
add a daughter via a reference
PATGenJetSlimmer(const edm::ParameterSet &iConfig)