102 vector<const L1MuBMTrackSegPhi*>::const_iterator iter =
m_TSphi.begin();
103 int bx = (*iter)->bx();
152 phi2 = second->
phi() >> sh_phi;
153 sector = second->
sector();
155 else if ( second == 0 && first ) {
156 phi2 = first->
phi() >> sh_phi;
159 else if ( second == 0 && forth ) {
160 phi2 = forth->
phi() >> sh_phi;
168 int sectordiff = (sector - sector0)%12;
169 if ( sectordiff >= 6 ) sectordiff -= 12;
170 if ( sectordiff < -6 ) sectordiff += 12;
173 int phi_precision = 4096 >> sh_phi;
174 const double k = 57.2958/0.625/
static_cast<float>(phi_precision);
175 double phi_f =
static_cast<double>(phi2);
176 int phi_8 =
static_cast<int>(floor(phi_f*k));
178 if ( second == 0 && first ) {
179 int bend_angle = (first->
phib() >> sh_phib) << sh_phib;
183 else if ( second == 0 && forth ) {
185 int bend_angle = (forth->
phib() >> sh_phib) << sh_phib;
192 phi_8 += sectordiff*48;
194 int phi = phi_8 + 24;
195 if (phi > 55) phi = 55;
196 if (phi < -8) phi = -8;
231 int charge = ( bend_carga >= 0 ) ? chsign : -1 * chsign;
249 case T1234 : { quality = 7;
break; }
250 case T123 : { quality = 6;
break; }
251 case T124 : { quality = 6;
break; }
252 case T134 : { quality = 5;
break; }
253 case T234 : { quality = 4;
break; }
254 case T12 : { quality = 3;
break; }
255 case T13 : { quality = 3;
break; }
256 case T14 : { quality = 3;
break; }
257 case T23 : { quality = 2;
break; }
258 case T24 : { quality = 2;
break; }
259 case T34 : { quality = 1;
break; }
260 default : { quality = 0;
break; }
276 for (
int stat = 1; stat <= 4; stat++ ) {
280 if ( ts != 0 )
m_TSphi.push_back( ts );
292 vector<const L1MuBMTrackSegPhi*>::const_iterator iter;
295 if ( station == stat ) {
312 const int sectorvalues[12] = { 0, 12, 24, 36, 48, 60, 72, 84,
315 return sectorvalues[sector];
367 if ( s.test(0) && s.test(3) ) method = 2;
368 if ( s.test(0) && s.test(2) ) method = 1;
369 if ( s.test(0) && s.test(1) ) method = 0;
370 if ( !s.test(0) && s.test(1) && s.test(3) ) method = 4;
371 if ( !s.test(0) && s.test(1) && s.test(2) ) method = 3;
372 if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 5;
426 bendangle = (bendangle+8192)%4096;
427 if ( bendangle > 2047 ) bendangle -= 4096;
428 if ( bendangle < 0 ) signo = -1;
430 if (bendcharge)
return signo;
432 bendangle = (bendangle+2048)%1024;
433 if ( bendangle > 511 ) bendangle -= 1024;
457 int sectordiff = (sector2 - sector1)%12;
458 if ( sectordiff >= 6 ) sectordiff -= 12;
459 if ( sectordiff < -6 ) sectordiff += 12;
463 int offset = (2144 >> sh_phi) * sectordiff;
464 int bendangle = (phi2 - phi1 +
offset) << sh_phi;
L1MuBMLUTHandler::PtAssMethod getPtMethod() const
determine pt assignment method
void setTC(TrackClass tc)
set track-class of muon candidate
static int getNbitsPhiPhi()
void setPt(int pt)
set pt-code of muon candidate
static int getNbitsPhiPhib()
L1MuBMAssignmentUnit(L1MuBMSectorProcessor &sp, int id)
constructor
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
void QuaAU()
assign quality
int getPt(int pta_ind, int address) const
get pt-value for a given address
void PtAU(const edm::EventSetup &c)
assign pt and charge
void setQuality(unsigned int quality)
set quality of muon candidate
void setPhi(int phi)
set phi-code of muon candidate
int getPtAddress(L1MuBMLUTHandler::PtAssMethod, int bendcharge=0) const
calculate bend angle
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
static int getNbitsPtaPhi()
void setCharge(int charge)
set charge of muon candidate
L1MuBMLUTHandler * thePtaLUTs
pt-assignment look-up tables
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
unsigned short station(int stat) const
get address of a given station [1-4]
void TSR()
Track Segment Router.
void enable()
enable muon candidate
std::vector< const L1MuBMTrackSegPhi * > m_TSphi
U second(std::pair< T, U > const &p)
L1MuBMTrack * tracK(int id) const
return pointer to muon candidate, index [0,1]
int sector() const
return sector number
int phib() const
return phib
static int getNbitsPtaPhib()
static int convertSector(int)
convert sector Id to 8 bit code (= sector center)
L1MuBMLUTHandler * thePhiLUTs
phi-assignment look-up tables
static unsigned short nbit_phib
of bits used for pt-assignment
static void setPrecision()
set precision of phi and phib
TrackClass trackClass(int id) const
return Track Class of found track
virtual void run()
run processor logic
void get(HolderT &iHolder) const
virtual ~L1MuBMAssignmentUnit()
destructor
Abs< T >::type abs(const T &t)
const L1MuBMTrackAssembler * TA() const
return pointer to Track Assembler
void setBx(int bx)
set charge of muon candidate
const L1MuBMSecProcId & id() const
return Sector Processor identifier
L1MuBMTrack * track(int id) const
return pointer to muon candidate, index [0,1]
int phi() const
return phi
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
void setTSphi(const std::vector< const L1MuBMTrackSegPhi * > &tsList)
set phi track segments used to form the muon candidate
T const * product() const
L1MuBMAddressArray m_addArray
virtual void reset()
reset Assignment Unit
const L1MuBMTrackSegPhi * getTSphi(int station) const
get track segment from a given station
const TSPhivector & getTSphi() const
get all track segments from the buffer
static int getCharge(L1MuBMLUTHandler::PtAssMethod)
determine charge
void reset()
reset address array
const std::bitset< 4 > & trackBitMap(int id) const
return bitmap of found track
const L1MuBMDataBuffer * data() const
return pointer to Data Buffer
int station() const
return station
int phiDiff(int stat1, int stat2) const
build difference of two phi values
L1MuBMSectorProcessor & m_sp
void PhiAU(const edm::EventSetup &c)
assign phi
static unsigned short nbit_phi
of bits used for pt-assignment
int sector() const
return sector
L1MuBMLUTHandler::PtAssMethod m_ptAssMethod
int address(int id, int stat) const
get address of a single station of selected track candidate