11 #include <boost/bind.hpp>
43 produces<reco::PFJetCollection>(
"jets");
44 produces<PFJetMatchMap>();
55 std::vector<PFCandPtr> pfCands;
56 pfCands.reserve(pfCandsHandle->size());
57 for (
size_t icand = 0; icand < pfCandsHandle->size(); ++icand) {
58 pfCands.push_back(PFCandPtr(pfCandsHandle, icand));
66 reco::tau::castView<reco::PFJetRefVector>(jetView);
67 size_t nJets = jets.
size();
73 size_t nOriginalJets = 0;
78 evt.
get(originalId, originalJets);
81 <<
"Can't get the original jets that made: " <<
inputJets_
82 <<
" that have product ID: " << originalId
83 <<
" from the event!!";
86 nOriginalJets = originalJets->size();
93 std::vector<int> matchInfo(nOriginalJets, -1);
94 newJets->reserve(nJets);
95 for (
size_t ijet = 0; ijet < nJets; ++ijet) {
99 newJets->emplace_back(*jetRef);
104 for (
auto cand : pfCands )
108 matchInfo[jetRef.
key()] = ijet;
113 evt.
put(newJets,
"jets");
116 std::auto_ptr<PFJetMatchMap> matching(
new PFJetMatchMap(newJetsInEvent));
119 filler.
insert(originalJets, matchInfo.begin(), matchInfo.end());
T getParameter(std::string const &) const
RecoTauJetRegionProducer(const edm::ParameterSet &pset)
edm::Association< reco::PFJetCollection > PFJetMatchMap
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &evt, const edm::EventSetup &es)
void insert(const H &h, I begin, I end)
Jets made from PFObjects.
ProductID id() const
Accessor for product ID.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~RecoTauJetRegionProducer()
bool get(ProductID const &oid, Handle< PROD > &result) const
double deltaR2(double eta1, double phi1, double eta2, double phi2)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
key_type key() const
Accessor for product key.
void clearDaughters()
clear daughter references
std::vector< PFJet > PFJetCollection
collection of PFJet objects
void addDaughter(const CandidatePtr &)
add a daughter via a reference
size_type size() const
Size of the RefVector.