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::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 m_inputmuons.

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 }
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
L1MuGMTMatrix< bool > m_iso_bits
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
unsigned long m_runnr

◆ ~L1MuGMTInputEvent()

L1MuGMTInputEvent::~L1MuGMTInputEvent ( )
virtual

Definition at line 62 of file L1MuGMTInputEvent.cc.

62 {}

Member Function Documentation

◆ addInputMuon()

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

Definition at line 67 of file L1MuGMTInputEvent.cc.

References m_inputmuons.

Referenced by L1MuGMTHWFileReader::readNextEvent().

67  {
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 }
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons

◆ getEventNumber()

unsigned long L1MuGMTInputEvent::getEventNumber ( ) const
inline

get the Event number

Definition at line 70 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

70 { return m_evtnr; };
unsigned long m_evtnr

◆ getInputMuon()

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

References m_inputmuons.

Referenced by L1MuGMTHWFileReader::produce().

86  {
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 }
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons

◆ getIsoBit()

const bool& L1MuGMTInputEvent::getIsoBit ( unsigned  etaIndex,
unsigned  phiIndex 
)
inline

Definition at line 87 of file L1MuGMTInputEvent.h.

Referenced by L1MuGMTHWFileReader::produce().

87 { return m_iso_bits(etaIndex, phiIndex); };
L1MuGMTMatrix< bool > m_iso_bits

◆ getIsoBits()

const L1MuGMTMatrix<bool>& L1MuGMTInputEvent::getIsoBits ( ) const
inline

Definition at line 84 of file L1MuGMTInputEvent.h.

References m_iso_bits.

84 { return m_iso_bits; };
L1MuGMTMatrix< bool > m_iso_bits

◆ getMipBit()

const bool& L1MuGMTInputEvent::getMipBit ( unsigned  etaIndex,
unsigned  phiIndex 
)
inline

Definition at line 86 of file L1MuGMTInputEvent.h.

References m_mip_bits.

Referenced by L1MuGMTHWFileReader::produce().

86 { return m_mip_bits(etaIndex, phiIndex); };
L1MuGMTMatrix< bool > m_mip_bits

◆ getMipBits()

const L1MuGMTMatrix<bool>& L1MuGMTInputEvent::getMipBits ( ) const
inline

get the MIP / ISO bits

Definition at line 82 of file L1MuGMTInputEvent.h.

References m_mip_bits.

82 { return m_mip_bits; };
L1MuGMTMatrix< bool > m_mip_bits

◆ getRunNumber()

unsigned long L1MuGMTInputEvent::getRunNumber ( ) const
inline

get the Run number

Definition at line 67 of file L1MuGMTInputEvent.h.

References m_runnr.

Referenced by L1MuGMTHWFileReader::setRunAndEventInfo().

67 { return m_runnr; };
unsigned long m_runnr

◆ isEmpty()

bool L1MuGMTInputEvent::isEmpty ( void  ) const
inline

is the event empty?

Definition at line 73 of file L1MuGMTInputEvent.h.

References dttmaxenums::L, m_evtnr, and m_runnr.

Referenced by plotting.Plot::clone().

73 { return (m_runnr == 0L) && (m_evtnr == 0L); };
unsigned long m_evtnr
unsigned long m_runnr

◆ reset()

void L1MuGMTInputEvent::reset ( void  )

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

Definition at line 73 of file L1MuGMTInputEvent.cc.

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

Referenced by L1MuGMTHWFileReader::readNextEvent().

73  {
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 }
L1MuGMTMatrix< bool > m_mip_bits
unsigned long m_evtnr
L1MuGMTMatrix< bool > m_iso_bits
std::map< std::string, std::vector< L1MuRegionalCand > > m_inputmuons
void reset(T v)
reset all elements
unsigned long m_runnr

◆ setEventNumber()

void L1MuGMTInputEvent::setEventNumber ( unsigned long  eventnr)
inline

Definition at line 56 of file L1MuGMTInputEvent.h.

References m_evtnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

56 { m_evtnr = eventnr; };
unsigned long m_evtnr

◆ setIsoBit()

void L1MuGMTInputEvent::setIsoBit ( unsigned  etaIndex,
unsigned  phiIndex,
bool  val 
)
inline

Definition at line 64 of file L1MuGMTInputEvent.h.

References m_iso_bits, and heppy_batch::val.

Referenced by L1MuGMTHWFileReader::readNextEvent().

64 { m_iso_bits(etaIndex, phiIndex) = val; };
L1MuGMTMatrix< bool > m_iso_bits

◆ setMipBit()

void L1MuGMTInputEvent::setMipBit ( unsigned  etaIndex,
unsigned  phiIndex,
bool  val 
)
inline

Definition at line 61 of file L1MuGMTInputEvent.h.

References m_mip_bits, and heppy_batch::val.

Referenced by L1MuGMTHWFileReader::readNextEvent().

61 { m_mip_bits(etaIndex, phiIndex) = val; };
L1MuGMTMatrix< bool > m_mip_bits

◆ setRunNumber()

void L1MuGMTInputEvent::setRunNumber ( unsigned long  runnr)
inline

Definition at line 54 of file L1MuGMTInputEvent.h.

References m_runnr, and fileCollector::runnr.

Referenced by L1MuGMTHWFileReader::readNextEvent().

54 { m_runnr = runnr; };
unsigned long m_runnr

Member Data Documentation

◆ m_evtnr

unsigned long L1MuGMTInputEvent::m_evtnr
private

Definition at line 91 of file L1MuGMTInputEvent.h.

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

◆ m_inputmuons

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

Definition at line 93 of file L1MuGMTInputEvent.h.

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

◆ m_iso_bits

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_iso_bits
private

Definition at line 96 of file L1MuGMTInputEvent.h.

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

◆ m_mip_bits

L1MuGMTMatrix<bool> L1MuGMTInputEvent::m_mip_bits
private

Definition at line 95 of file L1MuGMTInputEvent.h.

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

◆ m_runnr

unsigned long L1MuGMTInputEvent::m_runnr
private

Definition at line 87 of file L1MuGMTInputEvent.h.

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