54 for (
int stat = 1; stat <= 4; stat++ ) {
55 m_station[stat-1] = addarray.
m_station[stat-1];
77 if (
this != &addarray ) {
78 for (
int stat = 1; stat <= 4; stat++ ) {
79 m_station[stat-1] = addarray.
m_station[stat-1];
92 for (
int stat = 1; stat <= 4; stat++ ) {
93 if ( m_station[stat-1] != addarray.
m_station[stat-1] )
return false;
106 for (
int stat = 1; stat <= 4; stat++ ) {
107 if ( m_station[stat-1] != addarray.
m_station[stat-1] )
return true;
120 for (
int stat = 1; stat <= 4; stat++ ) {
121 m_station[stat-1] = 15;
134 m_station[stat-1] = adr;
159 int s1 = m_station[0];
160 s1 = ( s1 == 15 ) ? 0 : ((s1/2)%2)+1;
161 int s2 = m_station[1];
162 s2 = ( s2 == 15 ) ? 0 : ((s2/2)%2)+1;
163 int s3 = m_station[2];
164 s3 = ( s3 == 15 ) ? 0 : ((s3/2)%2)+1;
165 int s4 = m_station[3];
166 s4 = ( s4 == 15 ) ? 0 : ((s4/2)%2)+1;
172 if ( s1 == 0 && s2 == 0 && s3 == 0 && s4 == 0 ) code = 0;
173 if ( s1 == 0 && s2 == 0 && s3 == 2 && s4 == 1 ) code = 0;
174 if ( s1 == 0 && s2 == 0 && s3 == 2 && s4 == 2 ) code = 0;
175 if ( s1 == 0 && s2 == 2 && s3 == 0 && s4 == 1 ) code = 0;
176 if ( s1 == 0 && s2 == 2 && s3 == 0 && s4 == 2 ) code = 0;
177 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 0 ) code = 0;
178 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 0 ) code = 0;
179 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 1 ) code = 0;
180 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 1 ) code = 0;
181 if ( s1 == 0 && s2 == 2 && s3 == 1 && s4 == 2 ) code = 0;
182 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 1 ) code = 0;
183 if ( s1 == 0 && s2 == 2 && s3 == 2 && s4 == 2 ) code = 0;
184 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 1 ) code = 0;
185 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 1 ) code = 0;
186 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 0 ) code = 0;
187 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 1 ) code = 0;
188 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 1 ) code = 0;
189 if ( s1 == 1 && s2 == 2 && s3 == 1 && s4 == 2 ) code = 0;
190 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 1 ) code = 0;
191 if ( s1 == 0 && s2 == 0 && s3 == 1 && s4 == 1 ) code = 1;
192 if ( s1 == 0 && s2 == 0 && s3 == 1 && s4 == 2 ) code = 2;
193 if ( s1 == 0 && s2 == 1 && s3 == 0 && s4 == 1 ) code = 3;
194 if ( s1 == 0 && s2 == 1 && s3 == 0 && s4 == 2 ) code = 4;
195 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 0 ) code = 5;
196 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 1 ) code = 6;
197 if ( s1 == 0 && s2 == 1 && s3 == 1 && s4 == 2 ) code = 7;
198 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 0 ) code = 8;
199 if ( s1 == 0 && s2 == 1 && s3 == 2 && s4 == 2 ) code = 8;
200 if ( s1 == 1 && s2 == 0 && s3 == 0 && s4 == 1 ) code = 9;
201 if ( s1 == 1 && s2 == 0 && s3 == 0 && s4 == 2 ) code = 10;
202 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 0 ) code = 11;
203 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 1 ) code = 12;
204 if ( s1 == 1 && s2 == 0 && s3 == 1 && s4 == 2 ) code = 13;
205 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 0 ) code = 14;
206 if ( s1 == 1 && s2 == 0 && s3 == 2 && s4 == 2 ) code = 14;
207 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 0 ) code = 15;
208 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 1 ) code = 16;
209 if ( s1 == 1 && s2 == 1 && s3 == 0 && s4 == 2 ) code = 17;
210 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 0 ) code = 18;
211 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 1 ) code = 19;
212 if ( s1 == 1 && s2 == 1 && s3 == 1 && s4 == 2 ) code = 20;
213 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 0 ) code = 21;
214 if ( s1 == 1 && s2 == 1 && s3 == 2 && s4 == 2 ) code = 21;
215 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 0 ) code = 22;
216 if ( s1 == 1 && s2 == 2 && s3 == 0 && s4 == 2 ) code = 22;
217 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 0 ) code = 22;
218 if ( s1 == 1 && s2 == 2 && s3 == 2 && s4 == 2 ) code = 22;
238 return newaddressarray;
248 s.setf(ios::right,ios::adjustfield);
249 for (
int stat = 1; stat <= 4; stat++ ) {
250 s <<
"stat " << stat <<
": " << setw(2) << adrarr.
station(stat) <<
" ";
263 unsigned short int newaddress = 15;
266 case 0 : { newaddress = 8;
break; }
267 case 1 : { newaddress = 9;
break; }
268 case 2 : { newaddress = 0;
break; }
269 case 3 : { newaddress = 1;
break; }
270 case 4 : { newaddress = 10;
break; }
271 case 5 : { newaddress = 11;
break; }
272 case 6 : { newaddress = 2;
break; }
273 case 7 : { newaddress = 3;
break; }
274 case 8 : { newaddress = 12;
break; }
275 case 9 : { newaddress = 13;
break; }
276 case 10 : { newaddress = 4;
break; }
277 case 11 : { newaddress = 5;
break; }
278 case 15 : { newaddress = 15;
break; }
279 default: { newaddress = 15;
break; }
294 return ( (adr/2)%2 == 0 );
305 return ( (adr/2)%2 == 1 );
static bool sameWheel(unsigned short int adr)
is it a same wheel address?
int trackAddressCode() const
get track address code (for eta track finder)
void reset()
reset address array
ostream & operator<<(std::ostream &o, vector< std::string > const &iValue)
L1MuDTAddressArray converted() const
get converted Addresses
static unsigned short int convert(unsigned short int adr)
convert address to corresponding VHDL addresse
unsigned short int m_station[4]
static bool nextWheel(unsigned short int adr)
is it a next wheel address?
bool operator==(const L1MuDTAddressArray &) const
equal operator
L1MuDTAddressArray()
default constructor
void setStations(int adr1, int adr2, int adr3, int adr4)
set addresses of all four stations
void setStation(int stat, int adr)
set address of a given station [1-4]
bool operator!=(const L1MuDTAddressArray &) const
unequal operator
void reset(double vett[256])
unsigned short station(int stat) const
get address of a given station [1-4]
virtual ~L1MuDTAddressArray()
destructor
L1MuDTAddressArray & operator=(const L1MuDTAddressArray &)
assignment operator