CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::CSCCFEBStatusDigi ( int  cfebnmb)
inline

Construct from the CFEB number (1-5).

Definition at line 22 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

22 {cfebnmb_ = cfebnmb;}
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 26 of file CSCCFEBStatusDigi.h.

References bWords_, cfebnmb_, contrWords_, and crcWords_.

27  {
28  cfebnmb_ = cfebnmb;
29  crcWords_ = crcWords;
30  contrWords_ = contrWords;
31  bWords_ = bWords;
32 }
std::vector< uint16_t > crcWords_
std::vector< uint16_t > contrWords_
std::vector< uint16_t > bWords_
CSCCFEBStatusDigi::CSCCFEBStatusDigi ( )
inline

Default construction.

Definition at line 36 of file CSCCFEBStatusDigi.h.

36 {}

Member Function Documentation

int CSCCFEBStatusDigi::getCFEBNmb ( ) const
inline

Get the CFEB number.

Definition at line 45 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

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

45 {return cfebnmb_;}
std::vector<uint16_t> CSCCFEBStatusDigi::getCRC ( ) const
inline

Get CRC per each time sample.

Definition at line 51 of file CSCCFEBStatusDigi.h.

References crcWords_.

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

51 {return crcWords_;}
std::vector< uint16_t > crcWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
std::vector< uint16_t > CSCCFEBStatusDigi::getSCAFullCond ( ) const

Get SCA Full Condition.

Definition at line 18 of file CSCCFEBStatusDigi.cc.

References bWords_.

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

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 }
std::vector< uint16_t > bWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
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.

References contrWords_, i, and ShiftSel().

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

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 }
int i
Definition: DBlmapReader.cc:9
int ShiftSel(int nmb, int nshift, int nsel) const
Shift and select.
std::vector< uint16_t > contrWords_
void CSCCFEBStatusDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 97 of file CSCCFEBStatusDigi.cc.

References getCFEBNmb(), getCRC(), getL1A_PHASE(), getLCT_PHASE(), getSCA_BLK(), getSCA_FULL(), getSCAFullCond(), getTRIG_TIME(), getTS_FLAG(), i, and findQualityFiles::size.

97  {
98  edm::LogVerbatim("CSCDigi") << "CSC CFEB # : " << getCFEBNmb();
99 
100  std::ostringstream ost;
101  ost << " SCAFullCond: ";
102  if(getSCAFullCond().size()!=0){
103  for (size_t i = 0; i<4; ++i ){ ost << " " <<(getSCAFullCond())[i]; }
104  }
105  else {
106  ost << " " <<"BWORD is not valid";
107  }
108  edm::LogVerbatim("CSCDigi") << ost.str();
109 
110  ost.clear();
111  ost << " CRC: ";
112  for (size_t i = 0; i<getCRC().size(); ++i ){ ost << " " <<(getCRC())[i]; }
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 ){ ost << " " <<(getTS_FLAG())[i]; }
118  edm::LogVerbatim("CSCDigi") << ost.str();
119 
120  ost.clear();
121  ost << " SCA_FULL: ";
122  for (size_t i = 0; i<getSCA_FULL().size(); ++i ){ ost << " " <<(getSCA_FULL())[i]; }
123  edm::LogVerbatim("CSCDigi") << ost.str();
124 
125  ost.clear();
126  ost << " LCT_PHASE: ";
127  for (size_t i = 0; i<getLCT_PHASE().size(); ++i ){ ost << " " <<(getLCT_PHASE())[i]; }
128  edm::LogVerbatim("CSCDigi") << ost.str();
129 
130  ost.clear();
131  ost << " L1A_PHASE: ";
132  for (size_t i = 0; i<getL1A_PHASE().size(); ++i ){ ost << " " <<(getL1A_PHASE())[i]; }
133  edm::LogVerbatim("CSCDigi") << ost.str();
134 
135  ost.clear();
136  ost << " SCA_BLK: ";
137  for (size_t i = 0; i<getSCA_BLK().size(); ++i ){ ost << " " <<(getSCA_BLK())[i]; }
138  edm::LogVerbatim("CSCDigi") << ost.str();
139 
140  ost.clear();
141  ost << " TRIG_TIME: ";
142  for (size_t i = 0; i<getTRIG_TIME().size(); ++i ){ ost << " " <<(getTRIG_TIME())[i]; }
143  edm::LogVerbatim("CSCDigi") << ost.str();
144 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > getTS_FLAG() const
Get TS_FLAG 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 > getL1A_PHASE() const
Get L1A_PHASE bit from SCA Controller data per each time slice.
std::vector< int > getLCT_PHASE() const
Get LCT_PHASE bit from SCA Controller data per each time slice.
int getCFEBNmb() const
Get the CFEB number.
std::vector< uint16_t > getSCAFullCond() const
Get SCA Full Condition.
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 > getTRIG_TIME() const
Get TRIG_TIME 8 bit word from SCA Controller data per each time slice.
tuple size
Write out results.
void CSCCFEBStatusDigi::setCRC ( const std::vector< uint16_t > &  crc)
inline

Set CRC vector.

Definition at line 39 of file CSCCFEBStatusDigi.h.

References crcWords_.

39 {crcWords_ = crc;}
std::vector< uint16_t > crcWords_
void CSCCFEBStatusDigi::setSCAC ( const std::vector< uint16_t > &  scac)
inline

Set SCAC (SCA Controller) vector.

Definition at line 42 of file CSCCFEBStatusDigi.h.

References contrWords_.

42 {contrWords_ = scac;}
std::vector< uint16_t > contrWords_
int CSCCFEBStatusDigi::ShiftSel ( int  nmb,
int  nshift,
int  nsel 
) const

Shift and select.

Definition at line 12 of file CSCCFEBStatusDigi.cc.

References tmp.

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

12  {
13  int tmp=nmb;
14  tmp=tmp>>nshift;
15  return tmp= tmp & nsel;
16 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

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

Definition at line 82 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), and getSCAFullCond().

uint16_t CSCCFEBStatusDigi::cfebnmb_
private

Definition at line 79 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), and getCFEBNmb().

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

Definition at line 80 of file CSCCFEBStatusDigi.h.

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