CMS 3D CMS Logo

L1MuGMTDebugBlock.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTDebugBlock
4 //
5 //
6 //
7 // Author :
8 // H. Sakulin HEPHY Vienna
9 //
10 // Migrated to CMSSW:
11 // I. Mikulec
12 //
13 //--------------------------------------------------
14 
15 //-----------------------
16 // This Class's Header --
17 //-----------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 
24 #include <iostream>
25 #include <vector>
26 #include <cmath>
27 
28 using namespace std;
29 
30 //----------------
31 // Constructors --
32 //----------------
33 
35  : _minbx(minbx),
36  _maxbx(maxbx),
37  _bx(_minbx),
38  _prophi(maxbx - minbx + 1, std::vector<float>(32, 0)),
39  _proeta(maxbx - minbx + 1, std::vector<float>(32, 0)),
40  _phisel(maxbx - minbx + 1, std::vector<unsigned>(32, 0)),
41  _etasel(maxbx - minbx + 1, std::vector<unsigned>(32, 0)),
42  _isMIPISO(maxbx - minbx + 1, std::vector<unsigned>(32, 0)),
43  _pairMatrices(maxbx - minbx + 1,
44  std::vector<L1MuGMTMatrix<bool> >(NumMatrices, L1MuGMTMatrix<bool>(4, 4, false))),
45  _mqMatrices(maxbx - minbx + 1, std::vector<L1MuGMTMatrix<int> >(NumMatrices, L1MuGMTMatrix<int>(4, 4, 0))),
46  _cancelbits(maxbx - minbx + 1, std::vector<unsigned>(4)),
47  _brlmuons(maxbx - minbx + 1, std::vector<L1MuGMTExtendedCand>(4)),
48  _fwdmuons(maxbx - minbx + 1, std::vector<L1MuGMTExtendedCand>(4))
49 // will not work w/o copy constructor
50 {
51  if (maxbx < minbx)
52  edm::LogWarning("BxRangeMismatch") << "*** error in L1MuGMTDebugBlock::L1MuGMTDebugBlock(): minbx > maxbx" << endl;
53  reset();
54 }
55 
56 //--------------
57 // Destructor --
58 //--------------
59 
61  for (int bx = 0; bx <= (_maxbx - _minbx); bx++) {
62  _prophi[bx].clear();
63  _proeta[bx].clear();
64  _phisel[bx].clear();
65  _etasel[bx].clear();
66  _isMIPISO[bx].clear();
67  _brlmuons[bx].clear();
68  _fwdmuons[bx].clear();
69  }
70  _prophi.clear();
71  _proeta.clear();
72  _phisel.clear();
73  _etasel.clear();
74  _isMIPISO.clear();
75  _pairMatrices.clear();
76  _mqMatrices.clear();
77  _brlmuons.clear();
78  _fwdmuons.clear();
79 }
80 
81 void L1MuGMTDebugBlock::SetCancelBits(int idx, const std::vector<bool>& mine, const vector<bool>& others) {
82  unsigned bits = 0;
83  unsigned mask = 1;
84 
85  for (int i = 0; i < 4; i++) {
86  if (mine[i])
87  bits |= mask;
88  mask = mask << 1;
89  }
90  for (int i = 0; i < 4; i++) {
91  if (others[i])
92  bits |= mask;
93  mask = mask << 1;
94  }
96 }
97 
98 //--------------
99 // Operations --
100 //--------------
101 
103  _bx = _minbx;
104  for (int bx = 0; bx < _maxbx - _minbx + 1; bx++) {
105  for (int i = 0; i < 32; i++) {
106  _prophi[bx][i] = _proeta[bx][i] = 99.;
107  _phisel[bx][i] = _etasel[bx][i] = 0;
108  _isMIPISO[bx][i] = 0;
109  }
110  for (int i = 0; i < NumMatrices; i++) {
111  _pairMatrices[bx][i].reset(false);
112  _mqMatrices[bx][i].reset(0);
113  }
114  for (int i = 0; i < 4; i++) {
115  _brlmuons[bx][i].reset();
116  _fwdmuons[bx][i].reset();
117  }
118  }
119 }
std::vector< std::vector< float > > _proeta
std::vector< std::vector< L1MuGMTMatrix< bool > > > _pairMatrices
std::vector< std::vector< L1MuGMTExtendedCand > > _fwdmuons
std::vector< std::vector< unsigned > > _phisel
constexpr uint32_t bits
Definition: gpuClustering.h:23
std::vector< std::vector< unsigned > > _cancelbits
constexpr uint32_t mask
Definition: gpuClustering.h:24
std::vector< std::vector< float > > _prophi
std::vector< std::vector< unsigned > > _isMIPISO
void SetCancelBits(int idx, const std::vector< bool > &mine, const std::vector< bool > &others)
Set cancel bits.
L1MuGMTDebugBlock(int minbx=-10, int maxbx=10)
constructor
std::vector< std::vector< L1MuGMTExtendedCand > > _brlmuons
virtual ~L1MuGMTDebugBlock()
destructor
std::vector< std::vector< L1MuGMTMatrix< int > > > _mqMatrices
void reset()
Reset the debug block.
Log< level::Warning, false > LogWarning
std::vector< std::vector< unsigned > > _etasel
static const int NumMatrices