58 m_addArray(), m_TSphi(), m_ptAssMethod(
NODEF) {
104 vector<const L1MuDTTrackSegPhi*>::const_iterator iter =
m_TSphi.begin();
105 int bx = (*iter)->bx();
160 phi2 = second->
phi() >> sh_phi;
161 sector = second->
sector();
163 else if ( second == 0 && first ) {
164 phi2 = first->
phi() >> sh_phi;
167 else if ( second == 0 && forth ) {
168 phi2 = forth->
phi() >> sh_phi;
176 int sectordiff = (sector - sector0)%12;
177 if ( sectordiff >= 6 ) sectordiff -= 12;
178 if ( sectordiff < -6 ) sectordiff += 12;
186 int phi_precision = 4096 >> sh_phi;
187 const double k = 57.2958/2.5/
static_cast<float>(phi_precision);
188 double phi_f =
static_cast<double>(phi2);
189 int phi_8 =
static_cast<int>(floor(phi_f*k));
191 if ( second == 0 && first ) {
192 int bend_angle = (first->
phib() >> sh_phib) << sh_phib;
193 phi_8 = phi_8 +
thePhiLUTs->getDeltaPhi(0,bend_angle);
195 else if ( second == 0 && forth ) {
196 int bend_angle = (forth->
phib() >> sh_phib) << sh_phib;
197 phi_8 = phi_8 +
thePhiLUTs->getDeltaPhi(1,bend_angle);
200 phi_8 += sectordiff*12;
202 if (phi_8 > 15) phi_8 = 15;
203 if (phi_8 < -16) phi_8 = -16;
205 int phi = (sector_8 + phi_8 + 144)%144;
206 phi_8 = (phi_8 + 32)%32;
237 int charge = ( bend_carga >= 0 ) ? chsign : -1 * chsign;
254 case T1234 : { quality = 7;
break; }
255 case T123 : { quality = 6;
break; }
256 case T124 : { quality = 6;
break; }
257 case T134 : { quality = 5;
break; }
258 case T234 : { quality = 4;
break; }
259 case T12 : { quality = 3;
break; }
260 case T13 : { quality = 3;
break; }
261 case T14 : { quality = 3;
break; }
262 case T23 : { quality = 2;
break; }
263 case T24 : { quality = 2;
break; }
264 case T34 : { quality = 1;
break; }
265 default : { quality = 0;
break; }
281 for (
int stat = 1; stat <= 4; stat++ ) {
285 if ( ts != 0 )
m_TSphi.push_back( ts );
297 vector<const L1MuDTTrackSegPhi*>::const_iterator iter;
300 if ( station == stat ) {
317 const int sectorvalues[12] = { 0, 12, 24, 36, 48, 60, 72, 84,
320 return sectorvalues[sector];
332 case PT12L : { chargesign = -1;
break; }
333 case PT12H : { chargesign = -1;
break; }
334 case PT13L : { chargesign = -1;
break; }
335 case PT13H : { chargesign = -1;
break; }
336 case PT14L : { chargesign = -1;
break; }
337 case PT14H : { chargesign = -1;
break; }
338 case PT23L : { chargesign = -1;
break; }
339 case PT23H : { chargesign = -1;
break; }
340 case PT24L : { chargesign = -1;
break; }
341 case PT24H : { chargesign = -1;
break; }
342 case PT34L : { chargesign = 1;
break; }
343 case PT34H : { chargesign = 1;
break; }
344 case PT12LO : { chargesign = -1;
break; }
345 case PT12HO : { chargesign = -1;
break; }
346 case PT13LO : { chargesign = -1;
break; }
347 case PT13HO : { chargesign = -1;
break; }
348 case PT14LO : { chargesign = -1;
break; }
349 case PT14HO : { chargesign = -1;
break; }
350 case PT23LO : { chargesign = -1;
break; }
351 case PT23HO : { chargesign = -1;
break; }
352 case PT24LO : { chargesign = -1;
break; }
353 case PT24HO : { chargesign = -1;
break; }
354 case PT34LO : { chargesign = 1;
break; }
355 case PT34HO : { chargesign = 1;
break; }
356 case PT15LO : { chargesign = -1;
break; }
357 case PT15HO : { chargesign = -1;
break; }
358 case PT25LO : { chargesign = -1;
break; }
359 case PT25HO : { chargesign = -1;
break; }
360 case NODEF : { chargesign = 0;
386 if ( s.test(0) && s.test(3) ) method = 2;
387 if ( s.test(0) && s.test(2) ) method = 1;
388 if ( s.test(0) && s.test(1) ) method = 0;
389 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 4;
390 if ( !s.test(0) && s.test(1) && s.test(2) ) method = 3;
391 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 5;
395 bool s5 = (adr == 15) ?
false : ((adr/2)%2 == 1);
396 if ( s.test(0) && s.test(3) ) method = 8;
397 if ( s.test(0) && s.test(2) && s5 ) method = 12;
398 if ( s.test(0) && s.test(2) && !s5 ) method = 7;
399 if ( s.test(0) && s.test(1) ) method = 6;
400 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 10;
401 if ( !s.test(0) && s.test(1) && s.test(2) && s5 ) method = 13;
402 if ( !s.test(0) && s.test(1) && s.test(2) && !s5 ) method = 9;
403 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 11;
476 case NODEF : { bendangle = 0;
483 bendangle = (bendangle+8192)%4096;
484 if ( bendangle > 2047 ) bendangle -= 4096;
485 if ( bendangle < 0 ) signo = -1;
487 if (bendcharge)
return signo;
489 bendangle = (bendangle+2048)%1024;
490 if ( bendangle > 511 ) bendangle -= 1024;
514 int sectordiff = (sector2 - sector1)%12;
515 if ( sectordiff >= 6 ) sectordiff -= 12;
516 if ( sectordiff < -6 ) sectordiff += 12;
520 int offset = (2144 >> sh_phi) * sectordiff;
521 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
tuple quality
[pTError/pT]*max(1,normChi2) <= ptErrorCut
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
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