27 DataMixingHcalWorker::DataMixingHcalWorker() { }
31 label_(ps.getParameter<std::
string>(
"Label"))
78 LogInfo(
"DataMixingHcalWorker")<<
"===============> adding MC signals for "<<e.
id();
87 HBHERecHits = pHBHERecHits.
product();
88 LogDebug(
"DataMixingHcalWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
96 it != HBHERecHits->
end(); ++it) {
101 LogDebug(
"DataMixingHcalWorker") <<
"processed HBHERecHit with rawId: "
103 <<
" rechit energy: " << it->energy();
116 HORecHits = pHORecHits.
product();
118 LogDebug(
"DataMixingHcalWorker") <<
"total # HO rechits: " << HORecHits->
size();
127 it != HORecHits->
end(); ++it) {
132 LogDebug(
"DataMixingHcalWorker") <<
"processed HORecHit with rawId: "
134 <<
" rechit energy: " << it->energy();
147 HFRecHits = pHFRecHits.
product();
149 LogDebug(
"DataMixingHcalWorker") <<
"total # HF rechits: " << HFRecHits->
size();
158 it != HFRecHits->
end(); ++it) {
163 LogDebug(
"DataMixingHcalWorker") <<
"processed HFRecHit with rawId: "
165 <<
" rechit energy: " << it->energy();
178 ZDCRecHits = pZDCRecHits.
product();
180 LogDebug(
"DataMixingHcalWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
189 it != ZDCRecHits->
end(); ++it) {
194 LogDebug(
"DataMixingHcalWorker") <<
"processed ZDCRecHit with rawId: "
196 <<
" rechit energy: " << it->energy();
207 LogDebug(
"DataMixingHcalWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
213 boost::shared_ptr<Wrapper<HBHERecHitCollection>
const> HBHERecHitsPTR =
216 if(HBHERecHitsPTR ) {
220 LogDebug(
"DataMixingEMWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
224 it != HBHERecHits->
end(); ++it) {
229 LogDebug(
"DataMixingEMWorker") <<
"processed HBHERecHit with rawId: "
230 << it->id().rawId() <<
"\n"
231 <<
" rechit energy: " << it->energy();
238 boost::shared_ptr<Wrapper<HORecHitCollection>
const> HORecHitsPTR =
245 LogDebug(
"DataMixingEMWorker") <<
"total # HO rechits: " << HORecHits->
size();
249 it != HORecHits->
end(); ++it) {
254 LogDebug(
"DataMixingEMWorker") <<
"processed HORecHit with rawId: "
255 << it->id().rawId() <<
"\n"
256 <<
" rechit energy: " << it->energy();
263 boost::shared_ptr<Wrapper<HFRecHitCollection>
const> HFRecHitsPTR =
270 LogDebug(
"DataMixingEMWorker") <<
"total # HF rechits: " << HFRecHits->
size();
274 it != HFRecHits->
end(); ++it) {
279 LogDebug(
"DataMixingEMWorker") <<
"processed HFRecHit with rawId: "
280 << it->id().rawId() <<
"\n"
281 <<
" rechit energy: " << it->energy();
288 boost::shared_ptr<Wrapper<ZDCRecHitCollection>
const> ZDCRecHitsPTR =
295 LogDebug(
"DataMixingEMWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
299 it != ZDCRecHits->
end(); ++it) {
304 LogDebug(
"DataMixingEMWorker") <<
"processed ZDCRecHit with rawId: "
305 << it->id().rawId() <<
"\n"
306 <<
" rechit energy: " << it->energy();
330 HBHERecHitMap::const_iterator iHBchk;
335 currentID = iHB->first;
337 if (currentID == formerID) {
339 ESum+=(iHB->second).
energy();
346 HBHErechits->push_back( aHit );
349 formerID = currentID;
350 ESum = (iHB->second).
energy();
351 HBTime = (iHB->second).
time();
357 HBHErechits->push_back( aHit );
368 HORecHitMap::const_iterator iHOchk;
373 currentID = iHO->first;
375 if (currentID == formerID) {
377 ESum+=(iHO->second).
energy();
383 HORecHit aHit(formerID, ESum, HOTime);
384 HOrechits->push_back( aHit );
387 formerID = currentID;
388 ESum = (iHO->second).
energy();
389 HOTime = (iHO->second).
time();
394 HORecHit aHit(formerID, ESum, HOTime);
395 HOrechits->push_back( aHit );
408 HFRecHitMap::const_iterator iHFchk;
413 currentID = iHF->first;
415 if (currentID == formerID) {
417 ESum+=(iHF->second).
energy();
423 HFRecHit aHit(formerID, ESum, HFTime);
424 HFrechits->push_back( aHit );
427 formerID = currentID;
428 ESum = (iHF->second).
energy();
429 HFTime = (iHF->second).
time();
434 HFRecHit aHit(formerID, ESum, HBTime);
435 HFrechits->push_back( aHit );
445 float lowGainEnergy = 0;
448 ZDCRecHitMap::const_iterator iZDCchk;
453 currentID = iZDC->first;
455 if (currentID == formerID) {
457 ESum+=(iZDC->second).
energy();
463 ZDCRecHit aHit(formerID, ESum, ZDCTime, lowGainEnergy);
464 ZDCrechits->push_back( aHit );
467 formerID = currentID;
468 ESum = (iZDC->second).
energy();
469 lowGainEnergy = (iZDC->second).lowGainEnergy();
470 ZDCTime = (iZDC->second).
time();
475 ZDCRecHit aHit(formerID, ESum, HBTime, lowGainEnergy);
476 ZDCrechits->push_back( aHit );
483 LogInfo(
"DataMixingHcalWorker") <<
"total # HBHE Merged rechits: " << HBHErechits->size() ;
484 LogInfo(
"DataMixingHcalWorker") <<
"total # HO Merged rechits: " << HOrechits->size() ;
485 LogInfo(
"DataMixingHcalWorker") <<
"total # HF Merged rechits: " << HFrechits->size() ;
486 LogInfo(
"DataMixingHcalWorker") <<
"total # ZDC Merged rechits: " << ZDCrechits->size() ;
T getParameter(std::string const &) const
std::string HORecHitCollectionDM_
void addHcalSignals(const edm::Event &e)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void addHcalPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
HBHERecHitMap HBHERecHitStorage_
EventID const & id() const
std::vector< HBHERecHit >::const_iterator const_iterator
edm::EDGetTokenT< ZDCRecHitCollection > ZDCRecHitToken_
ZDCRecHitMap ZDCRecHitStorage_
edm::EDGetTokenT< ZDCRecHitCollection > ZDCRecHitPToken_
std::string HBHERecHitCollectionDM_
HFRecHitMap HFRecHitStorage_
edm::InputTag HFPileRecHitInputTag_
edm::EDGetTokenT< HORecHitCollection > HORecHitToken_
edm::InputTag HOrechitCollectionSig_
edm::EDGetTokenT< HBHERecHitCollection > HBHERecHitPToken_
std::string ZDCRecHitCollectionDM_
edm::EDGetTokenT< HFRecHitCollection > HFRecHitToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag HBHErechitCollectionSig_
edm::InputTag HBHEPileRecHitInputTag_
Container::value_type value_type
std::string HFRecHitCollectionDM_
edm::InputTag HOPileRecHitInputTag_
edm::InputTag ZDCrechitCollectionSig_
const_iterator end() const
edm::EDGetTokenT< HBHERecHitCollection > HBHERecHitToken_
edm::EDGetTokenT< HFRecHitCollection > HFRecHitPToken_
T const * product() const
edm::InputTag ZDCPileRecHitInputTag_
edm::InputTag HFrechitCollectionSig_
void putHcal(edm::Event &e)
HORecHitMap HORecHitStorage_
edm::EDGetTokenT< HORecHitCollection > HORecHitPToken_
virtual ~DataMixingHcalWorker()
const_iterator begin() const