CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTInputEvent.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // class L1MuGMTInputEvent
4 //
5 // Description:
6 //
7 // $Date: 2007/03/23 18:51:35 $
8 // $Revision: 1.2 $
9 //
10 // Author :
11 // Tobias Noebauer HEPHY Vienna
12 //
13 // Migrated to CMSSW:
14 // I. Mikulec
15 //
16 //--------------------------------------------------
17 
18 //-----------------------
19 // This Class's Header --
20 //-----------------------
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 #include <stdexcept>
27 
28 //-------------------------------
29 // Collaborating Class Headers --
30 //-------------------------------
32 //#include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
34 
35 //----------------
36 // Constructors --
37 //----------------
39  m_runnr(0L), m_evtnr(0L), m_mip_bits(14,18), m_iso_bits(14,18) {
40  std::vector<L1MuRegionalCand> empty_vec;
41  m_inputmuons["INC"] = empty_vec;
42  m_inputmuons["IND"] = empty_vec;
43  m_inputmuons["INB"] = empty_vec;
44  m_inputmuons["INF"] = empty_vec;
45 
46  // m_inputmuons["INC"].reserve(L1MuGMTConfig::MAXCSC);
47  // m_inputmuons["IND"].reserve(L1MuGMTConfig::MAXDTBX);
48  // m_inputmuons["INB"].reserve(L1MuGMTConfig::MAXRPC);
49  // m_inputmuons["INF"].reserve(L1MuGMTConfig::MAXRPC);
50  m_inputmuons["INC"].reserve(4);
51  m_inputmuons["IND"].reserve(4);
52  m_inputmuons["INB"].reserve(4);
53  m_inputmuons["INF"].reserve(4);
54 
55  m_mip_bits.init(false);
56  m_iso_bits.init(true); //this is more useful when reading a standalone input file
57  //since "not-quiet" bits are stored there
58 }
59 
60 //--------------
61 // Destructor --
62 //--------------
64 }
65 
66 //--------------
67 // Operations --
68 //--------------
69 void L1MuGMTInputEvent::addInputMuon(const std::string chipid,
70  const L1MuRegionalCand& inMu) {
71  if (m_inputmuons.count(chipid) == 0)
72  throw std::runtime_error("L1MuGMTInputEvent::addInputMuon: invalid chipid:" + chipid);
73  m_inputmuons[chipid].push_back(inMu);
74 }
75 
77  m_runnr = 0L;
78  m_evtnr = 0L;
79 
80  std::map<std::string, std::vector<L1MuRegionalCand> >::iterator it = m_inputmuons.begin();
81  for (; it != m_inputmuons.end(); it++) {
82  it->second.clear();
83  }
84 
85  m_mip_bits.init(false);
86  m_iso_bits.init(true); //see CTOR for info on this
87 }
88 
89 const L1MuRegionalCand* L1MuGMTInputEvent::getInputMuon(std::string chipid, unsigned index) const {
90 
91  if (m_inputmuons.count(chipid) == 0 )
92  throw std::runtime_error("L1GMTInputEvent::getInputMuon: invalid chipid:" + chipid);
93 
94  if (index >= m_inputmuons.find(chipid)->second.size()) return 0;
95  return &(m_inputmuons.find(chipid)->second.at(index));
96 }
97 
98 
99 
100 
101 
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
void init(T v=0)
initialize matrix
virtual ~L1MuGMTInputEvent()
L1MuGMTMatrix< bool > m_iso_bits
void addInputMuon(std::string chipid, const L1MuRegionalCand &inMu)
const L1MuRegionalCand * getInputMuon(std::string chipid, unsigned index) const
unsigned long m_runnr
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons