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
//-------------------------------------------------
//
//   Class: L1MuBMTrackSegEta
//
//   Description: ETA Track Segment
//
//
//
//   Author :
//   N. Neumeister            CERN EP
//
//--------------------------------------------------

//-----------------------
// This Class's Header --
//-----------------------

#include "DataFormats/L1TMuon/interface/L1MuBMTrackSegEta.h"

//---------------
// C++ Headers --
//---------------

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>

//-------------------------------
// Collaborating Class Headers --
//-------------------------------

#include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"

using namespace std;

// --------------------------------
//       class L1MuBMTrackSegEta
//---------------------------------

//----------------
// Constructors --
//----------------

L1MuBMTrackSegEta::L1MuBMTrackSegEta() : m_location(), m_position(0), m_quality(0), m_bx(0) {}

L1MuBMTrackSegEta::L1MuBMTrackSegEta(int wheel_id, int sector_id, int station_id, int pos, int quality, int bx)
    : m_location(wheel_id, sector_id, station_id), m_position(pos), m_quality(quality), m_bx(bx) {}

L1MuBMTrackSegEta::L1MuBMTrackSegEta(const L1MuBMTrackSegLoc& id, int pos, int quality, int bx)
    : m_location(id), m_position(pos), m_quality(quality), m_bx(bx) {}

L1MuBMTrackSegEta::L1MuBMTrackSegEta(const L1MuBMTrackSegEta& id)
    : m_location(id.m_location), m_position(id.m_position), m_quality(id.m_quality), m_bx(id.m_bx) {}

//--------------
// Destructor --
//--------------
L1MuBMTrackSegEta::~L1MuBMTrackSegEta() {}

//--------------
// Operations --
//--------------

//
// reset ETA Track Segment
//
void L1MuBMTrackSegEta::reset() {
  m_position = 0;
  m_quality = 0;
  m_bx = 0;
}

//
// Assignment operator
//
L1MuBMTrackSegEta& L1MuBMTrackSegEta::operator=(const L1MuBMTrackSegEta& id) {
  if (this != &id) {
    m_location = id.m_location;
    m_position = id.m_position;
    m_quality = id.m_quality;
    m_bx = id.m_bx;
  }
  return *this;
}

//
// Equal operator
//
bool L1MuBMTrackSegEta::operator==(const L1MuBMTrackSegEta& id) const {
  if (m_location != id.m_location)
    return false;
  if (m_position != id.m_position)
    return false;
  if (m_quality != id.m_quality)
    return false;
  if (m_bx != id.m_bx)
    return false;
  return true;
}

//
// Unequal operator
//
bool L1MuBMTrackSegEta::operator!=(const L1MuBMTrackSegEta& id) const {
  if (m_location != id.m_location)
    return true;
  if (m_position != id.m_position)
    return true;
  if (m_quality != id.m_quality)
    return true;
  if (m_bx != id.m_bx)
    return true;
  return false;
}

//
// output stream operator
//
ostream& operator<<(ostream& s, const L1MuBMTrackSegEta& id) {
  s.setf(ios::right, ios::adjustfield);
  s << (id.m_location) << "\t"
    << "position : " << bitset<7>(id.position()) << "  "
    << "quality : " << bitset<7>(id.quality());

  return s;
}