CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/L1GlobalMuonTrigger/src/L1MuGMTExtendedCand.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTExtendedCand
00004 //
00005 //   Description: L1 Global Muon Trigger Candidate
00006 //
00007 //
00008 //   $Date: 2007/04/02 15:44:10 $
00009 //   $Revision: 1.3 $
00010 //
00011 //   Author :
00012 //   H. Sakulin        HEPHY Vienna
00013 //
00014 //   Migrated to CMSSW:
00015 //   I. Mikulec
00016 //
00017 //--------------------------------------------------
00018 
00019 //-----------------------
00020 // This Class's Header --
00021 //-----------------------
00022 
00023 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"
00024 
00025 //---------------
00026 // C++ Headers --
00027 //---------------
00028 
00029 #include <iostream>
00030 #include <iomanip>
00031 #include <cmath>
00032 
00033 //-------------------------------
00034 // Collaborating Class Headers --
00035 //-------------------------------
00036 
00037 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00038 
00039 using namespace std;
00040 
00041 //---------------------------------
00042 //       class L1MuGMTExtendedCand
00043 //---------------------------------
00044 
00045 //----------------
00046 // Constructors --
00047 //----------------
00048 
00049 L1MuGMTExtendedCand::L1MuGMTExtendedCand() : L1MuGMTCand(), m_rank(0) {
00050 }
00051 
00052 L1MuGMTExtendedCand::L1MuGMTExtendedCand(const L1MuGMTExtendedCand& mu) :
00053   L1MuGMTCand(mu), m_rank(mu.m_rank){
00054 }
00055 
00056 L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand (data, bx), m_rank(rank) {
00057 
00058 }
00059 
00060 //--------------
00061 // Destructor --
00062 //--------------
00063 L1MuGMTExtendedCand::~L1MuGMTExtendedCand() {
00064 
00065   reset();
00066 
00067 }
00068 
00069 
00070 //--------------
00071 // Operations --
00072 //--------------
00073 
00074 //
00075 // reset Muon Track Candidate
00076 //
00077 void L1MuGMTExtendedCand::reset() {
00078 
00079   L1MuGMTCand::reset();
00080   m_rank = 0;
00081 
00082 }
00083 
00084 //
00085 // return detector index 
00086 // 1 RPC, 2 DT, 3 DT/RPC, 4 CSC, 5 CSC/RPC
00087 //
00088 // supported for backward compatibility only
00089 //
00090 
00091 unsigned int L1MuGMTExtendedCand::detector() const {
00092   
00093   if (quality() == 7) // matched ?
00094     return isFwd() ? 5 : 3;
00095   else 
00096     return isRPC() ? 1 : ( isFwd()? 4 : 2); 
00097 
00098 }
00099 
00100 
00101 //
00102 // Equal operator
00103 //
00104 bool L1MuGMTExtendedCand::operator==(const L1MuGMTExtendedCand& cand) const {
00105 
00106   if ( (L1MuGMTCand const&) *this != cand )   return false; 
00107   if ( m_rank                     != m_rank ) return false;
00108   return true;
00109 
00110 }
00111 
00112 
00113 //
00114 // Unequal operator
00115 //
00116 bool L1MuGMTExtendedCand::operator!=(const L1MuGMTExtendedCand& cand) const {
00117 
00118   if ( (L1MuGMTCand const&) *this != cand ) return true;  
00119   if ( m_rank  != cand.m_rank )             return true;
00120   return false;
00121 
00122 }
00123 
00124 
00125 //
00126 // print parameters of track candidate
00127 //
00128 void L1MuGMTExtendedCand::print() const {
00129 
00130   L1MuGMTCand::print();
00131   if ( !empty() ) {
00132     edm::LogVerbatim("GMT_Candidate_info")
00133          << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
00134          << "rank = " << setw(3) << rank() << "  " 
00135          << "idxdtcsc = " << setw(1) << getDTCSCIndex() << "  "
00136          << "idxrpc = " << setw(1) << getRPCIndex() << "  "
00137          << "isFwd = " << setw(1) << isFwd()  << "  "
00138          << "isRPC = " << setw(1) << isRPC() << endl;
00139    }
00140 
00141 }
00142 
00143 
00144 //
00145 // output stream operator for track candidate
00146 //
00147 ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
00148 
00149   if ( !id.empty() ) {
00150     s << ( (L1MuGMTCand const &) id ) <<
00151       setiosflags(ios::showpoint | ios::fixed) 
00152       << "rank = " << setw(3) << id.rank() << "  "
00153       << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << "  "
00154       << "idxrpc = " << setw(1) << id.getRPCIndex() << "  "
00155       << "isFwd = " << setw(1) << id.isFwd() << "  "
00156       << "isRPC = " << setw(1) << id.isRPC() ;
00157   }
00158   return s;
00159 
00160 }
00161 
00162 
00163 
00164 
00165 
00166 
00167 
00168 
00169 
00170