CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends
TotemRPLocalTrack Class Reference

A track fit through a single RP. More...

#include <TotemRPLocalTrack.h>

Classes

class  FittedRecHit
 

Public Member Functions

void addHit (unsigned int detId, const FittedRecHit &hit)
 
double getChiSquared () const
 
double getChiSquaredOverNDF () const
 
TMatrixD getCovarianceMatrix () const
 
TVector3 getDirectionVector () const
 
const edm::DetSetVector< FittedRecHit > & getHits () const
 
TVectorD getParameterVector () const
 
TVector3 getTrackCentrePoint ()
 
TVector2 getTrackPoint (double z) const
 returns (x, y) vector More...
 
double getTx () const
 
double getTxSigma () const
 
double getTy () const
 
double getTySigma () const
 
double getX0 () const
 
double getX0Sigma () const
 
double getX0Variance () const
 
double getY0 () const
 
double getY0Sigma () const
 
double getY0Variance () const
 
double getZ0 () const
 
bool isValid () const
 
void setChiSquared (double &chiSquared)
 
void setCovarianceMatrix (const TMatrixD &par_covariance_matrix)
 
void setParameterVector (const TVectorD &track_params_vector)
 
void setValid (bool valid)
 
void setZ0 (double z0)
 
 TotemRPLocalTrack ()
 
 TotemRPLocalTrack (double z0, const TVectorD &track_params_vector, const TMatrixD &par_covariance_matrix, double chiSquared)
 
TMatrixD trackPointInterpolationCovariance (double z) const
 
virtual ~TotemRPLocalTrack ()
 

Static Public Attributes

static const int covarianceSize = dimension * dimension
 
static const int dimension = 4
 < parameter vector size More...
 

Private Member Functions

const double & CovarianceMatrixElement (int i, int j) const
 
double & CovarianceMatrixElement (int i, int j)
 

Private Attributes

double chiSquared_
 fit chi^2 More...
 
double par_covariance_matrix_ [covarianceSize]
 
edm::DetSetVector< FittedRecHittrack_hits_vector_
 
double track_params_vector_ [dimension]
 track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ... More...
 
bool valid_
 fit valid? More...
 
double z0_
 

Friends

bool operator< (const TotemRPLocalTrack &l, const TotemRPLocalTrack &r)
 

Detailed Description

A track fit through a single RP.

x = x0+tx*(z-z0) y = ...

z0 is defined below x any y refer to the global (x, y) system with the beam at (x = 0, y = 0). Only VALID tracks (IsValid()==true) can be later used for physics reconstruction!

Definition at line 31 of file TotemRPLocalTrack.h.

Constructor & Destructor Documentation

TotemRPLocalTrack::TotemRPLocalTrack ( )
inline

Definition at line 68 of file TotemRPLocalTrack.h.

68  : z0_(0), chiSquared_(0), valid_(false)
69  {
70  }
double chiSquared_
fit chi^2
bool valid_
fit valid?
TotemRPLocalTrack::TotemRPLocalTrack ( double  z0,
const TVectorD &  track_params_vector,
const TMatrixD &  par_covariance_matrix,
double  chiSquared 
)

Definition at line 35 of file TotemRPLocalTrack.cc.

References CovarianceMatrixElement(), dimension, mps_fire::i, and track_params_vector_.

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 }
static const int dimension
< parameter vector size
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double chiSquared_
fit chi^2
const double & CovarianceMatrixElement(int i, int j) const
bool valid_
fit valid?
virtual TotemRPLocalTrack::~TotemRPLocalTrack ( )
inlinevirtual

Definition at line 75 of file TotemRPLocalTrack.h.

75 {}

Member Function Documentation

void TotemRPLocalTrack::addHit ( unsigned int  detId,
const FittedRecHit hit 
)
inline

Definition at line 78 of file TotemRPLocalTrack.h.

References track_hits_vector_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack().

79  {
80  track_hits_vector_.find_or_insert(detId).push_back(hit);
81  }
edm::DetSetVector< FittedRecHit > track_hits_vector_
const double& TotemRPLocalTrack::CovarianceMatrixElement ( int  i,
int  j 
) const
inlineprivate
double& TotemRPLocalTrack::CovarianceMatrixElement ( int  i,
int  j 
)
inlineprivate

Definition at line 146 of file TotemRPLocalTrack.h.

References par_covariance_matrix_.

147  {
148  return par_covariance_matrix_[i * dimension + j];
149  }
double par_covariance_matrix_[covarianceSize]
static const int dimension
< parameter vector size
double TotemRPLocalTrack::getChiSquared ( ) const
inline

Definition at line 113 of file TotemRPLocalTrack.h.

References chiSquared_.

113 { return chiSquared_; }
double chiSquared_
fit chi^2
double TotemRPLocalTrack::getChiSquaredOverNDF ( ) const
inline

Definition at line 116 of file TotemRPLocalTrack.h.

References chiSquared_, and track_hits_vector_.

116 { return chiSquared_ / (track_hits_vector_.size() - 4); }
double chiSquared_
fit chi^2
edm::DetSetVector< FittedRecHit > track_hits_vector_
TMatrixD TotemRPLocalTrack::getCovarianceMatrix ( ) const

Definition at line 71 of file TotemRPLocalTrack.cc.

References CovarianceMatrixElement(), dimension, mps_fire::i, and funct::m.

Referenced by getDirectionVector().

72 {
73  TMatrixD m(dimension,dimension);
74 
75  for(int i=0; i<dimension; ++i)
76  for(int j=0; j<dimension; ++j)
77  m(i,j) = CovarianceMatrixElement(i,j);
78 
79  return m;
80 }
static const int dimension
< parameter vector size
const double & CovarianceMatrixElement(int i, int j) const
TVector3 TotemRPLocalTrack::getDirectionVector ( ) const
inline

Definition at line 100 of file TotemRPLocalTrack.h.

References getCovarianceMatrix(), getParameterVector(), getTx(), getTy(), setCovarianceMatrix(), and setParameterVector().

101  {
102  TVector3 vect(getTx(), getTy(), 1);
103  vect.SetMag(1.0);
104  return vect;
105  }
double getTx() const
double getTy() const
const edm::DetSetVector<FittedRecHit>& TotemRPLocalTrack::getHits ( ) const
inline

Definition at line 77 of file TotemRPLocalTrack.h.

References track_hits_vector_.

Referenced by TotemRPLocalTrackFitter::produce().

77 { return track_hits_vector_; }
edm::DetSetVector< FittedRecHit > track_hits_vector_
TVectorD TotemRPLocalTrack::getParameterVector ( ) const

Definition at line 51 of file TotemRPLocalTrack.cc.

References dimension, mps_fire::i, track_params_vector_, and findQualityFiles::v.

Referenced by getDirectionVector().

52 {
53  TVectorD v(dimension);
54 
55  for (int i = 0; i < dimension; ++i)
57 
58  return v;
59 }
static const int dimension
< parameter vector size
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
TVector3 TotemRPLocalTrack::getTrackCentrePoint ( )
inline

Definition at line 127 of file TotemRPLocalTrack.h.

References track_params_vector_, trackPointInterpolationCovariance(), z, and z0_.

128  {
129  return TVector3(track_params_vector_[0], track_params_vector_[1], z0_);
130  }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
TVector2 TotemRPLocalTrack::getTrackPoint ( double  z) const
inline

returns (x, y) vector

Definition at line 119 of file TotemRPLocalTrack.h.

References track_params_vector_, and z0_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack().

120  {
121  double delta_z = z - z0_;
122  return TVector2(
123  track_params_vector_[0] + track_params_vector_[2] * delta_z,
124  track_params_vector_[1] + track_params_vector_[3] * delta_z);
125  }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double TotemRPLocalTrack::getTx ( ) const
inline

Definition at line 94 of file TotemRPLocalTrack.h.

References track_params_vector_.

Referenced by getDirectionVector().

94 { return track_params_vector_[2]; }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double TotemRPLocalTrack::getTxSigma ( ) const
inline

Definition at line 95 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement(), and mathSSE::sqrt().

95 { return sqrt(CovarianceMatrixElement(2, 2)); }
T sqrt(T t)
Definition: SSEVec.h:18
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getTy ( ) const
inline

Definition at line 97 of file TotemRPLocalTrack.h.

References track_params_vector_.

Referenced by getDirectionVector().

97 { return track_params_vector_[3]; }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double TotemRPLocalTrack::getTySigma ( ) const
inline

Definition at line 98 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement(), and mathSSE::sqrt().

98 { return sqrt(CovarianceMatrixElement(3, 3)); }
T sqrt(T t)
Definition: SSEVec.h:18
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getX0 ( ) const
inline

Definition at line 83 of file TotemRPLocalTrack.h.

References track_params_vector_.

Referenced by ElasticPlotDQMSource::analyze().

83 { return track_params_vector_[0]; }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double TotemRPLocalTrack::getX0Sigma ( ) const
inline

Definition at line 84 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement(), and mathSSE::sqrt().

84 { return sqrt(CovarianceMatrixElement(0, 0)); }
T sqrt(T t)
Definition: SSEVec.h:18
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getX0Variance ( ) const
inline

Definition at line 85 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement().

85 { return CovarianceMatrixElement(0, 0); }
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getY0 ( ) const
inline

Definition at line 87 of file TotemRPLocalTrack.h.

References track_params_vector_.

Referenced by ElasticPlotDQMSource::analyze().

87 { return track_params_vector_[1]; }
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
double TotemRPLocalTrack::getY0Sigma ( ) const
inline

Definition at line 88 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement(), and mathSSE::sqrt().

88 { return sqrt(CovarianceMatrixElement(1, 1)); }
T sqrt(T t)
Definition: SSEVec.h:18
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getY0Variance ( ) const
inline

Definition at line 89 of file TotemRPLocalTrack.h.

References CovarianceMatrixElement().

89 { return CovarianceMatrixElement(1, 1); }
const double & CovarianceMatrixElement(int i, int j) const
double TotemRPLocalTrack::getZ0 ( ) const
inline

Definition at line 91 of file TotemRPLocalTrack.h.

References z0_.

91 { return z0_; }
bool TotemRPLocalTrack::isValid ( void  ) const
inline
void TotemRPLocalTrack::setChiSquared ( double &  chiSquared)
inline

Definition at line 114 of file TotemRPLocalTrack.h.

References chiSquared_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack().

114 { chiSquared_ = chiSquared; }
double chiSquared_
fit chi^2
void TotemRPLocalTrack::setCovarianceMatrix ( const TMatrixD &  par_covariance_matrix)

Definition at line 84 of file TotemRPLocalTrack.cc.

References CovarianceMatrixElement(), dimension, and mps_fire::i.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack(), and getDirectionVector().

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 }
static const int dimension
< parameter vector size
const double & CovarianceMatrixElement(int i, int j) const
void TotemRPLocalTrack::setParameterVector ( const TVectorD &  track_params_vector)

Definition at line 63 of file TotemRPLocalTrack.cc.

References dimension, mps_fire::i, and track_params_vector_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack(), and getDirectionVector().

64 {
65  for (int i = 0; i < dimension; ++i)
66  track_params_vector_[i] = track_params_vector[i];
67 }
static const int dimension
< parameter vector size
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
void TotemRPLocalTrack::setValid ( bool  valid)
inline

Definition at line 136 of file TotemRPLocalTrack.h.

References checklumidiff::l, operator<, alignCSCRings::r, and valid_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack().

136 { valid_ = valid; }
bool valid_
fit valid?
void TotemRPLocalTrack::setZ0 ( double  z0)
inline

Definition at line 92 of file TotemRPLocalTrack.h.

References z0_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack().

92 { z0_ = z0; }
TMatrixD TotemRPLocalTrack::trackPointInterpolationCovariance ( double  z) const

Definition at line 14 of file TotemRPLocalTrack.cc.

References CovarianceMatrixElement(), dimension, h, mps_fire::i, JetComb::kMult, and z0_.

Referenced by TotemRPLocalTrackFitterAlgorithm::fitTrack(), and getTrackCentrePoint().

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 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static const int dimension
< parameter vector size
const double & CovarianceMatrixElement(int i, int j) const

Friends And Related Function Documentation

bool operator< ( const TotemRPLocalTrack l,
const TotemRPLocalTrack r 
)
friend

Definition at line 93 of file TotemRPLocalTrack.cc.

Referenced by setValid().

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 }
static const int dimension
< parameter vector size
double track_params_vector_[dimension]
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...

Member Data Documentation

double TotemRPLocalTrack::chiSquared_
private

fit chi^2

Definition at line 163 of file TotemRPLocalTrack.h.

Referenced by getChiSquared(), getChiSquaredOverNDF(), and setChiSquared().

const int TotemRPLocalTrack::covarianceSize = dimension * dimension
static

Definition at line 66 of file TotemRPLocalTrack.h.

const int TotemRPLocalTrack::dimension = 4
static
double TotemRPLocalTrack::par_covariance_matrix_[covarianceSize]
private

Definition at line 160 of file TotemRPLocalTrack.h.

Referenced by CovarianceMatrixElement().

edm::DetSetVector<FittedRecHit> TotemRPLocalTrack::track_hits_vector_
private

Definition at line 151 of file TotemRPLocalTrack.h.

Referenced by addHit(), getChiSquaredOverNDF(), and getHits().

double TotemRPLocalTrack::track_params_vector_[dimension]
private

track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...

Definition at line 154 of file TotemRPLocalTrack.h.

Referenced by getParameterVector(), getTrackCentrePoint(), getTrackPoint(), getTx(), getTy(), getX0(), getY0(), operator<(), setParameterVector(), and TotemRPLocalTrack().

bool TotemRPLocalTrack::valid_
private

fit valid?

Definition at line 166 of file TotemRPLocalTrack.h.

Referenced by isValid(), and setValid().

double TotemRPLocalTrack::z0_
private

z where x0 and y0 are evaluated. filled from CTPPSGeometry::getRPTranslation

Definition at line 158 of file TotemRPLocalTrack.h.

Referenced by getTrackCentrePoint(), getTrackPoint(), getZ0(), operator<(), setZ0(), and trackPointInterpolationCovariance().