CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1MuGMTInputEvent Class Reference

#include <L1MuGMTInputEvent.h>

List of all members.

Public Member Functions

void addInputMuon (std::string chipid, const L1MuRegionalCand &inMu)
unsigned long getEventNumber () const
 get the Event number
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
unsigned long getRunNumber () const
 get the Run number
bool isEmpty () const
 is the event empty?
 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.

                                     : 
                m_runnr(0L), m_evtnr(0L), m_mip_bits(14,18), m_iso_bits(14,18) {
  std::vector<L1MuRegionalCand> empty_vec;
  m_inputmuons["INC"] = empty_vec;
  m_inputmuons["IND"] = empty_vec;
  m_inputmuons["INB"] = empty_vec;
  m_inputmuons["INF"] = empty_vec;

  //  m_inputmuons["INC"].reserve(L1MuGMTConfig::MAXCSC);
  //  m_inputmuons["IND"].reserve(L1MuGMTConfig::MAXDTBX);
  //  m_inputmuons["INB"].reserve(L1MuGMTConfig::MAXRPC);
  //  m_inputmuons["INF"].reserve(L1MuGMTConfig::MAXRPC);
  m_inputmuons["INC"].reserve(4);
  m_inputmuons["IND"].reserve(4);
  m_inputmuons["INB"].reserve(4);
  m_inputmuons["INF"].reserve(4);
  
  m_mip_bits.init(false);
  m_iso_bits.init(true); //this is more useful when reading a standalone input file
                         //since "not-quiet" bits are stored there
}
L1MuGMTInputEvent::~L1MuGMTInputEvent ( ) [virtual]

Definition at line 63 of file L1MuGMTInputEvent.cc.

                                      {
}

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().

                                                                   {
  if (m_inputmuons.count(chipid) == 0)
    throw std::runtime_error("L1MuGMTInputEvent::addInputMuon: invalid chipid:" + chipid);
  m_inputmuons[chipid].push_back(inMu);
}
unsigned long L1MuGMTInputEvent::getEventNumber ( ) const [inline]

get the Event number

Definition at line 76 of file L1MuGMTInputEvent.h.

References m_evtnr.

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

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

                                                                                              {

  if (m_inputmuons.count(chipid) == 0 )
    throw std::runtime_error("L1GMTInputEvent::getInputMuon: invalid chipid:" + chipid);
  
  if (index >= m_inputmuons.find(chipid)->second.size()) return 0;
  return &(m_inputmuons.find(chipid)->second.at(index));
}
const bool& L1MuGMTInputEvent::getIsoBit ( unsigned  etaIndex,
unsigned  phiIndex 
) [inline]

Definition at line 93 of file L1MuGMTInputEvent.h.

Referenced by L1MuGMTHWFileReader::produce().

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

Definition at line 90 of file L1MuGMTInputEvent.h.

References m_iso_bits.

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

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

get the MIP / ISO bits

Definition at line 88 of file L1MuGMTInputEvent.h.

References m_mip_bits.

{ return 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::produce(), and L1MuGMTHWFileReader::setRunAndEventInfo().

{ return 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.

{ return (m_runnr == 0L) && (m_evtnr == 0L); };
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().

                              {
  m_runnr = 0L;
  m_evtnr = 0L;

  std::map<std::string, std::vector<L1MuRegionalCand> >::iterator it = m_inputmuons.begin();
  for (; it != m_inputmuons.end(); it++) {
    it->second.clear();
  }

  m_mip_bits.init(false);
  m_iso_bits.init(true); //see CTOR for info on this
}
void L1MuGMTInputEvent::setEventNumber ( unsigned long  eventnr) [inline]

Definition at line 60 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

{ m_evtnr=eventnr; };
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().

                                                                   {
      m_iso_bits(etaIndex, phiIndex) = val; };
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().

                                                                   { 
      m_mip_bits(etaIndex, phiIndex) = val; };
void L1MuGMTInputEvent::setRunNumber ( unsigned long  runnr) [inline]

Definition at line 58 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

{ m_runnr=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().

Definition at line 104 of file L1MuGMTInputEvent.h.

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

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().