11 #include <boost/bind.hpp>
75 produces<reco::PFJetCollection>(
"jets");
76 produces<PFJetMatchMap>();
82 std::cout <<
"<RecoTauJetRegionProducer::produce (moduleLabel = " <<
moduleLabel_ <<
")>:" << std::endl;
93 std::vector<PFCandPtr> pfCands;
94 pfCands.reserve(pfCandsHandle->size());
95 for (
size_t icand = 0; icand < pfCandsHandle->size(); ++icand ) {
96 pfCands.push_back(PFCandPtr(pfCandsHandle, icand));
104 size_t nJets = jets.
size();
117 size_t nOriginalJets = 0;
122 evt.
get(originalId, originalJets);
125 <<
"Can't get the original jets that made: " <<
inputJets_
126 <<
" that have product ID: " << originalId
127 <<
" from the event!!";
130 nOriginalJets = originalJets->size();
137 std::vector<int> matchInfo(nOriginalJets, -1);
138 newJets->reserve(nJets);
139 for (
size_t ijet = 0; ijet < nJets; ++ijet ) {
143 newJets->emplace_back(*jetRef);
148 for ( std::vector<PFCandPtr>::const_iterator pfCand = pfCands.begin();
149 pfCand != pfCands.end(); ++pfCand ) {
150 bool isMappedToJet =
false;
154 pfCandMappedToJet != pfCandsMappedToJet.
end(); ++pfCandMappedToJet ) {
155 if (
reco::deltaR2(**pfCandMappedToJet, **pfCand) < 1.e-8 ) {
156 isMappedToJet =
true;
161 isMappedToJet =
true;
166 std::cout <<
"jet #" << ijet <<
": Pt = " << jetRef->pt() <<
", eta = " << jetRef->eta() <<
", phi = " << jetRef->eta() <<
","
167 <<
" mass = " << jetRef->mass() <<
", area = " << jetRef->jetArea() << std::endl;
170 for ( std::vector<reco::PFCandidatePtr>::const_iterator jetConstituent = jetConstituents.begin();
171 jetConstituent != jetConstituents.end(); ++jetConstituent ) {
172 std::cout <<
" constituent #" << idx <<
": Pt = " << (*jetConstituent)->pt() <<
", eta = " << (*jetConstituent)->eta() <<
", phi = " << (*jetConstituent)->phi() << std::endl;
177 matchInfo[jetRef.
key()] = ijet;
184 std::auto_ptr<PFJetMatchMap> matching(
new PFJetMatchMap(newJetsInEvent));
187 filler.
insert(originalJets, matchInfo.begin(), matchInfo.end());
T getParameter(std::string const &) const
RecoTauJetRegionProducer(const edm::ParameterSet &pset)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Association< reco::PFJetCollection > PFJetMatchMap
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::PFCandidateCollection > pf_token
void insert(const H &h, I begin, I end)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const_iterator end() const
Termination of iteration.
void produce(edm::Event &evt, const edm::EventSetup &es) override
Jets made from PFObjects.
const_iterator begin() const
Initialize an iterator over the RefVector.
ProductID id() const
Accessor for product ID.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::CandidateView > Jets_token
~RecoTauJetRegionProducer()
edm::EDGetTokenT< JetToPFCandidateAssociation > pfCandAssocMap_token
bool get(ProductID const &oid, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::InputTag pfCandAssocMapSrc_
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
key_type key() const
Accessor for product key.
void clearDaughters()
clear daughter references
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::AssociationMap< edm::OneToMany< std::vector< reco::PFJet >, std::vector< reco::PFCandidate >, unsigned int > > JetToPFCandidateAssociation
void addDaughter(const CandidatePtr &)
add a daughter via a reference
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
size_type size() const
Size of the RefVector.