CMS 3D CMS Logo

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

#include <CSCCFEBStatusDigi.h>

Public Member Functions

 CSCCFEBStatusDigi (int cfebnmb)
 Construct from the CFEB number (1-5). More...
 
 CSCCFEBStatusDigi (int cfebnmb, const std::vector< uint16_t > &crcWords, const std::vector< uint16_t > &contrWords, const std::vector< uint16_t > &bWords)
 Constructor for all variables. More...
 
 CSCCFEBStatusDigi ()
 Default construction. More...
 
int getCFEBNmb () const
 Get the CFEB number. More...
 
std::vector< uint16_t > getCRC () const
 Get CRC per each time sample. More...
 
std::vector< int > getL1A_PHASE () const
 Get L1A_PHASE bit from SCA Controller data per each time slice. More...
 
std::vector< int > getLCT_PHASE () const
 Get LCT_PHASE bit from SCA Controller data per each time slice. More...
 
std::vector< int > getSCA_BLK () const
 Get SCA_BLK 4 bit word from SCA Controller data per each time slice. More...
 
std::vector< int > getSCA_FULL () const
 Get SCA_FULL bit from SCA Controller data per each time slice. More...
 
std::vector< uint16_t > getSCAFullCond () const
 Get SCA Full Condition. More...
 
std::vector< int > getTRIG_TIME () const
 Get TRIG_TIME 8 bit word from SCA Controller data per each time slice. More...
 
std::vector< int > getTS_FLAG () const
 Get TS_FLAG bit from SCA Controller data per each time slice. More...
 
void print () const
 Print content of digi. More...
 
void setCRC (const std::vector< uint16_t > &crc)
 Set CRC vector. More...
 
void setSCAC (const std::vector< uint16_t > &scac)
 Set SCAC (SCA Controller) vector. More...
 
int ShiftSel (int nmb, int nshift, int nsel) const
 Shift and select. More...
 

Private Attributes

std::vector< uint16_t > bWords_
 
uint16_t cfebnmb_
 
std::vector< uint16_t > contrWords_
 
std::vector< uint16_t > crcWords_
 

Detailed Description

Digi for CSC CFEB status.

Author
N. Terentiev, CMU

Definition at line 17 of file CSCCFEBStatusDigi.h.

Constructor & Destructor Documentation

◆ CSCCFEBStatusDigi() [1/3]

CSCCFEBStatusDigi::CSCCFEBStatusDigi ( int  cfebnmb)
inline

Construct from the CFEB number (1-5).

Definition at line 20 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

20 { cfebnmb_ = cfebnmb; }

◆ CSCCFEBStatusDigi() [2/3]

CSCCFEBStatusDigi::CSCCFEBStatusDigi ( int  cfebnmb,
const std::vector< uint16_t > &  crcWords,
const std::vector< uint16_t > &  contrWords,
const std::vector< uint16_t > &  bWords 
)
inline

Constructor for all variables.

Definition at line 23 of file CSCCFEBStatusDigi.h.

References bWords_, cfebnmb_, contrWords_, and crcWords_.

26  {
27  cfebnmb_ = cfebnmb;
28  crcWords_ = crcWords;
29  contrWords_ = contrWords;
30  bWords_ = bWords;
31  }
std::vector< uint16_t > crcWords_
std::vector< uint16_t > contrWords_
std::vector< uint16_t > bWords_

◆ CSCCFEBStatusDigi() [3/3]

CSCCFEBStatusDigi::CSCCFEBStatusDigi ( )
inline

Default construction.

Definition at line 34 of file CSCCFEBStatusDigi.h.

34 {}

Member Function Documentation

◆ getCFEBNmb()

int CSCCFEBStatusDigi::getCFEBNmb ( ) const
inline

Get the CFEB number.

Definition at line 43 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

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

43 { return cfebnmb_; }

◆ getCRC()

std::vector<uint16_t> CSCCFEBStatusDigi::getCRC ( ) const
inline

Get CRC per each time sample.

Definition at line 49 of file CSCCFEBStatusDigi.h.

References crcWords_.

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

49 { return crcWords_; }
std::vector< uint16_t > crcWords_

◆ getL1A_PHASE()

std::vector< int > CSCCFEBStatusDigi::getL1A_PHASE ( ) const

Get L1A_PHASE bit from SCA Controller data per each time slice.

Definition at line 60 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

60  {
61  std::vector<int> vec(contrWords_.size(), 0);
62  int nmb;
63  for (unsigned int i = 0; i < vec.size(); i++) {
64  nmb = contrWords_[i];
65  vec[i] = ShiftSel(nmb, 12, 1);
66  }
67  return vec;
68 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ getLCT_PHASE()

std::vector< int > CSCCFEBStatusDigi::getLCT_PHASE ( ) const

Get LCT_PHASE bit from SCA Controller data per each time slice.

Definition at line 49 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

49  {
50  std::vector<int> vec(contrWords_.size(), 0);
51  int nmb;
52  for (unsigned int i = 0; i < vec.size(); i++) {
53  nmb = contrWords_[i];
54  vec[i] = ShiftSel(nmb, 13, 1);
55  }
56  return vec;
57 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ getSCA_BLK()

std::vector< int > CSCCFEBStatusDigi::getSCA_BLK ( ) const

Get SCA_BLK 4 bit word from SCA Controller data per each time slice.

Definition at line 71 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

71  {
72  std::vector<int> vec(contrWords_.size(), 0);
73  int nmb;
74  for (unsigned int i = 0; i < vec.size(); i++) {
75  nmb = contrWords_[i];
76  vec[i] = ShiftSel(nmb, 8, 15);
77  }
78  return vec;
79 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ getSCA_FULL()

std::vector< int > CSCCFEBStatusDigi::getSCA_FULL ( ) const

Get SCA_FULL bit from SCA Controller data per each time slice.

Definition at line 38 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

38  {
39  std::vector<int> vec(contrWords_.size(), 0);
40  int nmb;
41  for (unsigned int i = 0; i < vec.size(); i++) {
42  nmb = contrWords_[i];
43  vec[i] = ShiftSel(nmb, 14, 1);
44  }
45  return vec;
46 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ getSCAFullCond()

std::vector< uint16_t > CSCCFEBStatusDigi::getSCAFullCond ( ) const

Get SCA Full Condition.

Definition at line 14 of file CSCCFEBStatusDigi.cc.

References bWords_.

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

14  {
15  /* std::vector<int> vec(4,0);
16  vec[0]=ShiftSel(SCAFullCond_,0,15); // 4-bit FIFO1 word count
17  vec[1]=ShiftSel(SCAFullCond_,4,15); // 4-bit Block Number if Error Code=1
18  // (CFEB: SCA Capacitors Full)
19  // 4-bit FIFO3 word count if Error Code=2
20  // (CFEB: FPGA FIFO full)
21  vec[2]=ShiftSel(SCAFullCond_,9,7); // Error Code
22  vec[3]=ShiftSel(SCAFullCond_,12,15); // DDU Code, should be 0xB
23  return vec;*/
24  return bWords_;
25 }
std::vector< uint16_t > bWords_

◆ getTRIG_TIME()

std::vector< int > CSCCFEBStatusDigi::getTRIG_TIME ( ) const

Get TRIG_TIME 8 bit word from SCA Controller data per each time slice.

Definition at line 82 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

82  {
83  std::vector<int> vec(contrWords_.size(), 0);
84  int nmb;
85  for (unsigned int i = 0; i < vec.size(); i++) {
86  nmb = contrWords_[i];
87  vec[i] = ShiftSel(nmb, 0, 255);
88  }
89  return vec;
90 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ getTS_FLAG()

std::vector< int > CSCCFEBStatusDigi::getTS_FLAG ( ) const

Get TS_FLAG bit from SCA Controller data per each time slice.

Definition at line 27 of file CSCCFEBStatusDigi.cc.

References contrWords_, mps_fire::i, and ShiftSel().

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

27  {
28  std::vector<int> vec(contrWords_.size(), 0);
29  int nmb;
30  for (unsigned int i = 0; i < vec.size(); i++) {
31  nmb = contrWords_[i];
32  vec[i] = ShiftSel(nmb, 15, 1);
33  }
34  return vec;
35 }
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_

◆ print()

void CSCCFEBStatusDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 93 of file CSCCFEBStatusDigi.cc.

References relativeConstraints::empty, getCFEBNmb(), getCRC(), getL1A_PHASE(), getLCT_PHASE(), getSCA_BLK(), getSCA_FULL(), getSCAFullCond(), getTRIG_TIME(), getTS_FLAG(), and mps_fire::i.

93  {
94  edm::LogVerbatim("CSCDigi") << "CSC CFEB # : " << getCFEBNmb();
95 
96  std::ostringstream ost;
97  ost << " SCAFullCond: ";
98  if (!getSCAFullCond().empty()) {
99  for (size_t i = 0; i < 4; ++i) {
100  ost << " " << (getSCAFullCond())[i];
101  }
102  } else {
103  ost << " "
104  << "BWORD is not valid";
105  }
106  edm::LogVerbatim("CSCDigi") << ost.str();
107 
108  ost.clear();
109  ost << " CRC: ";
110  for (size_t i = 0; i < getCRC().size(); ++i) {
111  ost << " " << (getCRC())[i];
112  }
113  edm::LogVerbatim("CSCDigi") << ost.str();
114 
115  ost.clear();
116  ost << " TS_FLAG: ";
117  for (size_t i = 0; i < getTS_FLAG().size(); ++i) {
118  ost << " " << (getTS_FLAG())[i];
119  }
120  edm::LogVerbatim("CSCDigi") << ost.str();
121 
122  ost.clear();
123  ost << " SCA_FULL: ";
124  for (size_t i = 0; i < getSCA_FULL().size(); ++i) {
125  ost << " " << (getSCA_FULL())[i];
126  }
127  edm::LogVerbatim("CSCDigi") << ost.str();
128 
129  ost.clear();
130  ost << " LCT_PHASE: ";
131  for (size_t i = 0; i < getLCT_PHASE().size(); ++i) {
132  ost << " " << (getLCT_PHASE())[i];
133  }
134  edm::LogVerbatim("CSCDigi") << ost.str();
135 
136  ost.clear();
137  ost << " L1A_PHASE: ";
138  for (size_t i = 0; i < getL1A_PHASE().size(); ++i) {
139  ost << " " << (getL1A_PHASE())[i];
140  }
141  edm::LogVerbatim("CSCDigi") << ost.str();
142 
143  ost.clear();
144  ost << " SCA_BLK: ";
145  for (size_t i = 0; i < getSCA_BLK().size(); ++i) {
146  ost << " " << (getSCA_BLK())[i];
147  }
148  edm::LogVerbatim("CSCDigi") << ost.str();
149 
150  ost.clear();
151  ost << " TRIG_TIME: ";
152  for (size_t i = 0; i < getTRIG_TIME().size(); ++i) {
153  ost << " " << (getTRIG_TIME())[i];
154  }
155  edm::LogVerbatim("CSCDigi") << ost.str();
156 }
Log< level::Info, true > LogVerbatim
std::vector< int > getSCA_FULL() const
Get SCA_FULL bit from SCA Controller data per each time slice.
std::vector< uint16_t > getCRC() const
Get CRC per each time sample.
std::vector< int > getLCT_PHASE() const
Get LCT_PHASE bit from SCA Controller data per each time slice.
std::vector< int > getTS_FLAG() const
Get TS_FLAG bit from SCA Controller data per each time slice.
std::vector< int > getL1A_PHASE() const
Get L1A_PHASE bit from SCA Controller data per each time slice.
std::vector< int > getSCA_BLK() const
Get SCA_BLK 4 bit word from SCA Controller data per each time slice.
std::vector< int > getTRIG_TIME() const
Get TRIG_TIME 8 bit word from SCA Controller data per each time slice.
std::vector< uint16_t > getSCAFullCond() const
Get SCA Full Condition.
int getCFEBNmb() const
Get the CFEB number.

◆ setCRC()

void CSCCFEBStatusDigi::setCRC ( const std::vector< uint16_t > &  crc)
inline

Set CRC vector.

Definition at line 37 of file CSCCFEBStatusDigi.h.

References crcWords_.

37 { crcWords_ = crc; }
std::vector< uint16_t > crcWords_

◆ setSCAC()

void CSCCFEBStatusDigi::setSCAC ( const std::vector< uint16_t > &  scac)
inline

Set SCAC (SCA Controller) vector.

Definition at line 40 of file CSCCFEBStatusDigi.h.

References contrWords_.

40 { contrWords_ = scac; }
std::vector< uint16_t > contrWords_

◆ ShiftSel()

int CSCCFEBStatusDigi::ShiftSel ( int  nmb,
int  nshift,
int  nsel 
) const

Shift and select.

Definition at line 12 of file CSCCFEBStatusDigi.cc.

Referenced by getL1A_PHASE(), getLCT_PHASE(), getSCA_BLK(), getSCA_FULL(), getTRIG_TIME(), and getTS_FLAG().

12 { return (nmb >> nshift) & nsel; }

Member Data Documentation

◆ bWords_

std::vector<uint16_t> CSCCFEBStatusDigi::bWords_
private

Definition at line 79 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), and getSCAFullCond().

◆ cfebnmb_

uint16_t CSCCFEBStatusDigi::cfebnmb_
private

Definition at line 76 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), and getCFEBNmb().

◆ contrWords_

std::vector<uint16_t> CSCCFEBStatusDigi::contrWords_
private

◆ crcWords_

std::vector<uint16_t> CSCCFEBStatusDigi::crcWords_
private

Definition at line 77 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), getCRC(), and setCRC().