CMS 3D CMS Logo

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 mps_fire::i, dqmiolumiharvest::j, and findQualityFiles::size.

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

Definition at line 39 of file HcalPacker.cc.

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

Referenced by HcalPacker::pack().

41  {
42  if (pt == nullptr) {
43  return 0;
44  }
45  int size = 0;
47  bool any_nonzero = false;
48  if (i != pt->end()) {
49  int presamples = i->presamples();
50  size = i->size();
51 
52  for (int j = 0; j < size; j++) {
53  buffer[j] = (*i)[j].raw();
54  if ((buffer[j] & 0x1FF) != 0)
55  any_nonzero = true;
56  if (j == presamples) {
57  buffer[j] |= 0x0200;
58  }
59  }
60  }
61  return (any_nonzero) ? (size) : (0);
62 }
size
Write out results.
std::vector< T >::const_iterator const_iterator
const_iterator end() const
iterator find(key_type k)