31 recoChargedCandidateProducer_ = consumes<reco::RecoChargedCandidateCollection>(
33 pfEcalClusterProducer_ =
34 consumes<reco::RecoChargedCandidateIsolationMap>(
config.getParameter<
edm::InputTag>(
"pfEcalClusterProducer"));
35 pfHcalClusterProducer_ =
36 consumes<reco::RecoChargedCandidateIsolationMap>(
config.getParameter<
edm::InputTag>(
"pfHcalClusterProducer"));
38 produces<edm::ValueMap<float>>();
48 descriptions.
add((
"hltL3MuonSumCaloPFIsolationProducer"),
desc);
53 iEvent.getByToken(recoChargedCandidateProducer_, recochargedcandHandle);
59 iEvent.getByToken(pfHcalClusterProducer_, hcalIsolation);
61 auto caloIsoMap = std::make_unique<edm::ValueMap<float>>();
62 std::vector<float> isoFloats(recochargedcandHandle->size(), 0);
64 for (
unsigned int iReco = 0; iReco < recochargedcandHandle->size(); iReco++) {
67 float valisoECAL = mapiECAL->
val;
69 float valisoHCAL = mapiHCAL->
val;
70 float caloIso = valisoECAL + valisoHCAL;
71 isoFloats[iReco] = caloIso;
75 isoFloatFiller.
insert(recochargedcandHandle, isoFloats.begin(), isoFloats.end());
76 isoFloatFiller.
fill();
void insert(const H &h, I begin, I end)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
L3MuonSumCaloPFIsolationProducer(const edm::ParameterSet &)
constructor with config
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
~L3MuonSumCaloPFIsolationProducer() override