36 produces<edm::Association<std::vector<pat::GenericParticle>>>();
37 produces<edm::ValueMap<int>>(
"fsrIndex");
42 desc.
add<
edm::InputTag>(
"photons")->setComment(
"FSR photon collection to associate with muons");
43 desc.
add<
edm::InputTag>(
"muons")->setComment(
"collection of muons to associate with FSR photons");
65 std::vector<int> muonMapping(muons->size(), -1);
67 for (
auto muon = muons->begin();
muon != muons->end(); ++
muon) {
68 for (
auto iter_pho = photons->begin(); iter_pho != photons->end(); iter_pho++) {
69 if (iter_pho->hasUserCand(
"associatedMuon") and
71 muonMapping[
muon - muons->begin()] = (iter_pho - photons->begin());
75 auto muon2photon = std::make_unique<edm::Association<std::vector<pat::GenericParticle>>>(
photons);
77 muon2photonFiller.insert(muons, muonMapping.begin(), muonMapping.end());
78 muon2photonFiller.fill();
83 fillerBareIdx.
insert(muons, muonMapping.begin(), muonMapping.end());
T getParameter(std::string const &) const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void insert(const H &h, I begin, I end)
const edm::EDGetTokenT< edm::View< reco::Muon > > muons_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< pat::GenericParticleCollection > photons_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MuonFSRAssociator(const edm::ParameterSet &iConfig)
~MuonFSRAssociator() override