43 produces<EcalRecHitCollection>(OutputLabelEB_);
44 produces<EcalRecHitCollection>(OutputLabelEE_);
56 desc.
add<
bool>(
"debug",
false);
73 descriptions.
add(
"hltEcalRecHitsMerger", desc);
84 if (debug_)
std::cout <<
" EcalRecHitMerger : Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
86 std::vector< edm::Handle<EcalRecHitCollection> > EcalRecHits_done;
92 unsigned int nColl = EcalRecHits_done.size();
98 for (
unsigned int i=0;
i < nColl;
i++) {
101 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
103 if ( module_label != EgammaSourceEB_.label() &&
104 module_label != MuonsSourceEB_.label() &&
105 module_label != JetsSourceEB_.label() &&
106 module_label != TausSourceEB_.label() &&
107 module_label != RestSourceEB_.label() &&
108 module_label != Pi0SourceEB_.label() )
continue;
110 if (instance == InputRecHitEB_) {
111 nEB += EcalRecHits_done[
i] ->
size();
113 else if (instance == InputRecHitEE_) {
114 nEE += EcalRecHits_done[
i] ->
size();
119 EBMergedRecHits -> reserve(nEB);
120 EEMergedRecHits -> reserve(nEE);
121 if (debug_)
std::cout <<
" Number of EB Rechits to merge = " << nEB << std::endl;
122 if (debug_)
std::cout <<
" Number of EE Rechits to merge = " << nEE << std::endl;
124 for (
unsigned int i=0;
i < nColl;
i++) {
127 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
128 if ( module_label != EgammaSourceEB_.label() &&
129 module_label != MuonsSourceEB_.label() &&
130 module_label != JetsSourceEB_.label() &&
131 module_label != TausSourceEB_.label() &&
132 module_label != RestSourceEB_.label() &&
133 module_label != Pi0SourceEB_.label() )
continue;
135 if (instance == InputRecHitEB_) {
137 EBMergedRecHits -> push_back(*it);
140 else if (instance == InputRecHitEE_) {
142 EEMergedRecHits -> push_back(*it);
150 e.
put(EBMergedRecHits,OutputLabelEB_);
151 e.
put(EEMergedRecHits,OutputLabelEE_);
void getManyByType(std::vector< Handle< PROD > > &results) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static PFTauRenderPlugin instance
EcalRecHitsMerger(const edm::ParameterSet &pset)
std::vector< EcalRecHit >::const_iterator const_iterator
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void beginJob(void) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual ~EcalRecHitsMerger()
void endJob(void) override
tuple size
Write out results.
void produce(edm::Event &e, const edm::EventSetup &c) override