35 DataMixingHcalDigiWorker::DataMixingHcalDigiWorker() {sel_=0;}
39 label_(ps.getParameter<std::string>(
"Label"))
94 LogInfo(
"DataMixingHcalDigiWorker")<<
"===============> adding MC signals for "<<e.
id();
103 HBHEDigis = pHBHEDigis.
product();
104 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HBHE digis: " << HBHEDigis->
size();
113 it != HBHEDigis->
end(); ++it) {
119 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
135 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HBHEDigi with rawId: "
137 <<
" digi energy: " << it->energy();
152 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HO digis: " << HODigis->
size();
161 it != HODigis->
end(); ++it) {
166 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
175 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HODigi with rawId: "
177 <<
" digi energy: " << it->energy();
192 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HF digis: " << HFDigis->
size();
201 it != HFDigis->
end(); ++it) {
206 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
215 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HFDigi with rawId: "
217 <<
" digi energy: " << it->energy();
230 ZDCDigis = pZDCDigis.
product();
232 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # ZDC digis: " << ZDCDigis->
size();
241 it != ZDCDigis->
end(); ++it) {
246 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
255 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed ZDCDigi with rawId: "
257 <<
" digi energy: " << it->energy();
267 LogDebug(
"DataMixingHcalDigiWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
273 const HcalQIEShape* shape = conditions->getHcalShape ();
279 boost::shared_ptr<Wrapper<HBHEDigiCollection>
const> HBHEDigisPTR =
286 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HBHE digis: " << HBHEDigis->
size();
290 it != HBHEDigis->
end(); ++it) {
295 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
304 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HBHEDigi with rawId: "
306 <<
" digi energy: " << it->energy();
312 boost::shared_ptr<Wrapper<HODigiCollection>
const> HODigisPTR =
319 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HO digis: " << HODigis->
size();
323 it != HODigis->
end(); ++it) {
328 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
337 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HODigi with rawId: "
339 <<
" digi energy: " << it->energy();
347 boost::shared_ptr<Wrapper<HFDigiCollection>
const> HFDigisPTR =
354 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HF digis: " << HFDigis->
size();
358 it != HFDigis->
end(); ++it) {
363 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
372 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HFDigi with rawId: "
374 <<
" digi energy: " << it->energy();
382 boost::shared_ptr<Wrapper<ZDCDigiCollection>
const> ZDCDigisPTR =
389 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # ZDC digis: " << ZDCDigis->
size();
393 it != ZDCDigis->
end(); ++it) {
398 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
407 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed ZDCDigi with rawId: "
409 <<
" digi energy: " << it->energy();
431 const HcalQIEShape* shape = conditions->getHcalShape ();
445 HBHEDigiMap::const_iterator iHBchk;
450 currentID = iHB->first;
452 if (currentID == formerID) {
456 unsigned int sizenew = (iHB->second).
size();
457 unsigned int sizeold = HB_old.
size();
461 if(sizenew > sizeold) usenew =
true;
463 unsigned int max_samp =
std::max(sizenew, sizeold);
472 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
473 if(isamp < sizenew) {
474 fC_new = (iHB->second)[isamp];
478 if(isamp < sizeold) {
479 fC_old = HB_old[isamp];
484 fC_sum = fC_new + fC_old;
490 if(usenew) {HB_bigger[isamp] = fC_sum; }
491 else { HB_old[isamp] = fC_sum; }
494 if(usenew) HB_old = HB_bigger;
505 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
508 unsigned int sizeold = HB_old.
size();
509 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
510 coder.
fC2adc(HB_old,(HBHEdigis->back()), 0 );
514 formerID = currentID;
515 HB_old = iHB->second;
528 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
531 unsigned int sizenew = (iHB->second).
size();
532 for(
unsigned int isamp = 0; isamp<sizenew; isamp++) {
533 coder.
fC2adc(HB_old,(HBHEdigis->back()), 0 );
545 HODigiMap::const_iterator iHOchk;
550 currentID = iHO->first;
552 if (currentID == formerID) {
555 unsigned int sizenew = (iHO->second).
size();
556 unsigned int sizeold = HO_old.
size();
558 unsigned int max_samp =
std::max(sizenew, sizeold);
564 if(sizenew > sizeold) usenew =
true;
569 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
570 if(isamp < sizenew) {
571 fC_new = (iHO->second)[isamp];
575 if(isamp < sizeold) {
576 fC_old = HO_old[isamp];
581 fC_sum = fC_new + fC_old;
583 if(usenew) {HO_bigger[isamp] = fC_sum; }
584 else { HO_old[isamp] = fC_sum; }
587 if(usenew) HO_old = HO_bigger;
598 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
601 unsigned int sizeold = HO_old.
size();
602 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
603 coder.
fC2adc(HO_old,(HOdigis->back()), 0 );
607 formerID = currentID;
608 HO_old = iHO->second;
619 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
622 unsigned int sizeold = (iHO->second).
size();
623 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
624 coder.
fC2adc(HO_old,(HOdigis->back()), 0 );
636 HFDigiMap::const_iterator iHFchk;
641 currentID = iHF->first;
643 if (currentID == formerID) {
646 unsigned int sizenew = (iHF->second).
size();
647 unsigned int sizeold = HF_old.
size();
649 unsigned int max_samp =
std::max(sizenew, sizeold);
655 if(sizenew > sizeold) usenew =
true;
660 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
661 if(isamp < sizenew) {
662 fC_new = (iHF->second)[isamp];
666 if(isamp < sizeold) {
667 fC_old = HF_old[isamp];
672 fC_sum = fC_new + fC_old;
674 if(usenew) {HF_bigger[isamp] = fC_sum; }
675 else { HF_old[isamp] = fC_sum; }
678 if(usenew) HF_old = HF_bigger;
689 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
692 unsigned int sizeold = HF_old.
size();
693 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
694 coder.
fC2adc(HF_old,(HFdigis->back()), 0 );
698 formerID = currentID;
699 HF_old = iHF->second;
710 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
713 unsigned int sizeold = (iHF->second).
size();
714 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
715 coder.
fC2adc(HF_old,(HFdigis->back()), 0 );
728 ZDCDigiMap::const_iterator iZDCchk;
733 currentID = iZDC->first;
735 if (currentID == formerID) {
738 unsigned int sizenew = (iZDC->second).
size();
739 unsigned int sizeold = ZDC_old.
size();
741 unsigned int max_samp =
std::max(sizenew, sizeold);
747 if(sizenew > sizeold) usenew =
true;
752 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
753 if(isamp < sizenew) {
754 fC_new = (iZDC->second)[isamp];
758 if(isamp < sizeold) {
759 fC_old = ZDC_old[isamp];
764 fC_sum = fC_new + fC_old;
766 if(usenew) {ZDC_bigger[isamp] = fC_sum; }
767 else { ZDC_old[isamp] = fC_sum; }
770 if(usenew) ZDC_old = ZDC_bigger;
781 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
784 unsigned int sizeold = ZDC_old.
size();
785 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
786 coder.
fC2adc(ZDC_old,(ZDCdigis->back()), 0 );
790 formerID = currentID;
791 ZDC_old = iZDC->second;
802 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
805 unsigned int sizeold = (iZDC->second).
size();
806 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
807 coder.
fC2adc(ZDC_old,(ZDCdigis->back()), 0 );
818 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HBHE Merged digis: " << HBHEdigis->size() ;
819 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HO Merged digis: " << HOdigis->size() ;
820 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HF Merged digis: " << HFdigis->size() ;
821 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # ZDC Merged digis: " << ZDCdigis->size() ;
T getParameter(std::string const &) const
std::string HBHEDigiCollectionDM_
edm::InputTag HBHEPileInputTag_
std::string ZDCDigiCollectionDM_
EventID const & id() const
edm::InputTag HBHEdigiCollectionSig_
std::string HODigiCollectionDM_
std::vector< T >::const_iterator const_iterator
HBHEDigiMap HBHEDigiStorage_
void addHcalPileups(const int bcr, edm::EventPrincipal *, unsigned int EventId, const edm::EventSetup &ES)
Container::value_type value_type
ZDCDigiMap ZDCDigiStorage_
virtual void fC2adc(const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const
const T & max(const T &a, const T &b)
void putHcal(edm::Event &e, const edm::EventSetup &ES)
edm::InputTag HFPileInputTag_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
edm::InputTag HOPileInputTag_
edm::InputTag ZDCPileInputTag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag ZDCdigiCollectionSig_
const_iterator end() const
int size() const
get the size
edm::InputTag HFdigiCollectionSig_
virtual ~DataMixingHcalDigiWorker()
T const * product() const
std::string HFDigiCollectionDM_
DetId id() const
get the (generic) id
void addHcalSignals(const edm::Event &e, const edm::EventSetup &ES)
tuple size
Write out results.
const_iterator begin() const
edm::InputTag HOdigiCollectionSig_