60 m_addArray(), m_TSphi(), m_ptAssMethod(
NODEF) {
106 vector<const L1MuDTTrackSegPhi*>::const_iterator iter =
m_TSphi.begin();
107 int bx = (*iter)->bx();
162 phi2 = second->
phi() >> sh_phi;
163 sector = second->
sector();
165 else if ( second == 0 && first ) {
166 phi2 = first->
phi() >> sh_phi;
169 else if ( second == 0 && forth ) {
170 phi2 = forth->
phi() >> sh_phi;
178 int sectordiff = (sector - sector0)%12;
179 if ( sectordiff >= 6 ) sectordiff -= 12;
180 if ( sectordiff < -6 ) sectordiff += 12;
188 int phi_precision = 4096 >> sh_phi;
189 const double k = 57.2958/2.5/
static_cast<float>(phi_precision);
190 double phi_f =
static_cast<double>(phi2);
191 int phi_8 =
static_cast<int>(floor(phi_f*k));
193 if ( second == 0 && first ) {
194 int bend_angle = (first->
phib() >> sh_phib) << sh_phib;
195 phi_8 = phi_8 +
thePhiLUTs->getDeltaPhi(0,bend_angle);
197 else if ( second == 0 && forth ) {
198 int bend_angle = (forth->
phib() >> sh_phib) << sh_phib;
199 phi_8 = phi_8 +
thePhiLUTs->getDeltaPhi(1,bend_angle);
202 phi_8 += sectordiff*12;
204 if (phi_8 > 15) phi_8 = 15;
205 if (phi_8 < -16) phi_8 = -16;
207 int phi = (sector_8 + phi_8 + 144)%144;
208 phi_8 = (phi_8 + 32)%32;
232 int pt =
thePtaLUTs->getPt(lut_idx,bend_angle );
239 int charge = ( bend_carga >= 0 ) ? chsign : -1 * chsign;
251 unsigned int quality = 0;
256 case T1234 : { quality = 7;
break; }
257 case T123 : { quality = 6;
break; }
258 case T124 : { quality = 6;
break; }
259 case T134 : { quality = 5;
break; }
260 case T234 : { quality = 4;
break; }
261 case T12 : { quality = 3;
break; }
262 case T13 : { quality = 3;
break; }
263 case T14 : { quality = 3;
break; }
264 case T23 : { quality = 2;
break; }
265 case T24 : { quality = 2;
break; }
266 case T34 : { quality = 1;
break; }
267 default : { quality = 0;
break; }
283 for (
int stat = 1; stat <= 4; stat++ ) {
287 if ( ts != 0 )
m_TSphi.push_back( ts );
299 vector<const L1MuDTTrackSegPhi*>::const_iterator iter;
302 if ( station == stat ) {
319 const int sectorvalues[12] = { 0, 12, 24, 36, 48, 60, 72, 84,
322 return sectorvalues[sector];
334 case PT12L : { chargesign = -1;
break; }
335 case PT12H : { chargesign = -1;
break; }
336 case PT13L : { chargesign = -1;
break; }
337 case PT13H : { chargesign = -1;
break; }
338 case PT14L : { chargesign = -1;
break; }
339 case PT14H : { chargesign = -1;
break; }
340 case PT23L : { chargesign = -1;
break; }
341 case PT23H : { chargesign = -1;
break; }
342 case PT24L : { chargesign = -1;
break; }
343 case PT24H : { chargesign = -1;
break; }
344 case PT34L : { chargesign = 1;
break; }
345 case PT34H : { chargesign = 1;
break; }
346 case PT12LO : { chargesign = -1;
break; }
347 case PT12HO : { chargesign = -1;
break; }
348 case PT13LO : { chargesign = -1;
break; }
349 case PT13HO : { chargesign = -1;
break; }
350 case PT14LO : { chargesign = -1;
break; }
351 case PT14HO : { chargesign = -1;
break; }
352 case PT23LO : { chargesign = -1;
break; }
353 case PT23HO : { chargesign = -1;
break; }
354 case PT24LO : { chargesign = -1;
break; }
355 case PT24HO : { chargesign = -1;
break; }
356 case PT34LO : { chargesign = 1;
break; }
357 case PT34HO : { chargesign = 1;
break; }
358 case PT15LO : { chargesign = -1;
break; }
359 case PT15HO : { chargesign = -1;
break; }
360 case PT25LO : { chargesign = -1;
break; }
361 case PT25HO : { chargesign = -1;
break; }
362 case NODEF : { chargesign = 0;
388 if ( s.test(0) && s.test(3) ) method = 2;
389 if ( s.test(0) && s.test(2) ) method = 1;
390 if ( s.test(0) && s.test(1) ) method = 0;
391 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 4;
392 if ( !s.test(0) && s.test(1) && s.test(2) ) method = 3;
393 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 5;
397 bool s5 = (adr == 15) ?
false : ((adr/2)%2 == 1);
398 if ( s.test(0) && s.test(3) ) method = 8;
399 if ( s.test(0) && s.test(2) && s5 ) method = 12;
400 if ( s.test(0) && s.test(2) && !s5 ) method = 7;
401 if ( s.test(0) && s.test(1) ) method = 6;
402 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 10;
403 if ( !s.test(0) && s.test(1) && s.test(2) && s5 ) method = 13;
404 if ( !s.test(0) && s.test(1) && s.test(2) && !s5 ) method = 9;
405 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 11;
478 case NODEF : { bendangle = 0;
485 bendangle = (bendangle+8192)%4096;
486 if ( bendangle > 2047 ) bendangle -= 4096;
487 if ( bendangle < 0 ) signo = -1;
489 if (bendcharge)
return signo;
491 bendangle = (bendangle+2048)%1024;
492 if ( bendangle > 511 ) bendangle -= 1024;
516 int sectordiff = (sector2 - sector1)%12;
517 if ( sectordiff >= 6 ) sectordiff -= 12;
518 if ( sectordiff < -6 ) sectordiff += 12;
522 int offset = (2144 >> sh_phi) * sectordiff;
523 int bendangle = (phi2 - phi1 +
offset) << sh_phi;
void PtAU(const edm::EventSetup &c)
assign pt and charge
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
int station() const
return station
void reset()
reset address array
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
static int getCharge(PtAssMethod)
determine charge
int phi() const
return phi
void setTC(TrackClass tc)
set track-class of muon candidate
L1MuDTAddressArray m_addArray
static int getNbitsPhiPhi()
void setAddresses(const L1MuDTAddressArray &addr)
set relative addresses of muon candidate
static int getNbitsPtaPhi()
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
static unsigned short nbit_phib
of bits used for pt-assignment
virtual void reset()
reset Assignment Unit
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
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
unsigned int offset(bool)
static int getNbitsPhiPhib()
const TSPhivector & getTSphi() const
get all track segments from the buffer
static int convertSector(int)
convert sector Id to 8 bit code (= sector center)
void PhiAU(const edm::EventSetup &c)
assign phi
static void setPrecision()
set precision of phi and phib
int getPtAddress(PtAssMethod, int bendcharge=0) const
calculate bend angle
int sector() const
return sector
static int getNbitsPtaPhib()
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]
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?
static unsigned short nbit_phi
of bits used for pt-assignment
void setCharge(int charge)
set charge of muon candidate