CMS 3D CMS Logo

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