59 m_addArray(), m_TSphi(), m_ptAssMethod(
NODEF),
60 nbit_phi(12),nbit_phib(10)
107 vector<const L1MuDTTrackSegPhi*>::const_iterator iter =
m_TSphi.begin();
108 int bx = (*iter)->bx();
163 phi2 = second->
phi() >> sh_phi;
164 sector = second->
sector();
166 else if ( second == 0 && first ) {
167 phi2 = first->
phi() >> sh_phi;
170 else if ( second == 0 && forth ) {
171 phi2 = forth->
phi() >> sh_phi;
179 int sectordiff = (sector - sector0)%12;
180 if ( sectordiff >= 6 ) sectordiff -= 12;
181 if ( sectordiff < -6 ) sectordiff += 12;
189 int phi_precision = 4096 >> sh_phi;
190 const double k = 57.2958/2.5/
static_cast<float>(phi_precision);
191 double phi_f =
static_cast<double>(phi2);
192 int phi_8 =
static_cast<int>(floor(phi_f*k));
194 if ( second == 0 && first ) {
195 int bend_angle = (first->
phib() >> sh_phib) << sh_phib;
198 else if ( second == 0 && forth ) {
199 int bend_angle = (forth->
phib() >> sh_phib) << sh_phib;
203 phi_8 += sectordiff*12;
205 if (phi_8 > 15) phi_8 = 15;
206 if (phi_8 < -16) phi_8 = -16;
208 int phi = (sector_8 + phi_8 + 144)%144;
209 phi_8 = (phi_8 + 32)%32;
240 int charge = ( bend_carga >= 0 ) ? chsign : -1 * chsign;
257 case T1234 : { quality = 7;
break; }
258 case T123 : { quality = 6;
break; }
259 case T124 : { quality = 6;
break; }
260 case T134 : { quality = 5;
break; }
261 case T234 : { quality = 4;
break; }
262 case T12 : { quality = 3;
break; }
263 case T13 : { quality = 3;
break; }
264 case T14 : { quality = 3;
break; }
265 case T23 : { quality = 2;
break; }
266 case T24 : { quality = 2;
break; }
267 case T34 : { quality = 1;
break; }
268 default : { quality = 0;
break; }
288 if ( ts != 0 )
m_TSphi.push_back( ts );
300 vector<const L1MuDTTrackSegPhi*>::const_iterator iter;
302 int stat = (*iter)->station();
303 if ( station == stat ) {
320 const int sectorvalues[12] = { 0, 12, 24, 36, 48, 60, 72, 84,
323 return sectorvalues[sector];
335 case PT12L : { chargesign = -1;
break; }
336 case PT12H : { chargesign = -1;
break; }
337 case PT13L : { chargesign = -1;
break; }
338 case PT13H : { chargesign = -1;
break; }
339 case PT14L : { chargesign = -1;
break; }
340 case PT14H : { chargesign = -1;
break; }
341 case PT23L : { chargesign = -1;
break; }
342 case PT23H : { chargesign = -1;
break; }
343 case PT24L : { chargesign = -1;
break; }
344 case PT24H : { chargesign = -1;
break; }
345 case PT34L : { chargesign = 1;
break; }
346 case PT34H : { chargesign = 1;
break; }
347 case PT12LO : { chargesign = -1;
break; }
348 case PT12HO : { chargesign = -1;
break; }
349 case PT13LO : { chargesign = -1;
break; }
350 case PT13HO : { chargesign = -1;
break; }
351 case PT14LO : { chargesign = -1;
break; }
352 case PT14HO : { chargesign = -1;
break; }
353 case PT23LO : { chargesign = -1;
break; }
354 case PT23HO : { chargesign = -1;
break; }
355 case PT24LO : { chargesign = -1;
break; }
356 case PT24HO : { chargesign = -1;
break; }
357 case PT34LO : { chargesign = 1;
break; }
358 case PT34HO : { chargesign = 1;
break; }
359 case PT15LO : { chargesign = -1;
break; }
360 case PT15HO : { chargesign = -1;
break; }
361 case PT25LO : { chargesign = -1;
break; }
362 case PT25HO : { chargesign = -1;
break; }
363 case NODEF : { chargesign = 0;
389 if ( s.test(0) && s.test(3) ) method = 2;
390 if ( s.test(0) && s.test(2) ) method = 1;
391 if ( s.test(0) && s.test(1) ) method = 0;
392 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 4;
393 if ( !s.test(0) && s.test(1) && s.test(2) ) method = 3;
394 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 5;
398 bool s5 = (adr == 15) ?
false : ((adr/2)%2 == 1);
399 if ( s.test(0) && s.test(3) ) method = 8;
400 if ( s.test(0) && s.test(2) && s5 ) method = 12;
401 if ( s.test(0) && s.test(2) && !s5 ) method = 7;
402 if ( s.test(0) && s.test(1) ) method = 6;
403 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 10;
404 if ( !s.test(0) && s.test(1) && s.test(2) && s5 ) method = 13;
405 if ( !s.test(0) && s.test(1) && s.test(2) && !s5 ) method = 9;
406 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 11;
479 case NODEF : { bendangle = 0;
486 bendangle = (bendangle+8192)%4096;
487 if ( bendangle > 2047 ) bendangle -= 4096;
488 if ( bendangle < 0 ) signo = -1;
490 if (bendcharge)
return signo;
492 bendangle = (bendangle+2048)%1024;
493 if ( bendangle > 511 ) bendangle -= 1024;
517 int sectordiff = (sector2 - sector1)%12;
518 if ( sectordiff >= 6 ) sectordiff -= 12;
519 if ( sectordiff < -6 ) sectordiff += 12;
523 int offset = (2144 >> sh_phi) * sectordiff;
524 int bendangle = (phi2 - phi1 +
offset) << sh_phi;
void PtAU(const edm::EventSetup &c)
assign pt and charge
int getPt(int pta_ind, int address) const
get pt-value for a given address
void setPt(int pt)
set pt-code of muon candidate
L1MuDTTrack * tracK(int id) const
return pointer to muon candidate, index [0,1]
edm::ESHandle< L1MuDTPhiLut > thePhiLUTs
phi-assignment look-up tables
void QuaAU()
assign quality
unsigned short nbit_phib
of bits used for pt-assignment
void reset()
reset address array
int getNbitsPtaPhib() const
edm::ESHandle< L1MuDTPtaLut > thePtaLUTs
pt-assignment look-up tables
void setTSphi(const std::vector< const L1MuDTTrackSegPhi * > &tsList)
set phi track segments used to form the muon candidate
int getCharge(PtAssMethod)
determine charge
int phi() const
return phi
void setTC(TrackClass tc)
set track-class of muon candidate
L1MuDTAddressArray m_addArray
void setAddresses(const L1MuDTAddressArray &addr)
set relative addresses of muon candidate
void enable()
enable muon candidate
int sector() const
return sector number
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
U second(std::pair< T, U > const &p)
L1MuDTSectorProcessor & m_sp
void setBx(int bx)
Set Bunch Crossing.
std::vector< const L1MuDTTrackSegPhi * > m_TSphi
virtual void reset()
reset Assignment Unit
unsigned short nbit_phi
of bits used for pt-assignment
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
virtual ~L1MuDTAssignmentUnit()
destructor
PtAssMethod m_ptAssMethod
const L1MuDTTrackAssembler * TA() const
return pointer to Track Assembler
void TSR()
Track Segment Router.
const L1MuDTTrackSegPhi * getTSphi(int station) const
get track segment from a given station
virtual void run()
run processor logic
const std::bitset< 4 > & trackBitMap(int id) const
return bitmap of found track
Abs< T >::type abs(const T &t)
int phib() const
return phib
int phiDiff(int stat1, int stat2) const
build difference of two phi values
const L1MuDTSecProcId & id() const
return Sector Processor identifier
void setQuality(unsigned int quality)
set quality of muon candidate
int getNbitsPtaPhi() const
const TSPhivector & getTSphi() const
get all track segments from the buffer
int convertSector(int)
convert sector Id to 8 bit code (= sector center)
void PhiAU(const edm::EventSetup &c)
assign phi
void setPrecision()
set precision of phi and phib
static L1MuDTTFConfig * config()
return configuration
int getPtAddress(PtAssMethod, int bendcharge=0) const
calculate bend angle
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
int sector() const
return sector
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
TrackClass trackClass(int id) const
return Track Class of found track
PtAssMethod getPtMethod() const
determine pt assignment method
L1MuDTTrack * track(int id) const
return pointer to muon candidate, index [0,1]
int address(int id, int stat) const
get address of a single station of selected track candidate
unsigned short station(int stat) const
get address of a given station [1-4]
int getNbitsPhiPhi() const
L1MuDTAssignmentUnit(L1MuDTSectorProcessor &sp, int id)
constructor
void setPhi(int phi)
set phi-code of muon candidate
bool ovl() const
is it an overlap region Sector Processor?
int getNbitsPhiPhib() const
void setCharge(int charge)
set charge of muon candidate