#include <L1Trigger/DTTrackFinder/src/L1MuDTAddressArray.h>
Public Member Functions | |
L1MuDTAddressArray | converted () const |
get converted Addresses | |
L1MuDTAddressArray (const L1MuDTAddressArray &) | |
copy constructor | |
L1MuDTAddressArray () | |
default constructor | |
bool | operator!= (const L1MuDTAddressArray &) const |
unequal operator | |
L1MuDTAddressArray & | operator= (const L1MuDTAddressArray &) |
assignment operator | |
bool | operator== (const L1MuDTAddressArray &) const |
equal operator | |
void | reset () |
reset address array | |
void | setStation (int stat, int adr) |
set address of a given station [1-4] | |
void | setStations (int adr1, int adr2, int adr3, int adr4) |
set addresses of all four stations | |
unsigned short | station (int stat) const |
get address of a given station [1-4] | |
int | trackAddressCode () const |
get track address code (for eta track finder) | |
virtual | ~L1MuDTAddressArray () |
destructor | |
Static Public Member Functions | |
static unsigned short int | convert (unsigned short int adr) |
convert address to corresponding VHDL addresse | |
static bool | nextWheel (unsigned short int adr) |
is it a next wheel address? | |
static bool | sameWheel (unsigned short int adr) |
is it a same wheel address? | |
Private Attributes | |
unsigned short int | m_station [4] |
Friends | |
std::ostream & | operator<< (std::ostream &, const L1MuDTAddressArray &) |
output stream operator for address array |
Array of 4 relative addresses (one per station);
the valid range of a relative address is 0 - 11 thus a relative address is a 4 bit word;
address = 15 indicates a negative extrapolation result
* ------------------------ * | 4 5 | 6 7 | * P ------------+----------- * H | 0 1 | 2 3 | * I ------------+----------- * | 8 9 | 10 11 | * ------------+----------- * my Wheel next Wheel *
N. Neumeister CERN EP
Definition at line 52 of file L1MuDTAddressArray.h.
L1MuDTAddressArray::L1MuDTAddressArray | ( | ) |
default constructor
Definition at line 45 of file L1MuDTAddressArray.cc.
References reset().
00045 { 00046 00047 reset(); 00048 00049 }
L1MuDTAddressArray::L1MuDTAddressArray | ( | const L1MuDTAddressArray & | addarray | ) |
copy constructor
Definition at line 52 of file L1MuDTAddressArray.cc.
References m_station.
00052 { 00053 00054 for ( int stat = 1; stat <= 4; stat++ ) { 00055 m_station[stat-1] = addarray.m_station[stat-1]; 00056 } 00057 00058 }
L1MuDTAddressArray::~L1MuDTAddressArray | ( | ) | [virtual] |
convert address to corresponding VHDL addresse
Definition at line 261 of file L1MuDTAddressArray.cc.
Referenced by converted().
00261 { 00262 00263 unsigned short int newaddress = 15; 00264 00265 switch ( adr ) { 00266 case 0 : { newaddress = 8; break; } 00267 case 1 : { newaddress = 9; break; } 00268 case 2 : { newaddress = 0; break; } 00269 case 3 : { newaddress = 1; break; } 00270 case 4 : { newaddress = 10; break; } 00271 case 5 : { newaddress = 11; break; } 00272 case 6 : { newaddress = 2; break; } 00273 case 7 : { newaddress = 3; break; } 00274 case 8 : { newaddress = 12; break; } 00275 case 9 : { newaddress = 13; break; } 00276 case 10 : { newaddress = 4; break; } 00277 case 11 : { newaddress = 5; break; } 00278 case 15 : { newaddress = 15; break; } 00279 default: { newaddress = 15; break; } 00280 00281 } 00282 00283 return newaddress; 00284 00285 }
L1MuDTAddressArray L1MuDTAddressArray::converted | ( | ) | const |
get converted Addresses
Definition at line 228 of file L1MuDTAddressArray.cc.
References convert(), m_station, and setStations().
00228 { 00229 00230 unsigned short int adr1 = L1MuDTAddressArray::convert(m_station[0]); 00231 unsigned short int adr2 = L1MuDTAddressArray::convert(m_station[1]); 00232 unsigned short int adr3 = L1MuDTAddressArray::convert(m_station[2]); 00233 unsigned short int adr4 = L1MuDTAddressArray::convert(m_station[3]); 00234 00235 L1MuDTAddressArray newaddressarray; 00236 newaddressarray.setStations(adr1,adr2,adr3,adr4); 00237 00238 return newaddressarray; 00239 00240 }
is it a next wheel address?
Definition at line 302 of file L1MuDTAddressArray.cc.
References TestMuL1L2Filter_cff::cerr, and lat::endl().
00302 { 00303 00304 if ( adr > 15 ) cerr << "L1MuDTAddressArray : Error wrong address " << adr << endl; 00305 return ( (adr/2)%2 == 1 ); 00306 00307 }
bool L1MuDTAddressArray::operator!= | ( | const L1MuDTAddressArray & | addarray | ) | const |
unequal operator
Definition at line 104 of file L1MuDTAddressArray.cc.
References m_station.
00104 { 00105 00106 for ( int stat = 1; stat <= 4; stat++ ) { 00107 if ( m_station[stat-1] != addarray.m_station[stat-1] ) return true; 00108 } 00109 00110 return false; 00111 00112 }
L1MuDTAddressArray & L1MuDTAddressArray::operator= | ( | const L1MuDTAddressArray & | addarray | ) |
assignment operator
Definition at line 75 of file L1MuDTAddressArray.cc.
References m_station.
00075 { 00076 00077 if ( this != &addarray ) { 00078 for ( int stat = 1; stat <= 4; stat++ ) { 00079 m_station[stat-1] = addarray.m_station[stat-1]; 00080 } 00081 } 00082 return *this; 00083 00084 }
bool L1MuDTAddressArray::operator== | ( | const L1MuDTAddressArray & | addarray | ) | const |
equal operator
Definition at line 90 of file L1MuDTAddressArray.cc.
References m_station.
00090 { 00091 00092 for ( int stat = 1; stat <= 4; stat++ ) { 00093 if ( m_station[stat-1] != addarray.m_station[stat-1] ) return false; 00094 } 00095 00096 return true; 00097 00098 }
reset address array
Definition at line 118 of file L1MuDTAddressArray.cc.
References m_station.
Referenced by L1MuDTAddressArray(), L1MuDTAssignmentUnit::reset(), L1MuDTTrack::reset(), L1MuDTTrackAssembler::reset(), and L1MuDTTrackAssembler::run().
00118 { 00119 00120 for ( int stat = 1; stat <= 4; stat++ ) { 00121 m_station[stat-1] = 15; 00122 } 00123 00124 }
is it a same wheel address?
Definition at line 291 of file L1MuDTAddressArray.cc.
References TestMuL1L2Filter_cff::cerr, and lat::endl().
00291 { 00292 00293 if ( adr > 15 ) cerr << "L1MuDTAddressArray : Error wrong address " << adr << endl; 00294 return ( (adr/2)%2 == 0 ); 00295 00296 }
set address of a given station [1-4]
Definition at line 130 of file L1MuDTAddressArray.cc.
References m_station.
Referenced by L1MuDTTrackAssembler::run(), and setStations().
00130 { 00131 00132 assert( stat > 0 && stat <= 4 ); 00133 assert( adr >= 0 && adr <= 15 ); 00134 m_station[stat-1] = adr; 00135 00136 }
set addresses of all four stations
Definition at line 142 of file L1MuDTAddressArray.cc.
References setStation().
Referenced by converted(), L1MuDTTrackAssembler::runAddressAssignment1(), and L1MuDTTrackAssembler::runAddressAssignment2().
00142 { 00143 00144 setStation(1,adr1); 00145 setStation(2,adr2); 00146 setStation(3,adr3); 00147 setStation(4,adr4); 00148 00149 }
unsigned short L1MuDTAddressArray::station | ( | int | stat | ) | const [inline] |
get address of a given station [1-4]
Definition at line 84 of file L1MuDTAddressArray.h.
References m_station.
Referenced by L1MuDTTrack::address(), L1MuDTTrackAssembler::address(), L1MuDTAssignmentUnit::getPtMethod(), operator<<(), L1MuDTTrackAssembler::run(), and L1MuDTAssignmentUnit::TSR().
00084 { return m_station[stat-1]; }
int L1MuDTAddressArray::trackAddressCode | ( | ) | const |
get track address code (for eta track finder)
Definition at line 155 of file L1MuDTAddressArray.cc.
References code, m_station, s1, s2, and s3.
Referenced by L1MuDTEtaProcessor::receiveAddresses().
00155 { 00156 00157 int code = -1; 00158 00159 int s1 = m_station[0]; 00160 s1 = ( s1 == 15 ) ? 0 : ((s1/2)%2)+1; 00161 int s2 = m_station[1]; 00162 s2 = ( s2 == 15 ) ? 0 : ((s2/2)%2)+1; 00163 int s3 = m_station[2]; 00164 s3 = ( s3 == 15 ) ? 0 : ((s3/2)%2)+1; 00165 int s4 = m_station[3]; 00166 s4 = ( s4 == 15 ) ? 0 : ((s4/2)%2)+1; 00167 00168 // 0 ... empty track segment 00169 // 1 ... same wheel 00170 // 2 ... next wheel 00171 00172 if ( s1 == 0 && s2 == 0 && s3 == 0 && s4 == 0 ) code = 0; 00173 if ( s1 == 0 && s2 == 0 && s3 == 2 && s4 == 1 ) code = 0; 00174 if ( s1 == 0 && s2 == 0 && s3 == 2 && s4 == 2 ) code = 0; 00175 if ( s1 == 0 && s2 == 2 && s3 == 0 && s4 == 1 ) code = 0; 00176 if ( s1 == 0 && s2 == 2 && s3 == 0 && s4 == 2 ) code = 0; 00177 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 0 ) code = 0; 00178 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 0 ) code = 0; 00179 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 1 ) code = 0; 00180 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 1 ) code = 0; 00181 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 2 ) code = 0; 00182 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 1 ) code = 0; 00183 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 2 ) code = 0; 00184 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 1 ) code = 0; 00185 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 1 ) code = 0; 00186 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 0 ) code = 0; 00187 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 1 ) code = 0; 00188 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 1 ) code = 0; 00189 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 2 ) code = 0; 00190 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 1 ) code = 0; 00191 if ( s1 == 0 && s2 == 0 && s3 == 1 && s4 == 1 ) code = 1; 00192 if ( s1 == 0 && s2 == 0 && s3 == 1 && s4 == 2 ) code = 2; 00193 if ( s1 == 0 && s2 == 1 && s3 == 0 && s4 == 1 ) code = 3; 00194 if ( s1 == 0 && s2 == 1 && s3 == 0 && s4 == 2 ) code = 4; 00195 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 0 ) code = 5; 00196 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 1 ) code = 6; 00197 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 2 ) code = 7; 00198 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 0 ) code = 8; 00199 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 2 ) code = 8; 00200 if ( s1 == 1 && s2 == 0 && s3 == 0 && s4 == 1 ) code = 9; 00201 if ( s1 == 1 && s2 == 0 && s3 == 0 && s4 == 2 ) code = 10; 00202 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 0 ) code = 11; 00203 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 1 ) code = 12; 00204 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 2 ) code = 13; 00205 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 0 ) code = 14; 00206 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 2 ) code = 14; 00207 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 0 ) code = 15; 00208 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 1 ) code = 16; 00209 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 2 ) code = 17; 00210 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 0 ) code = 18; 00211 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 1 ) code = 19; 00212 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 2 ) code = 20; 00213 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 0 ) code = 21; 00214 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 2 ) code = 21; 00215 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 0 ) code = 22; 00216 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 2 ) code = 22; 00217 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 0 ) code = 22; 00218 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 2 ) code = 22; 00219 00220 return code; 00221 00222 }
std::ostream& operator<< | ( | std::ostream & | , | |
const L1MuDTAddressArray & | ||||
) | [friend] |
output stream operator for address array
unsigned short int L1MuDTAddressArray::m_station[4] [private] |
Definition at line 106 of file L1MuDTAddressArray.h.
Referenced by converted(), L1MuDTAddressArray(), operator!=(), operator=(), operator==(), reset(), setStation(), station(), and trackAddressCode().