21 DataMixingEMWorker::DataMixingEMWorker() {}
25 : label_(ps.getParameter<std::
string>(
"Label"))
65 LogInfo(
"DataMixingEMWorker") <<
"===============> adding MC signals for " << e.
id();
74 EBRecHits = pEBRecHits.
product();
75 LogDebug(
"DataMixingEMWorker") <<
"total # EB rechits: " << EBRecHits->
size();
83 LogDebug(
"DataMixingEMWorker") <<
"processed EBRecHit with rawId: " << it->id().rawId() <<
"\n"
84 <<
" rechit energy: " << it->energy();
95 EERecHits = pEERecHits.
product();
96 LogDebug(
"DataMixingEMWorker") <<
"total # EE rechits: " << EERecHits->
size();
104 LogDebug(
"DataMixingEMWorker") <<
"processed EERecHit with rawId: " << it->id().rawId() <<
"\n"
105 <<
" rechit energy: " << it->energy();
116 ESRecHits = pESRecHits.
product();
118 LogDebug(
"DataMixingEMWorker") <<
"total # ES rechits: " << ESRecHits->
size();
128 LogDebug(
"DataMixingEMWorker") <<
"processed ESRecHit with rawId: " << it->id().rawId() <<
"\n"
129 <<
" rechit energy: " << it->energy();
138 unsigned int eventNr,
140 LogInfo(
"DataMixingEMWorker") <<
"\n===============> adding pileups from event " << ep->
id()
141 <<
" for bunchcrossing " << bcr;
148 std::shared_ptr<Wrapper<EBRecHitCollection>
const> EBRecHitsPTR =
154 LogDebug(
"DataMixingEMWorker") <<
"total # EB rechits: " << EBRecHits->
size();
161 LogDebug(
"DataMixingEMWorker") <<
"processed EBRecHit with rawId: " << it->id().rawId() <<
"\n"
162 <<
" rechit energy: " << it->energy();
169 std::shared_ptr<Wrapper<EERecHitCollection>
const> EERecHitsPTR =
175 LogDebug(
"DataMixingEMWorker") <<
"total # EE rechits: " << EERecHits->
size();
182 LogDebug(
"DataMixingEMWorker") <<
"processed EERecHit with rawId: " << it->id().rawId() <<
"\n"
183 <<
" rechit energy: " << it->energy();
190 std::shared_ptr<Wrapper<ESRecHitCollection>
const> ESRecHitsPTR =
196 LogDebug(
"DataMixingEMWorker") <<
"total # ES rechits: " << ESRecHits->
size();
203 LogDebug(
"DataMixingEMWorker") <<
"processed ESRecHit with rawId: " << it->id().rawId() <<
"\n"
204 <<
" rechit energy: " << it->energy();
225 EBRecHitMap::const_iterator iEBchk;
228 currentID = iEB->first;
230 if (currentID == formerID) {
232 ESum += (iEB->second).
energy();
237 EBrechits->push_back(aHit);
240 formerID = currentID;
241 ESum = (iEB->second).
energy();
242 EBTime = (iEB->second).time();
248 EBrechits->push_back(aHit);
260 EERecHitMap::const_iterator iEEchk;
263 currentID = iEE->first;
265 if (currentID == formerID) {
267 ESum += (iEE->second).
energy();
272 EErechits->push_back(aHit);
275 formerID = currentID;
276 ESum = (iEE->second).
energy();
277 EETime = (iEE->second).time();
283 EErechits->push_back(aHit);
295 ESRecHitMap::const_iterator iESchk;
298 currentID = iES->first;
300 if (currentID == formerID) {
302 ESum += (iES->second).
energy();
307 ESrechits->push_back(aHit);
310 formerID = currentID;
311 ESum = (iES->second).
energy();
312 ESTime = (iES->second).time();
318 ESrechits->push_back(aHit);
325 LogInfo(
"DataMixingEMWorker") <<
"total # EB Merged rechits: " << EBrechits->size();
326 LogInfo(
"DataMixingEMWorker") <<
"total # EE Merged rechits: " << EErechits->size();
327 LogInfo(
"DataMixingEMWorker") <<
"total # ES Merged rechits: " << ESrechits->size();
EBRecHitMap EBRecHitStorage_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void putEM(edm::Event &e)
void addEMSignals(const edm::Event &e)
edm::EDGetTokenT< EERecHitCollection > EEPileRecHitToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
EventID const & id() const
std::vector< EcalRecHit >::const_iterator const_iterator
virtual ~DataMixingEMWorker()
edm::InputTag EBrechitCollectionSig_
edm::InputTag ESProducerSig_
edm::InputTag ESPileRecHitInputTag_
Container::value_type value_type
std::string EBRecHitCollectionDM_
edm::EDGetTokenT< EERecHitCollection > EERecHitToken_
edm::InputTag EErechitCollectionSig_
edm::EDGetTokenT< EBRecHitCollection > EBRecHitToken_
edm::EDGetTokenT< ESRecHitCollection > ESPileRecHitToken_
const_iterator end() const
Log< level::Info, false > LogInfo
edm::EDGetTokenT< ESRecHitCollection > ESRecHitToken_
edm::InputTag ESrechitCollectionSig_
T const * product() const
std::string ESRecHitCollectionDM_
T getParameter(std::string const &) const
void addEMPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
edm::InputTag EBPileRecHitInputTag_
edm::InputTag EEProducerSig_
edm::InputTag EBProducerSig_
edm::InputTag EEPileRecHitInputTag_
ESRecHitMap ESRecHitStorage_
EERecHitMap EERecHitStorage_
std::string EERecHitCollectionDM_
edm::EDGetTokenT< EBRecHitCollection > EBPileRecHitToken_
const_iterator begin() const