CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CalibFormats/CaloTPG/src/HcalTPGCompressor.cc

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