CMS 3D CMS Logo

Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/EventFilter/HcalRawToDigi/src/HcalPacker.cc File Reference

#include "EventFilter/HcalRawToDigi/interface/HcalPacker.h"
#include "EventFilter/HcalRawToDigi/interface/HcalHTRData.h"
#include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h"
#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/FEDRawData/interface/FEDTrailer.h"
#include "FWCore/Utilities/interface/CRC16.h"

Go to the source code of this file.

Functions

template<class Coll , class DetIdClass >
int process (const Coll *pt, const DetId &did, unsigned short *buffer, int &presamples, bool &isUS, bool &isMP)
static unsigned char processTrig (const HcalTrigPrimDigiCollection *pt, const HcalTrigTowerDetId &tid, unsigned short *buffer)

Function Documentation

template<class Coll , class DetIdClass >
int process ( const Coll *  pt,
const DetId did,
unsigned short *  buffer,
int &  presamples,
bool &  isUS,
bool &  isMP 
)

Definition at line 19 of file HcalPacker.cc.

References i, j, and findQualityFiles::size.

                                                                                                              {
  isUS=false; isMP=false;
  if (pt==0) return 0;
  int size=0;
  typename Coll::const_iterator i=pt->find(DetIdClass(did));
  if (i!=pt->end()) {
    isUS=i->zsUnsuppressed();
    isMP=i->zsMarkAndPass();
    presamples=i->presamples();
    size=i->size();
    for (int j=0; j<size; j++) 
      buffer[j]=(*i)[j].raw();
  }
  return size;
}
static unsigned char processTrig ( const HcalTrigPrimDigiCollection pt,
const HcalTrigTowerDetId tid,
unsigned short *  buffer 
) [static]

Definition at line 35 of file HcalPacker.cc.

References edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), i, j, and findQualityFiles::size.

Referenced by HcalPacker::pack().

                                                                                                                              {
  if (pt==0) return 0;
  int size=0;
  HcalTrigPrimDigiCollection::const_iterator i=pt->find(tid);
  if (i!=pt->end()) {
    int presamples=i->presamples();
    int samples=i->size();

    for (int j=0; j<samples; j++) {
       buffer[j]=(*i)[j].raw();
       if (j==presamples) buffer[j]|=0x0200;
    }
  }
  return size;
}