CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1MuGMTInputEvent Class Reference

#include <L1MuGMTInputEvent.h>

Public Member Functions

void addInputMuon (std::string chipid, const L1MuRegionalCand &inMu)
 
unsigned long getEventNumber () const
 get the Event number More...
 
const L1MuRegionalCandgetInputMuon (std::string chipid, unsigned index) const
 
const bool & getIsoBit (unsigned etaIndex, unsigned phiIndex)
 
const L1MuGMTMatrix< bool > & getIsoBits () const
 
const bool & getMipBit (unsigned etaIndex, unsigned phiIndex)
 
const L1MuGMTMatrix< bool > & getMipBits () const
 get the MIP / ISO bits More...
 
unsigned long getRunNumber () const
 get the Run number More...
 
bool isEmpty () const
 is the event empty? More...
 
 L1MuGMTInputEvent ()
 
void reset ()
 
void setEventNumber (unsigned long eventnr)
 
void setIsoBit (unsigned etaIndex, unsigned phiIndex, bool val)
 
void setMipBit (unsigned etaIndex, unsigned phiIndex, bool val)
 
void setRunNumber (unsigned long runnr)
 
virtual ~L1MuGMTInputEvent ()
 

Private Attributes

unsigned long m_evtnr
 
std::map< std::string,
std::vector< L1MuRegionalCand > > 
m_inputmuons
 
L1MuGMTMatrix< bool > m_iso_bits
 
L1MuGMTMatrix< bool > m_mip_bits
 
unsigned long m_runnr
 

Detailed Description

Definition at line 43 of file L1MuGMTInputEvent.h.

Constructor & Destructor Documentation

L1MuGMTInputEvent::L1MuGMTInputEvent ( )

constructor, initializes everything to 0/false, apart from the ISO bits, which are initialized to true;

Definition at line 38 of file L1MuGMTInputEvent.cc.

References L1MuGMTMatrix< T >::init(), m_inputmuons, m_iso_bits, and m_mip_bits.

38  :
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 }
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
void init(T v=0)
initialize matrix
L1MuGMTMatrix< bool > m_iso_bits
unsigned long m_runnr
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
L1MuGMTInputEvent::~L1MuGMTInputEvent ( )
virtual

Definition at line 63 of file L1MuGMTInputEvent.cc.

63  {
64 }

Member Function Documentation

void L1MuGMTInputEvent::addInputMuon ( std::string  chipid,
const L1MuRegionalCand inMu 
)

Definition at line 69 of file L1MuGMTInputEvent.cc.

References m_inputmuons.

Referenced by L1MuGMTHWFileReader::readNextEvent().

70  {
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 }
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
unsigned long L1MuGMTInputEvent::getEventNumber ( ) const
inline

get the Event number

Definition at line 76 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

76 { return m_evtnr; };
unsigned long m_evtnr
const L1MuRegionalCand * L1MuGMTInputEvent::getInputMuon ( std::string  chipid,
unsigned  index 
) const

get [index]th input muon in chip [chipid]

Parameters
chipidis the input chip ID (IND, INC, INB, INF)
indexis the index of the muon in the input chip (starting with 0)
Returns
the L1MuRegionalCand specified or 0 if index is out of range

Definition at line 89 of file L1MuGMTInputEvent.cc.

References m_inputmuons.

Referenced by L1MuGMTHWFileReader::produce().

89  {
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 }
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
const bool& L1MuGMTInputEvent::getIsoBit ( unsigned  etaIndex,
unsigned  phiIndex 
)
inline

Definition at line 93 of file L1MuGMTInputEvent.h.

Referenced by L1MuGMTHWFileReader::produce().

93 { return m_iso_bits(etaIndex, phiIndex); };
L1MuGMTMatrix< bool > m_iso_bits
const L1MuGMTMatrix<bool>& L1MuGMTInputEvent::getIsoBits ( ) const
inline

Definition at line 90 of file L1MuGMTInputEvent.h.

References m_iso_bits.

90 { return m_iso_bits; };
L1MuGMTMatrix< bool > m_iso_bits
const bool& L1MuGMTInputEvent::getMipBit ( unsigned  etaIndex,
unsigned  phiIndex 
)
inline

Definition at line 92 of file L1MuGMTInputEvent.h.

References m_mip_bits.

Referenced by L1MuGMTHWFileReader::produce().

92 { return m_mip_bits(etaIndex, phiIndex); };
L1MuGMTMatrix< bool > m_mip_bits
const L1MuGMTMatrix<bool>& L1MuGMTInputEvent::getMipBits ( ) const
inline

get the MIP / ISO bits

Definition at line 88 of file L1MuGMTInputEvent.h.

References m_mip_bits.

88 { return m_mip_bits; };
L1MuGMTMatrix< bool > m_mip_bits
unsigned long L1MuGMTInputEvent::getRunNumber ( ) const
inline

get the Run number

Definition at line 73 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

73 { return m_runnr; };
unsigned long m_runnr
bool L1MuGMTInputEvent::isEmpty ( void  ) const
inline

is the event empty?

Definition at line 79 of file L1MuGMTInputEvent.h.

References dttmaxenums::L, m_evtnr, and m_runnr.

79 { return (m_runnr == 0L) && (m_evtnr == 0L); };
unsigned long m_evtnr
unsigned long m_runnr
void L1MuGMTInputEvent::reset ( void  )

resets everything to 0/false, apart from the ISO bits, which are all set to true;

Definition at line 76 of file L1MuGMTInputEvent.cc.

References L1MuGMTMatrix< T >::init(), dttmaxenums::L, m_evtnr, m_inputmuons, m_iso_bits, m_mip_bits, and m_runnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

76  {
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 }
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
void init(T v=0)
initialize matrix
L1MuGMTMatrix< bool > m_iso_bits
unsigned long m_runnr
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
void L1MuGMTInputEvent::setEventNumber ( unsigned long  eventnr)
inline

Definition at line 60 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

60 { m_evtnr=eventnr; };
unsigned long m_evtnr
void L1MuGMTInputEvent::setIsoBit ( unsigned  etaIndex,
unsigned  phiIndex,
bool  val 
)
inline

Definition at line 69 of file L1MuGMTInputEvent.h.

References m_iso_bits.

Referenced by L1MuGMTHWFileReader::readNextEvent().

69  {
70  m_iso_bits(etaIndex, phiIndex) = val; };
L1MuGMTMatrix< bool > m_iso_bits
void L1MuGMTInputEvent::setMipBit ( unsigned  etaIndex,
unsigned  phiIndex,
bool  val 
)
inline

Definition at line 65 of file L1MuGMTInputEvent.h.

References m_mip_bits.

Referenced by L1MuGMTHWFileReader::readNextEvent().

65  {
66  m_mip_bits(etaIndex, phiIndex) = val; };
L1MuGMTMatrix< bool > m_mip_bits
void L1MuGMTInputEvent::setRunNumber ( unsigned long  runnr)
inline

Definition at line 58 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

58 { m_runnr=runnr; };
unsigned long m_runnr

Member Data Documentation

unsigned long L1MuGMTInputEvent::m_evtnr
private

Definition at line 99 of file L1MuGMTInputEvent.h.

Referenced by getEventNumber(), isEmpty(), reset(), and setEventNumber().

std::map<std::string, std::vector <L1MuRegionalCand> > L1MuGMTInputEvent::m_inputmuons
private

Definition at line 101 of file L1MuGMTInputEvent.h.

Referenced by addInputMuon(), getInputMuon(), L1MuGMTInputEvent(), and reset().

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_iso_bits
private

Definition at line 104 of file L1MuGMTInputEvent.h.

Referenced by getIsoBits(), L1MuGMTInputEvent(), reset(), and setIsoBit().

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_mip_bits
private

Definition at line 103 of file L1MuGMTInputEvent.h.

Referenced by getMipBit(), getMipBits(), L1MuGMTInputEvent(), reset(), and setMipBit().

unsigned long L1MuGMTInputEvent::m_runnr
private

Definition at line 93 of file L1MuGMTInputEvent.h.

Referenced by getRunNumber(), isEmpty(), reset(), and setRunNumber().