CMS 3D CMS Logo

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