34 consumesMany<ESRecHitCollection>();
35 produces<EcalRecHitCollection>(OutputLabelES_);
42 desc.
add<
bool>(
"debug",
false);
52 descriptions.
add(
"hltESRecHitsMerger", desc);
69 if (debug_)
std::cout <<
" ESRecHitMerger : Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
72 std::vector< edm::Handle<ESRecHitCollection> > EcalRecHits_done;
75 auto ESMergedRecHits = std::make_unique<EcalRecHitCollection>();
78 unsigned int nColl = EcalRecHits_done.size();
83 for (
unsigned int i=0;
i < nColl;
i++) {
86 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
90 std::cout<<
"ESrechit to be merged from "<<module_label.c_str()<<
" "<<instance.c_str()<<std::endl;
93 if ( module_label != EgammaSourceES_.label() &&
94 module_label != MuonsSourceES_.label() &&
95 module_label != JetsSourceES_.label() &&
96 module_label != TausSourceES_.label() &&
97 module_label != RestSourceES_.label() &&
98 module_label != Pi0SourceES_.label() &&
99 module_label != EtaSourceES_.label())
continue;
101 if (instance == InputRecHitES_) {
102 nES += EcalRecHits_done[
i] ->
size();
108 ESMergedRecHits -> reserve(nES);
110 if (debug_)
std::cout <<
" Number of ES Rechits to merge = " << nES << std::endl;
112 for (
unsigned int i=0;
i < nColl;
i++) {
115 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
116 if ( module_label != EgammaSourceES_.label() &&
117 module_label != MuonsSourceES_.label() &&
118 module_label != JetsSourceES_.label() &&
119 module_label != TausSourceES_.label() &&
120 module_label != RestSourceES_.label() &&
121 module_label != Pi0SourceES_.label() &&
122 module_label != EtaSourceES_.label() )
continue;
124 if (instance == InputRecHitES_) {
126 ESMergedRecHits -> push_back(*it);
void getManyByType(std::vector< Handle< PROD > > &results) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~ESRecHitsMerger() override
static PFTauRenderPlugin instance
void produce(edm::StreamID sid, edm::Event &e, const edm::EventSetup &c) const override
std::vector< EcalRecHit >::const_iterator const_iterator
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void endJob(void) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void beginJob(void) override
ESRecHitsMerger(const edm::ParameterSet &pset)