CMS 3D CMS Logo

OmtfPhase2AngleConverter.cc
Go to the documentation of this file.
2 
3 int OmtfPhase2AngleConverter::getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const {
4  constexpr int dtPhiBins = 65536; //65536. for [-0.5,0.5] radians
5  double hsPhiPitch = 2 * M_PI / nPhiBins; // width of phi Pitch, related to halfStrip at CSC station 2
6 
7  int sector = dtScNum + 1; //NOTE: there is a inconsistency in DT sector numb. Thus +1 needed to get detector numb.
8 
9  double scale = 0.5 / dtPhiBins / hsPhiPitch; //was 0.8
10  int scale_coeff = lround(scale * (1 << 15));
11 
12  int ichamber = sector - 1;
13  if (ichamber > 6)
14  ichamber = ichamber - 12;
15 
16  int offsetGlobal = (int)nPhiBins * ichamber / 12;
17 
18  int phiConverted = ((dtPhi * scale_coeff) >> 15) + offsetGlobal - phiZero;
19 
20  return config->foldPhi(phiConverted);
21 }
22 
23 /* TODO implement the etat for the phase2 stubs
24 int getGlobalEta(const DTChamberId dTChamberId, const L1Phase2MuDTThContainer *dtThDigis, int bxNum) const {
25 
26  //const DTChamberId dTChamberId(aDigi.whNum(),aDigi.stNum(),aDigi.scNum()+1);
27  DTTrigGeom trig_geom(_geodt->chamber(dTChamberId), false);
28 
29 
30 }
31 */
Definition: config.py:1
int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const override
unsigned int nPhiBins
Number of phi bins along 2Pi.
#define M_PI
part
Definition: HCALResponse.h:20