CMS 3D CMS Logo

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 41 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 36 of file L1MuGMTInputEvent.cc.

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

36  :
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 }
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 61 of file L1MuGMTInputEvent.cc.

61  {
62 }

Member Function Documentation

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

Definition at line 67 of file L1MuGMTInputEvent.cc.

References m_inputmuons.

Referenced by L1MuGMTHWFileReader::readNextEvent(), and setEventNumber().

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

get the Event number

Definition at line 74 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

74 { 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 87 of file L1MuGMTInputEvent.cc.

References m_inputmuons.

Referenced by isEmpty(), and L1MuGMTHWFileReader::produce().

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

Definition at line 91 of file L1MuGMTInputEvent.h.

Referenced by L1MuGMTHWFileReader::produce().

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

Definition at line 88 of file L1MuGMTInputEvent.h.

References m_iso_bits.

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

Definition at line 90 of file L1MuGMTInputEvent.h.

References m_mip_bits.

Referenced by L1MuGMTHWFileReader::produce().

90 { 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 86 of file L1MuGMTInputEvent.h.

References m_mip_bits.

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

get the Run number

Definition at line 71 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

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

is the event empty?

Definition at line 77 of file L1MuGMTInputEvent.h.

References getInputMuon(), dttmaxenums::L, m_evtnr, m_runnr, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by plotting.Plot::clone().

77 { 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 74 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().

74  {
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 }
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 58 of file L1MuGMTInputEvent.h.

References addInputMuon(), m_evtnr, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1MuGMTHWFileReader::readNextEvent().

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

Definition at line 67 of file L1MuGMTInputEvent.h.

References m_iso_bits, and heppy_batch::val.

Referenced by L1MuGMTHWFileReader::readNextEvent().

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

Definition at line 63 of file L1MuGMTInputEvent.h.

References m_mip_bits, and heppy_batch::val.

Referenced by L1MuGMTHWFileReader::readNextEvent().

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

Definition at line 56 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

56 { m_runnr=runnr; };
unsigned long m_runnr

Member Data Documentation

unsigned long L1MuGMTInputEvent::m_evtnr
private

Definition at line 97 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 99 of file L1MuGMTInputEvent.h.

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

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_iso_bits
private

Definition at line 102 of file L1MuGMTInputEvent.h.

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

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_mip_bits
private

Definition at line 101 of file L1MuGMTInputEvent.h.

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

unsigned long L1MuGMTInputEvent::m_runnr
private

Definition at line 91 of file L1MuGMTInputEvent.h.

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