DataFormats
L1CSCTrackFinder
src
TrackStub.cc
Go to the documentation of this file.
1
#include <
DataFormats/L1CSCTrackFinder/interface/TrackStub.h
>
2
#include <
DataFormats/L1CSCTrackFinder/interface/CSCBitWidths.h
>
3
#include <
DataFormats/MuonDetId/interface/CSCTriggerNumbering.h
>
4
#include <
DataFormats/MuonDetId/interface/DTChamberId.h
>
5
#include <
DataFormats/MuonDetId/interface/CSCDetId.h
>
6
#include <
DataFormats/MuonDetId/interface/MuonSubdetId.h
>
7
8
namespace
csctf
{
9
10
const
double
TrackStub::thePhiBinning
=
CSCTFConstants::SECTOR_RAD
/ (1 <<
CSCBitWidths::kGlobalPhiDataBitWidth
);
11
const
double
TrackStub::theEtaBinning
= (
CSCTFConstants::maxEta
-
CSCTFConstants::minEta
) / (
CSCTFConstants::etaBins
);
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
):
70
se =
CSCTriggerNumbering::triggerSectorFromLabels
(
CSCDetId
(
theDetId_
));
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
):
89
ss
=
CSCTriggerNumbering::triggerSubSectorFromLabels
(
CSCDetId
(
theDetId_
));
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
)
100
return
CSCTriggerNumbering::triggerCscIdFromLabels
(
CSCDetId
(
theDetId_
));
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;
108
CSCDetId
id
(
theDetId_
);
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
CSCTriggerNumbering::triggerSectorFromLabels
static int triggerSectorFromLabels(int station, int ring, int chamber)
Definition:
CSCTriggerNumbering.cc:76
CSCBitWidths.h
MuonSubdetId::CSC
static constexpr int CSC
Definition:
MuonSubdetId.h:12
CSCCorrelatedLCTDigi::getTrknmb
uint16_t getTrknmb() const
return track number
Definition:
CSCCorrelatedLCTDigi.h:64
csctf::TrackStub::station
unsigned station() const
Definition:
TrackStub.cc:43
csctf::TrackStub::operator<
bool operator<(const TrackStub &) const
Definition:
TrackStub.cc:115
CSCTriggerNumbering::triggerSubSectorFromLabels
static int triggerSubSectorFromLabels(int station, int chamber)
Definition:
CSCTriggerNumbering.cc:105
csctf::TrackStub::sector
unsigned sector() const
Definition:
TrackStub.cc:60
CSCTriggerNumbering::triggerCscIdFromLabels
static int triggerCscIdFromLabels(int station, int ring, int chamber)
Definition:
CSCTriggerNumbering.cc:137
csctf::TrackStub
Definition:
TrackStub.h:22
csctf::TrackStub::operator>
bool operator>(const TrackStub &) const
Comparision Operators, used for MPC sorting.
Definition:
TrackStub.cc:121
CSCDetId.h
csctf::TrackStub::TrackStub
TrackStub()
Definition:
TrackStub.h:24
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
DetId
Definition:
DetId.h:17
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
PVValHelper::eta
Definition:
PVValidationHelpers.h:70
CSCTriggerNumbering.h
MuonSubdetId::DT
static constexpr int DT
Definition:
MuonSubdetId.h:11
DTChamberId.h
csctf::TrackStub::cscidSeparateME1a
unsigned cscidSeparateME1a() const
Definition:
TrackStub.cc:105
csctf::TrackStub::thePhiBinning
static const double thePhiBinning
Definition:
TrackStub.h:71
csctf::TrackStub::theEtaBinning
static const double theEtaBinning
Definition:
TrackStub.h:71
CSCDetId
Definition:
CSCDetId.h:26
CSCTFConstants::minEta
const static double minEta
Definition:
CSCTFConstants.h:39
CSCBitWidths::kGlobalPhiDataBitWidth
Definition:
CSCBitWidths.h:28
csctf::TrackStub::endcap
unsigned endcap() const
Definition:
TrackStub.cc:26
CSCTFConstants::etaBins
Definition:
CSCTFConstants.h:34
MuonSubdetId.h
DTChamberId::sector
int sector() const
Definition:
DTChamberId.h:49
CSCTFConstants::maxEta
const static double maxEta
Definition:
CSCTFConstants.h:40
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:29
CSCDetId::endcap
int endcap() const
Definition:
CSCDetId.h:85
csctf
Definition:
TrackStub.h:20
relativeConstraints.ring
ring
Definition:
relativeConstraints.py:68
CSCTFConstants::SECTOR_RAD
const static double SECTOR_RAD
Definition:
CSCTFConstants.h:55
csctf::TrackStub::subsector
unsigned subsector() const
Definition:
TrackStub.cc:79
DTChamberId
Definition:
DTChamberId.h:14
CSCDetId::station
int station() const
Definition:
CSCDetId.h:79
CSCCorrelatedLCTDigi::isValid
bool isValid() const
return valid pattern bit
Definition:
CSCCorrelatedLCTDigi.h:67
TrackStub.h
CSCCorrelatedLCTDigi::getQuality
uint16_t getQuality() const
return the Quality
Definition:
CSCCorrelatedLCTDigi.h:70
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition:
DTChamberId.h:39
csctf::TrackStub::theDetId_
uint32_t theDetId_
Definition:
TrackStub.h:69
csctf::TrackStub::cscid
unsigned cscid() const
Definition:
TrackStub.cc:98
DTChamberId::station
int station() const
Return the station number.
Definition:
DTChamberId.h:42
CSCCorrelatedLCTDigi
Definition:
CSCCorrelatedLCTDigi.h:19
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16