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 "GblTrajectory.h"
102 
103 
105 {
106 
107 public:
108 
110 
113 
114  struct Config {
117  double est = -std::numeric_limits<double>::infinity()) :
118  materialEffects(matEff),
119  propDir(direction),
120  mass(m),
121  momentumEstimate(est)
122  {}
123 
126  double mass;
128  bool useBeamSpot{false};
129  bool hitsAreReverse{false};
130  bool useRefittedState{false};
132  bool includeAPEs{false};
133  bool allowZeroMaterial{false};
134  };
135 
137 
138  bool isValid() { return theValidityFlag; }
139 
142  const AlgebraicVector& measurements() const { return theMeasurements; }
143 
147 
152 
156 
160  const AlgebraicMatrix& derivatives() const { return theDerivatives; }
161 
168 
171  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> >& gblInput() { return theGblInput; }
172 
175  const Eigen::MatrixXd& gblExtDerivatives() const { return theGblExtDerivatives; }
176 
179  const Eigen::VectorXd& gblExtMeasurements() const { return theGblExtMeasurements; }
180 
183  const Eigen::VectorXd& gblExtPrecisions() const { return theGblExtPrecisions; }
184 
185 
188  const AlgebraicVector& parameters() const { return theParameters; }
189 
192  inline bool parameterErrorsAvailable() const { return theParamCovFlag; }
193 
197 
200  inline const AlgebraicSymMatrix& parameterErrors() const { return theParameterCov; }
201 
204  const std::vector<TrajectoryStateOnSurface>& trajectoryStates() const { return theTsosVec; }
205 
210 
211  inline unsigned int numberOfHits() const { return theNumberOfHits; }
212  inline unsigned int numberOfPar() const { return theNumberOfPars; }
213  inline unsigned int numberOfVirtualMeas() const { return theNumberOfVirtualMeas; }
214  inline unsigned int numberOfVirtualPar() const { return theNumberOfVirtualPars; }
215  inline unsigned int numberOfHitMeas() const { return theNumberOfHits * nMeasPerHit; }
216  inline int nominalField() const { return theNomField; }
217 
218  virtual ReferenceTrajectoryBase* clone() const = 0;
219 
220 protected:
221 
222  explicit ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits,
223  unsigned int nVirtualPar, unsigned int nVirtualMeas);
224 
226  bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
227 
230 
231  unsigned int theNumberOfHits; // number of (measurements from) hits
232  unsigned int theNumberOfPars; // number of (track) parameters
233  unsigned int theNumberOfVirtualMeas; // number of virtual measurements
234  unsigned int theNumberOfVirtualPars; // number of parameters for virtual measurements
235 
236  std::vector<TrajectoryStateOnSurface> theTsosVec;
238 
241 
244 
247 
249 
250 // CHK for beamspot transformation trajectory parameter to curvilinear at refTSos
252 // CHK for TwoBodyD. transformation local to trajectory parameter at refTsos
254 // CHK GBL input: list of (list of points on trajectory and transformation at inner (first) point)
255  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> > theGblInput;
257 // CHK GBL TBD: virtual (mass) measurement
258  Eigen::MatrixXd theGblExtDerivatives;
259  Eigen::VectorXd theGblExtMeasurements;
260  Eigen::VectorXd theGblExtPrecisions;
261 
262  static constexpr unsigned int nMeasPerHit{2};
263 };
264 
265 #endif // REFERENCE_TRAJECTORY_BASE_H
266 
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