CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CalibFormats/CaloTPG/src/EcalTPGCompressor.cc

Go to the documentation of this file.
00001 #include "CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h"
00002 #include "CalibFormats/CaloTPG/interface/EcalTPGCompressor.h"
00003 
00004 EcalTPGCompressor::EcalTPGCompressor(const CaloTPGTranscoder* coder) : coder_(coder) {
00005 }
00006   
00007 void EcalTPGCompressor::compress(const IntegerCaloSamples& ics, const std::vector<bool>& fineGrain, EcalTriggerPrimitiveDigi& digi) const {
00008   digi.setSize(ics.size());
00009   for (int i=0; i<ics.size(); i++)
00010     digi.setSample(i,coder_->ecalCompress(ics.id(),ics[i],fineGrain[i]));
00011 }
00012 
00013 EcalTriggerPrimitiveSample EcalTPGCompressor::compress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const {
00014   return coder_->ecalCompress(id, sample, fineGrain);
00015 }