L1MuGMTReadoutRecord

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
//-------------------------------------------------
//
/** \class L1MuGMTReadoutRecord
 *
 *  L1 Global Muon Trigger Readout Buffer
 *
 *  Contains the data that the GMT sends to readout
 *  for one bunch crossing.
 *
 *  Only simple data members are used so that it is easier
 *  to make the data persistent or use it in an other context.
*/
//
//
//   Author :
//   H. Sakulin                  HEPHY Vienna
//
//   Migrated to CMSSW:
//   I. Mikulec
//
//--------------------------------------------------
#ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutRecord_h
#define DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutRecord_h

//---------------
// C++ Headers --
//---------------
#include <vector>

//----------------------
// Base Class Headers --
//----------------------

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"

//              ---------------------
//              -- Class Interface --
//              ---------------------

class L1MuGMTReadoutRecord {
public:
  /// constructors
  L1MuGMTReadoutRecord();
  L1MuGMTReadoutRecord(int bxie);

  /// destructor
  virtual ~L1MuGMTReadoutRecord();

  /// reset the record
  void reset();

  //
  // Getters
  //

  /// get counters
  int getBxNr() const { return (int)m_BxNr; };
  int getBxCounter() const { return (int)m_BxInEvent; };  // for backward compatibility, do not use
  int getBxInEvent() const { return (int)m_BxInEvent; };
  int getEvNr() const { return (int)m_EvNr; };
  int getBCERR() const { return (int)m_BCERR; };

  /// get GMT candidates vector
  std::vector<L1MuGMTExtendedCand> getGMTCands() const;

  /// get GMT candidates vector as stored in data (no rank info)
  std::vector<L1MuGMTExtendedCand>& getGMTCandsData();

  /// get GMT barrel candidates vector
  std::vector<L1MuGMTExtendedCand> getGMTBrlCands() const;
  std::vector<L1MuGMTExtendedCand>& getGMTBrlCandsData() { return m_BarrelCands; };

  /// get GMT forward candidates vector
  std::vector<L1MuGMTExtendedCand> getGMTFwdCands() const;

  /// get DT candidates vector
  std::vector<L1MuRegionalCand> getDTBXCands() const;

  /// get CSC candidates vector
  std::vector<L1MuRegionalCand> getCSCCands() const;

  /// get barrel RPC candidates vector
  std::vector<L1MuRegionalCand> getBrlRPCCands() const;

  /// get forward RPC candidates vector
  std::vector<L1MuRegionalCand> getFwdRPCCands() const;

  /// get MIP bit
  unsigned getMIPbit(int eta, int phi) const;

  /// get Quiet bit
  unsigned getQuietbit(int eta, int phi) const;

  //
  // Setters
  //

  /// set counters
  void setBxNr(int bxnr) { m_BxNr = (unsigned)bxnr; };
  void setBxCounter(int bxie) { m_BxInEvent = (unsigned)bxie; };  // for backward compatibility, do not use
  void setBxInEvent(int bxie) { m_BxInEvent = (unsigned)bxie; };
  void setEvNr(int evnr) { m_EvNr = (unsigned)evnr; };
  void setBCERR(int bcerr) { m_BCERR = (unsigned)bcerr; };

  /// set GMT barrel candidate
  void setGMTBrlCand(int nr, L1MuGMTExtendedCand const& cand);

  /// set GMT barrel candidate
  void setGMTBrlCand(int nr, unsigned data, unsigned rank);

  /// set GMT forward candidate
  void setGMTFwdCand(int nr, L1MuGMTExtendedCand const& cand);

  /// set GMT forward candidate
  void setGMTFwdCand(int nr, unsigned data, unsigned rank);

  /// set GMT candidate (does not store rank)
  void setGMTCand(int nr, L1MuGMTExtendedCand const& cand);

  /// set GMT candidate (does not store rank)
  void setGMTCand(int nr, unsigned data);

  /// set Input muon
  void setInputCand(int nr, unsigned data);

  /// set Input muon
  void setInputCand(int nr, L1MuRegionalCand const& cand);

  /// set MIP bit
  void setMIPbit(int eta, int phi);

  /// set Quiet bit
  void setQuietbit(int eta, int phi);

private:
  unsigned getBrlRank(int i) const;
  unsigned getFwdRank(int i) const;

  void setBrlRank(int i, unsigned value);
  void setFwdRank(int i, unsigned value);

private:
  unsigned m_BxNr;
  unsigned m_BxInEvent;
  unsigned m_EvNr;

  unsigned m_BCERR;

  std::vector<L1MuRegionalCand> m_InputCands;

  std::vector<L1MuGMTExtendedCand> m_BarrelCands;
  std::vector<L1MuGMTExtendedCand> m_ForwardCands;
  std::vector<L1MuGMTExtendedCand> m_GMTCands;

  // mip/iso bits (252 EACH)
  unsigned m_MIPbits[8];
  unsigned m_Quietbits[8];
};

#endif