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.

Date:
2013/04/22 22:39:23
Revision:
1.8
Author
N. Terentiev, CMU

Definition at line 19 of file CSCCFEBStatusDigi.h.

Constructor & Destructor Documentation

CSCCFEBStatusDigi::CSCCFEBStatusDigi ( int  cfebnmb)
inline

Construct from the CFEB number (1-5).

Definition at line 24 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

24 {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 28 of file CSCCFEBStatusDigi.h.

References bWords_, cfebnmb_, contrWords_, and crcWords_.

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

Default construction.

Definition at line 38 of file CSCCFEBStatusDigi.h.

38 {}

Member Function Documentation

int CSCCFEBStatusDigi::getCFEBNmb ( ) const
inline

Get the CFEB number.

Definition at line 47 of file CSCCFEBStatusDigi.h.

References cfebnmb_.

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

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

Get CRC per each time sample.

Definition at line 53 of file CSCCFEBStatusDigi.h.

References crcWords_.

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

53 {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 66 of file CSCCFEBStatusDigi.cc.

References contrWords_, i, and ShiftSel().

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

66  {
67  std::vector<int> vec(contrWords_.size(),0);
68  int nmb;
69  for(unsigned int i=0;i<vec.size();i++) {
70  nmb=contrWords_[i];
71  vec[i]=ShiftSel(nmb,12,1);
72  }
73  return vec;
74 }
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 55 of file CSCCFEBStatusDigi.cc.

References contrWords_, i, and ShiftSel().

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

55  {
56  std::vector<int> vec(contrWords_.size(),0);
57  int nmb;
58  for(unsigned int i=0;i<vec.size();i++) {
59  nmb=contrWords_[i];
60  vec[i]=ShiftSel(nmb,13,1);
61  }
62  return vec;
63 }
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 77 of file CSCCFEBStatusDigi.cc.

References contrWords_, i, and ShiftSel().

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

77  {
78  std::vector<int> vec(contrWords_.size(),0);
79  int nmb;
80  for(unsigned int i=0;i<vec.size();i++) {
81  nmb=contrWords_[i];
82  vec[i]=ShiftSel(nmb,8,15);
83  }
84  return vec;
85 }
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 44 of file CSCCFEBStatusDigi.cc.

References contrWords_, i, and ShiftSel().

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

44  {
45  std::vector<int> vec(contrWords_.size(),0);
46  int nmb;
47  for(unsigned int i=0;i<vec.size();i++) {
48  nmb=contrWords_[i];
49  vec[i]=ShiftSel(nmb,14,1);
50  }
51  return vec;
52 }
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 20 of file CSCCFEBStatusDigi.cc.

References bWords_.

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

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

References contrWords_, i, and ShiftSel().

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

88  {
89  std::vector<int> vec(contrWords_.size(),0);
90  int nmb;
91  for(unsigned int i=0;i<vec.size();i++) {
92  nmb=contrWords_[i];
93  vec[i]=ShiftSel(nmb,0,255);
94  }
95  return vec;
96 }
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 33 of file CSCCFEBStatusDigi.cc.

References contrWords_, i, and ShiftSel().

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

33  {
34  std::vector<int> vec(contrWords_.size(),0);
35  int nmb;
36  for(unsigned int i=0;i<vec.size();i++) {
37  nmb=contrWords_[i];
38  vec[i]=ShiftSel(nmb,15,1);
39  }
40  return vec;
41 }
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 99 of file CSCCFEBStatusDigi.cc.

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

99  {
100  std::cout << "CSC CFEB # : " << getCFEBNmb() <<"\n";
101  std::cout << " SCAFullCond: ";
102  if(getSCAFullCond().size()!=0){
103  for (size_t i = 0; i<4; ++i ){
104  std::cout <<" " <<(getSCAFullCond())[i]; }
105  }
106  else {
107  std::cout << " " <<"BWORD is not valied";
108  }
109  std::cout << "\n";
110  std::cout << " CRC: ";
111  for (size_t i = 0; i<getCRC().size(); ++i ){
112  std::cout <<" " <<(getCRC())[i]; }
113  std::cout<<"\n";
114  std::cout << " TS_FLAG: ";
115  for (size_t i = 0; i<getTS_FLAG().size(); ++i ){
116  std::cout <<" " <<(getTS_FLAG())[i]; }
117  std::cout<<"\n";
118  std::cout << " SCA_FULL: ";
119  for (size_t i = 0; i<getSCA_FULL().size(); ++i ){
120  std::cout <<" " <<(getSCA_FULL())[i]; }
121  std::cout<<"\n";
122  std::cout << " LCT_PHASE: ";
123  for (size_t i = 0; i<getLCT_PHASE().size(); ++i ){
124  std::cout <<" " <<(getLCT_PHASE())[i]; }
125  std::cout<<"\n";
126  std::cout << " L1A_PHASE: ";
127  for (size_t i = 0; i<getL1A_PHASE().size(); ++i ){
128  std::cout <<" " <<(getL1A_PHASE())[i]; }
129  std::cout<<"\n";
130  std::cout << " SCA_BLK: ";
131  for (size_t i = 0; i<getSCA_BLK().size(); ++i ){
132  std::cout <<" " <<(getSCA_BLK())[i]; }
133  std::cout<<"\n";
134  std::cout << " TRIG_TIME: ";
135  for (size_t i = 0; i<getTRIG_TIME().size(); ++i ){
136  std::cout <<" " <<(getTRIG_TIME())[i]; }
137  std::cout<<"\n";
138 }
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 cout
Definition: gather_cfg.py:121
tuple size
Write out results.
void CSCCFEBStatusDigi::setCRC ( const std::vector< uint16_t > &  crc)
inline

Set CRC vector.

Definition at line 41 of file CSCCFEBStatusDigi.h.

References crcWords_.

41 {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 44 of file CSCCFEBStatusDigi.h.

References contrWords_.

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

Shift and select.

Definition at line 14 of file CSCCFEBStatusDigi.cc.

References tmp.

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

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

Member Data Documentation

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

Definition at line 84 of file CSCCFEBStatusDigi.h.

Referenced by CSCCFEBStatusDigi(), and getSCAFullCond().

uint16_t CSCCFEBStatusDigi::cfebnmb_
private

Definition at line 81 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 82 of file CSCCFEBStatusDigi.h.

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