39 recHitsLegacyTokenOut_{produces<HBHERecHitCollection>()} {}
43 auto recHitsLegacy = std::make_unique<HBHERecHitCollection>();
46 auto const& hcalRechitSoAView =
event.get(
recHitsTokenIn_).const_view();
48 recHitsLegacy->reserve(hcalRechitSoAView.metadata().size());
50 for (
auto i = 0;
i < hcalRechitSoAView.metadata().size();
i++) {
51 auto const& rechit = hcalRechitSoAView[
i];
53 if (rechit.chi2() < 0)
57 recHitsLegacy->emplace_back(
HcalDetId{rechit.detId()},
62 recHitsLegacy->back().setChiSquared(rechit.chi2());
63 recHitsLegacy->back().setRawEnergy(rechit.energyM0());
void produce(edm::Event &, edm::EventSetup const &) override
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &)
const edm::EDGetTokenT< hcal::RecHitHostCollection > recHitsTokenIn_
const edm::EDPutTokenT< HBHERecHitCollection > recHitsLegacyTokenOut_
#define DEFINE_FWK_MODULE(type)
HcalRecHitSoAToLegacy(edm::ParameterSet const &ps)
~HcalRecHitSoAToLegacy() override=default