Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:34

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuBMTrackSegLoc
0004 //
0005 //   Description: Logical location of a 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 "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 #include <iostream>
0025 #include <iomanip>
0026 #include <cstdlib>
0027 #include <cassert>
0028 
0029 //-------------------------------
0030 // Collaborating Class Headers --
0031 //-------------------------------
0032 
0033 using namespace std;
0034 
0035 // --------------------------------
0036 //       class L1MuBMTrackSegLoc
0037 //---------------------------------
0038 
0039 //----------------
0040 // Constructors --
0041 //----------------
0042 
0043 L1MuBMTrackSegLoc::L1MuBMTrackSegLoc() : m_wheel(0), m_sector(0), m_station(0) {}
0044 
0045 L1MuBMTrackSegLoc::L1MuBMTrackSegLoc(int wheel_id, int sector_id, int station_id)
0046     : m_wheel(wheel_id), m_sector(sector_id), m_station(station_id) {
0047   //  assert(wheel_id   >= -3 && wheel_id   <=  3);
0048   //  assert(sector_id  >=  0 && sector_id  <  12);
0049 
0050   if (abs(wheel_id) == 3) {
0051     //    assert(station_id >= 3 && station_id <= 4);
0052   } else {
0053     //    assert(station_id >= 1 && station_id <= 4);
0054   }
0055 }
0056 
0057 L1MuBMTrackSegLoc::L1MuBMTrackSegLoc(const L1MuBMTrackSegLoc& id)
0058     : m_wheel(id.m_wheel), m_sector(id.m_sector), m_station(id.m_station) {}
0059 
0060 //--------------
0061 // Destructor --
0062 //--------------
0063 
0064 L1MuBMTrackSegLoc::~L1MuBMTrackSegLoc() {}
0065 
0066 //--------------
0067 // Operations --
0068 //--------------
0069 
0070 //
0071 // Assignment operator
0072 //
0073 L1MuBMTrackSegLoc& L1MuBMTrackSegLoc::operator=(const L1MuBMTrackSegLoc& id) {
0074   if (this != &id) {
0075     m_wheel = id.m_wheel;
0076     m_sector = id.m_sector;
0077     m_station = id.m_station;
0078   }
0079   return *this;
0080 }
0081 
0082 //
0083 // Equal operator
0084 //
0085 bool L1MuBMTrackSegLoc::operator==(const L1MuBMTrackSegLoc& id) const {
0086   if (m_wheel != id.wheel())
0087     return false;
0088   if (m_sector != id.sector())
0089     return false;
0090   if (m_station != id.station())
0091     return false;
0092   return true;
0093 }
0094 
0095 //
0096 // Unequal operator
0097 //
0098 bool L1MuBMTrackSegLoc::operator!=(const L1MuBMTrackSegLoc& id) const {
0099   if (m_wheel != id.wheel())
0100     return true;
0101   if (m_sector != id.sector())
0102     return true;
0103   if (m_station != id.station())
0104     return true;
0105   return false;
0106 }
0107 
0108 //
0109 // Less operator
0110 //
0111 bool L1MuBMTrackSegLoc::operator<(const L1MuBMTrackSegLoc& id) const {
0112   if (wheel() < id.wheel())
0113     return true;
0114   if (wheel() > id.wheel())
0115     return false;
0116   if (sector() < id.sector())
0117     return true;
0118   if (sector() > id.sector())
0119     return false;
0120   if (station() < id.station())
0121     return true;
0122   if (station() > id.station())
0123     return false;
0124   return false;
0125 }
0126 
0127 //
0128 // output stream operator
0129 //
0130 ostream& operator<<(ostream& s, const L1MuBMTrackSegLoc& id) {
0131   s.setf(ios::right, ios::adjustfield);
0132   s << "wheel = " << setw(2) << id.wheel() << "  "
0133     << "sector = " << setw(2) << id.sector() << "  "
0134     << "station = " << setw(1) << id.station();
0135 
0136   return s;
0137 }