CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/L1Trigger/DTTrackFinder/src/L1MuDTTrackSegEta.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuDTTrackSegEta
00004 //
00005 //   Description: ETA Track Segment 
00006 //
00007 //
00008 //   $Date: 2007/02/27 11:44:00 $
00009 //   $Revision: 1.2 $
00010 //
00011 //   Author :
00012 //   N. Neumeister            CERN EP 
00013 //
00014 //--------------------------------------------------
00015 
00016 //-----------------------
00017 // This Class's Header --
00018 //-----------------------
00019 
00020 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegEta.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 #include <iostream>
00027 #include <iomanip>
00028 #include <algorithm>
00029 #include <bitset>
00030 
00031 //-------------------------------
00032 // Collaborating Class Headers --
00033 //-------------------------------
00034 
00035 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegLoc.h"
00036 
00037 using namespace std;
00038 
00039 // --------------------------------
00040 //       class L1MuDTTrackSegEta
00041 //---------------------------------
00042 
00043 //----------------
00044 // Constructors --
00045 //----------------
00046 
00047 L1MuDTTrackSegEta::L1MuDTTrackSegEta() : 
00048   m_location(), m_position(0), m_quality(0), m_bx(0) {}
00049 
00050 
00051 L1MuDTTrackSegEta::L1MuDTTrackSegEta(int wheel_id, int sector_id, int station_id, 
00052                                      int pos, int quality, int  bx) :
00053   m_location(wheel_id, sector_id, station_id),
00054   m_position(pos), m_quality(quality), m_bx(bx) {
00055 
00056 }
00057 
00058 
00059 L1MuDTTrackSegEta::L1MuDTTrackSegEta(const L1MuDTTrackSegLoc& id, 
00060                                      int pos, int quality, int  bx) : 
00061   m_location(id), m_position(pos), m_quality(quality), m_bx(bx) {
00062 
00063 }
00064   
00065 
00066 L1MuDTTrackSegEta::L1MuDTTrackSegEta(const L1MuDTTrackSegEta& id) :
00067   m_location(id.m_location),
00068   m_position(id.m_position), m_quality(id.m_quality), m_bx(id.m_bx) {}
00069 
00070 
00071 
00072 //--------------
00073 // Destructor --
00074 //--------------
00075 L1MuDTTrackSegEta::~L1MuDTTrackSegEta() {}
00076 
00077 
00078 //--------------
00079 // Operations --
00080 //--------------
00081 
00082 //
00083 // reset ETA Track Segment
00084 //
00085 void L1MuDTTrackSegEta::reset() {
00086 
00087   m_position = 0;
00088   m_quality  = 0;
00089   m_bx       = 0;
00090 
00091 }
00092 
00093 
00094 //
00095 // Assignment operator
00096 //
00097 L1MuDTTrackSegEta& L1MuDTTrackSegEta::operator=(const L1MuDTTrackSegEta& id) {
00098 
00099   if ( this != &id ) {
00100     m_location = id.m_location;
00101     m_position = id.m_position;
00102     m_quality  = id.m_quality;
00103     m_bx       = id.m_bx;
00104   }
00105   return *this;
00106 
00107 }
00108 
00109 
00110 //
00111 // Equal operator
00112 //
00113 bool L1MuDTTrackSegEta::operator==(const L1MuDTTrackSegEta& id) const {
00114 
00115   if ( m_location != id.m_location ) return false;
00116   if ( m_position != id.m_position ) return false;
00117   if ( m_quality  != id.m_quality )  return false;
00118   if ( m_bx       != id.m_bx )       return false;
00119   return true;
00120 
00121 }
00122 
00123 
00124 //
00125 // Unequal operator
00126 //
00127 bool L1MuDTTrackSegEta::operator!=(const L1MuDTTrackSegEta& id) const {
00128   
00129   if ( m_location != id.m_location ) return true;
00130   if ( m_position != id.m_position ) return true;
00131   if ( m_quality  != id.m_quality )  return true;
00132   if ( m_bx       != id.m_bx )       return true;
00133   return false;
00134 
00135 }
00136 
00137 
00138 //
00139 // output stream operator
00140 //
00141 ostream& operator<<(ostream& s, const L1MuDTTrackSegEta& id) {
00142 
00143   s.setf(ios::right,ios::adjustfield);
00144   s << (id.m_location) << "\t" 
00145     << "position : " << bitset<7>(id.position()) << "  "
00146     << "quality : " << bitset<7>(id.quality()); 
00147 
00148   return s;
00149 
00150 }