70 auto out = std::make_unique<vector<reco::GenJet> >();
71 out->reserve(src->size());
76 auto genJetSlimmedGenJetAssociation = make_unique< edm::Association<std::vector<reco::GenJet> > > ();
78 auto mapping = std::make_unique<std::vector<int> >();
79 mapping->reserve(src->size());
84 bool selectedLoose =
false;
90 bool pass =
cut_(*it) || selectedLoose;
92 mapping->push_back(-1);
99 mapping->push_back(it-src->begin());
110 std::map<unsigned int,reco::CandidatePtr> ptrs;
111 for(
unsigned int i=0;
i<old.size();
i++)
118 for(std::map<unsigned int,reco::CandidatePtr>::iterator itp=ptrs.begin();itp!=ptrs.end();itp++)
133 auto asso = std::make_unique<edm::Association<std::vector<reco::GenJet> > >(orphanHandle);
135 slimmedAssoFiller.insert(src, mapping->begin(), mapping->end());
136 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
const StringCutObjectSelector< reco::GenJet > cutLoose_
virtual const daughters & daughterPtrVector() const
references to daughtes
const bool clearDaughters_
reset daughters to an empty vector
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 ...
void addDaughter(const CandidatePtr &)
add a daughter via a reference