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 
106 public:
108 
119  };
120 
121  struct Config {
123  PropagationDirection direction,
126  : materialEffects(matEff), propDir(direction), mass(m), momentumEstimate(est) {}
127 
130  double mass;
132  bool useBeamSpot{false};
133  bool hitsAreReverse{false};
134  bool useRefittedState{false};
136  bool includeAPEs{false};
137  bool allowZeroMaterial{false};
138  };
139 
141 
142  bool isValid() { return theValidityFlag; }
143 
146  const AlgebraicVector& measurements() const { return theMeasurements; }
147 
151 
156 
160 
164  const AlgebraicMatrix& derivatives() const { return theDerivatives; }
165 
172 
175  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> >& gblInput() { return theGblInput; }
176 
180 
184 
188 
191  const AlgebraicVector& parameters() const { return theParameters; }
192 
195  inline bool parameterErrorsAvailable() const { return theParamCovFlag; }
196 
201  theParamCovFlag = true;
202  }
203 
206  inline const AlgebraicSymMatrix& parameterErrors() const { return theParameterCov; }
207 
210  const std::vector<TrajectoryStateOnSurface>& trajectoryStates() const { return theTsosVec; }
211 
216 
217  inline unsigned int numberOfHits() const { return theNumberOfHits; }
218  inline unsigned int numberOfPar() const { return theNumberOfPars; }
219  inline unsigned int numberOfVirtualMeas() const { return theNumberOfVirtualMeas; }
220  inline unsigned int numberOfVirtualPar() const { return theNumberOfVirtualPars; }
221  inline unsigned int numberOfHitMeas() const { return theNumberOfHits * nMeasPerHit; }
222  inline int nominalField() const { return theNomField; }
223 
224  virtual ReferenceTrajectoryBase* clone() const = 0;
225 
226 protected:
227  explicit ReferenceTrajectoryBase(unsigned int nPar,
228  unsigned int nHits,
229  unsigned int nVirtualPar,
230  unsigned int nVirtualMeas);
231 
233  bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
234 
237 
238  unsigned int theNumberOfHits; // number of (measurements from) hits
239  unsigned int theNumberOfPars; // number of (track) parameters
240  unsigned int theNumberOfVirtualMeas; // number of virtual measurements
241  unsigned int theNumberOfVirtualPars; // number of parameters for virtual measurements
242 
243  std::vector<TrajectoryStateOnSurface> theTsosVec;
245 
248 
251 
254 
256 
257  // CHK for beamspot transformation trajectory parameter to curvilinear at refTSos
259  // CHK for TwoBodyD. transformation local to trajectory parameter at refTsos
261  // CHK GBL input: list of (list of points on trajectory and transformation at inner (first) point)
262  std::vector<std::pair<std::vector<gbl::GblPoint>, Eigen::MatrixXd> > theGblInput;
264  // CHK GBL TBD: virtual (mass) measurement
268 
269  static constexpr unsigned int nMeasPerHit{2};
270 };
271 
272 #endif // REFERENCE_TRAJECTORY_BASE_H
ReferenceCountingPointer< ReferenceTrajectoryBase > ReferenceTrajectoryPtr
AlgebraicMatrix theInnerTrajectoryToCurvilinear
const AlgebraicMatrix & localToTrajectory() const
unsigned int numberOfPar() const
virtual ReferenceTrajectoryBase * clone() const =0
const AlgebraicSymMatrix & measurementErrors() const
AlgebraicMatrix theInnerLocalToTrajectory
unsigned int numberOfHits() const
unsigned int numberOfHitMeas() const
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
void setParameterErrors(const AlgebraicSymMatrix &error)
unsigned int numberOfVirtualMeas() const
const AlgebraicVector & measurements() const
PropagationDirection
unsigned int numberOfVirtualPar() const
Config(MaterialEffects matEff, PropagationDirection direction, double m=-std::numeric_limits< double >::infinity(), double est=-std::numeric_limits< double >::infinity())
const Eigen::VectorXd & gblExtPrecisions() const
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const
AlgebraicSymMatrix theTrajectoryPositionCov
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > theGblInput
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
CLHEP::HepMatrix AlgebraicMatrix
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Eigen::VectorXd VectorXd
Definition: FitUtils.h:12
const double infinity
const Eigen::VectorXd & gblExtMeasurements() const
const AlgebraicVector & trajectoryPositions() const
const AlgebraicSymMatrix & parameterErrors() const
TransientTrackingRecHit::ConstRecHitContainer theRecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
AlgebraicSymMatrix theMeasurementsCov
CLHEP::HepVector AlgebraicVector
static constexpr unsigned int nMeasPerHit
const AlgebraicSymMatrix & trajectoryPositionErrors() const
Eigen::MatrixXd MatrixXd
Definition: FitUtils.h:13
const Eigen::MatrixXd & gblExtDerivatives() const
AlgebraicSymMatrix theParameterCov
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > & gblInput()
const AlgebraicMatrix & trajectoryToCurv() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: Config.py:1
std::vector< TrajectoryStateOnSurface > theTsosVec
const AlgebraicVector & parameters() const
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
const AlgebraicMatrix & derivatives() const