44 produces<edm::PtrVector<reco::Candidate> >(
"col1");
45 produces<edm::PtrVector<reco::Candidate> >(
"col2");
48 produces<edm::PtrVector<reco::PFCandidate> >(
"pfCandCol1");
49 produces<edm::PtrVector<reco::PFCandidate> >(
"pfCandCol2");
81 for(
size_t iC1=0;iC1<col1Handle->size();iC1++) {
82 for(
size_t iC2=0;iC2<col2Handle->size();iC2++) {
84 bool matched=(col1Handle->ptrAt(iC1)==col2Handle->ptrAt(iC2));
86 deltaR2(col1Handle->ptrAt(iC1)->p4(), col2Handle->ptrAt(iC2)->p4() )< 0.000001) {
91 outcol1->push_back( col1Handle->ptrAt(iC1) );
92 outcol2->push_back( col2Handle->ptrAt(iC2) );
95 std::set<reco::CandidatePtr> sc1s;
96 std::set<reco::CandidatePtr> sc2s;
97 for(
size_t ics1=0;ics1<col1Handle->ptrAt(iC1)->numberOfSourceCandidatePtrs();
99 sc1s.insert( col1Handle->ptrAt(iC1)->sourceCandidatePtr(ics1));
101 for(
size_t ics2=0;ics2<col2Handle->ptrAt(iC2)->numberOfSourceCandidatePtrs();
103 sc2s.insert( col2Handle->ptrAt(iC2)->sourceCandidatePtr(ics2));
106 for(
size_t ic=0;ic<pfCandHandle->size(); ++ic) {
109 bool match1=(sc1s.find(c)!=sc1s.end());
110 bool match2=(sc2s.find(c)!=sc2s.end());
113 for(
size_t ics1=0;ics1<sc1s.size();ics1++) {
115 col1Handle->ptrAt(iC1)->sourceCandidatePtr(ics1)->p4())<0.0000001) {
122 for(
size_t ics2=0;ics2<sc2s.size();ics2++) {
124 col2Handle->ptrAt(iC2)->sourceCandidatePtr(ics2)->p4())<0.00001) {
132 outPFCandCol1->push_back(c);
135 outPFCandCol2->push_back(c);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
PFMatchedCandidateRefExtractor(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::View< reco::Candidate > > col1Token_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::View< reco::Candidate > > col2Token_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > pfCandToken_
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
virtual ~PFMatchedCandidateRefExtractor()