Alignment
MuonAlignmentAlgorithms
src
MuonHitsChamberResidual.cc
Go to the documentation of this file.
1
6
#include "
Alignment/MuonAlignmentAlgorithms/interface/MuonHitsChamberResidual.h
"
7
8
MuonHitsChamberResidual::MuonHitsChamberResidual
(
edm::ESHandle<GlobalTrackingGeometry>
globalGeometry,
9
AlignableNavigator
*
navigator
,
10
DetId
chamberId,
11
const
AlignableDetOrUnitPtr
& chamberAlignable)
12
:
MuonChamberResidual
(globalGeometry,
navigator
, chamberId, chamberAlignable),
13
m_chamber_width(0.),
14
m_chamber_length(0.),
15
m_residual_1(0.),
16
m_residual_x(0.),
17
m_residual_y(0.),
18
m_residual_xx(0.),
19
m_residual_xy(0.),
20
m_trackx_1(0.),
21
m_trackx_x(0.),
22
m_trackx_y(0.),
23
m_trackx_xx(0.),
24
m_trackx_xy(0.),
25
m_tracky_1(0.),
26
m_tracky_x(0.),
27
m_tracky_y(0.),
28
m_tracky_xx(0.),
29
m_tracky_xy(0.),
30
m_hitx_1(0.),
31
m_hitx_x(0.),
32
m_hitx_y(0.),
33
m_hitx_xx(0.),
34
m_hitx_xy(0.),
35
m_hity_1(0.),
36
m_hity_x(0.),
37
m_hity_y(0.),
38
m_hity_xx(0.),
39
m_hity_xy(0.) {}
40
41
void
MuonHitsChamberResidual::segment_fit
() {
42
assert
(
m_numHits
> 1);
43
44
double
delta
=
m_residual_1
*
m_residual_xx
-
m_residual_x
*
m_residual_x
;
45
m_residual
= (
m_residual_xx
*
m_residual_y
-
m_residual_x
*
m_residual_xy
) /
delta
;
46
47
delta
=
m_residual_1
*
m_residual_xx
-
m_residual_x
*
m_residual_x
;
48
m_residual_error
=
sqrt
(
m_residual_xx
/
delta
);
49
50
delta
=
m_residual_1
*
m_residual_xx
-
m_residual_x
*
m_residual_x
;
51
m_resslope
= (
m_residual_1
*
m_residual_xy
-
m_residual_x
*
m_residual_y
) /
delta
;
52
53
delta
=
m_residual_1
*
m_residual_xx
-
m_residual_x
*
m_residual_x
;
54
m_resslope_error
=
sqrt
(
m_residual_1
/
delta
);
55
56
m_ndof
=
m_individual_x
.size() - 2;
57
58
m_chi2
= 0.;
59
double
a
=
m_residual
;
60
double
b
=
m_resslope
;
61
std::vector<double>::const_iterator
x
=
m_individual_x
.begin();
62
std::vector<double>::const_iterator
y
=
m_individual_y
.begin();
63
std::vector<double>::const_iterator
w
=
m_individual_weight
.begin();
64
for
(;
x
!=
m_individual_x
.end(); ++
x
, ++
y
, ++
w
)
65
m_chi2
+=
pow
((*
y
) -
a
-
b
* (*x), 2) * (*
w
);
66
67
delta
=
m_trackx_1
*
m_trackx_xx
-
m_trackx_x
*
m_trackx_x
;
68
m_trackdxdz
= (
m_trackx_1
*
m_trackx_xy
-
m_trackx_x
*
m_trackx_y
) /
delta
;
69
70
delta
=
m_tracky_1
*
m_tracky_xx
-
m_tracky_x
*
m_tracky_x
;
71
m_trackdydz
= (
m_tracky_1
*
m_tracky_xy
-
m_tracky_x
*
m_tracky_y
) /
delta
;
72
73
delta
=
m_trackx_1
*
m_trackx_xx
-
m_trackx_x
*
m_trackx_x
;
74
m_trackx
= (
m_trackx_xx
*
m_trackx_y
-
m_trackx_x
*
m_trackx_xy
) /
delta
;
75
76
delta
=
m_tracky_1
*
m_tracky_xx
-
m_tracky_x
*
m_tracky_x
;
77
m_tracky
= (
m_tracky_xx
*
m_tracky_y
-
m_tracky_x
*
m_tracky_xy
) /
delta
;
78
79
delta
=
m_hitx_1
*
m_hitx_xx
-
m_hitx_x
*
m_hitx_x
;
80
m_segdxdz
= (
m_hitx_1
*
m_hitx_xy
-
m_hitx_x
*
m_hitx_y
) /
delta
;
81
82
delta
=
m_hity_1
*
m_hity_xx
-
m_hity_x
*
m_hity_x
;
83
m_segdydz
= (
m_hity_1
*
m_hity_xy
-
m_hity_x
*
m_hity_y
) /
delta
;
84
85
delta
=
m_hitx_1
*
m_hitx_xx
-
m_hitx_x
*
m_hitx_x
;
86
m_segx
= (
m_hitx_xx
*
m_hitx_y
-
m_hitx_x
*
m_hitx_xy
) /
delta
;
87
88
delta
=
m_hity_1
*
m_hity_xx
-
m_hity_x
*
m_hity_x
;
89
m_segy
= (
m_hity_xx
*
m_hity_y
-
m_hity_x
*
m_hity_xy
) /
delta
;
90
91
m_ChambW
=
m_chamber_width
;
92
m_Chambl
=
m_chamber_length
;
93
}
MuonHitsChamberResidual::m_tracky_x
double m_tracky_x
Definition:
MuonHitsChamberResidual.h:45
MuonChamberResidual::m_individual_y
std::vector< double > m_individual_y
Definition:
MuonChamberResidual.h:97
MuonChamberResidual::m_resslope_error
double m_resslope_error
Definition:
MuonChamberResidual.h:107
MuonHitsChamberResidual.h
HLT_2022v12_cff.navigator
navigator
Definition:
HLT_2022v12_cff.py:9661
MuonChamberResidual::m_trackdydz
double m_trackdydz
Definition:
MuonChamberResidual.h:109
w
T w() const
Definition:
extBasic3DVector.h:225
MuonHitsChamberResidual::m_chamber_width
double m_chamber_width
Definition:
MuonHitsChamberResidual.h:32
MuonHitsChamberResidual::m_trackx_1
double m_trackx_1
Definition:
MuonHitsChamberResidual.h:39
MuonHitsChamberResidual::m_tracky_xx
double m_tracky_xx
Definition:
MuonHitsChamberResidual.h:47
MuonChamberResidual::m_resslope
double m_resslope
Definition:
MuonChamberResidual.h:106
MuonChamberResidual::m_ChambW
double m_ChambW
Definition:
MuonChamberResidual.h:116
MuonHitsChamberResidual::m_trackx_xx
double m_trackx_xx
Definition:
MuonHitsChamberResidual.h:42
MuonHitsChamberResidual::m_hity_xx
double m_hity_xx
Definition:
MuonHitsChamberResidual.h:57
AlignableDetOrUnitPtr
Definition:
AlignableDetOrUnitPtr.h:30
MuonHitsChamberResidual::m_trackx_x
double m_trackx_x
Definition:
MuonHitsChamberResidual.h:40
MuonChamberResidual
Definition:
MuonChamberResidual.h:26
cms::cuda::assert
assert(be >=bs)
MuonChamberResidual::m_tracky
double m_tracky
Definition:
MuonChamberResidual.h:111
MuonChamberResidual::m_ndof
int m_ndof
Definition:
MuonChamberResidual.h:103
MuonChamberResidual::m_numHits
int m_numHits
Definition:
MuonChamberResidual.h:93
dumpMFGeometry_cfg.delta
delta
Definition:
dumpMFGeometry_cfg.py:25
MuonChamberResidual::m_residual_error
double m_residual_error
Definition:
MuonChamberResidual.h:105
MuonChamberResidual::m_individual_x
std::vector< double > m_individual_x
Definition:
MuonChamberResidual.h:96
MuonChamberResidual::m_chi2
double m_chi2
Definition:
MuonChamberResidual.h:102
MuonHitsChamberResidual::m_residual_xx
double m_residual_xx
Definition:
MuonHitsChamberResidual.h:37
MuonChamberResidual::m_segdxdz
double m_segdxdz
Definition:
MuonChamberResidual.h:112
AlignableNavigator
Definition:
AlignableNavigator.h:25
MuonHitsChamberResidual::m_tracky_y
double m_tracky_y
Definition:
MuonHitsChamberResidual.h:46
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
edm::ESHandle< GlobalTrackingGeometry >
MuonChamberResidual::m_Chambl
double m_Chambl
Definition:
MuonChamberResidual.h:117
MuonHitsChamberResidual::m_residual_xy
double m_residual_xy
Definition:
MuonHitsChamberResidual.h:38
MuonHitsChamberResidual::m_hity_x
double m_hity_x
Definition:
MuonHitsChamberResidual.h:55
MuonHitsChamberResidual::m_trackx_xy
double m_trackx_xy
Definition:
MuonHitsChamberResidual.h:43
MuonHitsChamberResidual::m_hity_y
double m_hity_y
Definition:
MuonHitsChamberResidual.h:56
MuonHitsChamberResidual::m_hitx_y
double m_hitx_y
Definition:
MuonHitsChamberResidual.h:51
MuonHitsChamberResidual::m_hity_1
double m_hity_1
Definition:
MuonHitsChamberResidual.h:54
DetId
Definition:
DetId.h:17
MuonHitsChamberResidual::m_residual_x
double m_residual_x
Definition:
MuonHitsChamberResidual.h:35
MuonChamberResidual::m_trackdxdz
double m_trackdxdz
Definition:
MuonChamberResidual.h:108
MuonHitsChamberResidual::m_tracky_xy
double m_tracky_xy
Definition:
MuonHitsChamberResidual.h:48
MuonHitsChamberResidual::m_hitx_1
double m_hitx_1
Definition:
MuonHitsChamberResidual.h:49
MuonHitsChamberResidual::m_residual_y
double m_residual_y
Definition:
MuonHitsChamberResidual.h:36
MuonChamberResidual::m_residual
double m_residual
Definition:
MuonChamberResidual.h:104
MuonHitsChamberResidual::m_residual_1
double m_residual_1
Definition:
MuonHitsChamberResidual.h:34
MuonChamberResidual::m_segx
double m_segx
Definition:
MuonChamberResidual.h:114
MuonHitsChamberResidual::m_tracky_1
double m_tracky_1
Definition:
MuonHitsChamberResidual.h:44
b
double b
Definition:
hdecay.h:118
MuonHitsChamberResidual::m_hitx_xy
double m_hitx_xy
Definition:
MuonHitsChamberResidual.h:53
MuonHitsChamberResidual::m_hitx_x
double m_hitx_x
Definition:
MuonHitsChamberResidual.h:50
MuonHitsChamberResidual::m_chamber_length
double m_chamber_length
Definition:
MuonHitsChamberResidual.h:33
MuonHitsChamberResidual::segment_fit
void segment_fit()
Definition:
MuonHitsChamberResidual.cc:41
MuonChamberResidual::m_segy
double m_segy
Definition:
MuonChamberResidual.h:115
DDAxes::y
a
double a
Definition:
hdecay.h:119
MuonHitsChamberResidual::m_hity_xy
double m_hity_xy
Definition:
MuonHitsChamberResidual.h:58
MuonHitsChamberResidual::MuonHitsChamberResidual
MuonHitsChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)
Definition:
MuonHitsChamberResidual.cc:8
MuonChamberResidual::m_trackx
double m_trackx
Definition:
MuonChamberResidual.h:110
MuonHitsChamberResidual::m_trackx_y
double m_trackx_y
Definition:
MuonHitsChamberResidual.h:41
MuonChamberResidual::m_segdydz
double m_segdydz
Definition:
MuonChamberResidual.h:113
DDAxes::x
MuonChamberResidual::m_individual_weight
std::vector< double > m_individual_weight
Definition:
MuonChamberResidual.h:98
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition:
Power.h:29
MuonHitsChamberResidual::m_hitx_xx
double m_hitx_xx
Definition:
MuonHitsChamberResidual.h:52
Generated for CMSSW Reference Manual by
1.8.14