28 DataMixingHcalWorker::DataMixingHcalWorker() { }
32 label_(ps.getParameter<std::
string>(
"Label"))
79 LogInfo(
"DataMixingHcalWorker")<<
"===============> adding MC signals for "<<e.
id();
88 HBHERecHits = pHBHERecHits.
product();
89 LogDebug(
"DataMixingHcalWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
97 it != HBHERecHits->
end(); ++it) {
102 LogDebug(
"DataMixingHcalWorker") <<
"processed HBHERecHit with rawId: "
104 <<
" rechit energy: " << it->energy();
117 HORecHits = pHORecHits.
product();
119 LogDebug(
"DataMixingHcalWorker") <<
"total # HO rechits: " << HORecHits->
size();
128 it != HORecHits->
end(); ++it) {
133 LogDebug(
"DataMixingHcalWorker") <<
"processed HORecHit with rawId: "
135 <<
" rechit energy: " << it->energy();
148 HFRecHits = pHFRecHits.
product();
150 LogDebug(
"DataMixingHcalWorker") <<
"total # HF rechits: " << HFRecHits->
size();
159 it != HFRecHits->
end(); ++it) {
164 LogDebug(
"DataMixingHcalWorker") <<
"processed HFRecHit with rawId: "
166 <<
" rechit energy: " << it->energy();
179 ZDCRecHits = pZDCRecHits.
product();
181 LogDebug(
"DataMixingHcalWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
190 it != ZDCRecHits->
end(); ++it) {
195 LogDebug(
"DataMixingHcalWorker") <<
"processed ZDCRecHit with rawId: "
197 <<
" rechit energy: " << it->energy();
208 LogDebug(
"DataMixingHcalWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
214 std::shared_ptr<Wrapper<HBHERecHitCollection>
const> HBHERecHitsPTR =
217 if(HBHERecHitsPTR ) {
221 LogDebug(
"DataMixingEMWorker") <<
"total # HBHE rechits: " << HBHERecHits->
size();
225 it != HBHERecHits->
end(); ++it) {
230 LogDebug(
"DataMixingEMWorker") <<
"processed HBHERecHit with rawId: "
231 << it->id().rawId() <<
"\n"
232 <<
" rechit energy: " << it->energy();
239 std::shared_ptr<Wrapper<HORecHitCollection>
const> HORecHitsPTR =
246 LogDebug(
"DataMixingEMWorker") <<
"total # HO rechits: " << HORecHits->
size();
250 it != HORecHits->
end(); ++it) {
255 LogDebug(
"DataMixingEMWorker") <<
"processed HORecHit with rawId: "
256 << it->id().rawId() <<
"\n"
257 <<
" rechit energy: " << it->energy();
264 std::shared_ptr<Wrapper<HFRecHitCollection>
const> HFRecHitsPTR =
271 LogDebug(
"DataMixingEMWorker") <<
"total # HF rechits: " << HFRecHits->
size();
275 it != HFRecHits->
end(); ++it) {
280 LogDebug(
"DataMixingEMWorker") <<
"processed HFRecHit with rawId: "
281 << it->id().rawId() <<
"\n"
282 <<
" rechit energy: " << it->energy();
289 std::shared_ptr<Wrapper<ZDCRecHitCollection>
const> ZDCRecHitsPTR =
296 LogDebug(
"DataMixingEMWorker") <<
"total # ZDC rechits: " << ZDCRecHits->
size();
300 it != ZDCRecHits->
end(); ++it) {
305 LogDebug(
"DataMixingEMWorker") <<
"processed ZDCRecHit with rawId: "
306 << it->id().rawId() <<
"\n"
307 <<
" rechit energy: " << it->energy();
331 HBHERecHitMap::const_iterator iHBchk;
336 currentID = iHB->first;
338 if (currentID == formerID) {
340 ESum+=(iHB->second).
energy();
347 HBHErechits->push_back( aHit );
350 formerID = currentID;
351 ESum = (iHB->second).
energy();
352 HBTime = (iHB->second).
time();
358 HBHErechits->push_back( aHit );
369 HORecHitMap::const_iterator iHOchk;
374 currentID = iHO->first;
376 if (currentID == formerID) {
378 ESum+=(iHO->second).
energy();
384 HORecHit aHit(formerID, ESum, HOTime);
385 HOrechits->push_back( aHit );
388 formerID = currentID;
389 ESum = (iHO->second).
energy();
390 HOTime = (iHO->second).
time();
395 HORecHit aHit(formerID, ESum, HOTime);
396 HOrechits->push_back( aHit );
409 HFRecHitMap::const_iterator iHFchk;
414 currentID = iHF->first;
416 if (currentID == formerID) {
418 ESum+=(iHF->second).
energy();
424 HFRecHit aHit(formerID, ESum, HFTime);
425 HFrechits->push_back( aHit );
428 formerID = currentID;
429 ESum = (iHF->second).
energy();
430 HFTime = (iHF->second).
time();
435 HFRecHit aHit(formerID, ESum, HBTime);
436 HFrechits->push_back( aHit );
446 float lowGainEnergy = 0;
449 ZDCRecHitMap::const_iterator iZDCchk;
454 currentID = iZDC->first;
456 if (currentID == formerID) {
458 ESum+=(iZDC->second).
energy();
464 ZDCRecHit aHit(formerID, ESum, ZDCTime, lowGainEnergy);
465 ZDCrechits->push_back( aHit );
468 formerID = currentID;
469 ESum = (iZDC->second).
energy();
470 lowGainEnergy = (iZDC->second).lowGainEnergy();
471 ZDCTime = (iZDC->second).
time();
476 ZDCRecHit aHit(formerID, ESum, HBTime, lowGainEnergy);
477 ZDCrechits->push_back( aHit );
484 LogInfo(
"DataMixingHcalWorker") <<
"total # HBHE Merged rechits: " << HBHErechits->size() ;
485 LogInfo(
"DataMixingHcalWorker") <<
"total # HO Merged rechits: " << HOrechits->size() ;
486 LogInfo(
"DataMixingHcalWorker") <<
"total # HF Merged rechits: " << HFrechits->size() ;
487 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
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