41 produces<EcalRecHitCollection>(OutputLabelEB_);
42 produces<EcalRecHitCollection>(OutputLabelEE_);
60 if (debug_)
std::cout <<
" EcalRecHitMerger : Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
62 std::vector< edm::Handle<EcalRecHitCollection> > EcalRecHits_done;
68 unsigned int nColl = EcalRecHits_done.size();
74 for (
unsigned int i=0;
i < nColl;
i++) {
77 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
79 if ( module_label != EgammaSourceEB_.label() &&
80 module_label != MuonsSourceEB_.label() &&
81 module_label != JetsSourceEB_.label() &&
82 module_label != TausSourceEB_.label() &&
83 module_label != RestSourceEB_.label() &&
84 module_label != Pi0SourceEB_.label() )
continue;
86 if (instance == InputRecHitEB_) {
87 nEB += EcalRecHits_done[
i] ->
size();
89 else if (instance == InputRecHitEE_) {
90 nEE += EcalRecHits_done[
i] ->
size();
95 EBMergedRecHits -> reserve(nEB);
96 EEMergedRecHits -> reserve(nEE);
97 if (debug_)
std::cout <<
" Number of EB Rechits to merge = " << nEB << std::endl;
98 if (debug_)
std::cout <<
" Number of EE Rechits to merge = " << nEE << std::endl;
100 for (
unsigned int i=0;
i < nColl;
i++) {
103 std::string module_label = EcalRecHits_done[
i].provenance()->moduleLabel();
104 if ( module_label != EgammaSourceEB_.label() &&
105 module_label != MuonsSourceEB_.label() &&
106 module_label != JetsSourceEB_.label() &&
107 module_label != TausSourceEB_.label() &&
108 module_label != RestSourceEB_.label() &&
109 module_label != Pi0SourceEB_.label() )
continue;
111 if (instance == InputRecHitEB_) {
113 EBMergedRecHits -> push_back(*it);
116 else if (instance == InputRecHitEE_) {
118 EEMergedRecHits -> push_back(*it);
126 e.
put(EBMergedRecHits,OutputLabelEB_);
127 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 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.
virtual ~EcalRecHitsMerger()
tuple size
Write out results.
void produce(edm::Event &e, const edm::EventSetup &c)