27 DataMixingHcalWorker::DataMixingHcalWorker() { }
31 label_(ps.getParameter<std::
string>(
"Label"))
67 LogInfo(
"DataMixingHcalWorker")<<
"===============> adding MC signals for "<<e.
id();
76 HBHERecHits = pHBHERecHits.
product();
77 LogDebug(
"DataMixingHcalWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
85 it != HBHERecHits->
end(); ++it) {
90 LogDebug(
"DataMixingHcalWorker") <<
"processed HBHERecHit with rawId: "
92 <<
" rechit energy: " << it->energy();
105 HORecHits = pHORecHits.
product();
107 LogDebug(
"DataMixingHcalWorker") <<
"total # HO rechits: " << HORecHits->
size();
116 it != HORecHits->
end(); ++it) {
121 LogDebug(
"DataMixingHcalWorker") <<
"processed HORecHit with rawId: "
123 <<
" rechit energy: " << it->energy();
136 HFRecHits = pHFRecHits.
product();
138 LogDebug(
"DataMixingHcalWorker") <<
"total # HF rechits: " << HFRecHits->
size();
147 it != HFRecHits->
end(); ++it) {
152 LogDebug(
"DataMixingHcalWorker") <<
"processed HFRecHit with rawId: "
154 <<
" rechit energy: " << it->energy();
167 ZDCRecHits = pZDCRecHits.
product();
169 LogDebug(
"DataMixingHcalWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
178 it != ZDCRecHits->
end(); ++it) {
183 LogDebug(
"DataMixingHcalWorker") <<
"processed ZDCRecHit with rawId: "
185 <<
" rechit energy: " << it->energy();
195 LogDebug(
"DataMixingHcalWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
201 boost::shared_ptr<Wrapper<HBHERecHitCollection>
const> HBHERecHitsPTR =
204 if(HBHERecHitsPTR ) {
208 LogDebug(
"DataMixingEMWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
212 it != HBHERecHits->
end(); ++it) {
217 LogDebug(
"DataMixingEMWorker") <<
"processed HBHERecHit with rawId: "
218 << it->id().rawId() <<
"\n"
219 <<
" rechit energy: " << it->energy();
226 boost::shared_ptr<Wrapper<HORecHitCollection>
const> HORecHitsPTR =
233 LogDebug(
"DataMixingEMWorker") <<
"total # HO rechits: " << HORecHits->
size();
237 it != HORecHits->
end(); ++it) {
242 LogDebug(
"DataMixingEMWorker") <<
"processed HORecHit with rawId: "
243 << it->id().rawId() <<
"\n"
244 <<
" rechit energy: " << it->energy();
251 boost::shared_ptr<Wrapper<HFRecHitCollection>
const> HFRecHitsPTR =
258 LogDebug(
"DataMixingEMWorker") <<
"total # HF rechits: " << HFRecHits->
size();
262 it != HFRecHits->
end(); ++it) {
267 LogDebug(
"DataMixingEMWorker") <<
"processed HFRecHit with rawId: "
268 << it->id().rawId() <<
"\n"
269 <<
" rechit energy: " << it->energy();
276 boost::shared_ptr<Wrapper<ZDCRecHitCollection>
const> ZDCRecHitsPTR =
283 LogDebug(
"DataMixingEMWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
287 it != ZDCRecHits->
end(); ++it) {
292 LogDebug(
"DataMixingEMWorker") <<
"processed ZDCRecHit with rawId: "
293 << it->id().rawId() <<
"\n"
294 <<
" rechit energy: " << it->energy();
318 HBHERecHitMap::const_iterator iHBchk;
323 currentID = iHB->first;
325 if (currentID == formerID) {
327 ESum+=(iHB->second).
energy();
334 HBHErechits->push_back( aHit );
337 formerID = currentID;
338 ESum = (iHB->second).
energy();
339 HBTime = (iHB->second).
time();
345 HBHErechits->push_back( aHit );
356 HORecHitMap::const_iterator iHOchk;
361 currentID = iHO->first;
363 if (currentID == formerID) {
365 ESum+=(iHO->second).
energy();
371 HORecHit aHit(formerID, ESum, HOTime);
372 HOrechits->push_back( aHit );
375 formerID = currentID;
376 ESum = (iHO->second).
energy();
377 HOTime = (iHO->second).
time();
382 HORecHit aHit(formerID, ESum, HOTime);
383 HOrechits->push_back( aHit );
396 HFRecHitMap::const_iterator iHFchk;
401 currentID = iHF->first;
403 if (currentID == formerID) {
405 ESum+=(iHF->second).
energy();
411 HFRecHit aHit(formerID, ESum, HFTime);
412 HFrechits->push_back( aHit );
415 formerID = currentID;
416 ESum = (iHF->second).
energy();
417 HFTime = (iHF->second).
time();
422 HFRecHit aHit(formerID, ESum, HBTime);
423 HFrechits->push_back( aHit );
433 float lowGainEnergy = 0;
436 ZDCRecHitMap::const_iterator iZDCchk;
441 currentID = iZDC->first;
443 if (currentID == formerID) {
445 ESum+=(iZDC->second).
energy();
451 ZDCRecHit aHit(formerID, ESum, ZDCTime, lowGainEnergy);
452 ZDCrechits->push_back( aHit );
455 formerID = currentID;
456 ESum = (iZDC->second).
energy();
457 lowGainEnergy = (iZDC->second).lowGainEnergy();
458 ZDCTime = (iZDC->second).
time();
463 ZDCRecHit aHit(formerID, ESum, HBTime, lowGainEnergy);
464 ZDCrechits->push_back( aHit );
471 LogInfo(
"DataMixingHcalWorker") <<
"total # HBHE Merged rechits: " << HBHErechits->size() ;
472 LogInfo(
"DataMixingHcalWorker") <<
"total # HO Merged rechits: " << HOrechits->size() ;
473 LogInfo(
"DataMixingHcalWorker") <<
"total # HF Merged rechits: " << HFrechits->size() ;
474 LogInfo(
"DataMixingHcalWorker") <<
"total # ZDC Merged rechits: " << ZDCrechits->size() ;
T getParameter(std::string const &) const
std::string HORecHitCollectionDM_
void addHcalSignals(const edm::Event &e)
void addHcalPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId)
HBHERecHitMap HBHERecHitStorage_
EventID const & id() const
std::vector< T >::const_iterator const_iterator
ZDCRecHitMap ZDCRecHitStorage_
std::string HBHERecHitCollectionDM_
HFRecHitMap HFRecHitStorage_
edm::InputTag HFPileRecHitInputTag_
edm::InputTag HOrechitCollectionSig_
std::string ZDCRecHitCollectionDM_
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_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag HOPileRecHitInputTag_
edm::InputTag ZDCrechitCollectionSig_
const_iterator end() const
T const * product() const
edm::InputTag ZDCPileRecHitInputTag_
edm::InputTag HFrechitCollectionSig_
void putHcal(edm::Event &e)
HORecHitMap HORecHitStorage_
virtual ~DataMixingHcalWorker()
const_iterator begin() const