CMS 3D CMS Logo

TrackStub.cc
Go to the documentation of this file.
7 
8 namespace csctf {
9 
12 
13  TrackStub::TrackStub(const CSCCorrelatedLCTDigi& aDigi, const DetId& aDetId)
14  : CSCCorrelatedLCTDigi(aDigi), theDetId_(aDetId.rawId()), thePhi_(0), theEta_(0), link_(0) {}
15 
16  TrackStub::TrackStub(const CSCCorrelatedLCTDigi& aDigi, const DetId& aDetId, const unsigned& phi, const unsigned& eta)
17  : CSCCorrelatedLCTDigi(aDigi), theDetId_(aDetId.rawId()), thePhi_(phi), theEta_(eta), link_(0) {}
18 
19  unsigned TrackStub::endcap() const {
20  int e = 0;
21 
22  switch (DetId(theDetId_).subdetId()) {
23  case (MuonSubdetId::DT):
24  e = (DTChamberId(theDetId_).wheel() > 0) ? 1 : 2;
25  break;
26  case (MuonSubdetId::CSC):
28  break;
29  default:
30  break;
31  }
32 
33  return e;
34  }
35 
36  unsigned TrackStub::station() const {
37  int s = 0;
38 
39  switch (DetId(theDetId_).subdetId()) {
40  case (MuonSubdetId::DT):
41  s = DTChamberId(theDetId_).station() + 4;
42  break;
43  case (MuonSubdetId::CSC):
45  break;
46  default:
47  break;
48  }
49 
50  return s;
51  }
52 
53  unsigned TrackStub::sector() const {
54  int se = 0, temps = 0;
55 
56  switch (DetId(theDetId_).subdetId()) {
57  case (MuonSubdetId::DT): {
58  temps = DTChamberId(theDetId_).sector();
59  const unsigned int dt2csc[12] = {6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6};
60  se = dt2csc[temps - 1];
61  } break;
62  case (MuonSubdetId::CSC):
64  break;
65  default:
66  break;
67  }
68 
69  return se;
70  }
71 
72  unsigned TrackStub::subsector() const {
73  int ss = 0;
74 
75  switch (DetId(theDetId_).subdetId()) {
76  case (MuonSubdetId::DT): {
78  const unsigned int dt2csc_[12] = {2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
79  ss = dt2csc_[ss - 1];
80  } break;
81  case (MuonSubdetId::CSC):
83  break;
84  default:
85  break;
86  }
87 
88  return ss;
89  }
90 
91  unsigned TrackStub::cscid() const {
92  if (DetId(theDetId_).subdetId() == MuonSubdetId::CSC)
94 
95  return 0; // DT chambers obviously don't have a csc id :-D
96  }
97 
98  unsigned TrackStub::cscidSeparateME1a() const {
99  if (DetId(theDetId_).subdetId() != MuonSubdetId::CSC)
100  return 0;
102  unsigned normal_cscid = CSCTriggerNumbering::triggerCscIdFromLabels(id);
103  if (id.station() == 1 && id.ring() == 4)
104  return normal_cscid + 9; // 10,11,12 for ME1a
105  return normal_cscid;
106  }
107 
108  bool TrackStub::operator<(const TrackStub& rhs) const {
109  return (rhs.isValid() && ((!(isValid())) || (getQuality() < rhs.getQuality()) ||
110  (getQuality() == rhs.getQuality() && cscid() < rhs.cscid()) ||
111  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 2))));
112  }
113 
114  bool TrackStub::operator>(const TrackStub& rhs) const {
115  return (isValid() && ((!(rhs.isValid())) || (getQuality() > rhs.getQuality()) ||
116  (getQuality() == rhs.getQuality() && cscid() > rhs.cscid()) ||
117  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 1))));
118  }
119 
120 } // namespace csctf
int station() const
Return the station number.
Definition: DTChamberId.h:45
bool operator<(const TrackStub &) const
Definition: TrackStub.cc:108
static const double minEta
unsigned station() const
Definition: TrackStub.cc:36
static const double theEtaBinning
Definition: TrackStub.h:70
static const double thePhiBinning
Definition: TrackStub.h:70
bool isValid() const
return valid pattern bit
static const double maxEta
bool operator>(const TrackStub &) const
Comparision Operators, used for MPC sorting.
Definition: TrackStub.cc:114
unsigned endcap() const
Definition: TrackStub.cc:19
static int triggerCscIdFromLabels(int station, int ring, int chamber)
uint16_t getTrknmb() const
return track number
uint16_t getQuality() const
return the Quality
Definition: DetId.h:17
int station() const
Definition: CSCDetId.h:79
static int triggerSectorFromLabels(int station, int ring, int chamber)
uint32_t theDetId_
Definition: TrackStub.h:68
int endcap() const
Definition: CSCDetId.h:85
static int triggerSubSectorFromLabels(int station, int chamber)
unsigned subsector() const
Definition: TrackStub.cc:72
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
unsigned cscidSeparateME1a() const
Definition: TrackStub.cc:98
int sector() const
Definition: DTChamberId.h:52
static const double SECTOR_RAD
static constexpr int DT
Definition: MuonSubdetId.h:11
unsigned cscid() const
Definition: TrackStub.cc:91
static constexpr int CSC
Definition: MuonSubdetId.h:12
unsigned sector() const
Definition: TrackStub.cc:53