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  }
95  _cancelbits[_bx - _minbx][idx] = bits;
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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:366
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:29
L1MuGMTExtendedCand
Definition: L1MuGMTExtendedCand.h:46
L1MuGMTDebugBlock::_minbx
const int _minbx
Definition: L1MuGMTDebugBlock.h:136
L1MuGMTDebugBlock::_pairMatrices
std::vector< std::vector< L1MuGMTMatrix< bool > > > _pairMatrices
Definition: L1MuGMTDebugBlock.h:147
L1MuGMTDebugBlock::_fwdmuons
std::vector< std::vector< L1MuGMTExtendedCand > > _fwdmuons
Definition: L1MuGMTDebugBlock.h:152
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuGMTDebugBlock::_proeta
std::vector< std::vector< float > > _proeta
Definition: L1MuGMTDebugBlock.h:142
L1MuGMTDebugBlock::_phisel
std::vector< std::vector< unsigned > > _phisel
Definition: L1MuGMTDebugBlock.h:143
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
L1MuGMTDebugBlock::_cancelbits
std::vector< std::vector< unsigned > > _cancelbits
Definition: L1MuGMTDebugBlock.h:150
L1MuGMTDebugBlock::SetCancelBits
void SetCancelBits(int idx, const std::vector< bool > &mine, const std::vector< bool > &others)
Set cancel bits.
Definition: L1MuGMTDebugBlock.cc:81
L1MuGMTDebugBlock::_brlmuons
std::vector< std::vector< L1MuGMTExtendedCand > > _brlmuons
Definition: L1MuGMTDebugBlock.h:151
L1MuGMTDebugBlock::_prophi
std::vector< std::vector< float > > _prophi
Definition: L1MuGMTDebugBlock.h:141
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
L1MuGMTDebugBlock::_isMIPISO
std::vector< std::vector< unsigned > > _isMIPISO
Definition: L1MuGMTDebugBlock.h:145
L1MuGMTDebugBlock.h
L1MuGMTDebugBlock::~L1MuGMTDebugBlock
virtual ~L1MuGMTDebugBlock()
destructor
Definition: L1MuGMTDebugBlock.cc:60
std
Definition: JetResolutionObject.h:76
L1MuGMTDebugBlock::L1MuGMTDebugBlock
L1MuGMTDebugBlock(int minbx=-10, int maxbx=10)
constructor
Definition: L1MuGMTDebugBlock.cc:34
L1MuGMTDebugBlock::_bx
int _bx
Definition: L1MuGMTDebugBlock.h:140
L1MuGMTDebugBlock::reset
void reset()
Reset the debug block.
Definition: L1MuGMTDebugBlock.cc:102
L1MuGMTDebugBlock::_etasel
std::vector< std::vector< unsigned > > _etasel
Definition: L1MuGMTDebugBlock.h:144
L1MuGMTDebugBlock::NumMatrices
static const int NumMatrices
Definition: L1MuGMTDebugBlock.h:47
L1MuGMTMatrix
Definition: L1MuGMTMatrix.h:45
L1MuGMTDebugBlock::_mqMatrices
std::vector< std::vector< L1MuGMTMatrix< int > > > _mqMatrices
Definition: L1MuGMTDebugBlock.h:148
L1MuGMTDebugBlock::_maxbx
const int _maxbx
Definition: L1MuGMTDebugBlock.h:136