CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCTFDTReceiver Class Reference

#include <CSCTFDTReceiver.h>

Public Member Functions

 CSCTFDTReceiver ()
 
CSCTriggerContainer< csctf::TrackStubprocess (const L1MuDTChambPhContainer *)
 
 ~CSCTFDTReceiver ()
 

Private Attributes

CSCTriggerContainer< csctf::TrackStubdtstubs
 

Detailed Description

Definition at line 12 of file CSCTFDTReceiver.h.

Constructor & Destructor Documentation

◆ CSCTFDTReceiver()

CSCTFDTReceiver::CSCTFDTReceiver ( )
inline

Definition at line 14 of file CSCTFDTReceiver.h.

References CSCTriggerContainer< T >::clear(), and dtstubs.

14 { dtstubs.clear(); }
CSCTriggerContainer< csctf::TrackStub > dtstubs

◆ ~CSCTFDTReceiver()

CSCTFDTReceiver::~CSCTFDTReceiver ( )
inline

Definition at line 15 of file CSCTFDTReceiver.h.

15 {}

Member Function Documentation

◆ process()

CSCTriggerContainer< csctf::TrackStub > CSCTFDTReceiver::process ( const L1MuDTChambPhContainer dttrig)

shift all by one and take mod 8, since DT quality of 7 is a null stub

Definition at line 12 of file CSCTFDTReceiver.cc.

References l1GtPatternGenerator_cfi::bx, L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), CSCTriggerContainer< T >::clear(), L1MuDTChambPhDigi::code(), gather_cfg::cout, dtstubs, MillePedeFileConverter_cfg::e, L1MuDTTFConfig::getBxMaxGlobally(), L1MuDTTFConfig::getBxMinGlobally(), CSCBitWidths::kGlobalPhiDataBitWidth, CSCConstants::LCT_CENTRAL_BX, CSCTFDTReceiverLUT::lut, CSCDetId::maxEndcapId(), CSCTriggerNumbering::maxTriggerSectorId(), CSCDetId::minEndcapId(), CSCTriggerNumbering::minTriggerSectorId(), phi, L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), CSCTriggerContainer< T >::push_back(), alignCSCRings::s, hgcalTBTopologyTester_cfi::sector, and makeMuonMisalignmentScenario::wheel.

Referenced by CSCTFTrackProducer::produce().

12  {
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;
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
static int maxTriggerSectorId()
static const unsigned short int lut[4096]
static int minTriggerSectorId()
void push_back(const T &data)
CSCTriggerContainer< csctf::TrackStub > dtstubs
static int getBxMaxGlobally()
static int maxEndcapId()
Definition: CSCDetId.h:235
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
static int getBxMinGlobally()
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const

Member Data Documentation

◆ dtstubs

CSCTriggerContainer<csctf::TrackStub> CSCTFDTReceiver::dtstubs
private

Definition at line 21 of file CSCTFDTReceiver.h.

Referenced by CSCTFDTReceiver(), and process().