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) {
36 creator->init(iSetup);
45 auto out = std::make_unique<reco::PFRecHitCollection>();
46 auto cleaned = std::make_unique<reco::PFRecHitCollection>();
50 out->reserve(localRA1.upper());
51 cleaned->reserve(localRA2.upper());
54 creator->importRecHits(
out, cleaned, iEvent, iSetup);
57 if (
out->capacity() > 2 *
out->size())
59 if (cleaned->capacity() > 2 * cleaned->size())
60 cleaned->shrink_to_fit();
61 localRA1.update(
out->size());
62 localRA2.update(cleaned->size());
63 std::sort(
out->begin(),
out->end(), sortByDetId);
68 for (
auto& pfrechit : *
out) {
69 navigator_->associateNeighbours(pfrechit, out, refProd);
T getParameter(std::string const &) const
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
~PFRecHitProducer() override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
def create(alignables, pedeDump, additionalData, outputFile, config)
unsigned detId() const
rechit detId
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
void produce(edm::Event &, const edm::EventSetup &) override
void addDefault(ParameterSetDescription const &psetDescription)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
void endLuminosityBlock(edm::LuminosityBlock const &, const edm::EventSetup &) override
RefProd< PROD > getRefBeforePut()
PFRecHitProducer(const edm::ParameterSet &iConfig)
void beginLuminosityBlock(edm::LuminosityBlock const &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::unique_ptr< PFRecHitNavigatorBase > navigator_