34 moduleLabel_(iConfig.getParameter<
std::
string>(
"@module_label")) {
39 produces<edm::PtrVector<reco::Candidate>>(
"col1");
40 produces<edm::PtrVector<reco::Candidate>>(
"col2");
43 produces<edm::PtrVector<reco::PFCandidate>>(
"pfCandCol1");
44 produces<edm::PtrVector<reco::PFCandidate>>(
"pfCandCol2");
68 for (
size_t iC1 = 0; iC1 < col1Handle->size(); iC1++) {
69 for (
size_t iC2 = 0; iC2 < col2Handle->size(); iC2++) {
70 bool matched = (col1Handle->ptrAt(iC1) == col2Handle->ptrAt(iC2));
71 if (!
matched &&
deltaR2(col1Handle->ptrAt(iC1)->p4(), col2Handle->ptrAt(iC2)->p4()) < 0.000001) {
76 outcol1->push_back(col1Handle->ptrAt(iC1));
77 outcol2->push_back(col2Handle->ptrAt(iC2));
81 std::set<reco::CandidatePtr> sc1s;
82 std::set<reco::CandidatePtr> sc2s;
83 for (
size_t ics1 = 0; ics1 < col1Handle->ptrAt(iC1)->numberOfSourceCandidatePtrs(); ics1++) {
84 sc1s.insert(col1Handle->ptrAt(iC1)->sourceCandidatePtr(ics1));
86 for (
size_t ics2 = 0; ics2 < col2Handle->ptrAt(iC2)->numberOfSourceCandidatePtrs(); ics2++) {
87 sc2s.insert(col2Handle->ptrAt(iC2)->sourceCandidatePtr(ics2));
90 for (
size_t ic = 0; ic < pfCandHandle->size(); ++ic) {
93 bool match1 = (sc1s.find(
c) != sc1s.end());
94 bool match2 = (sc2s.find(
c) != sc2s.end());
97 for (
size_t ics1 = 0; ics1 < sc1s.size(); ics1++) {
99 col1Handle->ptrAt(iC1)->sourceCandidatePtr(ics1)->p4()) <
107 for (
size_t ics2 = 0; ics2 < sc2s.size(); ics2++) {
109 col2Handle->ptrAt(iC2)->sourceCandidatePtr(ics2)->p4()) < 0.00001) {
117 outPFCandCol1->push_back(
c);
120 outPFCandCol2->push_back(
c);
T getParameter(std::string const &) const
PFMatchedCandidateRefExtractor(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< edm::View< reco::Candidate > > col1Token_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::View< reco::Candidate > > col2Token_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > pfCandToken_
~PFMatchedCandidateRefExtractor() override
void produce(edm::StreamID iID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override