CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackStub.cc
Go to the documentation of this file.
7 
8 namespace csctf
9 {
10 
13 
15  const DetId& aDetId): CSCCorrelatedLCTDigi(aDigi),
16  theDetId_(aDetId.rawId()),
17  thePhi_(0),
18  theEta_(0),
19  link_(0)
20  {}
21 
23  const DetId& aDetId,
24  const unsigned& phi, const unsigned& eta): CSCCorrelatedLCTDigi(aDigi),
25  theDetId_(aDetId.rawId()),
26  thePhi_(phi),
27  theEta_(eta),
28  link_(0)
29  {}
30 
31 
32 
33  TrackStub::TrackStub(const TrackStub& aTrackStub): CSCCorrelatedLCTDigi(aTrackStub),
34  theDetId_(aTrackStub.theDetId_),
35  thePhi_(aTrackStub.thePhi_),
36  theEta_(aTrackStub.theEta_),
37  link_(aTrackStub.link_)
38  {}
39 
40  unsigned TrackStub::endcap() const
41  {
42  int e = 0;
43 
44  switch(DetId(theDetId_).subdetId())
45  {
46  case (MuonSubdetId::DT):
47  e = (DTChamberId(theDetId_).wheel() > 0) ? 1 : 2;
48  break;
49  case (MuonSubdetId::CSC):
50  e = CSCDetId(theDetId_).endcap();
51  break;
52  default:
53  break;
54  }
55 
56  return e;
57  }
58 
59  unsigned TrackStub::station() const
60  {
61  int s = 0;
62 
63  switch(DetId(theDetId_).subdetId())
64  {
65  case (MuonSubdetId::DT):
66  s = DTChamberId(theDetId_).station() + 4;
67  break;
68  case (MuonSubdetId::CSC):
69  s = CSCDetId(theDetId_).station();
70  break;
71  default:
72  break;
73  }
74 
75  return s;
76  }
77 
78  unsigned TrackStub::sector() const
79  {
80  int se = 0, temps = 0;
81 
82  switch(DetId(theDetId_).subdetId())
83  {
84  case (MuonSubdetId::DT): {
85  temps = DTChamberId(theDetId_).sector();
86  const unsigned int dt2csc[12] = {6,1,1,2,2,3,3,4,4,5,5,6};
87  se = dt2csc[temps-1]; }
88  break;
89  case (MuonSubdetId::CSC):
91  break;
92  default:
93  break;
94  }
95 
96  return se;
97  }
98 
99  unsigned TrackStub::subsector() const
100  {
101  int ss = 0;
102 
103  switch(DetId(theDetId_).subdetId())
104  {
105  case (MuonSubdetId::DT): {
106  ss = DTChamberId(theDetId_).sector();
107  const unsigned int dt2csc_[12] = {2,1,2,1,2,1,2,1,2,1,2,1};
108  ss = dt2csc_[ss-1]; }
109  break;
110  case (MuonSubdetId::CSC):
112  break;
113  default:
114  break;
115  }
116 
117  return ss;
118  }
119 
120  unsigned TrackStub::cscid() const
121  {
122  if(DetId(theDetId_).subdetId() == MuonSubdetId::CSC)
124 
125  return 0; // DT chambers obviously don't have a csc id :-D
126  }
127 
129  {
130  if(DetId(theDetId_).subdetId() != MuonSubdetId::CSC) return 0;
131  CSCDetId id(theDetId_);
132  unsigned normal_cscid = CSCTriggerNumbering::triggerCscIdFromLabels(id);
133  if (id.station()==1 && id.ring()==4) return normal_cscid + 9; // 10,11,12 for ME1a
134  return normal_cscid;
135  }
136 
137  bool TrackStub::operator<(const TrackStub& rhs) const
138  {
139  return ( rhs.isValid() && ( (!(isValid())) || (getQuality() < rhs.getQuality()) ||
140  (getQuality() == rhs.getQuality() && cscid() < rhs.cscid()) ||
141  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() &&
142  (getTrknmb() == 2)) ) );
143  }
144 
145  bool TrackStub::operator>(const TrackStub& rhs) const
146  {
147  return ( isValid() && ( (!(rhs.isValid())) || (getQuality() > rhs.getQuality()) ||
148  (getQuality() == rhs.getQuality() && cscid() > rhs.cscid()) ||
149  (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() &&
150  (getTrknmb() == 1)) ) );
151  }
152 
153 }
bool operator<(const TrackStub &) const
Definition: TrackStub.cc:137
bool operator>(const TrackStub &) const
Comparision Operators, used for MPC sorting.
Definition: TrackStub.cc:145
int getQuality() const
return the 4 bit Correlated LCT Quality
unsigned sector() const
Definition: TrackStub.cc:78
static const double minEta
unsigned station() const
Definition: TrackStub.cc:59
static const int CSC
Definition: MuonSubdetId.h:13
static const double theEtaBinning
Definition: TrackStub.h:72
static const double thePhiBinning
Definition: TrackStub.h:72
static const double maxEta
int getTrknmb() const
return track number
static int triggerCscIdFromLabels(int station, int ring, int chamber)
unsigned subsector() const
Definition: TrackStub.cc:99
Definition: DetId.h:18
static int triggerSectorFromLabels(int station, int ring, int chamber)
uint32_t theDetId_
Definition: TrackStub.h:70
static int triggerSubSectorFromLabels(int station, int chamber)
unsigned cscid() const
Definition: TrackStub.cc:120
bool isValid() const
return valid pattern bit
unsigned endcap() const
Definition: TrackStub.cc:40
static const double SECTOR_RAD
static const int DT
Definition: MuonSubdetId.h:12
unsigned cscidSeparateME1a() const
Definition: TrackStub.cc:128