CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonHitsChamberResidual.cc
Go to the documentation of this file.
1 
7 
10  DetId chamberId,
11  const AlignableDetOrUnitPtr& chamberAlignable)
12  : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
13  , m_chamber_width(0.), m_chamber_length(0.)
14  , m_residual_1(0.)
15  , m_residual_x(0.) , m_residual_y(0.)
16  , m_residual_xx(0.) , m_residual_xy(0.)
17  , m_trackx_1(0.)
18  , m_trackx_x(0.) , m_trackx_y(0.)
19  , m_trackx_xx(0.) , m_trackx_xy(0.)
20  , m_tracky_1(0.)
21  , m_tracky_x(0.) , m_tracky_y(0.)
22  , m_tracky_xx(0.) , m_tracky_xy(0.)
23  , m_hitx_1(0.)
24  , m_hitx_x(0.) , m_hitx_y(0.)
25  , m_hitx_xx(0.) , m_hitx_xy(0.)
26  , m_hity_1(0.)
27  , m_hity_x(0.) , m_hity_y(0.)
28  , m_hity_xx(0.) , m_hity_xy(0.)
29 {}
30 
31 
33 {
34  assert(m_numHits > 1);
35 
37  m_residual = (m_residual_xx * m_residual_y - m_residual_x * m_residual_xy) / delta;
38 
39  delta = m_residual_1 * m_residual_xx - m_residual_x * m_residual_x;
41 
42  delta = m_residual_1 * m_residual_xx - m_residual_x * m_residual_x;
43  m_resslope = (m_residual_1 * m_residual_xy - m_residual_x * m_residual_y) / delta;
44 
45  delta = m_residual_1 * m_residual_xx - m_residual_x * m_residual_x;
47 
48  m_ndof = m_individual_x.size() - 2;
49 
50  m_chi2 = 0.;
51  double a = m_residual;
52  double b = m_resslope;
53  std::vector< double >::const_iterator x = m_individual_x.begin();
54  std::vector< double >::const_iterator y = m_individual_y.begin();
55  std::vector< double >::const_iterator w = m_individual_weight.begin();
56  for (; x != m_individual_x.end(); ++x, ++y, ++w) m_chi2 += pow((*y) - a - b * (*x), 2) * (*w);
57 
59  m_trackdxdz = (m_trackx_1 * m_trackx_xy - m_trackx_x * m_trackx_y) / delta;
60 
62  m_trackdydz = (m_tracky_1 * m_tracky_xy - m_tracky_x * m_tracky_y) / delta;
63 
64  delta = m_trackx_1 * m_trackx_xx - m_trackx_x * m_trackx_x;
65  m_trackx = (m_trackx_xx * m_trackx_y - m_trackx_x * m_trackx_xy) / delta;
66 
67  delta = m_tracky_1 * m_tracky_xx - m_tracky_x * m_tracky_x;
68  m_tracky = (m_tracky_xx * m_tracky_y - m_tracky_x * m_tracky_xy) / delta;
69 
70  delta = m_hitx_1 * m_hitx_xx - m_hitx_x * m_hitx_x;
71  m_segdxdz = (m_hitx_1 * m_hitx_xy - m_hitx_x * m_hitx_y) / delta;
72 
73  delta = m_hity_1 * m_hity_xx - m_hity_x * m_hity_x;
74  m_segdydz = (m_hity_1 * m_hity_xy - m_hity_x * m_hity_y) / delta;
75 
76  delta = m_hitx_1 * m_hitx_xx - m_hitx_x * m_hitx_x;
77  m_segx = (m_hitx_xx * m_hitx_y - m_hitx_x * m_hitx_xy) / delta;
78 
79  delta = m_hity_1 * m_hity_xx - m_hity_x * m_hity_x;
80  m_segy = (m_hity_xx * m_hity_y - m_hity_x * m_hity_xy) / delta;
81 
84 }
85 
dbl * delta
Definition: mlp_gen.cc:36
std::vector< double > m_individual_y
const double w
Definition: UKUtility.cc:23
assert(m_qm.get())
std::vector< double > m_individual_x
T sqrt(T t)
Definition: SSEVec.h:18
Definition: DetId.h:18
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
MuonHitsChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)
std::vector< double > m_individual_weight
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40