CMS 3D CMS Logo

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

#include <CSCCFEBStatusDigi.h>

Public Member Functions

 CSCCFEBStatusDigi ()
 Default construction. More...
 
 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...
 
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.

20 { cfebnmb_ = cfebnmb; }

References 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.

26  {
27  cfebnmb_ = cfebnmb;
28  crcWords_ = crcWords;
29  contrWords_ = contrWords;
30  bWords_ = bWords;
31  }

References bWords_, cfebnmb_, contrWords_, and crcWords_.

◆ 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.

43 { return cfebnmb_; }

References cfebnmb_.

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

◆ getCRC()

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

Get CRC per each time sample.

Definition at line 49 of file CSCCFEBStatusDigi.h.

49 { return crcWords_; }

References crcWords_.

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

◆ getL1A_PHASE()

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

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

Definition at line 64 of file CSCCFEBStatusDigi.cc.

64  {
65  std::vector<int> vec(contrWords_.size(), 0);
66  int nmb;
67  for (unsigned int i = 0; i < vec.size(); i++) {
68  nmb = contrWords_[i];
69  vec[i] = ShiftSel(nmb, 12, 1);
70  }
71  return vec;
72 }

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

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

◆ getLCT_PHASE()

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

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

Definition at line 53 of file CSCCFEBStatusDigi.cc.

53  {
54  std::vector<int> vec(contrWords_.size(), 0);
55  int nmb;
56  for (unsigned int i = 0; i < vec.size(); i++) {
57  nmb = contrWords_[i];
58  vec[i] = ShiftSel(nmb, 13, 1);
59  }
60  return vec;
61 }

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

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

◆ 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 75 of file CSCCFEBStatusDigi.cc.

75  {
76  std::vector<int> vec(contrWords_.size(), 0);
77  int nmb;
78  for (unsigned int i = 0; i < vec.size(); i++) {
79  nmb = contrWords_[i];
80  vec[i] = ShiftSel(nmb, 8, 15);
81  }
82  return vec;
83 }

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

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

◆ getSCA_FULL()

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

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

Definition at line 42 of file CSCCFEBStatusDigi.cc.

42  {
43  std::vector<int> vec(contrWords_.size(), 0);
44  int nmb;
45  for (unsigned int i = 0; i < vec.size(); i++) {
46  nmb = contrWords_[i];
47  vec[i] = ShiftSel(nmb, 14, 1);
48  }
49  return vec;
50 }

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

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

◆ getSCAFullCond()

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

Get SCA Full Condition.

Definition at line 18 of file CSCCFEBStatusDigi.cc.

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

References bWords_.

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

◆ 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 86 of file CSCCFEBStatusDigi.cc.

86  {
87  std::vector<int> vec(contrWords_.size(), 0);
88  int nmb;
89  for (unsigned int i = 0; i < vec.size(); i++) {
90  nmb = contrWords_[i];
91  vec[i] = ShiftSel(nmb, 0, 255);
92  }
93  return vec;
94 }

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

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

◆ getTS_FLAG()

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

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

Definition at line 31 of file CSCCFEBStatusDigi.cc.

31  {
32  std::vector<int> vec(contrWords_.size(), 0);
33  int nmb;
34  for (unsigned int i = 0; i < vec.size(); i++) {
35  nmb = contrWords_[i];
36  vec[i] = ShiftSel(nmb, 15, 1);
37  }
38  return vec;
39 }

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

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

◆ print()

void CSCCFEBStatusDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 97 of file CSCCFEBStatusDigi.cc.

97  {
98  edm::LogVerbatim("CSCDigi") << "CSC CFEB # : " << getCFEBNmb();
99 
100  std::ostringstream ost;
101  ost << " SCAFullCond: ";
102  if (!getSCAFullCond().empty()) {
103  for (size_t i = 0; i < 4; ++i) {
104  ost << " " << (getSCAFullCond())[i];
105  }
106  } else {
107  ost << " "
108  << "BWORD is not valid";
109  }
110  edm::LogVerbatim("CSCDigi") << ost.str();
111 
112  ost.clear();
113  ost << " CRC: ";
114  for (size_t i = 0; i < getCRC().size(); ++i) {
115  ost << " " << (getCRC())[i];
116  }
117  edm::LogVerbatim("CSCDigi") << ost.str();
118 
119  ost.clear();
120  ost << " TS_FLAG: ";
121  for (size_t i = 0; i < getTS_FLAG().size(); ++i) {
122  ost << " " << (getTS_FLAG())[i];
123  }
124  edm::LogVerbatim("CSCDigi") << ost.str();
125 
126  ost.clear();
127  ost << " SCA_FULL: ";
128  for (size_t i = 0; i < getSCA_FULL().size(); ++i) {
129  ost << " " << (getSCA_FULL())[i];
130  }
131  edm::LogVerbatim("CSCDigi") << ost.str();
132 
133  ost.clear();
134  ost << " LCT_PHASE: ";
135  for (size_t i = 0; i < getLCT_PHASE().size(); ++i) {
136  ost << " " << (getLCT_PHASE())[i];
137  }
138  edm::LogVerbatim("CSCDigi") << ost.str();
139 
140  ost.clear();
141  ost << " L1A_PHASE: ";
142  for (size_t i = 0; i < getL1A_PHASE().size(); ++i) {
143  ost << " " << (getL1A_PHASE())[i];
144  }
145  edm::LogVerbatim("CSCDigi") << ost.str();
146 
147  ost.clear();
148  ost << " SCA_BLK: ";
149  for (size_t i = 0; i < getSCA_BLK().size(); ++i) {
150  ost << " " << (getSCA_BLK())[i];
151  }
152  edm::LogVerbatim("CSCDigi") << ost.str();
153 
154  ost.clear();
155  ost << " TRIG_TIME: ";
156  for (size_t i = 0; i < getTRIG_TIME().size(); ++i) {
157  ost << " " << (getTRIG_TIME())[i];
158  }
159  edm::LogVerbatim("CSCDigi") << ost.str();
160 }

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

◆ setCRC()

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

Set CRC vector.

Definition at line 37 of file CSCCFEBStatusDigi.h.

37 { crcWords_ = crc; }

References 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.

40 { contrWords_ = scac; }

References contrWords_.

◆ ShiftSel()

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

Shift and select.

Definition at line 12 of file CSCCFEBStatusDigi.cc.

12  {
13  int tmp = nmb;
14  tmp = tmp >> nshift;
15  return tmp = tmp & nsel;
16 }

References createJobs::tmp.

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

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().

CSCCFEBStatusDigi::getSCAFullCond
std::vector< uint16_t > getSCAFullCond() const
Get SCA Full Condition.
Definition: CSCCFEBStatusDigi.cc:18
mps_fire.i
i
Definition: mps_fire.py:428
CSCCFEBStatusDigi::getCRC
std::vector< uint16_t > getCRC() const
Get CRC per each time sample.
Definition: CSCCFEBStatusDigi.h:49
CSCCFEBStatusDigi::getSCA_FULL
std::vector< int > getSCA_FULL() const
Get SCA_FULL bit from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:42
CSCCFEBStatusDigi::getCFEBNmb
int getCFEBNmb() const
Get the CFEB number.
Definition: CSCCFEBStatusDigi.h:43
CSCCFEBStatusDigi::ShiftSel
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
Definition: CSCCFEBStatusDigi.cc:12
CSCCFEBStatusDigi::cfebnmb_
uint16_t cfebnmb_
Definition: CSCCFEBStatusDigi.h:76
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
CSCCFEBStatusDigi::getTS_FLAG
std::vector< int > getTS_FLAG() const
Get TS_FLAG bit from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:31
CSCCFEBStatusDigi::getLCT_PHASE
std::vector< int > getLCT_PHASE() const
Get LCT_PHASE bit from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:53
CSCCFEBStatusDigi::getL1A_PHASE
std::vector< int > getL1A_PHASE() const
Get L1A_PHASE bit from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:64
CSCCFEBStatusDigi::bWords_
std::vector< uint16_t > bWords_
Definition: CSCCFEBStatusDigi.h:79
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CSCCFEBStatusDigi::contrWords_
std::vector< uint16_t > contrWords_
Definition: CSCCFEBStatusDigi.h:78
CSCCFEBStatusDigi::getTRIG_TIME
std::vector< int > getTRIG_TIME() const
Get TRIG_TIME 8 bit word from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:86
CSCCFEBStatusDigi::getSCA_BLK
std::vector< int > getSCA_BLK() const
Get SCA_BLK 4 bit word from SCA Controller data per each time slice.
Definition: CSCCFEBStatusDigi.cc:75
CSCCFEBStatusDigi::crcWords_
std::vector< uint16_t > crcWords_
Definition: CSCCFEBStatusDigi.h:77