test
CMS 3D CMS Logo

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

typedef int HcalTTPDigi::key_type

Definition at line 14 of file HcalTTPDigi.h.

Constructor & Destructor Documentation

HcalTTPDigi::HcalTTPDigi ( )

Definition at line 3 of file HcalTTPDigi.cc.

References algoDepend_, i, j, triggerInputs_, and triggerOutput_.

4  for (int i=0; i<8; i++) {
5  algoDepend_[i] = 0 ; triggerOutput_[i] = 0 ;
6  for (int j=0; j<5; j++) triggerInputs_[j*8+i] = 0 ;
7  }
8 }
int i
Definition: DBlmapReader.cc:9
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
unsigned int lPipe_
Definition: HcalTTPDigi.h:46
int presamples_
Definition: HcalTTPDigi.h:43
int j
Definition: DBlmapReader.cc:9
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::HcalTTPDigi ( int  identifier,
int  samples,
int  presamples,
unsigned int  fwVersion,
int  algorithm,
unsigned int  lPipe 
)

Definition at line 10 of file HcalTTPDigi.cc.

References algoDepend_, i, j, triggerInputs_, and triggerOutput_.

11  :
12  identifier_(identifier),
13  samples_(samples),
17  lPipe_(lPipe) {
18  for (int i=0; i<8; i++) {
19  algoDepend_[i] = 0x0 ; triggerOutput_[i] = 0x0 ;
20  for (int j=0; j<5; j++) triggerInputs_[i*5+j] = 0x0 ;
21  }
22 }
int i
Definition: DBlmapReader.cc:9
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
unsigned int lPipe_
Definition: HcalTTPDigi.h:46
int presamples() const
Definition: HcalTTPDigi.h:33
int presamples_
Definition: HcalTTPDigi.h:43
int j
Definition: DBlmapReader.cc:9
unsigned int fwVersion() const
Definition: HcalTTPDigi.h:35
int identifier_
Definition: HcalTTPDigi.h:42
uint8_t triggerOutput_[8]
Definition: HcalTTPDigi.h:50
int algorithm() const
Definition: HcalTTPDigi.h:34
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

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
uint32_t HcalTTPDigi::algorithmWord ( int  relativeSample = 0) const

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

Definition at line 61 of file HcalTTPDigi.cc.

References algoDepend_, presamples_, and samples_.

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

61  {
62  int linSample=presamples_+relativeSample;
63  if (linSample>=0 && linSample<samples_) return algoDepend_[linSample];
64  else return 0;
65 }
uint32_t algoDepend_[8]
Definition: HcalTTPDigi.h:49
int presamples_
Definition: HcalTTPDigi.h:43
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
int HcalTTPDigi::id ( void  ) const
inline

Definition at line 31 of file HcalTTPDigi.h.

References identifier_.

Referenced by operator<<().

31 { return identifier_ ; }
int identifier_
Definition: HcalTTPDigi.h:42
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 42 of file HcalTTPDigi.cc.

References i, presamples_, samples_, and triggerInputs_.

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

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

Definition at line 39 of file HcalTTPDigi.h.

39 { return !(*this == digi) ; }
bool HcalTTPDigi::operator== ( const HcalTTPDigi digi) const

Definition at line 67 of file HcalTTPDigi.cc.

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

67  {
68 
69  if (samples_ != digi.size() || presamples_ != digi.presamples()) return false ;
70  int relativeSize = digi.size() - digi.presamples() ;
71  for (int i=-this->presamples(); i<relativeSize; i++) {
72  if (this->inputPattern(i) != digi.inputPattern(i)) return false ;
73  if (this->algorithmWord(i) != digi.algorithmWord(i)) return false ;
74  if (this->triggerOutput(i) != digi.triggerOutput(i)) return false ;
75  }
76  return true ;
77 }
int i
Definition: DBlmapReader.cc:9
int size() const
Definition: HcalTTPDigi.h:32
uint32_t algorithmWord(int relativeSample=0) const
Definition: HcalTTPDigi.cc:61
int presamples() const
Definition: HcalTTPDigi.h:33
int presamples_
Definition: HcalTTPDigi.h:43
uint8_t triggerOutput(int relativeSample=0) const
Definition: HcalTTPDigi.cc:55
std::vector< bool > inputPattern(int relativeSample=0) const
Definition: HcalTTPDigi.cc:42
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
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
void HcalTTPDigi::setSample ( int  relativeSample,
const uint16_t *  triggerInputs,
const uint32_t  algodep,
const uint8_t  outputTrigger 
)

Definition at line 24 of file HcalTTPDigi.cc.

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

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

27  {
28 
29  int linSample=presamples_+relativeSample;
30  if (linSample>=0 && linSample<samples_) {
31  // Trigger input: 72 bits
32  for (int i=0; i<4; i++)
33  triggerInputs_[5*linSample+i] = triggerInputs[i] ;
34  triggerInputs_[5*linSample+4] = triggerInputs[4]&0xFF ;
35  // Algo dependency: 20 bits
36  algoDepend_[linSample] = algodep&0xFFFFF ;
37  // Trigger output: 4 bits
38  triggerOutput_[linSample] = outputTrigger&0xF ;
39  }
40 }
int i
Definition: DBlmapReader.cc:9
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
int HcalTTPDigi::size ( void  ) const
inline

Definition at line 32 of file HcalTTPDigi.h.

References samples_.

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

32 { return samples_ ; }
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 55 of file HcalTTPDigi.cc.

References presamples_, samples_, and triggerOutput_.

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

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

Member Data Documentation

uint32_t HcalTTPDigi::algoDepend_[8]
private

Definition at line 49 of file HcalTTPDigi.h.

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

int HcalTTPDigi::algorithm_
private

Definition at line 45 of file HcalTTPDigi.h.

Referenced by algorithm().

unsigned int HcalTTPDigi::fwVersion_
private

Definition at line 44 of file HcalTTPDigi.h.

Referenced by fwVersion().

int HcalTTPDigi::identifier_
private

Definition at line 42 of file HcalTTPDigi.h.

Referenced by id().

unsigned int HcalTTPDigi::lPipe_
private

Definition at line 46 of file HcalTTPDigi.h.

Referenced by pipelineLength().

int HcalTTPDigi::presamples_
private
int HcalTTPDigi::samples_
private

Definition at line 43 of file HcalTTPDigi.h.

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

uint16_t HcalTTPDigi::triggerInputs_[5 *8]
private

Definition at line 48 of file HcalTTPDigi.h.

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

uint8_t HcalTTPDigi::triggerOutput_[8]
private

Definition at line 50 of file HcalTTPDigi.h.

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