CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCTFDTReceiver.cc
Go to the documentation of this file.
9 
11 
13  dtstubs.clear();
14  if (!dttrig)
15  return dtstubs;
16 
17  const int dt_minBX = L1MuDTTFConfig::getBxMinGlobally();
18  const int dt_maxBX = L1MuDTTFConfig::getBxMaxGlobally();
19 
20  const int dt_toffs = 0; // changed since DT tpg now centers around zero //abs(dt_maxBX - dt_minBX);
21 
22  // consider all BX
23  for (int bx = dt_minBX + dt_toffs; bx <= dt_maxBX + dt_toffs; ++bx)
24  for (int e = CSCDetId::minEndcapId(); e <= CSCDetId::maxEndcapId(); ++e)
26  int wheel = (e == 1) ? 2 : -2;
27  int sector = 2 * s - 1;
28  int csc_bx = bx + CSCConstants::LCT_CENTRAL_BX; //Delay DT stubs by the central LCT bx.
29 
30  // combine two 30 degree DT sectors into a 60 degree CSC
31  // sector.
32  for (int is = sector; is <= sector + 1; ++is) {
33  int iss = (is == 12) ? 0 : is;
34  const L1MuDTChambPhDigi* dtts[2];
35 
36  for (int stub = 0; stub < 2; ++stub) {
37  dtts[stub] = (stub == 0) ? dttrig->chPhiSegm1(wheel, 1, iss, bx) : dttrig->chPhiSegm2(wheel, 1, iss, bx);
38  if (dtts[stub]) {
39  // --------------------------------------------------------------
40  // IKF: this code has been reformulated ...
41  // --------------------------------------------------------------
42  // // Convert stubs to CSC format (signed -> unsigned)
43  // // phi was 12 bits (signed) for pi radians = 57.3 deg
44  // // relative to center of 30 degree DT sector
45  // double tmp = static_cast<const double> (dtts[stub]->phi()) /
46  // DTConfigTraco::RESOLPSIR * 180./M_PI + 15.;
47  // int phi = static_cast<int> (tmp/62. * (1<<(CSCBitWidths::kGlobalPhiDataBitWidth)));
48  // --------------------------------------------------------------
49  // IKF ...and is now this line, actually works a tiny bit better.
50  // --------------------------------------------------------------
51  // float tmp = dtts[stub] -> phi() * 1.0;
52  //
53  // tmp *= 90.0;
54  // tmp /= 31.0;
55  // // tmp /= M_PI;
56  // tmp /= 3.1416;
57  // tmp += 1057.0;
58  //
59  // int phi = static_cast<int> (tmp);
60 
61  // --------------------------------------------------------------
62  // IKF ...and is now this line, actually works a tiny bit better.
63  // --------------------------------------------------------------
64  int phi = dtts[stub]->phi();
65 
66  if (phi < 0)
67  phi += 4096;
68 
69  if (phi > 4096) {
70  std::cout << "AAAAAAAAAAGH TOO BIG PHI:" << phi << std::endl;
71  continue;
72  }
73  if (phi < 0) {
74  std::cout << "AAAAAAAAH NEG PHI" << phi << std::endl;
75  continue;
76  }
77 
79 
80  // --------------------------------------------------------------
81 
82  // DT chambers may lie outside CSC sector boundary
83  // Eventually we need to extend CSC phi definition
84  // --------------------------------------------------------------
85  // IKF: this is a protection, physically can't happen in data (bus too narrow) -
86  // - what really happens in data?
87  // --------------------------------------------------------------
88 
89  phi = (phi > 0) ? phi : 0;
90  phi = (phi < (1 << (CSCBitWidths::kGlobalPhiDataBitWidth)))
91  ? phi
93 
94  // change phib from 10 bits to 5
95  int phib = ((dtts[stub]->phiB() & 0x3FF) >> 5) & 0x1F; // 0x3FF=1023, 0x1F=31
96  int qual = dtts[stub]->code();
97  // barrel allows quality=0!
99  qual = (qual + 1) % 8;
100 
101  CSCCorrelatedLCTDigi dtinfo(stub + 1, 1, qual, 0, stub, 0, phib, csc_bx + stub, 1 + (is + 1) % 2);
102  DTChamberId dtid(wheel, 1, iss + 1);
103  csctf::TrackStub tsCSC(dtinfo, dtid, phi, 0);
104 
105  dtstubs.push_back(tsCSC);
106  }
107  }
108  }
109  }
110 
111  return dtstubs;
112 }
static int minEndcapId()
Definition: CSCDetId.h:234
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
static int maxTriggerSectorId()
static const unsigned short int lut[4096]
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
static int minTriggerSectorId()
void push_back(const T &data)
CSCTriggerContainer< csctf::TrackStub > dtstubs
static int getBxMaxGlobally()
static int maxEndcapId()
Definition: CSCDetId.h:235
static int getBxMinGlobally()
tuple cout
Definition: gather_cfg.py:144