src
DataFormats
MuonReco
src
MuonChamberMatch.cc
Go to the documentation of this file.
1
#include "
DataFormats/MuonDetId/interface/DTChamberId.h
"
2
#include <
DataFormats/MuonDetId/interface/MuonSubdetId.h
>
3
#include "
DataFormats/MuonDetId/interface/CSCDetId.h
"
4
#include "
DataFormats/MuonDetId/interface/RPCDetId.h
"
5
#include "
DataFormats/MuonDetId/interface/GEMDetId.h
"
6
#include "
DataFormats/MuonDetId/interface/ME0DetId.h
"
7
#include "
DataFormats/MuonReco/interface/MuonChamberMatch.h
"
8
#include <cmath>
9
using namespace
reco
;
10
11
int
MuonChamberMatch::station
()
const
{
12
if
(
detector
() ==
MuonSubdetId::DT
) {
// DT
13
DTChamberId
segId(
id
.
rawId
());
14
return
segId.
station
();
15
}
16
if
(
detector
() ==
MuonSubdetId::CSC
) {
// CSC
17
CSCDetId
segId(
id
.
rawId
());
18
return
segId.
station
();
19
}
20
if
(
detector
() ==
MuonSubdetId::RPC
) {
//RPC
21
RPCDetId
segId(
id
.
rawId
());
22
return
segId.
station
();
23
}
24
if
(
detector
() ==
MuonSubdetId::GEM
) {
//GEM
25
GEMDetId
segId(
id
.
rawId
());
26
return
segId.
station
();
27
}
28
if
(
detector
() ==
MuonSubdetId::ME0
) {
//ME0
29
ME0DetId
segId(
id
.
rawId
());
30
return
segId.
station
();
31
}
32
return
-1;
// is this appropriate? fix this
33
}
34
35
std::pair<float, float>
MuonChamberMatch::getDistancePair
(
float
edgeX,
float
edgeY,
float
xErr,
float
yErr)
const
{
36
if
(
edgeX
> 9E5 &&
edgeY
> 9E5 &&
xErr
> 9E5 &&
yErr
> 9E5)
// there is no track
37
return
std::make_pair(999999, 999999);
38
39
float
distance
= 999999;
40
float
error
= 999999;
41
42
if
(
edgeX
< 0 &&
edgeY
< 0) {
43
if
(
edgeX
<
edgeY
) {
44
distance
=
edgeY
;
45
error
=
yErr
;
46
}
else
{
47
distance
=
edgeX
;
48
error
=
xErr
;
49
}
50
}
51
if
(edgeX < 0 && edgeY > 0) {
52
distance
=
edgeY
;
53
error
=
yErr
;
54
}
55
if
(
edgeX
> 0 &&
edgeY
< 0) {
56
distance
=
edgeX
;
57
error
=
xErr
;
58
}
59
if
(
edgeX
> 0 &&
edgeY
> 0) {
60
distance
=
sqrt
(
edgeX
*
edgeX
+
edgeY
*
edgeY
);
61
error
=
distance
?
sqrt
(
edgeX
*
edgeX
*
xErr
*
xErr
+
edgeY
*
edgeY
*
yErr
*
yErr
) / fabs(
distance
) : 0;
62
}
63
64
return
std::make_pair(
distance
,
error
);
65
}
DTChamberId::station
int station() const
Return the station number.
Definition:
DTChamberId.h:45
GEMDetId::station
constexpr int station() const
Definition:
GEMDetId.h:179
GEMDetId
Definition:
GEMDetId.h:18
reco::MuonChamberMatch::yErr
float yErr
Definition:
MuonChamberMatch.h:24
reco::MuonChamberMatch::getDistancePair
std::pair< float, float > getDistancePair(float edgeX, float edgeY, float xErr, float yErr) const
Definition:
MuonChamberMatch.cc:35
MuonSubdetId::GEM
static constexpr int GEM
Definition:
MuonSubdetId.h:14
reco::MuonChamberMatch::edgeY
float edgeY
Definition:
MuonChamberMatch.h:20
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
nano_mu_digi_cff.rawId
rawId
Definition:
nano_mu_digi_cff.py:56
ME0DetId
Definition:
ME0DetId.h:16
CSCDetId.h
CSCDetId
Definition:
CSCDetId.h:26
RPCDetId.h
DTChamberId
Definition:
DTChamberId.h:14
ME0DetId::station
int station() const
Definition:
ME0DetId.h:58
MuonChamberMatch.h
reco::MuonChamberMatch::station
int station() const
Definition:
MuonChamberMatch.cc:11
reco::MuonChamberMatch::xErr
float xErr
Definition:
MuonChamberMatch.h:23
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
reco::MuonChamberMatch::edgeX
float edgeX
Definition:
MuonChamberMatch.h:19
DTChamberId.h
MuonSubdetId.h
MuonSubdetId::ME0
static constexpr int ME0
Definition:
MuonSubdetId.h:15
GEMDetId.h
RPCDetId
Definition:
RPCDetId.h:16
CSCDetId::station
int station() const
Definition:
CSCDetId.h:79
MuonSubdetId::RPC
static constexpr int RPC
Definition:
MuonSubdetId.h:13
reco::MuonChamberMatch::detector
int detector() const
Definition:
MuonChamberMatch.h:33
RPCDetId::station
int station() const
Definition:
RPCDetId.h:78
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
ME0DetId.h
MuonSubdetId::DT
static constexpr int DT
Definition:
MuonSubdetId.h:11
MuonSubdetId::CSC
static constexpr int CSC
Definition:
MuonSubdetId.h:12
HLT_2023v12_cff.distance
distance
Definition:
HLT_2023v12_cff.py:5856
Generated for CMSSW Reference Manual by
1.8.14