CMS 3D CMS Logo

HcalUnpacker_impl Namespace Reference


Functions

template<class DigiClass>
const HcalQIESampleunpack (const HcalQIESample *startPoint, const HcalQIESample *limit, DigiClass &digi, int presamples, const HcalElectronicsId &eid, int startSample, int endSample)


Function Documentation

template<class DigiClass>
const HcalQIESample* HcalUnpacker_impl::unpack ( const HcalQIESample startPoint,
const HcalQIESample limit,
DigiClass &  digi,
int  presamples,
const HcalElectronicsId eid,
int  startSample,
int  endSample 
) [inline]

Definition at line 10 of file HcalUnpacker.cc.

References HcalQIESample::fiberAndChan().

Referenced by CSCSPEvent::unpack().

00010                                                                                                                                                                                           {
00011     // set parameters
00012     digi.setPresamples(presamples);
00013     digi.setReadoutIds(eid);
00014 
00015     // what is my sample number?
00016     int myFiberChan=startPoint->fiberAndChan();
00017     int ncurr=0,ntaken=0;
00018     const HcalQIESample* qie_work=startPoint;
00019     while (qie_work!=limit && qie_work->fiberAndChan()==myFiberChan) {
00020       if (ncurr>=startSample && ncurr<=endSample) {
00021         digi.setSample(ntaken,*qie_work);
00022         ++ntaken;
00023       }
00024       ncurr++;
00025       qie_work++;
00026     }
00027     digi.setSize(ntaken);
00028     return qie_work;
00029   }


Generated on Tue Jun 9 18:47:25 2009 for CMSSW by  doxygen 1.5.4