Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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/MuonReco/interface/MuonChamberMatch.h
"
6
#include <cmath>
7
using namespace
reco
;
8
9
int
MuonChamberMatch::station
()
const
{
10
if
(
detector
() ==
MuonSubdetId::DT
) {
// DT
11
DTChamberId
segId(
id
.rawId());
12
return
segId.
station
();
13
}
14
if
(
detector
() ==
MuonSubdetId::CSC
) {
// CSC
15
CSCDetId
segId(
id
.rawId());
16
return
segId.
station
();
17
}
18
if
(
detector
() ==
MuonSubdetId::RPC
) {
//RPC
19
RPCDetId
segId(
id
.rawId());
20
return
segId.
station
();
21
}
22
return
-1;
// is this appropriate? fix this
23
}
24
25
std::pair<float,float>
26
MuonChamberMatch::getDistancePair
(
float
edgeX,
float
edgeY,
float
xErr,
float
yErr)
const
27
{
28
if
(edgeX>9E5&&edgeY>9E5&&xErr>9E5&&yErr>9E5)
// there is no track
29
return
std::make_pair(999999, 999999);
30
31
float
distance = 999999;
32
float
error
= 999999;
33
34
if
(edgeX<0 && edgeY<0) {
35
if
(edgeX<edgeY) { distance =
edgeY
; error =
yErr
; }
36
else
{ distance =
edgeX
; error =
xErr
; }
37
}
38
if
(edgeX<0 && edgeY>0) { distance =
edgeY
; error =
yErr
; }
39
if
(edgeX>0 && edgeY<0) { distance =
edgeX
; error =
xErr
; }
40
if
(edgeX>0 && edgeY>0) { distance =
sqrt
(edgeX*edgeX+edgeY*edgeY); error = distance ?
sqrt
(edgeX*edgeX*xErr*xErr+edgeY*edgeY*yErr*yErr)/fabs(distance) : 0; }
41
42
return
std::make_pair(distance, error);
43
}
reco::MuonChamberMatch::detector
int detector() const
Definition:
MuonChamberMatch.h:27
reco::MuonChamberMatch::yErr
float yErr
Definition:
MuonChamberMatch.h:20
reco::MuonChamberMatch::edgeY
float edgeY
Definition:
MuonChamberMatch.h:16
CSCDetId.h
CSCDetId
Definition:
CSCDetId.h:27
RPCDetId.h
DTChamberId
Definition:
DTChamberId.h:14
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
MuonChamberMatch.h
MuonSubdetId::CSC
static const int CSC
Definition:
MuonSubdetId.h:13
reco::MuonChamberMatch::station
int station() const
Definition:
MuonChamberMatch.cc:9
reco::MuonChamberMatch::xErr
float xErr
Definition:
MuonChamberMatch.h:19
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:48
reco::MuonChamberMatch::edgeX
float edgeX
Definition:
MuonChamberMatch.h:15
DTChamberId.h
MuonSubdetId.h
RPCDetId
Definition:
RPCDetId.h:16
MuonSubdetId::RPC
static const int RPC
Definition:
MuonSubdetId.h:14
relativeConstraints.error
tuple error
Definition:
relativeConstraints.py:55
CSCDetId::station
int station() const
Definition:
CSCDetId.h:99
MuonSubdetId::DT
static const int DT
Definition:
MuonSubdetId.h:12
DTChamberId::station
int station() const
Return the station number.
Definition:
DTChamberId.h:51
reco::MuonChamberMatch::getDistancePair
std::pair< float, float > getDistancePair(float edgeX, float edgeY, float xErr, float yErr) const
Definition:
MuonChamberMatch.cc:26
RPCDetId::station
int station() const
Definition:
RPCDetId.h:96
Generated for CMSSW Reference Manual by
1.8.5