Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:23:55

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuDTAssignmentUnit
0004 //
0005 //   Description: Assignment Unit
0006 //
0007 //
0008 //
0009 //   Author :
0010 //   N. Neumeister            CERN EP
0011 //   J. Troconiz              UAM Madrid
0012 //
0013 //--------------------------------------------------
0014 
0015 //-----------------------
0016 // This Class's Header --
0017 //-----------------------
0018 
0019 #include "L1Trigger/DTTrackFinder/src/L1MuDTAssignmentUnit.h"
0020 
0021 //---------------
0022 // C++ Headers --
0023 //---------------
0024 
0025 #include <iostream>
0026 #include <cmath>
0027 #include <cassert>
0028 
0029 //-------------------------------
0030 // Collaborating Class Headers --
0031 //-------------------------------
0032 
0033 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTFConfig.h"
0034 #include "L1Trigger/DTTrackFinder/src/L1MuDTSectorProcessor.h"
0035 #include "L1Trigger/DTTrackFinder/src/L1MuDTDataBuffer.h"
0036 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegPhi.h"
0037 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegLoc.h"
0038 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackAssembler.h"
0039 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackAssParam.h"
0040 #include "CondFormats/L1TObjects/interface/L1MuDTPhiLut.h"
0041 #include "CondFormats/DataRecord/interface/L1MuDTPhiLutRcd.h"
0042 #include "CondFormats/L1TObjects/interface/L1MuDTPtaLut.h"
0043 #include "CondFormats/DataRecord/interface/L1MuDTPtaLutRcd.h"
0044 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrack.h"
0045 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackFinder.h"
0046 
0047 using namespace std;
0048 
0049 // --------------------------------
0050 //       class L1MuDTAssignmentUnit
0051 //---------------------------------
0052 
0053 //----------------
0054 // Constructors --
0055 //----------------
0056 
0057 L1MuDTAssignmentUnit::L1MuDTAssignmentUnit(L1MuDTSectorProcessor& sp, int id, edm::ConsumesCollector iC)
0058     : m_sp(sp),
0059       m_id(id),
0060       m_addArray(),
0061       m_TSphi(),
0062       m_ptAssMethod(NODEF),
0063       thePhiToken(iC.esConsumes()),
0064       thePtaToken(iC.esConsumes()),
0065       nbit_phi(12),
0066       nbit_phib(10) {
0067   m_TSphi.reserve(4);  // a track candidate can consist of max 4 TS
0068   reset();
0069 
0070   setPrecision();
0071 }
0072 
0073 //--------------
0074 // Destructor --
0075 //--------------
0076 
0077 L1MuDTAssignmentUnit::~L1MuDTAssignmentUnit() {}
0078 
0079 //--------------
0080 // Operations --
0081 //--------------
0082 
0083 //
0084 // run Assignment Unit
0085 //
0086 void L1MuDTAssignmentUnit::run(const edm::EventSetup& c) {
0087   // enable track candidate
0088   m_sp.track(m_id)->enable();
0089   m_sp.tracK(m_id)->enable();
0090 
0091   // set track class
0092   TrackClass tc = m_sp.TA()->trackClass(m_id);
0093   m_sp.track(m_id)->setTC(tc);
0094   m_sp.tracK(m_id)->setTC(tc);
0095 
0096   // get relative addresses of matching track segments
0097   m_addArray = m_sp.TA()->address(m_id);
0098   m_sp.track(m_id)->setAddresses(m_addArray);
0099   m_sp.tracK(m_id)->setAddresses(m_addArray);
0100 
0101   // get track segments (track segment router)
0102   TSR();
0103   m_sp.track(m_id)->setTSphi(m_TSphi);
0104   m_sp.tracK(m_id)->setTSphi(m_TSphi);
0105 
0106   // set bunch-crossing (use first track segment)
0107   vector<const L1MuDTTrackSegPhi*>::const_iterator iter = m_TSphi.begin();
0108   int bx = (*iter)->bx();
0109   m_sp.track(m_id)->setBx(bx);
0110   m_sp.tracK(m_id)->setBx(bx);
0111 
0112   // assign phi
0113   PhiAU(c);
0114 
0115   // assign pt and charge
0116   PtAU(c);
0117 
0118   // assign quality
0119   QuaAU();
0120 
0121   // special hack for overlap region
0122   //  for ( iter = m_TSphi.begin(); iter != m_TSphi.end(); iter++ ) {
0123   //    int wheel = abs((*iter)->wheel());
0124   //    if ( wheel == 3 && (*iter)->etaFlag() ) m_sp.track(m_id)->disable();
0125   //    if ( wheel == 3 && (*iter)->etaFlag() ) m_sp.tracK(m_id)->disable();
0126   //  }
0127 }
0128 
0129 //
0130 // reset Assignment Unit
0131 //
0132 void L1MuDTAssignmentUnit::reset() {
0133   m_addArray.reset();
0134   m_TSphi.clear();
0135   m_ptAssMethod = NODEF;
0136 }
0137 
0138 //
0139 // assign phi with 8 bit precision
0140 //
0141 void L1MuDTAssignmentUnit::PhiAU(const edm::EventSetup& c) {
0142   // calculate phi at station 2 using 8 bits (precision = 2.5 degrees)
0143 
0144   thePhiLUTs = c.getHandle(thePhiToken);
0145 
0146   int sh_phi = 12 - m_sp.tf().config()->getNbitsPhiPhi();
0147   int sh_phib = 10 - m_sp.tf().config()->getNbitsPhiPhib();
0148 
0149   const L1MuDTTrackSegPhi* second = getTSphi(2);  // track segment at station 2
0150   const L1MuDTTrackSegPhi* first = getTSphi(1);   // track segment at station 1
0151   const L1MuDTTrackSegPhi* forth = getTSphi(4);   // track segment at station 4
0152 
0153   int phi2 = 0;  // phi-value at station 2
0154   int sector = 0;
0155 
0156   if (second) {
0157     phi2 = second->phi() >> sh_phi;
0158     sector = second->sector();
0159   } else if (second == nullptr && first) {
0160     phi2 = first->phi() >> sh_phi;
0161     sector = first->sector();
0162   } else if (second == nullptr && forth) {
0163     phi2 = forth->phi() >> sh_phi;
0164     sector = forth->sector();
0165   }
0166 
0167   int sector0 = m_sp.id().sector();
0168 
0169   // convert sector difference to values in the range -6 to +5
0170 
0171   int sectordiff = (sector - sector0) % 12;
0172   if (sectordiff >= 6)
0173     sectordiff -= 12;
0174   if (sectordiff < -6)
0175     sectordiff += 12;
0176 
0177   //  assert( abs(sectordiff) <= 1 );
0178 
0179   // get sector center in 8 bit coding
0180   int sector_8 = convertSector(sector0);
0181 
0182   // convert phi to 2.5 degree precision
0183   int phi_precision = 4096 >> sh_phi;
0184   const double k = 57.2958 / 2.5 / static_cast<float>(phi_precision);
0185   double phi_f = static_cast<double>(phi2);
0186   int phi_8 = static_cast<int>(floor(phi_f * k));
0187 
0188   if (second == nullptr && first) {
0189     int bend_angle = (first->phib() >> sh_phib) << sh_phib;
0190     phi_8 = phi_8 + thePhiLUTs->getDeltaPhi(0, bend_angle);
0191   } else if (second == nullptr && forth) {
0192     int bend_angle = (forth->phib() >> sh_phib) << sh_phib;
0193     phi_8 = phi_8 + thePhiLUTs->getDeltaPhi(1, bend_angle);
0194   }
0195 
0196   phi_8 += sectordiff * 12;
0197 
0198   if (phi_8 > 15)
0199     phi_8 = 15;
0200   if (phi_8 < -16)
0201     phi_8 = -16;
0202 
0203   int phi = (sector_8 + phi_8 + 144) % 144;
0204   phi_8 = (phi_8 + 32) % 32;
0205 
0206   m_sp.track(m_id)->setPhi(phi);
0207   m_sp.tracK(m_id)->setPhi(phi_8);
0208 }
0209 
0210 //
0211 // assign pt with 5 bit precision
0212 //
0213 void L1MuDTAssignmentUnit::PtAU(const edm::EventSetup& c) {
0214   thePtaLUTs = c.getHandle(thePtaToken);
0215 
0216   // get pt-assignment method as function of track class and TS phib values
0217   m_ptAssMethod = getPtMethod();
0218 
0219   // get input address for look-up table
0220   int bend_angle = getPtAddress(m_ptAssMethod);
0221   int bend_carga = getPtAddress(m_ptAssMethod, 1);
0222 
0223   // retrieve pt value from look-up table
0224   int lut_idx = m_ptAssMethod;
0225   int pt = thePtaLUTs->getPt(lut_idx, bend_angle);
0226 
0227   m_sp.track(m_id)->setPt(pt);
0228   m_sp.tracK(m_id)->setPt(pt);
0229 
0230   // assign charge
0231   int chsign = getCharge(m_ptAssMethod);
0232   int charge = (bend_carga >= 0) ? chsign : -1 * chsign;
0233   m_sp.track(m_id)->setCharge(charge);
0234   m_sp.tracK(m_id)->setCharge(charge);
0235 }
0236 
0237 //
0238 // assign 3 bit quality code
0239 //
0240 void L1MuDTAssignmentUnit::QuaAU() {
0241   unsigned int quality = 0;
0242 
0243   const TrackClass tc = m_sp.TA()->trackClass(m_id);
0244 
0245   switch (tc) {
0246     case T1234: {
0247       quality = 7;
0248       break;
0249     }
0250     case T123: {
0251       quality = 6;
0252       break;
0253     }
0254     case T124: {
0255       quality = 6;
0256       break;
0257     }
0258     case T134: {
0259       quality = 5;
0260       break;
0261     }
0262     case T234: {
0263       quality = 4;
0264       break;
0265     }
0266     case T12: {
0267       quality = 3;
0268       break;
0269     }
0270     case T13: {
0271       quality = 3;
0272       break;
0273     }
0274     case T14: {
0275       quality = 3;
0276       break;
0277     }
0278     case T23: {
0279       quality = 2;
0280       break;
0281     }
0282     case T24: {
0283       quality = 2;
0284       break;
0285     }
0286     case T34: {
0287       quality = 1;
0288       break;
0289     }
0290     default: {
0291       quality = 0;
0292       break;
0293     }
0294   }
0295 
0296   m_sp.track(m_id)->setQuality(quality);
0297   m_sp.tracK(m_id)->setQuality(quality);
0298 }
0299 
0300 //
0301 // Track Segment Router (TSR)
0302 //
0303 void L1MuDTAssignmentUnit::TSR() {
0304   // get the track segments from the data buffer
0305   const L1MuDTTrackSegPhi* ts = nullptr;
0306   for (int stat = 1; stat <= 4; stat++) {
0307     int adr = m_addArray.station(stat);
0308     if (adr != 15) {
0309       ts = m_sp.data()->getTSphi(stat, adr);
0310       if (ts != nullptr)
0311         m_TSphi.push_back(ts);
0312     }
0313   }
0314 }
0315 
0316 //
0317 // get track segment from a given station
0318 //
0319 const L1MuDTTrackSegPhi* L1MuDTAssignmentUnit::getTSphi(int station) const {
0320   vector<const L1MuDTTrackSegPhi*>::const_iterator iter;
0321   for (iter = m_TSphi.begin(); iter != m_TSphi.end(); iter++) {
0322     int stat = (*iter)->station();
0323     if (station == stat) {
0324       return (*iter);
0325       break;
0326     }
0327   }
0328 
0329   return nullptr;
0330 }
0331 
0332 //
0333 // convert sector Id to a precision of 2.5 degrees using 8 bits (= sector center)
0334 //
0335 int L1MuDTAssignmentUnit::convertSector(int sector) {
0336   //  assert( sector >=0 && sector < 12 );
0337   const int sectorvalues[12] = {0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132};
0338 
0339   return sectorvalues[sector];
0340 }
0341 
0342 //
0343 // determine charge
0344 //
0345 int L1MuDTAssignmentUnit::getCharge(PtAssMethod method) {
0346   int chargesign = 0;
0347   switch (method) {
0348     case PT12L: {
0349       chargesign = -1;
0350       break;
0351     }
0352     case PT12H: {
0353       chargesign = -1;
0354       break;
0355     }
0356     case PT13L: {
0357       chargesign = -1;
0358       break;
0359     }
0360     case PT13H: {
0361       chargesign = -1;
0362       break;
0363     }
0364     case PT14L: {
0365       chargesign = -1;
0366       break;
0367     }
0368     case PT14H: {
0369       chargesign = -1;
0370       break;
0371     }
0372     case PT23L: {
0373       chargesign = -1;
0374       break;
0375     }
0376     case PT23H: {
0377       chargesign = -1;
0378       break;
0379     }
0380     case PT24L: {
0381       chargesign = -1;
0382       break;
0383     }
0384     case PT24H: {
0385       chargesign = -1;
0386       break;
0387     }
0388     case PT34L: {
0389       chargesign = 1;
0390       break;
0391     }
0392     case PT34H: {
0393       chargesign = 1;
0394       break;
0395     }
0396     case PT12LO: {
0397       chargesign = -1;
0398       break;
0399     }
0400     case PT12HO: {
0401       chargesign = -1;
0402       break;
0403     }
0404     case PT13LO: {
0405       chargesign = -1;
0406       break;
0407     }
0408     case PT13HO: {
0409       chargesign = -1;
0410       break;
0411     }
0412     case PT14LO: {
0413       chargesign = -1;
0414       break;
0415     }
0416     case PT14HO: {
0417       chargesign = -1;
0418       break;
0419     }
0420     case PT23LO: {
0421       chargesign = -1;
0422       break;
0423     }
0424     case PT23HO: {
0425       chargesign = -1;
0426       break;
0427     }
0428     case PT24LO: {
0429       chargesign = -1;
0430       break;
0431     }
0432     case PT24HO: {
0433       chargesign = -1;
0434       break;
0435     }
0436     case PT34LO: {
0437       chargesign = 1;
0438       break;
0439     }
0440     case PT34HO: {
0441       chargesign = 1;
0442       break;
0443     }
0444     case PT15LO: {
0445       chargesign = -1;
0446       break;
0447     }
0448     case PT15HO: {
0449       chargesign = -1;
0450       break;
0451     }
0452     case PT25LO: {
0453       chargesign = -1;
0454       break;
0455     }
0456     case PT25HO: {
0457       chargesign = -1;
0458       break;
0459     }
0460     case NODEF: {
0461       chargesign = 0;
0462       //                    cerr << "AssignmentUnit::getCharge : undefined PtAssMethod!"
0463       //                         << endl;
0464       break;
0465     }
0466   }
0467 
0468   return chargesign;
0469 }
0470 
0471 //
0472 // determine pt-assignment method
0473 //
0474 PtAssMethod L1MuDTAssignmentUnit::getPtMethod() const {
0475   // determine which pt-assignment method should be used as a function
0476   // of the track class and
0477   // of the phib values of the track segments making up this track candidate.
0478 
0479   // get bitmap of track candidate
0480   const bitset<4> s = m_sp.TA()->trackBitMap(m_id);
0481 
0482   int method = -1;
0483 
0484   if (s.test(0) && s.test(3))
0485     method = 2;  // stations 1 and 4
0486   if (s.test(0) && s.test(2))
0487     method = 1;  // stations 1 and 3
0488   if (s.test(0) && s.test(1))
0489     method = 0;  // stations 1 and 2
0490   if (!s.test(0) && s.test(1) && s.test(3))
0491     method = 4;  // stations 2 and 4
0492   if (!s.test(0) && s.test(1) && s.test(2))
0493     method = 3;  // stations 2 and 3
0494   if (!s.test(0) && !s.test(1) && s.test(2) && s.test(3))
0495     method = 5;  // stations 3 and 4
0496 
0497   if (m_sp.ovl()) {
0498     int adr = m_addArray.station(3);
0499     bool s5 = (adr == 15) ? false : ((adr / 2) % 2 == 1);
0500     if (s.test(0) && s.test(3))
0501       method = 8;  // stations 1 and 4
0502     if (s.test(0) && s.test(2) && s5)
0503       method = 12;  // stations 1 and 5
0504     if (s.test(0) && s.test(2) && !s5)
0505       method = 7;  // stations 1 and 3
0506     if (s.test(0) && s.test(1))
0507       method = 6;  // stations 1 and 2
0508     if (!s.test(0) && s.test(1) && s.test(3))
0509       method = 10;  // stations 2 and 4
0510     if (!s.test(0) && s.test(1) && s.test(2) && s5)
0511       method = 13;  // stations 2 and 5
0512     if (!s.test(0) && s.test(1) && s.test(2) && !s5)
0513       method = 9;  // stations 2 and 3
0514     if (!s.test(0) && !s.test(1) && s.test(2) && s.test(3))
0515       method = 11;  // stations 3 and 4
0516   }
0517 
0518   int threshold = thePtaLUTs->getPtLutThreshold(method);
0519 
0520   // phib values of track segments from stations 1, 2 and 4
0521   int phib1 = (getTSphi(1) != nullptr) ? getTSphi(1)->phib() : 0;
0522   int phib2 = (getTSphi(2) != nullptr) ? getTSphi(2)->phib() : 0;
0523   int phib4 = (getTSphi(4) != nullptr) ? getTSphi(4)->phib() : 0;
0524 
0525   PtAssMethod pam = NODEF;
0526 
0527   switch (method) {
0528     case 0: {
0529       pam = (abs(phib1) < threshold) ? PT12H : PT12L;
0530       break;
0531     }
0532     case 1: {
0533       pam = (abs(phib1) < threshold) ? PT13H : PT13L;
0534       break;
0535     }
0536     case 2: {
0537       pam = (abs(phib1) < threshold) ? PT14H : PT14L;
0538       break;
0539     }
0540     case 3: {
0541       pam = (abs(phib2) < threshold) ? PT23H : PT23L;
0542       break;
0543     }
0544     case 4: {
0545       pam = (abs(phib2) < threshold) ? PT24H : PT24L;
0546       break;
0547     }
0548     case 5: {
0549       pam = (abs(phib4) < threshold) ? PT34H : PT34L;
0550       break;
0551     }
0552     case 6: {
0553       pam = (abs(phib1) < threshold) ? PT12HO : PT12LO;
0554       break;
0555     }
0556     case 7: {
0557       pam = (abs(phib1) < threshold) ? PT13HO : PT13LO;
0558       break;
0559     }
0560     case 8: {
0561       pam = (abs(phib1) < threshold) ? PT14HO : PT14LO;
0562       break;
0563     }
0564     case 9: {
0565       pam = (abs(phib2) < threshold) ? PT23HO : PT23LO;
0566       break;
0567     }
0568     case 10: {
0569       pam = (abs(phib2) < threshold) ? PT24HO : PT24LO;
0570       break;
0571     }
0572     case 11: {
0573       pam = (abs(phib4) < threshold) ? PT34HO : PT34LO;
0574       break;
0575     }
0576     case 12: {
0577       pam = (abs(phib1) < threshold) ? PT15HO : PT15LO;
0578       break;
0579     }
0580     case 13: {
0581       pam = (abs(phib2) < threshold) ? PT25HO : PT25LO;
0582       break;
0583     }
0584     default:;
0585       //cout << "L1MuDTAssignmentUnit : Error in PT ass method evaluation" << endl;
0586   }
0587 
0588   return pam;
0589 }
0590 
0591 //
0592 // calculate bend angle
0593 //
0594 int L1MuDTAssignmentUnit::getPtAddress(PtAssMethod method, int bendcharge) const {
0595   // calculate bend angle as difference of two azimuthal positions
0596 
0597   int bendangle = 0;
0598   switch (method) {
0599     case PT12L: {
0600       bendangle = phiDiff(1, 2);
0601       break;
0602     }
0603     case PT12H: {
0604       bendangle = phiDiff(1, 2);
0605       break;
0606     }
0607     case PT13L: {
0608       bendangle = phiDiff(1, 3);
0609       break;
0610     }
0611     case PT13H: {
0612       bendangle = phiDiff(1, 3);
0613       break;
0614     }
0615     case PT14L: {
0616       bendangle = phiDiff(1, 4);
0617       break;
0618     }
0619     case PT14H: {
0620       bendangle = phiDiff(1, 4);
0621       break;
0622     }
0623     case PT23L: {
0624       bendangle = phiDiff(2, 3);
0625       break;
0626     }
0627     case PT23H: {
0628       bendangle = phiDiff(2, 3);
0629       break;
0630     }
0631     case PT24L: {
0632       bendangle = phiDiff(2, 4);
0633       break;
0634     }
0635     case PT24H: {
0636       bendangle = phiDiff(2, 4);
0637       break;
0638     }
0639     case PT34L: {
0640       bendangle = phiDiff(4, 3);
0641       break;
0642     }
0643     case PT34H: {
0644       bendangle = phiDiff(4, 3);
0645       break;
0646     }
0647     case PT12LO: {
0648       bendangle = phiDiff(1, 2);
0649       break;
0650     }
0651     case PT12HO: {
0652       bendangle = phiDiff(1, 2);
0653       break;
0654     }
0655     case PT13LO: {
0656       bendangle = phiDiff(1, 3);
0657       break;
0658     }
0659     case PT13HO: {
0660       bendangle = phiDiff(1, 3);
0661       break;
0662     }
0663     case PT14LO: {
0664       bendangle = phiDiff(1, 4);
0665       break;
0666     }
0667     case PT14HO: {
0668       bendangle = phiDiff(1, 4);
0669       break;
0670     }
0671     case PT23LO: {
0672       bendangle = phiDiff(2, 3);
0673       break;
0674     }
0675     case PT23HO: {
0676       bendangle = phiDiff(2, 3);
0677       break;
0678     }
0679     case PT24LO: {
0680       bendangle = phiDiff(2, 4);
0681       break;
0682     }
0683     case PT24HO: {
0684       bendangle = phiDiff(2, 4);
0685       break;
0686     }
0687     case PT34LO: {
0688       bendangle = phiDiff(4, 3);
0689       break;
0690     }
0691     case PT34HO: {
0692       bendangle = phiDiff(4, 3);
0693       break;
0694     }
0695     case PT15LO: {
0696       bendangle = phiDiff(1, 3);
0697       break;
0698     }
0699     case PT15HO: {
0700       bendangle = phiDiff(1, 3);
0701       break;
0702     }
0703     case PT25LO: {
0704       bendangle = phiDiff(2, 3);
0705       break;
0706     }
0707     case PT25HO: {
0708       bendangle = phiDiff(2, 3);
0709       break;
0710     }
0711     case NODEF: {
0712       bendangle = 0;
0713       //                    cerr << "AssignmentUnit::getPtAddress : undefined PtAssMethod" << endl;
0714       break;
0715     }
0716   }
0717 
0718   int signo = 1;
0719   bendangle = (bendangle + 8192) % 4096;
0720   if (bendangle > 2047)
0721     bendangle -= 4096;
0722   if (bendangle < 0)
0723     signo = -1;
0724 
0725   if (bendcharge)
0726     return signo;
0727 
0728   bendangle = (bendangle + 2048) % 1024;
0729   if (bendangle > 511)
0730     bendangle -= 1024;
0731 
0732   return bendangle;
0733 }
0734 
0735 //
0736 // build difference of two phi values
0737 //
0738 int L1MuDTAssignmentUnit::phiDiff(int stat1, int stat2) const {
0739   // calculate bit shift
0740 
0741   int sh_phi = 12 - nbit_phi;
0742 
0743   // get 2 phi values and add offset (30 degrees ) for adjacent sector
0744   int sector1 = getTSphi(stat1)->sector();
0745   int sector2 = getTSphi(stat2)->sector();
0746   int phi1 = getTSphi(stat1)->phi() >> sh_phi;
0747   int phi2 = getTSphi(stat2)->phi() >> sh_phi;
0748 
0749   // convert sector difference to values in the range -6 to +5
0750 
0751   int sectordiff = (sector2 - sector1) % 12;
0752   if (sectordiff >= 6)
0753     sectordiff -= 12;
0754   if (sectordiff < -6)
0755     sectordiff += 12;
0756 
0757   //  assert( abs(sectordiff) <= 1 );
0758 
0759   int offset = (2144 >> sh_phi) * sectordiff;
0760   int bendangle = (phi2 - phi1 + offset) << sh_phi;
0761 
0762   return bendangle;
0763 }
0764 
0765 //
0766 // set precision for pt-assignment of phi and phib
0767 // default is 12 bits for phi and 10 bits for phib
0768 //
0769 void L1MuDTAssignmentUnit::setPrecision() {
0770   nbit_phi = m_sp.tf().config()->getNbitsPtaPhi();
0771   nbit_phib = m_sp.tf().config()->getNbitsPtaPhib();
0772 }
0773 
0774 // static data members