CMS 3D CMS Logo

CTPPSPixelLocalTrack.h
Go to the documentation of this file.
1 /*
2  *
3 * This is a part of CTPPS offline software.
4 * Author:
5 * Fabrizio Ferro (ferro@ge.infn.it)
6 * Enrico Robutti (robutti@ge.infn.it)
7 * Fabio Ravera (fabio.ravera@cern.ch)
8 *
9 */
10 
11 #ifndef DataFormats_CTPPSReco_CTPPSPixelLocalTrack_H
12 #define DataFormats_CTPPSReco_CTPPSPixelLocalTrack_H
13 
17 
23 
26 
28 //----------------------------------------------------------------------------------------------------
29 
31 public:
33  const GlobalPoint& space_point_on_det,
34  const LocalPoint& residual,
35  const LocalPoint& pull)
37  space_point_on_det_(space_point_on_det),
38  residual_(residual),
39  pull_(pull),
41  isRealHit_(false) {}
42 
44  : CTPPSPixelRecHit(),
45  residual_(LocalPoint(0, 0)),
46  pull_(LocalPoint(0, 0)),
48  isRealHit_(false) {}
49 
51 
52  inline const GlobalPoint& globalCoordinates() const { return space_point_on_det_; }
53  inline float xResidual() const { return residual_.x(); }
54  inline float yResidual() const { return residual_.y(); }
55 
56  inline float xPull() const { return pull_.x(); }
57  inline float yPull() const { return pull_.y(); }
58 
59  inline float xPullNormalization() const { return residual_.x() / pull_.x(); }
60  inline float yPullNormalization() const { return residual_.y() / pull_.y(); }
61 
62  inline void setIsUsedForFit(bool usedForFit) {
63  if (usedForFit)
64  isRealHit_ = true;
65  isUsedForFit_ = usedForFit;
66  }
67  inline bool isUsedForFit() const { return isUsedForFit_; }
68 
69  inline void setIsRealHit(bool realHit) {
70  if (!realHit)
71  isUsedForFit_ = false;
72  isRealHit_ = realHit;
73  }
74  inline bool isRealHit() const { return isRealHit_; }
75 
76 private:
81  bool isRealHit_;
82 };
83 
85 public:
86  enum class TrackPar { x0 = 0, y0 = 1, tx = 2, ty = 3 };
87 
89  static constexpr int dimension = 4;
92 
94  static constexpr int covarianceSize = dimension * dimension;
95 
97  : z0_(0),
98  chiSquared_(0),
99  valid_(false),
102 
103  CTPPSPixelLocalTrack(float z0,
104  const ParameterVector& track_params_vector,
105  const CovarianceMatrix& par_covariance_matrix,
106  float chiSquared);
107 
109 
111  inline void addHit(unsigned int detId, const CTPPSPixelFittedRecHit& hit) {
113  if (hit.isUsedForFit())
115  }
116 
117  inline float x0() const { return track_params_vector_[(unsigned int)TrackPar::x0]; }
118  inline float x0Sigma() const {
119  return sqrt(par_covariance_matrix_[(unsigned int)TrackPar::x0][(unsigned int)TrackPar::x0]);
120  }
121  inline float x0Variance() const {
122  return par_covariance_matrix_[(unsigned int)TrackPar::x0][(unsigned int)TrackPar::x0];
123  }
124 
125  inline float y0() const { return track_params_vector_[(unsigned int)TrackPar::y0]; }
126  inline float y0Sigma() const {
127  return sqrt(par_covariance_matrix_[(unsigned int)TrackPar::y0][(unsigned int)TrackPar::y0]);
128  }
129  inline float y0Variance() const {
130  return par_covariance_matrix_[(unsigned int)TrackPar::y0][(unsigned int)TrackPar::y0];
131  }
132 
133  inline float z0() const { return z0_; }
134  inline void setZ0(float z0) { z0_ = z0; }
135 
136  inline float tx() const { return track_params_vector_[(unsigned int)TrackPar::tx]; }
137  inline float txSigma() const {
138  return sqrt(par_covariance_matrix_[(unsigned int)TrackPar::tx][(unsigned int)TrackPar::tx]);
139  }
140 
141  inline float ty() const { return track_params_vector_[(unsigned int)TrackPar::ty]; }
142  inline float tySigma() const {
143  return sqrt(par_covariance_matrix_[(unsigned int)TrackPar::ty][(unsigned int)TrackPar::ty]);
144  }
145 
146  inline GlobalVector directionVector() const {
147  GlobalVector vect(tx(), ty(), 1);
148  return vect.unit();
149  }
150 
151  inline const ParameterVector& parameterVector() const { return track_params_vector_; }
152 
153  inline const CovarianceMatrix& covarianceMatrix() const { return par_covariance_matrix_; }
154 
155  inline float chiSquared() const { return chiSquared_; }
156 
157  inline float chiSquaredOverNDF() const {
159  return -999.;
160  else
162  }
163 
164  inline int ndf() const { return (2 * numberOfPointsUsedForFit_ - dimension); }
165 
167  inline GlobalPoint trackPoint(float z) const {
168  float delta_z = z - z0_;
169  return GlobalPoint(
170  track_params_vector_[(unsigned int)TrackPar::x0] + track_params_vector_[(unsigned int)TrackPar::tx] * delta_z,
171  track_params_vector_[(unsigned int)TrackPar::y0] + track_params_vector_[(unsigned int)TrackPar::ty] * delta_z,
172  z);
173  }
174 
176  return GlobalPoint(
177  track_params_vector_[(unsigned int)TrackPar::x0], track_params_vector_[(unsigned int)TrackPar::y0], z0_);
178  }
179 
181 
182  inline bool isValid() const { return valid_; }
183 
184  inline void setValid(bool valid) { valid_ = valid; }
185 
186  bool operator<(const CTPPSPixelLocalTrack& r);
187 
190 
191  inline unsigned short numberOfPointsUsedForFit() const { return numberOfPointsUsedForFit_; }
192 
193 private:
195 
198 
201  float z0_;
202 
204 
206  float chiSquared_;
207 
209  bool valid_;
210 
213 
215 };
216 
217 #endif
Vector3DBase
Definition: Vector3DBase.h:8
CTPPSPixelFittedRecHit::yPull
float yPull() const
Definition: CTPPSPixelLocalTrack.h:57
edm::DetSet::push_back
void push_back(const T &t)
Definition: DetSet.h:66
edm::DetSetVector< CTPPSPixelFittedRecHit >
CTPPSPixelFittedRecHit::isRealHit_
bool isRealHit_
Definition: CTPPSPixelLocalTrack.h:81
CTPPSPixelLocalTrack::TrackPar
TrackPar
Definition: CTPPSPixelLocalTrack.h:86
CTPPSpixelLocalTrackReconstructionInfo
CTPPSpixelLocalTrackReconstructionInfo
Definition: CTPPSPixelLocalTrackRecoInfo.h:17
CTPPSPixelFittedRecHit::~CTPPSPixelFittedRecHit
virtual ~CTPPSPixelFittedRecHit()
Definition: CTPPSPixelLocalTrack.h:50
CTPPSPixelFittedRecHit::yResidual
float yResidual() const
Definition: CTPPSPixelLocalTrack.h:54
CTPPSPixelRecHit
Definition: CTPPSPixelRecHit.h:17
funct::false
false
Definition: Factorize.h:34
CTPPSPixelLocalTrack::x0
float x0() const
Definition: CTPPSPixelLocalTrack.h:117
Vector.h
CTPPSPixelLocalTrack::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: CTPPSPixelLocalTrack.h:90
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CTPPSPixelLocalTrack::ndf
int ndf() const
Definition: CTPPSPixelLocalTrack.h:164
CTPPSPixelLocalTrack::recoInfo
CTPPSpixelLocalTrackReconstructionInfo recoInfo() const
Definition: CTPPSPixelLocalTrack.h:188
CTPPSPixelDetId.h
CTPPSPixelFittedRecHit::space_point_on_det_
GlobalPoint space_point_on_det_
mm
Definition: CTPPSPixelLocalTrack.h:77
CTPPSPixelLocalTrack::dimension
static constexpr int dimension
Definition: CTPPSPixelLocalTrack.h:89
CTPPSPixelFittedRecHit::globalCoordinates
const GlobalPoint & globalCoordinates() const
Definition: CTPPSPixelLocalTrack.h:52
CTPPSPixelLocalTrack::tySigma
float tySigma() const
Definition: CTPPSPixelLocalTrack.h:142
CTPPSPixelLocalTrack::covarianceMatrix
const CovarianceMatrix & covarianceMatrix() const
Definition: CTPPSPixelLocalTrack.h:153
CTPPSPixelFittedRecHit::setIsUsedForFit
void setIsUsedForFit(bool usedForFit)
Definition: CTPPSPixelLocalTrack.h:62
CTPPSPixelLocalTrack::y0Sigma
float y0Sigma() const
Definition: CTPPSPixelLocalTrack.h:126
CTPPSPixelFittedRecHit::setIsRealHit
void setIsRealHit(bool realHit)
Definition: CTPPSPixelLocalTrack.h:69
CovarianceMatrix
Definition: CovarianceMatrix.h:27
Matrix.h
CTPPSPixelLocalTrack::chiSquared_
float chiSquared_
fit chi^2
Definition: CTPPSPixelLocalTrack.h:206
CTPPSpixelLocalTrackReconstructionInfo::invalid
ParameterVector
reco::TrackBase::ParameterVector ParameterVector
Definition: TrackParameterAnalyzer.h:40
CTPPSPixelLocalTrack::z0
float z0() const
Definition: CTPPSPixelLocalTrack.h:133
CTPPSPixelLocalTrack::z0_
float z0_
Definition: CTPPSPixelLocalTrack.h:201
CTPPSPixelRecHit.h
CTPPSPixelLocalTrack::chiSquaredOverNDF
float chiSquaredOverNDF() const
Definition: CTPPSPixelLocalTrack.h:157
CTPPSPixelLocalTrack::setZ0
void setZ0(float z0)
Definition: CTPPSPixelLocalTrack.h:134
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
CTPPSPixelLocalTrack::track_params_vector_
ParameterVector track_params_vector_
track parameters: (x0, y0, tx, ty); x = x0 + tx*(z-z0) ...
Definition: CTPPSPixelLocalTrack.h:197
CTPPSPixelFittedRecHit::xPullNormalization
float xPullNormalization() const
Definition: CTPPSPixelLocalTrack.h:59
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
CTPPSPixelLocalTrack::setValid
void setValid(bool valid)
Definition: CTPPSPixelLocalTrack.h:184
CTPPSPixelLocalTrack::track_hits_vector_
edm::DetSetVector< CTPPSPixelFittedRecHit > track_hits_vector_
Definition: CTPPSPixelLocalTrack.h:194
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CTPPSPixelFittedRecHit::isRealHit
bool isRealHit() const
Definition: CTPPSPixelLocalTrack.h:74
DDAxes::z
CTPPSPixelFittedRecHit::xPull
float xPull() const
Definition: CTPPSPixelLocalTrack.h:56
CTPPSPixelLocalTrack::operator<
bool operator<(const CTPPSPixelLocalTrack &r)
Definition: CTPPSPixelLocalTrack.cc:39
CTPPSPixelLocalTrack::tx
float tx() const
Definition: CTPPSPixelLocalTrack.h:136
CTPPSPixelLocalTrack::ParameterVector
math::Vector< dimension >::type ParameterVector
covariance matrix size
Definition: CTPPSPixelLocalTrack.h:91
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
CTPPSPixelLocalTrack::hits
const edm::DetSetVector< CTPPSPixelFittedRecHit > & hits() const
Definition: CTPPSPixelLocalTrack.h:110
CTPPSPixelLocalTrack::TrackPar::y0
CTPPSPixelLocalTrack::par_covariance_matrix_
CovarianceMatrix par_covariance_matrix_
Definition: CTPPSPixelLocalTrack.h:203
CTPPSPixelLocalTrack::trackCentrePoint
GlobalPoint trackCentrePoint()
Definition: CTPPSPixelLocalTrack.h:175
Error.h
CTPPSPixelLocalTrack::x0Sigma
float x0Sigma() const
Definition: CTPPSPixelLocalTrack.h:118
CTPPSPixelLocalTrack::CTPPSPixelLocalTrack
CTPPSPixelLocalTrack()
Definition: CTPPSPixelLocalTrack.h:96
CTPPSPixelFittedRecHit::yPullNormalization
float yPullNormalization() const
Definition: CTPPSPixelLocalTrack.h:60
CTPPSPixelLocalTrack::setRecoInfo
void setRecoInfo(CTPPSpixelLocalTrackReconstructionInfo recoInfo)
Definition: CTPPSPixelLocalTrack.h:189
CTPPSPixelFittedRecHit
Definition: CTPPSPixelLocalTrack.h:30
CTPPSPixelLocalTrack
Definition: CTPPSPixelLocalTrack.h:84
CTPPSPixelLocalTrackRecoInfo.h
CTPPSPixelLocalTrack::addHit
void addHit(unsigned int detId, const CTPPSPixelFittedRecHit &hit)
Definition: CTPPSPixelLocalTrack.h:111
CTPPSPixelLocalTrack::chiSquared
float chiSquared() const
Definition: CTPPSPixelLocalTrack.h:155
CTPPSPixelFittedRecHit::pull_
LocalPoint pull_
normalised residual
Definition: CTPPSPixelLocalTrack.h:79
CTPPSPixelLocalTrack::~CTPPSPixelLocalTrack
~CTPPSPixelLocalTrack()
Definition: CTPPSPixelLocalTrack.h:108
CTPPSPixelLocalTrack::txSigma
float txSigma() const
Definition: CTPPSPixelLocalTrack.h:137
math::Vector
fixed size vector
Definition: Vector.h:24
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
CTPPSPixelLocalTrack::parameterVector
const ParameterVector & parameterVector() const
Definition: CTPPSPixelLocalTrack.h:151
createfilelist.int
int
Definition: createfilelist.py:10
CTPPSPixelLocalTrack::y0Variance
float y0Variance() const
Definition: CTPPSPixelLocalTrack.h:129
CTPPSPixelLocalTrack::covarianceSize
static constexpr int covarianceSize
Definition: CTPPSPixelLocalTrack.h:94
CTPPSPixelLocalTrack::x0Variance
float x0Variance() const
Definition: CTPPSPixelLocalTrack.h:121
CTPPSPixelFittedRecHit::CTPPSPixelFittedRecHit
CTPPSPixelFittedRecHit()
Definition: CTPPSPixelLocalTrack.h:43
DetSetVector.h
CTPPSPixelLocalTrack::trackPointInterpolationCovariance
AlgebraicSymMatrix22 trackPointInterpolationCovariance(float z) const
Definition: CTPPSPixelLocalTrack.cc:15
CTPPSPixelFittedRecHit::CTPPSPixelFittedRecHit
CTPPSPixelFittedRecHit(const CTPPSPixelRecHit &hit, const GlobalPoint &space_point_on_det, const LocalPoint &residual, const LocalPoint &pull)
Definition: CTPPSPixelLocalTrack.h:32
CTPPSPixelLocalTrack::directionVector
GlobalVector directionVector() const
Definition: CTPPSPixelLocalTrack.h:146
CTPPSPixelLocalTrack::numberOfPointsUsedForFit
unsigned short numberOfPointsUsedForFit() const
Definition: CTPPSPixelLocalTrack.h:191
alignCSCRings.r
r
Definition: alignCSCRings.py:93
CTPPSPixelLocalTrack::isValid
bool isValid() const
Definition: CTPPSPixelLocalTrack.h:182
CTPPSPixelLocalTrack::trackPoint
GlobalPoint trackPoint(float z) const
returns the point from which the track is passing by at the selected z
Definition: CTPPSPixelLocalTrack.h:167
CTPPSPixelFittedRecHit::isUsedForFit
bool isUsedForFit() const
Definition: CTPPSPixelLocalTrack.h:67
CTPPSPixelLocalTrack::valid_
bool valid_
fit valid?
Definition: CTPPSPixelLocalTrack.h:209
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
CTPPSPixelLocalTrack::y0
float y0() const
Definition: CTPPSPixelLocalTrack.h:125
GlobalVector.h
CTPPSPixelFittedRecHit::isUsedForFit_
bool isUsedForFit_
Definition: CTPPSPixelLocalTrack.h:80
CTPPSPixelLocalTrack::TrackPar::tx
CTPPSPixelLocalTrack::recoInfo_
CTPPSpixelLocalTrackReconstructionInfo recoInfo_
Definition: CTPPSPixelLocalTrack.h:214
edm::DetSetVector::find_or_insert
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
CTPPSPixelLocalTrack::TrackPar::ty
CTPPSPixelLocalTrack::ty
float ty() const
Definition: CTPPSPixelLocalTrack.h:141
CTPPSPixelLocalTrack::numberOfPointsUsedForFit_
int numberOfPointsUsedForFit_
number of points used for the track fit
Definition: CTPPSPixelLocalTrack.h:212
GlobalPoint.h
CTPPSPixelLocalTrack::TrackPar::x0
AlgebraicROOTObjects.h
AlgebraicSymMatrix22
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
Definition: AlgebraicROOTObjects.h:20
CTPPSPixelFittedRecHit::xResidual
float xResidual() const
Definition: CTPPSPixelLocalTrack.h:53
hit
Definition: SiStripHitEffFromCalibTree.cc:88
CTPPSPixelFittedRecHit::residual_
LocalPoint residual_
mm
Definition: CTPPSPixelLocalTrack.h:78