12 produces<reco::PFRecHitCollection>();
13 produces<reco::PFRecHitCollection>(
"Cleaned");
17 std::vector<edm::ParameterSet> creators = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"producers");
18 for (
auto& creator : creators) {
35 creator->init(iSetup);
45 auto out = std::make_unique<reco::PFRecHitCollection>();
46 auto cleaned = std::make_unique<reco::PFRecHitCollection>();
48 out->reserve(localRA1.upper());
49 cleaned->reserve(localRA2.upper());
52 creator->importRecHits(
out, cleaned,
iEvent, iSetup);
55 if (
out->capacity() > 2 *
out->size())
57 if (cleaned->capacity() > 2 * cleaned->size())
58 cleaned->shrink_to_fit();
59 localRA1.update(
out->size());
60 localRA2.update(cleaned->size());
61 std::sort(
out->begin(),
out->end(), sortByDetId);
66 for (
auto& pfrechit : *
out) {