test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
L1MuBMSecProcId Class Reference

#include <L1MuBMSecProcId.h>

Public Member Functions

 L1MuBMSecProcId ()
 default constructor More...
 
 L1MuBMSecProcId (int wheel_id, int sector_id)
 constructor More...
 
 L1MuBMSecProcId (const L1MuBMSecProcId &)
 copy constructor More...
 
int locwheel () const
 return physical wheel number (-2,-1,0,+1,+2) More...
 
bool operator!= (const L1MuBMSecProcId &) const
 unequal operator More...
 
bool operator< (const L1MuBMSecProcId &) const
 less operator More...
 
L1MuBMSecProcIdoperator= (const L1MuBMSecProcId &)
 assignment operator More...
 
bool operator== (const L1MuBMSecProcId &) const
 equal operator More...
 
bool ovl () const
 is it an overlap region Sector Processor? More...
 
int sector () const
 return sector number More...
 
int wheel () const
 return wheel number More...
 
virtual ~L1MuBMSecProcId ()
 destructor More...
 

Private Attributes

int m_sector
 
int m_wheel
 

Friends

std::ostream & operator<< (std::ostream &, const L1MuBMSecProcId &)
 output stream operator More...
 

Detailed Description

Sector Processor identifier:

There are 6 sector processors along the eta direction numbered: -3 -2 -1 +1 +2 +3 (= wheel)
and 12 sector processors along the phi direction [0,11].
This is necessary because wheel 0 needs two sector processors

N. Neumeister CERN EP

Definition at line 41 of file L1MuBMSecProcId.h.

Constructor & Destructor Documentation

L1MuBMSecProcId::L1MuBMSecProcId ( )

default constructor

Definition at line 42 of file L1MuBMSecProcId.cc.

42  :
43  m_wheel(0), m_sector(0) {}
L1MuBMSecProcId::L1MuBMSecProcId ( int  wheel_id,
int  sector_id 
)

constructor

Definition at line 45 of file L1MuBMSecProcId.cc.

45  :
46  m_wheel(wheel_id), m_sector(sector_id) {
47 
48  if ( !(wheel_id >= -3 && wheel_id <= 3) ) {
49  // cerr << "SecProcId : wheel out of range: " << wheel_id << endl;
50  }
51  if ( !(sector_id >= 0 && sector_id < 12) ) {
52  // cerr << "SecProcId : sector out of range: " << sector_id << endl;
53  }
54 
55 }
L1MuBMSecProcId::L1MuBMSecProcId ( const L1MuBMSecProcId id)

copy constructor

Definition at line 58 of file L1MuBMSecProcId.cc.

L1MuBMSecProcId::~L1MuBMSecProcId ( )
virtual

destructor

Definition at line 66 of file L1MuBMSecProcId.cc.

66 {}

Member Function Documentation

int L1MuBMSecProcId::locwheel ( ) const

return physical wheel number (-2,-1,0,+1,+2)

Definition at line 89 of file L1MuBMSecProcId.cc.

References funct::abs(), and m_wheel.

Referenced by L1MuBMSectorReceiver::address2wheel().

89  {
90 
91  return ( m_wheel/abs(m_wheel)*(abs(m_wheel)-1) );
92 
93 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool L1MuBMSecProcId::operator!= ( const L1MuBMSecProcId id) const

unequal operator

Definition at line 111 of file L1MuBMSecProcId.cc.

References m_sector, m_wheel, sector(), and wheel().

111  {
112 
113  if ( m_wheel != id.wheel() ) return true;
114  if ( m_sector != id.sector() ) return true;
115  return false;
116 
117 }
int sector() const
return sector number
int wheel() const
return wheel number
bool L1MuBMSecProcId::operator< ( const L1MuBMSecProcId id) const

less operator

Definition at line 123 of file L1MuBMSecProcId.cc.

References sector(), and wheel().

123  {
124 
125  if ( sector() < id.sector() ) return true;
126  if ( sector() > id.sector() ) return false;
127  if ( wheel() < 0 && id.wheel() < 0 ) {
128  if ( -wheel() < -id.wheel() ) return true;
129  }
130  else {
131  if ( wheel() < id.wheel() ) return true;
132  }
133  return false;
134 
135 }
int sector() const
return sector number
int wheel() const
return wheel number
L1MuBMSecProcId & L1MuBMSecProcId::operator= ( const L1MuBMSecProcId id)

assignment operator

Definition at line 75 of file L1MuBMSecProcId.cc.

References m_sector, and m_wheel.

75  {
76 
77  if ( this != &id ) {
78  m_wheel = id.m_wheel;
79  m_sector = id.m_sector;
80  }
81  return *this;
82 
83 }
bool L1MuBMSecProcId::operator== ( const L1MuBMSecProcId id) const

equal operator

Definition at line 99 of file L1MuBMSecProcId.cc.

References sector(), and wheel().

99  {
100 
101  if ( wheel() != id.wheel() ) return false;
102  if ( sector() != id.sector() ) return false;
103  return true;
104 
105 }
int sector() const
return sector number
int wheel() const
return wheel number
bool L1MuBMSecProcId::ovl ( ) const
inline

is it an overlap region Sector Processor?

Definition at line 64 of file L1MuBMSecProcId.h.

References funct::abs(), and m_wheel.

Referenced by L1MuBMSectorProcessor::brl(), and L1MuBMSectorProcessor::ovl().

64 { return (abs(m_wheel) == 3) ? true : false; }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int L1MuBMSecProcId::sector ( void  ) const
inline
int L1MuBMSecProcId::wheel ( ) const
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const L1MuBMSecProcId  
)
friend

output stream operator

Member Data Documentation

int L1MuBMSecProcId::m_sector
private

Definition at line 87 of file L1MuBMSecProcId.h.

Referenced by operator!=(), operator=(), and sector().

int L1MuBMSecProcId::m_wheel
private

Definition at line 86 of file L1MuBMSecProcId.h.

Referenced by locwheel(), operator!=(), operator=(), ovl(), and wheel().