Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:43

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuDTTrackSegEta
0004 //
0005 //   Description: ETA Track Segment
0006 //
0007 //
0008 //
0009 //   Author :
0010 //   N. Neumeister            CERN EP
0011 //
0012 //--------------------------------------------------
0013 
0014 //-----------------------
0015 // This Class's Header --
0016 //-----------------------
0017 
0018 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegEta.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 #include <iostream>
0025 #include <iomanip>
0026 #include <algorithm>
0027 #include <bitset>
0028 
0029 //-------------------------------
0030 // Collaborating Class Headers --
0031 //-------------------------------
0032 
0033 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegLoc.h"
0034 
0035 using namespace std;
0036 
0037 // --------------------------------
0038 //       class L1MuDTTrackSegEta
0039 //---------------------------------
0040 
0041 //----------------
0042 // Constructors --
0043 //----------------
0044 
0045 L1MuDTTrackSegEta::L1MuDTTrackSegEta() : m_location(), m_position(0), m_quality(0), m_bx(0) {}
0046 
0047 L1MuDTTrackSegEta::L1MuDTTrackSegEta(int wheel_id, int sector_id, int station_id, int pos, int quality, int bx)
0048     : m_location(wheel_id, sector_id, station_id), m_position(pos), m_quality(quality), m_bx(bx) {}
0049 
0050 L1MuDTTrackSegEta::L1MuDTTrackSegEta(const L1MuDTTrackSegLoc& id, int pos, int quality, int bx)
0051     : m_location(id), m_position(pos), m_quality(quality), m_bx(bx) {}
0052 
0053 L1MuDTTrackSegEta::L1MuDTTrackSegEta(const L1MuDTTrackSegEta& id)
0054     : m_location(id.m_location), m_position(id.m_position), m_quality(id.m_quality), m_bx(id.m_bx) {}
0055 
0056 //--------------
0057 // Destructor --
0058 //--------------
0059 L1MuDTTrackSegEta::~L1MuDTTrackSegEta() {}
0060 
0061 //--------------
0062 // Operations --
0063 //--------------
0064 
0065 //
0066 // reset ETA Track Segment
0067 //
0068 void L1MuDTTrackSegEta::reset() {
0069   m_position = 0;
0070   m_quality = 0;
0071   m_bx = 0;
0072 }
0073 
0074 //
0075 // Assignment operator
0076 //
0077 L1MuDTTrackSegEta& L1MuDTTrackSegEta::operator=(const L1MuDTTrackSegEta& id) {
0078   if (this != &id) {
0079     m_location = id.m_location;
0080     m_position = id.m_position;
0081     m_quality = id.m_quality;
0082     m_bx = id.m_bx;
0083   }
0084   return *this;
0085 }
0086 
0087 //
0088 // Equal operator
0089 //
0090 bool L1MuDTTrackSegEta::operator==(const L1MuDTTrackSegEta& id) const {
0091   if (m_location != id.m_location)
0092     return false;
0093   if (m_position != id.m_position)
0094     return false;
0095   if (m_quality != id.m_quality)
0096     return false;
0097   if (m_bx != id.m_bx)
0098     return false;
0099   return true;
0100 }
0101 
0102 //
0103 // Unequal operator
0104 //
0105 bool L1MuDTTrackSegEta::operator!=(const L1MuDTTrackSegEta& id) const {
0106   if (m_location != id.m_location)
0107     return true;
0108   if (m_position != id.m_position)
0109     return true;
0110   if (m_quality != id.m_quality)
0111     return true;
0112   if (m_bx != id.m_bx)
0113     return true;
0114   return false;
0115 }
0116 
0117 //
0118 // output stream operator
0119 //
0120 ostream& operator<<(ostream& s, const L1MuDTTrackSegEta& id) {
0121   s.setf(ios::right, ios::adjustfield);
0122   s << (id.m_location) << "\t"
0123     << "position : " << bitset<7>(id.position()) << "  "
0124     << "quality : " << bitset<7>(id.quality());
0125 
0126   return s;
0127 }