23 DataMixingHcalWorker::DataMixingHcalWorker() { }
27 label_(ps.getParameter<
std::
string>(
"Label"))
74 LogInfo(
"DataMixingHcalWorker")<<
"===============> adding MC signals for "<<e.
id();
83 HBHERecHits = pHBHERecHits.
product();
84 LogDebug(
"DataMixingHcalWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
92 it != HBHERecHits->
end(); ++it) {
97 LogDebug(
"DataMixingHcalWorker") <<
"processed HBHERecHit with rawId: " 99 <<
" rechit energy: " << it->energy();
112 HORecHits = pHORecHits.
product();
114 LogDebug(
"DataMixingHcalWorker") <<
"total # HO rechits: " << HORecHits->
size();
123 it != HORecHits->
end(); ++it) {
128 LogDebug(
"DataMixingHcalWorker") <<
"processed HORecHit with rawId: " 130 <<
" rechit energy: " << it->energy();
143 HFRecHits = pHFRecHits.
product();
145 LogDebug(
"DataMixingHcalWorker") <<
"total # HF rechits: " << HFRecHits->
size();
154 it != HFRecHits->
end(); ++it) {
159 LogDebug(
"DataMixingHcalWorker") <<
"processed HFRecHit with rawId: " 161 <<
" rechit energy: " << it->energy();
174 ZDCRecHits = pZDCRecHits.
product();
176 LogDebug(
"DataMixingHcalWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
185 it != ZDCRecHits->
end(); ++it) {
190 LogDebug(
"DataMixingHcalWorker") <<
"processed ZDCRecHit with rawId: " 192 <<
" rechit energy: " << it->energy();
203 LogDebug(
"DataMixingHcalWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
209 std::shared_ptr<Wrapper<HBHERecHitCollection>
const> HBHERecHitsPTR =
212 if(HBHERecHitsPTR ) {
216 LogDebug(
"DataMixingEMWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
220 it != HBHERecHits->
end(); ++it) {
225 LogDebug(
"DataMixingEMWorker") <<
"processed HBHERecHit with rawId: " 226 << it->id().rawId() <<
"\n" 227 <<
" rechit energy: " << it->energy();
234 std::shared_ptr<Wrapper<HORecHitCollection>
const> HORecHitsPTR =
241 LogDebug(
"DataMixingEMWorker") <<
"total # HO rechits: " << HORecHits->
size();
245 it != HORecHits->
end(); ++it) {
250 LogDebug(
"DataMixingEMWorker") <<
"processed HORecHit with rawId: " 251 << it->id().rawId() <<
"\n" 252 <<
" rechit energy: " << it->energy();
259 std::shared_ptr<Wrapper<HFRecHitCollection>
const> HFRecHitsPTR =
266 LogDebug(
"DataMixingEMWorker") <<
"total # HF rechits: " << HFRecHits->
size();
270 it != HFRecHits->
end(); ++it) {
275 LogDebug(
"DataMixingEMWorker") <<
"processed HFRecHit with rawId: " 276 << it->id().rawId() <<
"\n" 277 <<
" rechit energy: " << it->energy();
284 std::shared_ptr<Wrapper<ZDCRecHitCollection>
const> ZDCRecHitsPTR =
291 LogDebug(
"DataMixingEMWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
295 it != ZDCRecHits->
end(); ++it) {
300 LogDebug(
"DataMixingEMWorker") <<
"processed ZDCRecHit with rawId: " 301 << it->id().rawId() <<
"\n" 302 <<
" rechit energy: " << it->energy();
326 HBHERecHitMap::const_iterator iHBchk;
331 currentID = iHB->first;
333 if (currentID == formerID) {
335 ESum+=(iHB->second).energy();
342 HBHErechits->push_back( aHit );
345 formerID = currentID;
346 ESum = (iHB->second).energy();
347 HBTime = (iHB->second).
time();
353 HBHErechits->push_back( aHit );
364 HORecHitMap::const_iterator iHOchk;
369 currentID = iHO->first;
371 if (currentID == formerID) {
373 ESum+=(iHO->second).energy();
379 HORecHit aHit(formerID, ESum, HOTime);
380 HOrechits->push_back( aHit );
383 formerID = currentID;
384 ESum = (iHO->second).energy();
385 HOTime = (iHO->second).
time();
390 HORecHit aHit(formerID, ESum, HOTime);
391 HOrechits->push_back( aHit );
403 HFRecHitMap::const_iterator iHFchk;
408 currentID = iHF->first;
410 if (currentID == formerID) {
412 ESum+=(iHF->second).energy();
418 HFRecHit aHit(formerID, ESum, HFTime);
419 HFrechits->push_back( aHit );
422 formerID = currentID;
423 ESum = (iHF->second).energy();
424 HFTime = (iHF->second).
time();
429 HFRecHit aHit(formerID, ESum, HBTime);
430 HFrechits->push_back( aHit );
440 float lowGainEnergy = 0;
443 ZDCRecHitMap::const_iterator iZDCchk;
448 currentID = iZDC->first;
450 if (currentID == formerID) {
452 ESum+=(iZDC->second).energy();
458 ZDCRecHit aHit(formerID, ESum, ZDCTime, lowGainEnergy);
459 ZDCrechits->push_back( aHit );
462 formerID = currentID;
463 ESum = (iZDC->second).energy();
464 lowGainEnergy = (iZDC->second).lowGainEnergy();
465 ZDCTime = (iZDC->second).
time();
470 ZDCRecHit aHit(formerID, ESum, HBTime, lowGainEnergy);
471 ZDCrechits->push_back( aHit );
478 LogInfo(
"DataMixingHcalWorker") <<
"total # HBHE Merged rechits: " << HBHErechits->size() ;
479 LogInfo(
"DataMixingHcalWorker") <<
"total # HO Merged rechits: " << HOrechits->size() ;
480 LogInfo(
"DataMixingHcalWorker") <<
"total # HF Merged rechits: " << HFrechits->size() ;
481 LogInfo(
"DataMixingHcalWorker") <<
"total # ZDC Merged rechits: " << ZDCrechits->size() ;
T getParameter(std::string const &) const
std::string HORecHitCollectionDM_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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_
Container::value_type value_type
edm::EDGetTokenT< HFRecHitCollection > HFRecHitToken_
edm::InputTag HBHErechitCollectionSig_
edm::InputTag HBHEPileRecHitInputTag_
std::string HFRecHitCollectionDM_
edm::InputTag HOPileRecHitInputTag_
edm::InputTag ZDCrechitCollectionSig_
const_iterator end() const
T const * product() const
edm::EDGetTokenT< HBHERecHitCollection > HBHERecHitToken_
edm::EDGetTokenT< HFRecHitCollection > HFRecHitPToken_
edm::InputTag ZDCPileRecHitInputTag_
edm::InputTag HFrechitCollectionSig_
void putHcal(edm::Event &e)
HORecHitMap HORecHitStorage_
edm::EDGetTokenT< HORecHitCollection > HORecHitPToken_
virtual ~DataMixingHcalWorker()
const_iterator begin() const