CMS 3D CMS Logo

ReferenceTrajectoryBase.h
Go to the documentation of this file.
1 #ifndef Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H
2 #define Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H
3 
92 
93 // for AlgebraicVector, -Matrix and -SymMatrix:
98 
99 #include <vector>
100 
101 #include <Eigen/Dense>
102 
103 #include "GblTrajectory.h"
104 
105 
107 {
108 
109 public:
110 
112 
115 
116  struct Config {
119  double est = -std::numeric_limits<double>::infinity()) :
120  materialEffects(matEff),
121  propDir(direction),
122  mass(m),
123  momentumEstimate(est)
124  {}
125 
128  double mass;
130  bool useBeamSpot{false};
131  bool hitsAreReverse{false};
132  bool useRefittedState{false};
134  bool includeAPEs{false};
135  bool allowZeroMaterial{false};
136  };
137 
139 
140  bool isValid() { return theValidityFlag; }
141 
144  const AlgebraicVector& measurements() const { return theMeasurements; }
145 
149 
154 
158 
162  const AlgebraicMatrix& derivatives() const { return theDerivatives; }
163 
170 
173  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> >& gblInput() { return theGblInput; }
174 
177  const Eigen::MatrixXd& gblExtDerivatives() const { return theGblExtDerivatives; }
178 
181  const Eigen::VectorXd& gblExtMeasurements() const { return theGblExtMeasurements; }
182 
185  const Eigen::VectorXd& gblExtPrecisions() const { return theGblExtPrecisions; }
186 
187 
190  const AlgebraicVector& parameters() const { return theParameters; }
191 
194  inline bool parameterErrorsAvailable() const { return theParamCovFlag; }
195 
199 
202  inline const AlgebraicSymMatrix& parameterErrors() const { return theParameterCov; }
203 
206  const std::vector<TrajectoryStateOnSurface>& trajectoryStates() const { return theTsosVec; }
207 
212 
213  inline unsigned int numberOfHits() const { return theNumberOfHits; }
214  inline unsigned int numberOfPar() const { return theNumberOfPars; }
215  inline unsigned int numberOfVirtualMeas() const { return theNumberOfVirtualMeas; }
216  inline unsigned int numberOfVirtualPar() const { return theNumberOfVirtualPars; }
217  inline unsigned int numberOfHitMeas() const { return theNumberOfHits * nMeasPerHit; }
218  inline int nominalField() const { return theNomField; }
219 
220  virtual ReferenceTrajectoryBase* clone() const = 0;
221 
222 protected:
223 
224  explicit ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits,
225  unsigned int nVirtualPar, unsigned int nVirtualMeas);
226 
228  bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
229 
232 
233  unsigned int theNumberOfHits; // number of (measurements from) hits
234  unsigned int theNumberOfPars; // number of (track) parameters
235  unsigned int theNumberOfVirtualMeas; // number of virtual measurements
236  unsigned int theNumberOfVirtualPars; // number of parameters for virtual measurements
237 
238  std::vector<TrajectoryStateOnSurface> theTsosVec;
240 
243 
246 
249 
251 
252 // CHK for beamspot transformation trajectory parameter to curvilinear at refTSos
254 // CHK for TwoBodyD. transformation local to trajectory parameter at refTsos
256 // CHK GBL input: list of (list of points on trajectory and transformation at inner (first) point)
257  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> > theGblInput;
259 // CHK GBL TBD: virtual (mass) measurement
260  Eigen::MatrixXd theGblExtDerivatives;
261  Eigen::VectorXd theGblExtMeasurements;
262  Eigen::VectorXd theGblExtPrecisions;
263 
264  static constexpr unsigned int nMeasPerHit{2};
265 };
266 
267 #endif // REFERENCE_TRAJECTORY_BASE_H
268 
const Eigen::VectorXd & gblExtMeasurements() const
ReferenceCountingPointer< ReferenceTrajectoryBase > ReferenceTrajectoryPtr
AlgebraicMatrix theInnerTrajectoryToCurvilinear
unsigned int numberOfHits() const
AlgebraicMatrix theInnerLocalToTrajectory
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
void setParameterErrors(const AlgebraicSymMatrix &error)
const AlgebraicMatrix & trajectoryToCurv() const
unsigned int numberOfHitMeas() const
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
unsigned int numberOfVirtualPar() const
PropagationDirection
Config(MaterialEffects matEff, PropagationDirection direction, double m=-std::numeric_limits< double >::infinity(), double est=-std::numeric_limits< double >::infinity())
#define constexpr
const AlgebraicSymMatrix & measurementErrors() const
const AlgebraicSymMatrix & trajectoryPositionErrors() const
AlgebraicSymMatrix theTrajectoryPositionCov
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > theGblInput
const AlgebraicMatrix & derivatives() const
const AlgebraicSymMatrix & parameterErrors() const
CLHEP::HepMatrix AlgebraicMatrix
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
const double infinity
TransientTrackingRecHit::ConstRecHitContainer theRecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
const AlgebraicMatrix & localToTrajectory() const
AlgebraicSymMatrix theMeasurementsCov
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
const AlgebraicVector & parameters() const
CLHEP::HepVector AlgebraicVector
unsigned int numberOfPar() const
virtual ReferenceTrajectoryBase * clone() const =0
AlgebraicSymMatrix theParameterCov
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > & gblInput()
unsigned int numberOfVirtualMeas() const
const AlgebraicVector & measurements() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: Config.py:1
std::vector< TrajectoryStateOnSurface > theTsosVec
const AlgebraicVector & trajectoryPositions() const
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
const Eigen::VectorXd & gblExtPrecisions() const
const Eigen::MatrixXd & gblExtDerivatives() const
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const