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
//-------------------------------------------------
//
//   Class: L1MuGMTExtendedCand
//
//   Description: L1 Global Muon Trigger Candidate
//
//
//
//   Author :
//   H. Sakulin        HEPHY Vienna
//
//   Migrated to CMSSW:
//   I. Mikulec
//
//--------------------------------------------------

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

#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"

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

#include <iostream>
#include <iomanip>
#include <cmath>

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

#include "FWCore/MessageLogger/interface/MessageLogger.h"

using namespace std;

//---------------------------------
//       class L1MuGMTExtendedCand
//---------------------------------

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

L1MuGMTExtendedCand::L1MuGMTExtendedCand() : L1MuGMTCand(), m_rank(0) {}

L1MuGMTExtendedCand::L1MuGMTExtendedCand(const L1MuGMTExtendedCand& mu) : L1MuGMTCand(mu), m_rank(mu.m_rank) {}

L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand(data, bx), m_rank(rank) {}

//--------------
// Destructor --
//--------------
L1MuGMTExtendedCand::~L1MuGMTExtendedCand() { reset(); }

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

//
// reset Muon Track Candidate
//
void L1MuGMTExtendedCand::reset() {
  L1MuGMTCand::reset();
  m_rank = 0;
}

//
// return detector index
// 1 RPC, 2 DT, 3 DT/RPC, 4 CSC, 5 CSC/RPC
//
// supported for backward compatibility only
//

unsigned int L1MuGMTExtendedCand::detector() const {
  if (quality() == 7)  // matched ?
    return isFwd() ? 5 : 3;
  else
    return isRPC() ? 1 : (isFwd() ? 4 : 2);
}

//
// Equal operator
//
bool L1MuGMTExtendedCand::operator==(const L1MuGMTExtendedCand& cand) const {
  if ((L1MuGMTCand const&)*this != cand)
    return false;
  if (m_rank != cand.m_rank)
    return false;
  return true;
}

//
// Unequal operator
//
bool L1MuGMTExtendedCand::operator!=(const L1MuGMTExtendedCand& cand) const {
  if ((L1MuGMTCand const&)*this != cand)
    return true;
  if (m_rank != cand.m_rank)
    return true;
  return false;
}

//
// print parameters of track candidate
//
void L1MuGMTExtendedCand::print() const {
  L1MuGMTCand::print();
  if (!empty()) {
    edm::LogVerbatim("GMT_Candidate_info") << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
                                           << "rank = " << setw(3) << rank() << "  "
                                           << "idxdtcsc = " << setw(1) << getDTCSCIndex() << "  "
                                           << "idxrpc = " << setw(1) << getRPCIndex() << "  "
                                           << "isFwd = " << setw(1) << isFwd() << "  "
                                           << "isRPC = " << setw(1) << isRPC() << endl;
  }
}

//
// output stream operator for track candidate
//
ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
  if (!id.empty()) {
    s << ((L1MuGMTCand const&)id) << setiosflags(ios::showpoint | ios::fixed) << "rank = " << setw(3) << id.rank()
      << "  "
      << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << "  "
      << "idxrpc = " << setw(1) << id.getRPCIndex() << "  "
      << "isFwd = " << setw(1) << id.isFwd() << "  "
      << "isRPC = " << setw(1) << id.isRPC();
  }
  return s;
}