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;
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 }
CSCBitWidths.h
CSCTriggerContainer::clear
void clear()
Definition: CSCTriggerContainer.h:57
CSCTFDTReceiver::process
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
Definition: CSCTFDTReceiver.cc:12
L1MuDTTFConfig.h
L1MuDTTFConfig::getBxMinGlobally
static int getBxMinGlobally()
Definition: L1MuDTTFConfig.h:54
L1MuDTChambPhContainer::chPhiSegm1
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:67
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCConstants::LCT_CENTRAL_BX
Definition: CSCConstants.h:148
CSCTriggerNumbering::maxTriggerSectorId
static int maxTriggerSectorId()
Definition: CSCTriggerNumbering.h:112
L1MuDTTFConfig::getBxMaxGlobally
static int getBxMaxGlobally()
Definition: L1MuDTTFConfig.h:55
L1MuDTChambPhDigi::phiB
int phiB() const
Definition: L1MuDTChambPhDigi.cc:76
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
csctf::TrackStub
Definition: TrackStub.h:22
CSCDetId.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DTConfigTraco.h
CSCDetId::minEndcapId
static int minEndcapId()
Definition: CSCDetId.h:234
L1MuDTChambPhDigi::phi
int phi() const
Definition: L1MuDTChambPhDigi.cc:74
CSCConstants.h
CSCTriggerNumbering.h
DTChamberId.h
CSCTFDTReceiver.h
L1MuDTChambPhContainer::chPhiSegm2
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:78
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
CSCBitWidths::kGlobalPhiDataBitWidth
Definition: CSCBitWidths.h:28
CSCTriggerNumbering::minTriggerSectorId
static int minTriggerSectorId()
Definition: CSCTriggerNumbering.h:113
CSCDetId::maxEndcapId
static int maxEndcapId()
Definition: CSCDetId.h:235
DDAxes::phi
CSCTriggerContainer< csctf::TrackStub >
CSCTriggerContainer::push_back
void push_back(const T &data)
Definition: CSCTriggerContainer.h:51
CSCTFDTReceiverLUT::lut
static const unsigned short int lut[4096]
Definition: CSCTFDTReceiverLUT.h:6
DTChamberId
Definition: DTChamberId.h:14
L1MuDTChambPhDigi::code
int code() const
Definition: L1MuDTChambPhDigi.cc:78
CSCTFDTReceiverLUT.h
CSCTFDTReceiver::dtstubs
CSCTriggerContainer< csctf::TrackStub > dtstubs
Definition: CSCTFDTReceiver.h:21
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
L1MuDTChambPhDigi
Definition: L1MuDTChambPhDigi.h:31
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37