CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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),
38  m_evtnr(0L),
39  m_mip_bits(14, 18, false),
40  m_iso_bits(14, 18, true) //this is more useful when reading a standalone input file
41  //since "not-quiet" bits are stored there
42 {
43  std::vector<L1MuRegionalCand> empty_vec;
44  m_inputmuons["INC"] = empty_vec;
45  m_inputmuons["IND"] = empty_vec;
46  m_inputmuons["INB"] = empty_vec;
47  m_inputmuons["INF"] = empty_vec;
48 
49  // m_inputmuons["INC"].reserve(L1MuGMTConfig::MAXCSC);
50  // m_inputmuons["IND"].reserve(L1MuGMTConfig::MAXDTBX);
51  // m_inputmuons["INB"].reserve(L1MuGMTConfig::MAXRPC);
52  // m_inputmuons["INF"].reserve(L1MuGMTConfig::MAXRPC);
53  m_inputmuons["INC"].reserve(4);
54  m_inputmuons["IND"].reserve(4);
55  m_inputmuons["INB"].reserve(4);
56  m_inputmuons["INF"].reserve(4);
57 }
58 
59 //--------------
60 // Destructor --
61 //--------------
63 
64 //--------------
65 // Operations --
66 //--------------
68  if (m_inputmuons.count(chipid) == 0)
69  throw std::runtime_error("L1MuGMTInputEvent::addInputMuon: invalid chipid:" + chipid);
70  m_inputmuons[chipid].push_back(inMu);
71 }
72 
74  m_runnr = 0L;
75  m_evtnr = 0L;
76 
77  std::map<std::string, std::vector<L1MuRegionalCand> >::iterator it = m_inputmuons.begin();
78  for (; it != m_inputmuons.end(); it++) {
79  it->second.clear();
80  }
81 
82  m_mip_bits.reset(false);
83  m_iso_bits.reset(true); //see CTOR for info on this
84 }
85 
87  if (m_inputmuons.count(chipid) == 0)
88  throw std::runtime_error("L1GMTInputEvent::getInputMuon: invalid chipid:" + chipid);
89 
90  if (index >= m_inputmuons.find(chipid)->second.size())
91  return nullptr;
92  return &(m_inputmuons.find(chipid)->second.at(index));
93 }
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
virtual ~L1MuGMTInputEvent()
L1MuGMTMatrix< bool > m_iso_bits
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
void reset(T v)
reset all elements
void addInputMuon(std::string chipid, const L1MuRegionalCand &inMu)
const L1MuRegionalCand * getInputMuon(std::string chipid, unsigned index) const
unsigned long m_runnr