test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
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.

19  {
20  isUS=false; isMP=false;
21  if (pt==0) { return 0; }
22  int size=0;
23  typename Coll::const_iterator i=pt->find(DetIdClass(did));
24  if (i!=pt->end()) {
25  isUS=i->zsUnsuppressed();
26  isMP=i->zsMarkAndPass();
27  presamples=i->presamples();
28  size=i->size();
29  for (int j=0; j<size; j++) {
30  buffer[j]=(*i)[j].raw();
31  }
32  }
33  return size;
34 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
tuple size
Write out results.
static unsigned char processTrig ( const HcalTrigPrimDigiCollection pt,
const HcalTrigTowerDetId tid,
unsigned short *  buffer 
)
static

Definition at line 36 of file HcalPacker.cc.

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

Referenced by HcalPacker::pack().

36  {
37  if (pt==0) { return 0; }
38  int size=0;
40  bool any_nonzero=false;
41  if (i!=pt->end()) {
42  int presamples=i->presamples();
43  size=i->size();
44 
45  for (int j=0; j<size; j++) {
46  buffer[j]=(*i)[j].raw();
47  if ((buffer[j]&0x1FF)!=0) any_nonzero=true;
48  if (j==presamples) { buffer[j]|=0x0200; }
49  }
50  }
51  return (any_nonzero)?(size):(0);
52 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalTriggerPrimitiveDigi >::const_iterator const_iterator
int j
Definition: DBlmapReader.cc:9
const_iterator end() const
iterator find(key_type k)
tuple size
Write out results.