35 DataMixingHcalDigiWorker::DataMixingHcalDigiWorker() {sel_=0;}
39 label_(ps.getParameter<std::string>(
"Label"))
69 if(ZDCPileInputTag_.
label() !=
"") DoZDC_ =
true;
97 LogInfo(
"DataMixingHcalDigiWorker")<<
"===============> adding MC signals for "<<e.
id();
106 HBHEDigis = pHBHEDigis.
product();
107 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HBHE digis: " << HBHEDigis->
size();
116 it != HBHEDigis->
end(); ++it) {
122 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
138 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HBHEDigi with rawId: "
140 <<
" digi energy: " << it->energy();
155 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HO digis: " << HODigis->
size();
164 it != HODigis->
end(); ++it) {
169 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
178 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HODigi with rawId: "
180 <<
" digi energy: " << it->energy();
195 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HF digis: " << HFDigis->
size();
204 it != HFDigis->
end(); ++it) {
209 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
218 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HFDigi with rawId: "
220 <<
" digi energy: " << it->energy();
233 ZDCDigis = pZDCDigis.
product();
235 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # ZDC digis: " << ZDCDigis->
size();
244 it != ZDCDigis->
end(); ++it) {
249 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
258 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed ZDCDigi with rawId: "
260 <<
" digi energy: " << it->energy();
270 LogDebug(
"DataMixingHcalDigiWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
276 const HcalQIEShape* shape = conditions->getHcalShape ();
282 boost::shared_ptr<Wrapper<HBHEDigiCollection>
const> HBHEDigisPTR =
289 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HBHE digis: " << HBHEDigis->
size();
293 it != HBHEDigis->
end(); ++it) {
298 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
307 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HBHEDigi with rawId: "
309 <<
" digi energy: " << it->energy();
315 boost::shared_ptr<Wrapper<HODigiCollection>
const> HODigisPTR =
322 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HO digis: " << HODigis->
size();
326 it != HODigis->
end(); ++it) {
331 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
340 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HODigi with rawId: "
342 <<
" digi energy: " << it->energy();
350 boost::shared_ptr<Wrapper<HFDigiCollection>
const> HFDigisPTR =
357 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # HF digis: " << HFDigis->
size();
361 it != HFDigis->
end(); ++it) {
366 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
375 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed HFDigi with rawId: "
377 <<
" digi energy: " << it->energy();
388 boost::shared_ptr<Wrapper<ZDCDigiCollection>
const> ZDCDigisPTR =
395 LogDebug(
"DataMixingHcalDigiWorker") <<
"total # ZDC digis: " << ZDCDigis->
size();
399 it != ZDCDigis->
end(); ++it) {
404 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
413 LogDebug(
"DataMixingHcalDigiWorker") <<
"processed ZDCDigi with rawId: "
415 <<
" digi energy: " << it->energy();
437 const HcalQIEShape* shape = conditions->getHcalShape ();
451 HBHEDigiMap::const_iterator iHBchk;
456 currentID = iHB->first;
458 if (currentID == formerID) {
462 unsigned int sizenew = (iHB->second).
size();
463 unsigned int sizeold = HB_old.
size();
467 if(sizenew > sizeold) usenew =
true;
469 unsigned int max_samp =
std::max(sizenew, sizeold);
478 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
479 if(isamp < sizenew) {
480 fC_new = (iHB->second)[isamp];
484 if(isamp < sizeold) {
485 fC_old = HB_old[isamp];
490 fC_sum = fC_new + fC_old;
496 if(usenew) {HB_bigger[isamp] = fC_sum; }
497 else { HB_old[isamp] = fC_sum; }
500 if(usenew) HB_old = HB_bigger;
511 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
514 unsigned int sizeold = HB_old.
size();
515 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
516 coder.
fC2adc(HB_old,(HBHEdigis->back()), 0 );
520 formerID = currentID;
521 HB_old = iHB->second;
534 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
537 unsigned int sizenew = (iHB->second).
size();
538 for(
unsigned int isamp = 0; isamp<sizenew; isamp++) {
539 coder.
fC2adc(HB_old,(HBHEdigis->back()), 0 );
551 HODigiMap::const_iterator iHOchk;
556 currentID = iHO->first;
558 if (currentID == formerID) {
561 unsigned int sizenew = (iHO->second).
size();
562 unsigned int sizeold = HO_old.
size();
564 unsigned int max_samp =
std::max(sizenew, sizeold);
570 if(sizenew > sizeold) usenew =
true;
575 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
576 if(isamp < sizenew) {
577 fC_new = (iHO->second)[isamp];
581 if(isamp < sizeold) {
582 fC_old = HO_old[isamp];
587 fC_sum = fC_new + fC_old;
589 if(usenew) {HO_bigger[isamp] = fC_sum; }
590 else { HO_old[isamp] = fC_sum; }
593 if(usenew) HO_old = HO_bigger;
604 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
607 unsigned int sizeold = HO_old.
size();
608 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
609 coder.
fC2adc(HO_old,(HOdigis->back()), 0 );
613 formerID = currentID;
614 HO_old = iHO->second;
625 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
628 unsigned int sizeold = (iHO->second).
size();
629 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
630 coder.
fC2adc(HO_old,(HOdigis->back()), 0 );
642 HFDigiMap::const_iterator iHFchk;
647 currentID = iHF->first;
649 if (currentID == formerID) {
652 unsigned int sizenew = (iHF->second).
size();
653 unsigned int sizeold = HF_old.
size();
655 unsigned int max_samp =
std::max(sizenew, sizeold);
661 if(sizenew > sizeold) usenew =
true;
666 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
667 if(isamp < sizenew) {
668 fC_new = (iHF->second)[isamp];
672 if(isamp < sizeold) {
673 fC_old = HF_old[isamp];
678 fC_sum = fC_new + fC_old;
680 if(usenew) {HF_bigger[isamp] = fC_sum; }
681 else { HF_old[isamp] = fC_sum; }
684 if(usenew) HF_old = HF_bigger;
695 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
698 unsigned int sizeold = HF_old.
size();
699 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
700 coder.
fC2adc(HF_old,(HFdigis->back()), 0 );
704 formerID = currentID;
705 HF_old = iHF->second;
716 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
719 unsigned int sizeold = (iHF->second).
size();
720 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
721 coder.
fC2adc(HF_old,(HFdigis->back()), 0 );
734 ZDCDigiMap::const_iterator iZDCchk;
739 currentID = iZDC->first;
741 if (currentID == formerID) {
744 unsigned int sizenew = (iZDC->second).
size();
745 unsigned int sizeold = ZDC_old.
size();
747 unsigned int max_samp =
std::max(sizenew, sizeold);
753 if(sizenew > sizeold) usenew =
true;
758 for(
unsigned int isamp = 0; isamp<max_samp; isamp++) {
759 if(isamp < sizenew) {
760 fC_new = (iZDC->second)[isamp];
764 if(isamp < sizeold) {
765 fC_old = ZDC_old[isamp];
770 fC_sum = fC_new + fC_old;
772 if(usenew) {ZDC_bigger[isamp] = fC_sum; }
773 else { ZDC_old[isamp] = fC_sum; }
776 if(usenew) ZDC_old = ZDC_bigger;
787 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
790 unsigned int sizeold = ZDC_old.
size();
791 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
792 coder.
fC2adc(ZDC_old,(ZDCdigis->back()), 0 );
796 formerID = currentID;
797 ZDC_old = iZDC->second;
808 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
811 unsigned int sizeold = (iZDC->second).
size();
812 for(
unsigned int isamp = 0; isamp<sizeold; isamp++) {
813 coder.
fC2adc(ZDC_old,(ZDCdigis->back()), 0 );
824 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HBHE Merged digis: " << HBHEdigis->size() ;
825 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HO Merged digis: " << HOdigis->size() ;
826 LogInfo(
"DataMixingHcalDigiWorker") <<
"total # HF Merged digis: " << HFdigis->size() ;
827 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_
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
void addHcalPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, const edm::EventSetup &ES)
edm::InputTag HOPileInputTag_
edm::InputTag ZDCPileInputTag_
Container::value_type value_type
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_