test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MicroGMTConfiguration.cc
Go to the documentation of this file.
1 #include "../interface/MicroGMTConfiguration.h"
2 
3 unsigned
4 l1t::MicroGMTConfiguration::getTwosComp(const int signed_int, const int width) {
5  if (signed_int >= 0) {
6  return (unsigned)signed_int;
7  }
8  int all_one = (1 << width)-1;
9  return ((-signed_int) ^ all_one) + 1;
10 }
11 
12 int
14  int globPhi = 0;
15  if (t == bmtf) {
16  // each BMTF processor corresponds to a 30 degree wedge = 48 in int-scale
17  globPhi = (proc) * 48 + locPhi;
18  // first processor starts at CMS phi = -15 degrees...
19  globPhi += 576-24;
20  // handle wrap-around (since we add the 576-24, the value will never be negative!)
21  globPhi = globPhi%576;
22  } else {
23  // all others correspond to 60 degree sectors = 96 in int-scale
24  globPhi = (proc) * 96 + locPhi;
25  // first processor starts at CMS phi = 15 degrees... Handle wrap-around with %:
26  globPhi = (globPhi + 24) % 576;
27  }
28  return globPhi;
29 }
static unsigned getTwosComp(const int signedInt, const int width)
TrainProcessor *const proc
Definition: MVATrainer.cc:101
static int calcGlobalPhi(int locPhi, tftype t, int proc)