test
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 Member Functions | Private Attributes
CSCTMBBlockedCFEB Class Reference

#include <CSCTMBBlockedCFEB.h>

Public Member Functions

 CSCTMBBlockedCFEB ()
 
 CSCTMBBlockedCFEB (unsigned short *buf, int Line6BCB, int Line6ECB)
 
std::vector< int > getData () const
 
std::vector< std::vector< int > > getSingleCFEBList (int CFEBn) const
 UnpackBlockedCFEB. More...
 
int getSize () const
 
void print () const
 

Private Member Functions

int UnpackBlockedCFEB (unsigned short *buf, int Line6BCB, int Line6ECB)
 CSCTMBMiniScope. More...
 

Private Attributes

std::vector< int > BlockedCFEBdata
 
unsigned size_
 stores all mini scope data More...
 

Detailed Description

Definition at line 12 of file CSCTMBBlockedCFEB.h.

Constructor & Destructor Documentation

CSCTMBBlockedCFEB::CSCTMBBlockedCFEB ( )
inline

Definition at line 16 of file CSCTMBBlockedCFEB.h.

References size_.

16 {size_ = 0;} //default constructor
unsigned size_
stores all mini scope data
CSCTMBBlockedCFEB::CSCTMBBlockedCFEB ( unsigned short *  buf,
int  Line6BCB,
int  Line6ECB 
)

Definition at line 11 of file CSCTMBBlockedCFEB.cc.

References size_, and UnpackBlockedCFEB().

12 {
13 
14  size_ = UnpackBlockedCFEB(buf,Line6BCB,Line6ECB);
15 
16 }
unsigned size_
stores all mini scope data
int UnpackBlockedCFEB(unsigned short *buf, int Line6BCB, int Line6ECB)
CSCTMBMiniScope.

Member Function Documentation

std::vector<int> CSCTMBBlockedCFEB::getData ( void  ) const
inline

Definition at line 19 of file CSCTMBBlockedCFEB.h.

References BlockedCFEBdata.

Referenced by getSingleCFEBList(), and print().

19 {return BlockedCFEBdata;}
std::vector< int > BlockedCFEBdata
std::vector< std::vector< int > > CSCTMBBlockedCFEB::getSingleCFEBList ( int  CFEBn) const

UnpackBlockedCFEB.

Get 4 words for a particular CFEB (CFEBn)

Definition at line 37 of file CSCTMBBlockedCFEB.cc.

References getData(), i, j, and relval_2017::k.

Referenced by print().

38 {
39 
40  std::vector< std::vector<int> > CFEBnByLayers;
41  CFEBnByLayers.clear();
42  std::vector<int> CFEBnData;
43  CFEBnData.clear();
44  int idCFEB=-1;
45 
47  for (int i=0; i<(int)getData().size(); ++i)
48  {
49  idCFEB = (getData()[i] >> 12) & 0x7;
50  if (idCFEB==CFEBn)
51  {
52  CFEBnData.push_back(getData()[i] & 0xFFF);
53  }
54  idCFEB = -1;
55  }
56 
57  std::vector<int> Layer0, Layer1, Layer2, Layer3, Layer4, Layer5;
58  Layer0.clear();
59  Layer1.clear();
60  Layer2.clear();
61  Layer3.clear();
62  Layer4.clear();
63  Layer5.clear();
64 
65  for (int k=0; k<(int)CFEBnData.size(); ++k)
66  {
67  for (int j=0; j<12; j++)
68  {
69  int DiStr=0;
70  DiStr = (CFEBnData[k] >> j) & 0x1;
71  if ( (DiStr !=0) && (j<8) && (k==0) )
72  {
73  Layer0.push_back(j);
74  }
75  if ((DiStr !=0) && (j>7) && (j<12) && (k==0))
76  {
77  Layer1.push_back(j);
78  }
79  if ((DiStr !=0) && (j<4) && (k==1))
80  {
81  Layer1.push_back(j);
82  }
83  if ((DiStr !=0) && (j>3) && (j<12) && (k==1))
84  {
85  Layer2.push_back(j);
86  }
87  if ( (DiStr !=0) && (j<8) && (k==2) )
88  {
89  Layer3.push_back(j);
90  }
91  if ((DiStr !=0) && (j>7) && (j<12) && (k==2))
92  {
93  Layer4.push_back(j);
94  }
95  if ((DiStr !=0) && (j<4) && (k==3))
96  {
97  Layer4.push_back(j);
98  }
99  if ((DiStr !=0) && (j>3) && (j<12) && (k==3))
100  {
101  Layer5.push_back(j);
102  }
103  }
104  }
105 
106  CFEBnByLayers.push_back(Layer0);
107  CFEBnByLayers.push_back(Layer1);
108  CFEBnByLayers.push_back(Layer2);
109  CFEBnByLayers.push_back(Layer3);
110  CFEBnByLayers.push_back(Layer4);
111  CFEBnByLayers.push_back(Layer5);
112 
113  return CFEBnByLayers;
114 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::vector< int > getData() const
int CSCTMBBlockedCFEB::getSize ( ) const
inline

Definition at line 18 of file CSCTMBBlockedCFEB.h.

References size_.

18 {return size_;}
unsigned size_
stores all mini scope data
void CSCTMBBlockedCFEB::print ( void  ) const

Definition at line 116 of file CSCTMBBlockedCFEB.cc.

References gather_cfg::cout, TauDecayModes::dec, getData(), getSingleCFEBList(), i, and z.

117 {
118 
119  std::cout << " Blocked CFEB DiStrips List Content " << std::endl;
120  for (int i=0; i<(int)getData().size(); ++i)
121  {
122  std::cout << " word " << i << " : " << std::hex << getData()[i] << std::dec << std::endl;
123  }
124 
125  std::vector< std::vector<int> > anyCFEB;
126  anyCFEB.clear();
127  std::vector <int> anyLayer;
128  anyLayer.clear();
129  std::cout << std::endl;
130  std::cout << " Blocked DiStrips by CFEB and Layers unpacked " << std::endl;
131  for (int z=0; z<5; ++z)
132  {
133  anyCFEB = getSingleCFEBList(z);
134  std::cout << " CFEB# " << z << std::endl;
135  int LayerCnt=0;
136  for (std::vector< std::vector<int> >::const_iterator layerIt=anyCFEB.begin(); layerIt !=anyCFEB.end(); layerIt++)
137  {
138  anyLayer=*layerIt;
139  std::cout << " Layer: " << LayerCnt;
140  if (anyLayer.size() !=0)
141  {
142  for (int i=0; i<(int)anyLayer.size(); i++)
143  {
144  std::cout << " " << anyLayer[i];
145  }
146  }
147  else
148  std::cout << " No Blocked DiStrips on the Layer ";
149  std::cout << std::endl;
150  LayerCnt++;
151  anyLayer.clear();
152  }
153  anyCFEB.clear();
154  }
155 
156 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > getData() const
std::vector< std::vector< int > > getSingleCFEBList(int CFEBn) const
UnpackBlockedCFEB.
tuple cout
Definition: gather_cfg.py:145
int CSCTMBBlockedCFEB::UnpackBlockedCFEB ( unsigned short *  buf,
int  Line6BCB,
int  Line6ECB 
)
private

CSCTMBMiniScope.

Definition at line 19 of file CSCTMBBlockedCFEB.cc.

References BlockedCFEBdata, and i.

Referenced by CSCTMBBlockedCFEB().

20 {
21 
22  if ((Line6ECB-Line6BCB) != 0)
23  {
24 
25  for (int i=0; i<(Line6ECB-Line6BCB-1); i++)
26  {
27  BlockedCFEBdata.push_back(buf[Line6BCB+1+i]);
28  }
29 
30  }
31 
32  //print();
33  return (Line6ECB-Line6BCB + 1);
34 
35 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > BlockedCFEBdata

Member Data Documentation

std::vector<int> CSCTMBBlockedCFEB::BlockedCFEBdata
private

Definition at line 28 of file CSCTMBBlockedCFEB.h.

Referenced by getData(), and UnpackBlockedCFEB().

unsigned CSCTMBBlockedCFEB::size_
private

stores all mini scope data

Definition at line 29 of file CSCTMBBlockedCFEB.h.

Referenced by CSCTMBBlockedCFEB(), and getSize().