CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  TrackStub::TrackStub(const TrackStub& aTrackStub)
20  : CSCCorrelatedLCTDigi(aTrackStub),
21  theDetId_(aTrackStub.theDetId_),
22  thePhi_(aTrackStub.thePhi_),
23  theEta_(aTrackStub.theEta_),
24  link_(aTrackStub.link_) {}
25 
26  unsigned TrackStub::endcap() const {
27  int e = 0;
28 
29  switch (DetId(theDetId_).subdetId()) {
30  case (MuonSubdetId::DT):
31  e = (DTChamberId(theDetId_).wheel() > 0) ? 1 : 2;
32  break;
33  case (MuonSubdetId::CSC):
34  e = CSCDetId(theDetId_).endcap();
35  break;
36  default:
37  break;
38  }
39 
40  return e;
41  }
42 
43  unsigned TrackStub::station() const {
44  int s = 0;
45 
46  switch (DetId(theDetId_).subdetId()) {
47  case (MuonSubdetId::DT):
48  s = DTChamberId(theDetId_).station() + 4;
49  break;
50  case (MuonSubdetId::CSC):
51  s = CSCDetId(theDetId_).station();
52  break;
53  default:
54  break;
55  }
56 
57  return s;
58  }
59 
60  unsigned TrackStub::sector() const {
61  int se = 0, temps = 0;
62 
63  switch (DetId(theDetId_).subdetId()) {
64  case (MuonSubdetId::DT): {
65  temps = DTChamberId(theDetId_).sector();
66  const unsigned int dt2csc[12] = {6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6};
67  se = dt2csc[temps - 1];
68  } break;
69  case (MuonSubdetId::CSC):
71  break;
72  default:
73  break;
74  }
75 
76  return se;
77  }
78 
79  unsigned TrackStub::subsector() const {
80  int ss = 0;
81 
82  switch (DetId(theDetId_).subdetId()) {
83  case (MuonSubdetId::DT): {
84  ss = DTChamberId(theDetId_).sector();
85  const unsigned int dt2csc_[12] = {2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
86  ss = dt2csc_[ss - 1];
87  } break;
88  case (MuonSubdetId::CSC):
90  break;
91  default:
92  break;
93  }
94 
95  return ss;
96  }
97 
98  unsigned TrackStub::cscid() const {
99  if (DetId(theDetId_).subdetId() == MuonSubdetId::CSC)
101 
102  return 0; // DT chambers obviously don't have a csc id :-D
103  }
104 
105  unsigned TrackStub::cscidSeparateME1a() const {
106  if (DetId(theDetId_).subdetId() != MuonSubdetId::CSC)
107  return 0;
109  unsigned normal_cscid = CSCTriggerNumbering::triggerCscIdFromLabels(id);
110  if (id.station() == 1 && id.ring() == 4)
111  return normal_cscid + 9; // 10,11,12 for ME1a
112  return normal_cscid;
113  }
114 
115  bool TrackStub::operator<(const TrackStub& rhs) const {
116  return (rhs.isValid() && ((!(isValid())) || (getQuality() < rhs.getQuality()) ||
117  (getQuality() == rhs.getQuality() && cscid() < rhs.cscid()) ||
118  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 2))));
119  }
120 
121  bool TrackStub::operator>(const TrackStub& rhs) const {
122  return (isValid() && ((!(rhs.isValid())) || (getQuality() > rhs.getQuality()) ||
123  (getQuality() == rhs.getQuality() && cscid() > rhs.cscid()) ||
124  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 1))));
125  }
126 
127 } // namespace csctf
bool operator<(const TrackStub &) const
Definition: TrackStub.cc:115
uint16_t *__restrict__ id
bool operator>(const TrackStub &) const
Comparision Operators, used for MPC sorting.
Definition: TrackStub.cc:121
unsigned sector() const
Definition: TrackStub.cc:60
static const double minEta
unsigned station() const
Definition: TrackStub.cc:43
static const double theEtaBinning
Definition: TrackStub.h:71
static const double thePhiBinning
Definition: TrackStub.h:71
static const double maxEta
uint16_t getTrknmb() const
return track number
static int triggerCscIdFromLabels(int station, int ring, int chamber)
unsigned subsector() const
Definition: TrackStub.cc:79
Definition: DetId.h:17
static int triggerSectorFromLabels(int station, int ring, int chamber)
uint32_t theDetId_
Definition: TrackStub.h:69
static int triggerSubSectorFromLabels(int station, int chamber)
uint16_t getQuality() const
return the Quality
unsigned cscid() const
Definition: TrackStub.cc:98
bool isValid() const
return valid pattern bit
unsigned endcap() const
Definition: TrackStub.cc:26
static const double SECTOR_RAD
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
unsigned cscidSeparateME1a() const
Definition: TrackStub.cc:105