CMS 3D CMS Logo

TotemRPLocalTrack.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of TOTEM offline software.
4  * Authors:
5  * Hubert Niewiadomski
6  * Jan Kašpar (jan.kaspar@gmail.com)
7  *
8  ****************************************************************************/
9 
11 
12 //----------------------------------------------------------------------------------------------------
13 
15 {
16  TMatrixD h(2,4);
17  h(0,0)=1;
18  h(1,1)=1;
19  h(0,2)=z-z0_;
20  h(1,3)=z-z0_;
21 
22  TMatrixD cov_matr(dimension,dimension);
23  for(int i=0; i<dimension; ++i)
24  for(int j=0; j<dimension; ++j)
25  cov_matr(i,j)=CovarianceMatrixElement(i,j);
26 
27  TMatrixD V_hT(cov_matr, TMatrixD::kMultTranspose, h);
28  //h*=V_hT;
29  //return h;
30  return TMatrixD(h, TMatrixD::kMult, V_hT);
31 }
32 
33 //----------------------------------------------------------------------------------------------------
34 
35 TotemRPLocalTrack::TotemRPLocalTrack(double z0, const TVectorD & track_params_vector,
36  const TMatrixD &par_covariance_matrix, double chiSquared)
37  : z0_(z0), chiSquared_(chiSquared), valid_(true)
38 {
39  for(int i=0; i<dimension; ++i)
40  {
41  track_params_vector_[i]=track_params_vector[i];
42  for(int j=0; j<dimension; ++j)
43  {
44  CovarianceMatrixElement(i,j)=par_covariance_matrix(i,j);
45  }
46  }
47 }
48 
49 //----------------------------------------------------------------------------------------------------
50 
52 {
53  TVectorD v(dimension);
54 
55  for (int i = 0; i < dimension; ++i)
56  v[i] = track_params_vector_[i];
57 
58  return v;
59 }
60 
61 //----------------------------------------------------------------------------------------------------
62 
63 void TotemRPLocalTrack::setParameterVector(const TVectorD & track_params_vector)
64 {
65  for (int i = 0; i < dimension; ++i)
66  track_params_vector_[i] = track_params_vector[i];
67 }
68 
69 //----------------------------------------------------------------------------------------------------
70 
72 {
73  TMatrixD m(dimension,dimension);
74 
75  for(int i=0; i<dimension; ++i)
76  for(int j=0; j<dimension; ++j)
78 
79  return m;
80 }
81 
82 //----------------------------------------------------------------------------------------------------
83 
84 void TotemRPLocalTrack::setCovarianceMatrix(const TMatrixD &par_covariance_matrix)
85 {
86  for(int i=0; i<dimension; ++i)
87  for(int j=0; j<dimension; ++j)
88  CovarianceMatrixElement(i,j) = par_covariance_matrix(i,j);
89 }
90 
91 //----------------------------------------------------------------------------------------------------
92 
94 {
95  if (l.z0_ < r.z0_)
96  return true;
97  if (l.z0_ > r.z0_)
98  return true;
99 
100  for (int i = 0; i < TotemRPLocalTrack::dimension; ++i)
101  {
103  return true;
105  return true;
106  }
107 
108  return false;
109 }
int i
Definition: DBlmapReader.cc:9
TMatrixD getCovarianceMatrix() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TVectorD getParameterVector() const
A track fit through a single RP.
float float float z
TMatrixD trackPointInterpolationCovariance(double z) const
static const int dimension
< parameter vector size
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
int j
Definition: DBlmapReader.cc:9
double chiSquared_
fit chi^2
const double & CovarianceMatrixElement(int i, int j) const
void setCovarianceMatrix(const TMatrixD &par_covariance_matrix)
void setParameterVector(const TVectorD &track_params_vector)
bool valid_
fit valid?
friend bool operator<(const TotemRPLocalTrack &l, const TotemRPLocalTrack &r)