CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HcalTTPDigi Class Reference

#include <HcalTTPDigi.h>

Public Types

typedef int key_type
 

Public Member Functions

int algorithm () const
 
uint32_t algorithmWord (int relativeSample=0) const
 
unsigned int fwVersion () const
 
 HcalTTPDigi ()
 
 HcalTTPDigi (int identifier, int samples, int presamples, unsigned int fwVersion, int algorithm, unsigned int lPipe)
 
int id () const
 
std::vector< bool > inputPattern (int relativeSample=0) const
 
bool operator!= (const HcalTTPDigi &digi) const
 
bool operator== (const HcalTTPDigi &digi) const
 
unsigned int pipelineLength () const
 
int presamples () const
 
void setSample (int relativeSample, const uint16_t *triggerInputs, const uint32_t algodep, const uint8_t outputTrigger)
 
int size () const
 
uint8_t triggerOutput (int relativeSample=0) const
 

Private Attributes

uint32_t algoDepend_ [8]
 
int algorithm_
 
unsigned int fwVersion_
 
int identifier_
 
unsigned int lPipe_
 
int presamples_
 
int samples_
 
uint16_t triggerInputs_ [5 *8]
 
uint8_t triggerOutput_ [8]
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 12 of file HcalTTPDigi.h.

Member Typedef Documentation

◆ key_type

typedef int HcalTTPDigi::key_type

Definition at line 14 of file HcalTTPDigi.h.

Constructor & Destructor Documentation

◆ HcalTTPDigi() [1/2]

HcalTTPDigi::HcalTTPDigi ( )

Definition at line 3 of file HcalTTPDigi.cc.

References algoDepend_, mps_fire::i, dqmiolumiharvest::j, triggerInputs_, and triggerOutput_.

4  for (int i = 0; i < 8; i++) {
5  algoDepend_[i] = 0;
6  triggerOutput_[i] = 0;
7  for (int j = 0; j < 5; j++)
8  triggerInputs_[j * 8 + i] = 0;
9  }
10 }
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
unsigned int lPipe_
Definition: HcalTTPDigi.h:46
int presamples_
Definition: HcalTTPDigi.h:43
int identifier_
Definition: HcalTTPDigi.h:42
uint8_t triggerOutput_[8]
Definition: HcalTTPDigi.h:50
uint16_t triggerInputs_[5 *8]
Definition: HcalTTPDigi.h:48
int algorithm_
Definition: HcalTTPDigi.h:45
unsigned int fwVersion_
Definition: HcalTTPDigi.h:44

◆ HcalTTPDigi() [2/2]

HcalTTPDigi::HcalTTPDigi ( int  identifier,
int  samples,
int  presamples,
unsigned int  fwVersion,
int  algorithm,
unsigned int  lPipe 
)

Definition at line 12 of file HcalTTPDigi.cc.

References algoDepend_, mps_fire::i, dqmiolumiharvest::j, triggerInputs_, and triggerOutput_.

19  lPipe_(lPipe) {
20  for (int i = 0; i < 8; i++) {
21  algoDepend_[i] = 0x0;
22  triggerOutput_[i] = 0x0;
23  for (int j = 0; j < 5; j++)
24  triggerInputs_[i * 5 + j] = 0x0;
25  }
26 }
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
unsigned int fwVersion() const
Definition: HcalTTPDigi.h:35
unsigned int lPipe_
Definition: HcalTTPDigi.h:46
int presamples_
Definition: HcalTTPDigi.h:43
int identifier_
Definition: HcalTTPDigi.h:42
int algorithm() const
Definition: HcalTTPDigi.h:34
int presamples() const
Definition: HcalTTPDigi.h:33
uint8_t triggerOutput_[8]
Definition: HcalTTPDigi.h:50
uint16_t triggerInputs_[5 *8]
Definition: HcalTTPDigi.h:48
int algorithm_
Definition: HcalTTPDigi.h:45
unsigned int fwVersion_
Definition: HcalTTPDigi.h:44

Member Function Documentation

◆ algorithm()

int HcalTTPDigi::algorithm ( ) const
inline

Definition at line 34 of file HcalTTPDigi.h.

References algorithm_.

Referenced by operator<<().

34 { return algorithm_; }
int algorithm_
Definition: HcalTTPDigi.h:45

◆ algorithmWord()

uint32_t HcalTTPDigi::algorithmWord ( int  relativeSample = 0) const

get the "algorithm-dependent-word" for the given sample

Definition at line 65 of file HcalTTPDigi.cc.

References algoDepend_, presamples_, and samples_.

Referenced by operator<<(), and operator==().

65  {
66  int linSample = presamples_ + relativeSample;
67  if (linSample >= 0 && linSample < samples_)
68  return algoDepend_[linSample];
69  else
70  return 0;
71 }
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
int presamples_
Definition: HcalTTPDigi.h:43

◆ fwVersion()

unsigned int HcalTTPDigi::fwVersion ( ) const
inline

Definition at line 35 of file HcalTTPDigi.h.

References fwVersion_.

Referenced by operator<<().

35 { return fwVersion_; }
unsigned int fwVersion_
Definition: HcalTTPDigi.h:44

◆ id()

int HcalTTPDigi::id ( ) const
inline

Definition at line 31 of file HcalTTPDigi.h.

References identifier_.

Referenced by operator<<().

31 { return identifier_; }
int identifier_
Definition: HcalTTPDigi.h:42

◆ inputPattern()

std::vector< bool > HcalTTPDigi::inputPattern ( int  relativeSample = 0) const

get the input bit pattern for the given sample (relative to the SOI) the vector will be empty if there is no data for the requested sample

Definition at line 45 of file HcalTTPDigi.cc.

References mps_fire::i, presamples_, samples_, and triggerInputs_.

Referenced by operator<<(), and operator==().

45  {
46  std::vector<bool> retval;
47  int linSample = presamples_ + relativeSample;
48  if (linSample >= 0 && linSample < samples_) {
49  for (int i = 0; i < 72; i++) {
50  int ioff = i / 16;
51  retval.push_back(triggerInputs_[linSample * 5 + ioff] & (1 << (i % 16)));
52  }
53  }
54  return retval;
55 }
int presamples_
Definition: HcalTTPDigi.h:43
uint16_t triggerInputs_[5 *8]
Definition: HcalTTPDigi.h:48

◆ operator!=()

bool HcalTTPDigi::operator!= ( const HcalTTPDigi digi) const
inline

Definition at line 39 of file HcalTTPDigi.h.

39 { return !(*this == digi); }

◆ operator==()

bool HcalTTPDigi::operator== ( const HcalTTPDigi digi) const

Definition at line 73 of file HcalTTPDigi.cc.

References algorithmWord(), mps_fire::i, inputPattern(), presamples(), presamples_, samples_, size(), and triggerOutput().

73  {
74  if (samples_ != digi.size() || presamples_ != digi.presamples())
75  return false;
76  int relativeSize = digi.size() - digi.presamples();
77  for (int i = -this->presamples(); i < relativeSize; i++) {
78  if (this->inputPattern(i) != digi.inputPattern(i))
79  return false;
80  if (this->algorithmWord(i) != digi.algorithmWord(i))
81  return false;
82  if (this->triggerOutput(i) != digi.triggerOutput(i))
83  return false;
84  }
85  return true;
86 }
std::vector< bool > inputPattern(int relativeSample=0) const
Definition: HcalTTPDigi.cc:45
int size() const
Definition: HcalTTPDigi.h:32
int presamples_
Definition: HcalTTPDigi.h:43
uint32_t algorithmWord(int relativeSample=0) const
Definition: HcalTTPDigi.cc:65
int presamples() const
Definition: HcalTTPDigi.h:33
uint8_t triggerOutput(int relativeSample=0) const
Definition: HcalTTPDigi.cc:57

◆ pipelineLength()

unsigned int HcalTTPDigi::pipelineLength ( ) const
inline

Definition at line 36 of file HcalTTPDigi.h.

References lPipe_.

Referenced by operator<<().

36 { return lPipe_; }
unsigned int lPipe_
Definition: HcalTTPDigi.h:46

◆ presamples()

int HcalTTPDigi::presamples ( ) const
inline

Definition at line 33 of file HcalTTPDigi.h.

References presamples_.

Referenced by operator<<(), and operator==().

33 { return presamples_; }
int presamples_
Definition: HcalTTPDigi.h:43

◆ setSample()

void HcalTTPDigi::setSample ( int  relativeSample,
const uint16_t *  triggerInputs,
const uint32_t  algodep,
const uint8_t  outputTrigger 
)

Definition at line 28 of file HcalTTPDigi.cc.

References algoDepend_, mps_fire::i, presamples_, samples_, triggerInputs_, and triggerOutput_.

Referenced by HcalTTPDigiProducer::produce(), and HcalTTPUnpacker::unpack().

31  {
32  int linSample = presamples_ + relativeSample;
33  if (linSample >= 0 && linSample < samples_) {
34  // Trigger input: 72 bits
35  for (int i = 0; i < 4; i++)
36  triggerInputs_[5 * linSample + i] = triggerInputs[i];
37  triggerInputs_[5 * linSample + 4] = triggerInputs[4] & 0xFF;
38  // Algo dependency: 20 bits
39  algoDepend_[linSample] = algodep & 0xFFFFF;
40  // Trigger output: 4 bits
41  triggerOutput_[linSample] = outputTrigger & 0xF;
42  }
43 }
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
int presamples_
Definition: HcalTTPDigi.h:43
uint8_t triggerOutput_[8]
Definition: HcalTTPDigi.h:50
uint16_t triggerInputs_[5 *8]
Definition: HcalTTPDigi.h:48

◆ size()

int HcalTTPDigi::size ( void  ) const
inline

◆ triggerOutput()

uint8_t HcalTTPDigi::triggerOutput ( int  relativeSample = 0) const

get the output trigger bit set for the given sample (relative to the SOI) the vector will be empty if there is no data for the requested sample

Definition at line 57 of file HcalTTPDigi.cc.

References presamples_, samples_, and triggerOutput_.

Referenced by operator<<(), and operator==().

57  {
58  int linSample = presamples_ + relativeSample;
59  if (linSample >= 0 && linSample < samples_)
60  return triggerOutput_[linSample];
61  else
62  return 0;
63 }
int presamples_
Definition: HcalTTPDigi.h:43
uint8_t triggerOutput_[8]
Definition: HcalTTPDigi.h:50

Member Data Documentation

◆ algoDepend_

uint32_t HcalTTPDigi::algoDepend_[8]
private

Definition at line 49 of file HcalTTPDigi.h.

Referenced by algorithmWord(), HcalTTPDigi(), and setSample().

◆ algorithm_

int HcalTTPDigi::algorithm_
private

Definition at line 45 of file HcalTTPDigi.h.

Referenced by algorithm().

◆ fwVersion_

unsigned int HcalTTPDigi::fwVersion_
private

Definition at line 44 of file HcalTTPDigi.h.

Referenced by fwVersion().

◆ identifier_

int HcalTTPDigi::identifier_
private

Definition at line 42 of file HcalTTPDigi.h.

Referenced by id().

◆ lPipe_

unsigned int HcalTTPDigi::lPipe_
private

Definition at line 46 of file HcalTTPDigi.h.

Referenced by pipelineLength().

◆ presamples_

int HcalTTPDigi::presamples_
private

◆ samples_

int HcalTTPDigi::samples_
private

Definition at line 43 of file HcalTTPDigi.h.

Referenced by algorithmWord(), inputPattern(), operator==(), setSample(), size(), and triggerOutput().

◆ triggerInputs_

uint16_t HcalTTPDigi::triggerInputs_[5 *8]
private

Definition at line 48 of file HcalTTPDigi.h.

Referenced by HcalTTPDigi(), inputPattern(), and setSample().

◆ triggerOutput_

uint8_t HcalTTPDigi::triggerOutput_[8]
private

Definition at line 50 of file HcalTTPDigi.h.

Referenced by HcalTTPDigi(), setSample(), and triggerOutput().