17 produces<reco::PFRecHitCollection>();
18 produces<reco::PFRecHitCollection>(
"Cleaned");
22 std::vector<edm::ParameterSet> creators = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"producers");
23 for (
unsigned int i=0;
i<creators.size();++
i) {
48 creator->init(iSetup);
60 auto out = std::make_unique<reco::PFRecHitCollection>();
61 auto cleaned = std::make_unique<reco::PFRecHitCollection>();
65 out->reserve(localRA1.upper());
66 cleaned->reserve(localRA2.upper());
69 creator->importRecHits(
out,cleaned,iEvent,iSetup);
72 if (
out->capacity()>2*
out->size())
out->shrink_to_fit();
73 if (cleaned->capacity()>2*cleaned->size()) cleaned->shrink_to_fit();
74 localRA1.update(
out->size());
75 localRA2.update(cleaned->size());
76 std::sort(
out->begin(),
out->end(),sortByDetId);
82 for(
auto& pfrechit : *
out ) {
83 navigator_->associateNeighbours(pfrechit,out,refProd);
T getParameter(std::string const &) const
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
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
virtual 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...
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual void endLuminosityBlock(edm::LuminosityBlock const &, const edm::EventSetup &) override
RefProd< PROD > getRefBeforePut()
PFRecHitProducer(const edm::ParameterSet &iConfig)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T get(const Candidate &c)
std::unique_ptr< PFRecHitNavigatorBase > navigator_