CMS 3D CMS Logo

L1MuBMAssignmentUnit.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuBMAssignmentUnit
4 //
5 // Description: Assignment Unit
6 //
7 //
8 //
9 // Author :
10 // N. Neumeister CERN EP
11 // J. Troconiz UAM Madrid
12 // Modifications:
13 // G. Flouris U. Ioannina
14 // G Karathanasis U. Athens
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 #include <iostream>
28 #include <cmath>
29 #include <cassert>
30 
31 //-------------------------------
32 // Collaborating Class Headers --
33 //-------------------------------
34 
42 
43 #include <iostream>
44 #include <iomanip>
45 
46 using namespace std;
47 // --------------------------------
48 // class L1MuBMAssignmentUnit
49 //---------------------------------
50 
51 //----------------
52 // Constructors --
53 //----------------
54 
56  m_sp(sp), m_id(id),
57  m_addArray(), m_TSphi(), m_ptAssMethod(L1MuBMLUTHandler::NODEF ) {
58 
59  m_TSphi.reserve(4); // a track candidate can consist of max 4 TS
60  reset();
61  setPrecision();
62 
63 }
64 
65 
66 //--------------
67 // Destructor --
68 //--------------
69 
71 }
72 
73 
74 //--------------
75 // Operations --
76 //--------------
77 
78 //
79 // run Assignment Unit
80 //
82 
83  // enable track candidate
84  m_sp.track(m_id)->enable();
85  m_sp.tracK(m_id)->enable();
86 
87  // set track class
88  TrackClass tc = m_sp.TA()->trackClass(m_id);
89  m_sp.track(m_id)->setTC(tc);
90  m_sp.tracK(m_id)->setTC(tc);
91 
92  // get relative addresses of matching track segments
96 
97  // get track segments (track segment router)
98  TSR();
101 
102  // set bunch-crossing (use first track segment)
103  vector<const L1MuBMTrackSegPhi*>::const_iterator iter = m_TSphi.begin();
104  int bx = (*iter)->bx();
105  m_sp.track(m_id)->setBx(bx);
106  m_sp.tracK(m_id)->setBx(bx);
107 
108  // assign phi
109  PhiAU(c);
110 
111  // assign pt and charge
112  PtAU(c);
113 
114  // assign quality
115  QuaAU();
116 
117 }
118 
119 
120 //
121 // reset Assignment Unit
122 //
124 
125  m_addArray.reset();
126  m_TSphi.clear();
128 
129 }
130 
131 
132 //
133 // assign phi with 8 bit precision
134 //
136 
137  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
138  bmtfParamsRcd.get(bmtfParamsHandle);
139  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
140  thePhiLUTs = new L1MuBMLUTHandler(bmtfParams);
141  //thePhiLUTs->print();
142  // calculate phi at station 2 using 8 bits (precision = 0.625 degrees)
143  int sh_phi = 12 - L1MuBMTFConfig::getNbitsPhiPhi();
144  int sh_phib = 10 - L1MuBMTFConfig::getNbitsPhiPhib();
145 
146  const L1MuBMTrackSegPhi* second = getTSphi(2); // track segment at station 2
147  const L1MuBMTrackSegPhi* first = getTSphi(1); // track segment at station 1
148  const L1MuBMTrackSegPhi* forth = getTSphi(4); // track segment at station 4
149 
150  int phi2 = 0; // phi-value at station 2
151  int sector = 0;
152  if ( second ) {
153  phi2 = second->phi() >> sh_phi;
154  sector = second->sector();
155  }
156  else if ( second == nullptr && first ) {
157  phi2 = first->phi() >> sh_phi;
158  sector = first->sector();
159  }
160  else if ( second == nullptr && forth ) {
161  phi2 = forth->phi() >> sh_phi;
162  sector = forth->sector();
163  }
164 
165  int sector0 = m_sp.id().sector();
166 
167  // convert sector difference to values in the range -6 to +5
168 
169  int sectordiff = (sector - sector0)%12;
170  if ( sectordiff >= 6 ) sectordiff -= 12;
171  if ( sectordiff < -6 ) sectordiff += 12;
172 
173  // convert phi to 0.625 degree precision
174  int phi_precision = 4096 >> sh_phi;
175  const double k = 57.2958/0.625/static_cast<float>(phi_precision);
176  double phi_f = static_cast<double>(phi2);
177  int bit_div_phi=static_cast<int>(phi2)%4;
178  if (bit_div_phi<0) bit_div_phi+=4;
179  phi_f=phi_f-std::abs(bit_div_phi);
180  int phi_8 = static_cast<int>(floor(phi_f*k));
181 
182  if ( second == nullptr && first ) {
183  int bend_angle = (first->phib() >> sh_phib) << sh_phib;
184  phi_8 = phi_8 + thePhiLUTs->getDeltaPhi(0,bend_angle);
185  //phi_8 = phi_8 + getDeltaPhi(0, bend_angle, bmtfParams->phi_lut());
186  }
187  else if ( second == nullptr && forth ) {
188 
189  int bend_angle = (forth->phib() >> sh_phib) << sh_phib;
190  phi_8 = phi_8 + thePhiLUTs->getDeltaPhi(1,bend_angle);
191  //phi_8 = phi_8 + getDeltaPhi(1, bend_angle, bmtfParams->phi_lut());
192  }
193 
194  //If muon is found at the neighbour sector - second station
195  //a shift is needed by 48
196  phi_8 += sectordiff*48;
197 
198  int phi = phi_8 + 24;
199  // 78 phi bins (-8 to 69) correspond 30 degree sector plus
200  // additional lower and higher bins for neighboring sectors.
201  if (phi > 69) phi = 69;
202  if (phi < -8) phi = -8;
203 
204  m_sp.track(m_id)->setPhi(phi); // Regional
205  m_sp.tracK(m_id)->setPhi(phi);
206 
207 delete thePhiLUTs;
208 }
209 
210 
211 //
212 // assign pt with 5 bit precision
213 //
215 
216  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
217  bmtfParamsRcd.get(bmtfParamsHandle);
218  const L1TMuonBarrelParams& bmtfParams1 = *bmtfParamsHandle.product();
219  const L1TMuonBarrelParamsAllPublic& bmtfParams = L1TMuonBarrelParamsAllPublic(bmtfParams1);
220  thePtaLUTs = new L1MuBMLUTHandler(bmtfParams);
221  //thePtaLUTs->print();
222  // get pt-assignment method as function of track class and TS phib values
223  //m_ptAssMethod = getPtMethod(bmtfParams);
225  // get input address for look-up table
226  int bend_angle = getPtAddress(m_ptAssMethod);
227  int bend_carga = getPtAddress(m_ptAssMethod, 1);
228 
229  // retrieve pt value from look-up table
230  int lut_idx = m_ptAssMethod;
231  int pt = thePtaLUTs->getPt(lut_idx,bend_angle );
232  //int pt = getPt(lut_idx, bend_angle, bmtfParams->pta_lut());
233 
234 if(!bmtfParams.get_DisableNewAlgo()){
235 
236  if (Quality() < 4) {
237  int ptj = pt;
240  if (jj1 != L1MuBMLUTHandler::NODEF) {
241  lut_idx = jj1;
242  bend_angle = getPt1Address(m_ptAssMethod);
243  if (abs(bend_angle) < 512) ptj = thePtaLUTs->getPt(lut_idx,bend_angle );
244  }
245  else if (jj2 != L1MuBMLUTHandler::NODEF) {
246  lut_idx = jj2;
247  bend_angle = getPt2Address(m_ptAssMethod);
248  if (abs(bend_angle) < 512) ptj = thePtaLUTs->getPt(lut_idx,bend_angle );
249  }
250  if (ptj < pt) pt = ptj;
251  }
252 }
253 
254  m_sp.track(m_id)->setPt(pt);
255  m_sp.tracK(m_id)->setPt(pt);
256 
257  // assign charge
258  int chsign = getCharge(m_ptAssMethod);
259  int charge = ( bend_carga >= 0 ) ? chsign : -1 * chsign;
260  m_sp.track(m_id)->setCharge(charge);
261  m_sp.tracK(m_id)->setCharge(charge);
262  delete thePtaLUTs;
263 
264 }
265 
266 
267 //
268 // assign 4 bit quality code
269 //
271 
272  unsigned int quality = 0;
273 
274  const TrackClass tc = m_sp.TA()->trackClass(m_id);
275 
277  switch ( tc ) {
278  case T1234 : { quality = 3; break; }
279  case T123 : { quality = 2; break; }
280  case T124 : { quality = 2; break; }
281  case T134 : { quality = 2; break; }
282  case T234 : { quality = 2; break; }
283  case T12 : { quality = 1; break; }
284  case T13 : { quality = 1; break; }
285  case T14 : { quality = 1; break; }
286  case T23 : { quality = 0; break; }
287  case T24 : { quality = 0; break; }
288  case T34 : { quality = 0; break; }
289  default : { quality = 0; break; }
290  }
291 
293  quality += 12;
294 
295  m_sp.track(m_id)->setQuality(quality);
296  m_sp.tracK(m_id)->setQuality(quality);
297 
298 }
299 
300 
301 //
302 // assign 3 bit quality code
303 //
305 
306  unsigned int quality = 0;
307 
308  const TrackClass tc = m_sp.TA()->trackClass(m_id);
309 
310  switch ( tc ) {
311  case T1234 : { quality = 7; break; }
312  case T123 : { quality = 6; break; }
313  case T124 : { quality = 6; break; }
314  case T134 : { quality = 5; break; }
315  case T234 : { quality = 4; break; }
316  case T12 : { quality = 3; break; }
317  case T13 : { quality = 3; break; }
318  case T14 : { quality = 3; break; }
319  case T23 : { quality = 2; break; }
320  case T24 : { quality = 2; break; }
321  case T34 : { quality = 1; break; }
322  default : { quality = 0; }
323  }
324 
325  return quality;
326 
327 }
328 
329 //
330 // Track Segment Router (TSR)
331 //
333 
334  // get the track segments from the data buffer
335  const L1MuBMTrackSegPhi* ts = nullptr;
336  for ( int stat = 1; stat <= 4; stat++ ) {
337  int adr = m_addArray.station(stat);
338  if ( adr != 15 ) {
339  ts = m_sp.data()->getTSphi(stat,adr);
340  if ( ts != nullptr ) m_TSphi.push_back( ts );
341  }
342  }
343 
344 }
345 
346 
347 //
348 // get track segment from a given station
349 //
351 
352  vector<const L1MuBMTrackSegPhi*>::const_iterator iter;
353  for ( iter = m_TSphi.begin(); iter != m_TSphi.end(); iter++ ) {
354  int stat = (*iter)->station();
355  if ( station == stat ) {
356  return (*iter);
357  break;
358  }
359  }
360 
361  return nullptr;
362 
363 }
364 
365 
366 //
367 // convert sector Id to a precision of 2.5 degrees using 8 bits (= sector center)
368 //
370 
371  // assert( sector >=0 && sector < 12 );
372  const int sectorvalues[12] = { 0, 12, 24, 36, 48, 60, 72, 84,
373  96, 108, 120, 132 };
374 
375  return sectorvalues[sector];
376 
377 }
378 
379 
380 //
381 // determine charge
382 //
384 
385  int chargesign = 0;
386  switch ( method ) {
387  case L1MuBMLUTHandler::PT12L : { chargesign = -1; break; }
388  case L1MuBMLUTHandler::PT12H : { chargesign = -1; break; }
389  case L1MuBMLUTHandler::PT13L : { chargesign = -1; break; }
390  case L1MuBMLUTHandler::PT13H : { chargesign = -1; break; }
391  case L1MuBMLUTHandler::PT14L : { chargesign = -1; break; }
392  case L1MuBMLUTHandler::PT14H : { chargesign = -1; break; }
393  case L1MuBMLUTHandler::PT23L : { chargesign = -1; break; }
394  case L1MuBMLUTHandler::PT23H : { chargesign = -1; break; }
395  case L1MuBMLUTHandler::PT24L : { chargesign = -1; break; }
396  case L1MuBMLUTHandler::PT24H : { chargesign = -1; break; }
397  case L1MuBMLUTHandler::PT34L : { chargesign = 1; break; }
398  case L1MuBMLUTHandler::PT34H : { chargesign = 1; break; }
399 
400  case L1MuBMLUTHandler::NODEF : { chargesign = 0;
401  // cerr << "AssignmentUnit::getCharge : undefined PtAssMethod!"
402  // << endl;
403  break;
404  }
405  default : { chargesign = 0; }
406  }
407 
408  return chargesign;
409 
410 }
411 
412 
413 //
414 // determine pt-assignment method
415 //
416 //PtAssMethod L1MuBMAssignmentUnit::getPtMethod(L1TMuonBarrelParams *l1tbmparams) const {
418 
419  // determine which pt-assignment method should be used as a function
420  // of the track class and
421  // of the phib values of the track segments making up this track candidate.
422 
423  // get bitmap of track candidate
424  const bitset<4> s = m_sp.TA()->trackBitMap(m_id);
425 
426  int method = -1;
427 
428  if ( s.test(0) && s.test(3) ) method = 2; // stations 1 and 4
429  if ( s.test(0) && s.test(2) ) method = 1; // stations 1 and 3
430  if ( s.test(0) && s.test(1) ) method = 0; // stations 1 and 2
431  if ( !s.test(0) && s.test(1) && s.test(3) ) method = 4; // stations 2 and 4
432  if ( !s.test(0) && s.test(1) && s.test(2) ) method = 3; // stations 2 and 3
433  if ( !s.test(0) && !s.test(1) && s.test(2) && s.test(3) ) method = 5; // stations 3 and 4
434  int threshold = thePtaLUTs->getPtLutThreshold(method);
435 
436  // phib values of track segments from stations 1, 2 and 4
437  int phib1 = ( getTSphi(1) != nullptr ) ? getTSphi(1)->phib() : 0;
438  int phib2 = ( getTSphi(2) != nullptr ) ? getTSphi(2)->phib() : 0;
439  int phib4 = ( getTSphi(4) != nullptr ) ? getTSphi(4)->phib() : 0;
440 
442 
443  switch ( method ) {
444  case 0 : { pam = ( abs(phib1) < threshold ) ? L1MuBMLUTHandler::PT12H : L1MuBMLUTHandler::PT12L; break; }
445  case 1 : { pam = ( abs(phib1) < threshold ) ? L1MuBMLUTHandler::PT13H : L1MuBMLUTHandler::PT13L; break; }
446  case 2 : { pam = ( abs(phib1) < threshold ) ? L1MuBMLUTHandler::PT14H : L1MuBMLUTHandler::PT14L; break; }
447  case 3 : { pam = ( abs(phib2) < threshold ) ? L1MuBMLUTHandler::PT23H : L1MuBMLUTHandler::PT23L; break; }
448  case 4 : { pam = ( abs(phib2) < threshold ) ? L1MuBMLUTHandler::PT24H : L1MuBMLUTHandler::PT24L; break; }
449  case 5 : { pam = ( abs(phib4) < threshold ) ? L1MuBMLUTHandler::PT34H : L1MuBMLUTHandler::PT34L; break; }
450  default : ;
451  //cout << "L1MuBMAssignmentUnit : Error in PT ass method evaluation" << endl;
452  }
453 
454  return pam;
455 
456 }
457 
458 
459 //
460 // calculate bend angle
461 //
463 
464  // calculate bend angle as difference of two azimuthal positions
465 
466  int bendangle = 0;
467  switch (method) {
468  case L1MuBMLUTHandler::PT12L : { bendangle = phiDiff(1,2); break; }
469  case L1MuBMLUTHandler::PT12H : { bendangle = phiDiff(1,2); break; }
470  case L1MuBMLUTHandler::PT13L : { bendangle = phiDiff(1,3); break; }
471  case L1MuBMLUTHandler::PT13H : { bendangle = phiDiff(1,3); break; }
472  case L1MuBMLUTHandler::PT14L : { bendangle = phiDiff(1,4); break; }
473  case L1MuBMLUTHandler::PT14H : { bendangle = phiDiff(1,4); break; }
474  case L1MuBMLUTHandler::PT23L : { bendangle = phiDiff(2,3); break; }
475  case L1MuBMLUTHandler::PT23H : { bendangle = phiDiff(2,3); break; }
476  case L1MuBMLUTHandler::PT24L : { bendangle = phiDiff(2,4); break; }
477  case L1MuBMLUTHandler::PT24H : { bendangle = phiDiff(2,4); break; }
478  case L1MuBMLUTHandler::PT34L : { bendangle = phiDiff(4,3); break; }
479  case L1MuBMLUTHandler::PT34H : { bendangle = phiDiff(4,3); break; }
480  case L1MuBMLUTHandler::NODEF : { bendangle = 0;
481  // cerr << "AssignmentUnit::getPtAddress : undefined PtAssMethod" << endl;
482  break;
483  }
484  default : { bendangle = 0; }
485 
486  }
487 
488  int signo = 1;
489  bendangle = (bendangle+8192)%4096;
490  if ( bendangle > 2047 ) bendangle -= 4096;
491  if ( bendangle < 0 ) signo = -1;
492 
493  if (bendcharge) return signo;
494 
495  bendangle = (bendangle+2048)%1024;
496  if ( bendangle > 511 ) bendangle -= 1024;
497 
498  return bendangle;
499 
500 }
501 
502 
503 //
504 // build difference of two phi values
505 //
506 int L1MuBMAssignmentUnit::phiDiff(int stat1, int stat2) const {
507 
508  // calculate bit shift
509 
510  int sh_phi = 12 - nbit_phi;
511 
512  // get 2 phi values and add offset (30 degrees ) for adjacent sector
513  int sector1 = getTSphi(stat1)->sector();
514  int sector2 = getTSphi(stat2)->sector();
515  int phi1 = getTSphi(stat1)->phi() >> sh_phi;
516  int phi2 = getTSphi(stat2)->phi() >> sh_phi;
517 
518  // convert sector difference to values in the range -6 to +5
519 
520  int sectordiff = (sector2 - sector1)%12;
521  if ( sectordiff >= 6 ) sectordiff -= 12;
522  if ( sectordiff < -6 ) sectordiff += 12;
523 
524  // assert( abs(sectordiff) <= 1 );
525 
526  int offset = (2144 >> sh_phi) * sectordiff;
527  int bendangle = (phi2 - phi1 + offset) << sh_phi;
528 
529  return bendangle;
530 
531 }
532 
533 
534 
535 //
536 // determine pt-assignment method
537 //
539 
540  // quality values of track segments from stations 1, 2 and 4
541  int qual1 = ( getTSphi(1) != nullptr ) ? getTSphi(1)->quality() : 0;
542  int qual2 = ( getTSphi(2) != nullptr ) ? getTSphi(2)->quality() : 0;
543  int qual4 = ( getTSphi(4) != nullptr ) ? getTSphi(4)->quality() : 0;
544 
546 
547  switch ( method ) {
548  case L1MuBMLUTHandler::PT12H : { if (qual1 > 3) pam = L1MuBMLUTHandler::PB12H; break; }
549  case L1MuBMLUTHandler::PT13H : { if (qual1 > 3) pam = L1MuBMLUTHandler::PB13H; break; }
550  case L1MuBMLUTHandler::PT14H : { if (qual1 > 3) pam = L1MuBMLUTHandler::PB14H; break; }
551  case L1MuBMLUTHandler::PT23H : { if (qual2 > 3) pam = L1MuBMLUTHandler::PB23H; break; }
552  case L1MuBMLUTHandler::PT24H : { if (qual2 > 3) pam = L1MuBMLUTHandler::PB24H; break; }
553  case L1MuBMLUTHandler::PT34H : { if (qual4 > 3) pam = L1MuBMLUTHandler::PB34H; break; }
554  case L1MuBMLUTHandler::NODEF : { pam = L1MuBMLUTHandler::NODEF; break;}
555  default : { pam = L1MuBMLUTHandler::NODEF; }
556  }
557 
558  return pam;
559 
560 }
561 
562 
563 //
564 // determine pt-assignment method
565 //
567 
568  // quality values of track segments from stations 2 and 4
569  int qual2 = ( getTSphi(2) != nullptr ) ? getTSphi(2)->quality() : 0;
570  // int qual4 = ( getTSphi(4) != 0 ) ? getTSphi(4)->quality() : 0;
571 
573 
574  switch ( method ) {
575  case L1MuBMLUTHandler::PT12H : { if (qual2 > 3) pam = L1MuBMLUTHandler::PB21H; break; }
576  // case PT14H : { if (qual4 > 3) pam = PB34H; break; }
577  // case PT24H : { if (qual4 > 3) pam = PB34H; break; }
578  //case PT12HO : { if (qual2 > 3) pam = PB21HO; break; }
579  // case PT14HO : { if (qual4 > 3) pam = PB34HO; break; }
580  // case PT24HO : { if (qual4 > 3) pam = PB34HO; break; }
581  case L1MuBMLUTHandler::NODEF : { pam = L1MuBMLUTHandler::NODEF; break; }
582  default : { pam = L1MuBMLUTHandler::NODEF; }
583  }
584 
585  return pam;
586 
587 }
588 
589 
590 //
591 // calculate bend angle
592 //
594 
595  // phib values of track segments from stations 1, 2 and 4
596  int phib1 = ( getTSphi(1) != nullptr ) ? getTSphi(1)->phib() : -999;
597  int phib2 = ( getTSphi(2) != nullptr ) ? getTSphi(2)->phib() : -999;
598  int phib4 = ( getTSphi(4) != nullptr ) ? getTSphi(4)->phib() : -999;
599 
600 
601  int bendangle = -999;
602  switch (method) {
603  case L1MuBMLUTHandler::PT12H : { bendangle = phib1; break; }
604  case L1MuBMLUTHandler::PT13H : { bendangle = phib1; break; }
605  case L1MuBMLUTHandler::PT14H : { bendangle = phib1; break; }
606  case L1MuBMLUTHandler::PT23H : { bendangle = phib2; break; }
607  case L1MuBMLUTHandler::PT24H : { bendangle = phib2; break; }
608  case L1MuBMLUTHandler::PT34H : { bendangle = phib4; break; }
609  case L1MuBMLUTHandler::NODEF : { bendangle = -999; break; }
610  default : { bendangle = -999; }
611  }
612 
613  return bendangle;
614 
615 }
616 
617 
618 //
619 // calculate bend angle
620 //
622 
623  // phib values of track segments from stations 1, 2 and 4
624  int phib2 = ( getTSphi(2) != nullptr ) ? getTSphi(2)->phib() : -999;
625  int phib4 = ( getTSphi(4) != nullptr ) ? getTSphi(4)->phib() : -999;
626 
627 
628  int bendangle = -999;
629  switch (method) {
630  case L1MuBMLUTHandler::PT12H : { bendangle = phib2; break; }
631  case L1MuBMLUTHandler::PT14H : { bendangle = phib4; break; }
632  case L1MuBMLUTHandler::PT24H : { bendangle = phib4; break; }
633  //case L1MuBMLUTHandler::PT12HO : { bendangle = phib2; break; }
634  //case L1MuBMLUTHandler::PT14HO : { bendangle = phib4; break; }
635  //case L1MuBMLUTHandler::PT24HO : { bendangle = phib4; break; }
636  case L1MuBMLUTHandler::NODEF : { bendangle = -999; break; }
637  default : { bendangle = -999; }
638  }
639 
640  return bendangle;
641 
642 }
643 
644 //
645 // set precision for pt-assignment of phi and phib
646 // default is 12 bits for phi and 10 bits for phib
647 //
649 
652 
653 }
654 
655 
656 // static data members
657 
658 unsigned short int L1MuBMAssignmentUnit::nbit_phi = 12;
659 unsigned short int L1MuBMAssignmentUnit::nbit_phib = 10;
L1MuBMLUTHandler::PtAssMethod getPtMethod() const
determine pt assignment method
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuBMTrack.h:144
static int getNbitsPhiPhi()
void setPt(int pt)
set pt-code of muon candidate
Definition: L1MuBMTrack.h:156
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
Definition: L1MuBMTrack.h:165
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuBMTrack.h:147
int getPtAddress(L1MuBMLUTHandler::PtAssMethod, int bendcharge=0) const
calculate bend angle
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuBMTrack.h:168
static int getNbitsPtaPhi()
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuBMTrack.h:159
void reset() override
reset Assignment Unit
L1MuBMLUTHandler * thePtaLUTs
pt-assignment look-up tables
#define nullptr
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
Definition: L1MuBMTrack.h:135
std::vector< const L1MuBMTrackSegPhi * > m_TSphi
~L1MuBMAssignmentUnit() override
destructor
L1MuBMLUTHandler::PtAssMethod getPt1Method(L1MuBMLUTHandler::PtAssMethod) const
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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const L1MuBMTrackAssembler * TA() const
return pointer to Track Assembler
void setBx(int bx)
set charge of muon candidate
Definition: L1MuBMTrack.h:162
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 k[5][pyjets_maxn]
int getPt1Address(L1MuBMLUTHandler::PtAssMethod) const
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
Definition: L1MuBMTrack.cc:171
const T & get() const
Definition: EventSetup.h:55
L1MuBMAddressArray m_addArray
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 getPt2Address(L1MuBMLUTHandler::PtAssMethod) const
L1MuBMLUTHandler::PtAssMethod getPt2Method(L1MuBMLUTHandler::PtAssMethod) const
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
T const * product() const
Definition: ESHandle.h:86
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
int quality() const
return quality code