CMS 3D CMS Logo

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