CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTDebugBlock.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTDebugBlock
00004 //
00005 //
00006 //   $Date: 2007/04/02 15:45:38 $
00007 //   $Revision: 1.6 $
00008 //
00009 //   Author :
00010 //   H. Sakulin                HEPHY Vienna
00011 //
00012 //   Migrated to CMSSW:
00013 //   I. Mikulec
00014 //
00015 //--------------------------------------------------
00016 
00017 //-----------------------
00018 // This Class's Header --
00019 //-----------------------
00020 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTDebugBlock.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 #include <iostream>
00027 #include <vector>
00028 #include <math.h>
00029 
00030 using namespace std;
00031 
00032 //----------------
00033 // Constructors --
00034 //----------------
00035 
00036 L1MuGMTDebugBlock::L1MuGMTDebugBlock(int minbx, int maxbx) :
00037   _minbx(minbx), _maxbx(maxbx), _bx(_minbx),
00038   _prophi(maxbx-minbx+1, std::vector<float>(32,0)),
00039   _proeta(maxbx-minbx+1, std::vector<float>(32,0)),
00040   _phisel(maxbx-minbx+1, std::vector<unsigned>(32,0)),
00041   _etasel(maxbx-minbx+1, std::vector<unsigned>(32,0)),
00042   _isMIPISO(maxbx-minbx+1, std::vector<unsigned>(32,0)),
00043   _pairMatrices(maxbx-minbx+1, std::vector<L1MuGMTMatrix<bool> >(NumMatrices, L1MuGMTMatrix<bool> (4,4))),
00044   _mqMatrices(maxbx-minbx+1, std::vector<L1MuGMTMatrix<int> >(NumMatrices, L1MuGMTMatrix<int> (4,4))),
00045   _cancelbits(maxbx-minbx+1, std::vector<unsigned>(4)),
00046   _brlmuons(maxbx-minbx+1, std::vector<L1MuGMTExtendedCand>(4)),
00047   _fwdmuons(maxbx-minbx+1, std::vector<L1MuGMTExtendedCand>(4))
00048   // will not work w/o copy constructor  
00049 {
00050   if (maxbx < minbx) edm::LogWarning("BxRangeMismatch") << "*** error in L1MuGMTDebugBlock::L1MuGMTDebugBlock(): minbx > maxbx" << endl; 
00051   reset(); 
00052 }
00053 
00054 
00055 //--------------
00056 // Destructor --
00057 //--------------
00058 
00059 L1MuGMTDebugBlock::~L1MuGMTDebugBlock() {
00060   for (int bx=0; bx<=(_maxbx-_minbx); bx++) {
00061     _prophi[bx].clear();
00062     _proeta[bx].clear();
00063     _phisel[bx].clear();
00064     _etasel[bx].clear();
00065     _isMIPISO[bx].clear();
00066     _brlmuons[bx].clear();
00067     _fwdmuons[bx].clear();
00068   }
00069   _prophi.clear();
00070   _proeta.clear();
00071   _phisel.clear();
00072   _etasel.clear();
00073   _isMIPISO.clear();
00074   _pairMatrices.clear();
00075   _mqMatrices.clear();
00076   _brlmuons.clear();
00077   _fwdmuons.clear();
00078 }
00079 
00080 void L1MuGMTDebugBlock::SetCancelBits (int idx, std::vector<bool> mine, vector<bool> others) {
00081   unsigned bits = 0;
00082   unsigned mask = 1;
00083   
00084   for (int i=0;i<4;i++) {
00085     if (mine[i]) bits |= mask;
00086     mask = mask << 1;
00087   }
00088   for (int i=0;i<4;i++) {
00089     if (others[i]) bits |= mask;
00090     mask = mask << 1;
00091   }
00092   _cancelbits[_bx - _minbx][idx] = bits;
00093   
00094 }
00095 
00096 //--------------
00097 // Operations --
00098 //--------------
00099 
00100 void L1MuGMTDebugBlock::reset () {       
00101   _bx = _minbx;
00102   for (int bx=0; bx<_maxbx-_minbx+1; bx++) {
00103     for (int i=0;i<32;i++) {
00104       _prophi[bx][i]=_proeta[bx][i]=99.;
00105       _phisel[bx][i]=_etasel[bx][i]=0;
00106       _isMIPISO[bx][i]=0;
00107     }
00108     for (int i=0; i<NumMatrices; i++) {
00109       _pairMatrices[bx][i].init(0);
00110       _mqMatrices[bx][i].init(0);
00111     }
00112     for (int i=0; i<4; i++) {
00113       _brlmuons[bx][i].reset();
00114       _fwdmuons[bx][i].reset();
00115     }
00116   }
00117 }
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128