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
ReferenceTrajectoryBase::recHits
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
Definition: ReferenceTrajectoryBase.h:215
ReferenceTrajectoryBase::numberOfHits
unsigned int numberOfHits() const
Definition: ReferenceTrajectoryBase.h:217
ReferenceTrajectoryBase::useRecHit
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
Definition: ReferenceTrajectoryBase.cc:38
ReferenceTrajectoryBase::numberOfPar
unsigned int numberOfPar() const
Definition: ReferenceTrajectoryBase.h:218
ReferenceTrajectoryBase::ReferenceTrajectoryBase
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
Definition: ReferenceTrajectoryBase.cc:3
ReferenceTrajectoryBase::setParameterErrors
void setParameterErrors(const AlgebraicSymMatrix &error)
Definition: ReferenceTrajectoryBase.h:199
TrajectoryStateOnSurface.h
ReferenceTrajectoryBase::derivatives
const AlgebraicMatrix & derivatives() const
Definition: ReferenceTrajectoryBase.h:164
ReferenceTrajectoryBase::Config::constructTsosWithErrors
bool constructTsosWithErrors
Definition: ReferenceTrajectoryBase.h:135
ReferenceTrajectoryBase::theInnerLocalToTrajectory
AlgebraicMatrix theInnerLocalToTrajectory
Definition: ReferenceTrajectoryBase.h:260
AlgebraicObjects.h
ReferenceTrajectoryBase::curvlinGBL
Definition: ReferenceTrajectoryBase.h:118
ReferenceTrajectoryBase::theNumberOfVirtualPars
unsigned int theNumberOfVirtualPars
Definition: ReferenceTrajectoryBase.h:241
ReferenceTrajectoryBase::measurementErrors
const AlgebraicSymMatrix & measurementErrors() const
Definition: ReferenceTrajectoryBase.h:150
ReferenceTrajectoryBase::combined
Definition: ReferenceTrajectoryBase.h:113
ReferenceTrajectoryBase
Definition: ReferenceTrajectoryBase.h:105
ReferenceTrajectoryBase::Config::useRefittedState
bool useRefittedState
Definition: ReferenceTrajectoryBase.h:134
ReferenceTrajectoryBase::Config::momentumEstimate
double momentumEstimate
Definition: ReferenceTrajectoryBase.h:131
ReferenceTrajectoryBase::Config::includeAPEs
bool includeAPEs
Definition: ReferenceTrajectoryBase.h:136
ReferenceTrajectoryBase::gblExtPrecisions
const Eigen::VectorXd & gblExtPrecisions() const
Definition: ReferenceTrajectoryBase.h:187
ReferenceTrajectoryBase::theDerivatives
AlgebraicMatrix theDerivatives
Definition: ReferenceTrajectoryBase.h:255
TransientTrackingRecHit.h
ReferenceTrajectoryBase::theTrajectoryPositionCov
AlgebraicSymMatrix theTrajectoryPositionCov
Definition: ReferenceTrajectoryBase.h:250
ReferenceTrajectoryBase::numberOfHitMeas
unsigned int numberOfHitMeas() const
Definition: ReferenceTrajectoryBase.h:221
ReferenceTrajectoryBase::nominalField
int nominalField() const
Definition: ReferenceTrajectoryBase.h:222
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
ReferenceTrajectoryBase::numberOfVirtualMeas
unsigned int numberOfVirtualMeas() const
Definition: ReferenceTrajectoryBase.h:219
MaterialEffects
Definition: MaterialEffects.h:51
ReferenceTrajectoryBase::theMeasurements
AlgebraicVector theMeasurements
Definition: ReferenceTrajectoryBase.h:246
infinity
const double infinity
Definition: CSCChamberFitter.cc:10
relativeConstraints.error
error
Definition: relativeConstraints.py:53
ReferenceTrajectoryBase::theGblExtPrecisions
Eigen::VectorXd theGblExtPrecisions
Definition: ReferenceTrajectoryBase.h:267
ReferenceTrajectoryBase::energyLoss
Definition: ReferenceTrajectoryBase.h:112
ReferenceTrajectoryBase::measurements
const AlgebraicVector & measurements() const
Definition: ReferenceTrajectoryBase.h:146
ReferenceTrajectoryBase::trajectoryStates
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const
Definition: ReferenceTrajectoryBase.h:210
HcalResponse_cfi.nPar
nPar
Definition: HcalResponse_cfi.py:33
ReferenceTrajectoryBase::numberOfVirtualPar
unsigned int numberOfVirtualPar() const
Definition: ReferenceTrajectoryBase.h:220
ReferenceTrajectoryBase::theParameters
AlgebraicVector theParameters
Definition: ReferenceTrajectoryBase.h:252
ReferenceTrajectoryBase::Config::mass
double mass
Definition: ReferenceTrajectoryBase.h:130
LocalTrajectoryError.h
ReferenceTrajectoryBase::numberOfUsedRecHits
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
Definition: ReferenceTrajectoryBase.cc:28
ReferenceTrajectoryBase::theNumberOfVirtualMeas
unsigned int theNumberOfVirtualMeas
Definition: ReferenceTrajectoryBase.h:240
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
ReferenceTrajectoryBase::theNumberOfHits
unsigned int theNumberOfHits
Definition: ReferenceTrajectoryBase.h:238
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
ReferenceTrajectoryBase::theGblInput
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > theGblInput
Definition: ReferenceTrajectoryBase.h:262
ReferenceTrajectoryBase::parameterErrors
const AlgebraicSymMatrix & parameterErrors() const
Definition: ReferenceTrajectoryBase.h:206
ReferenceTrajectoryBase::~ReferenceTrajectoryBase
~ReferenceTrajectoryBase() override
Definition: ReferenceTrajectoryBase.h:140
ReferenceTrajectoryBase::brokenLinesFine
Definition: ReferenceTrajectoryBase.h:116
ReferenceTrajectoryBase::theMeasurementsCov
AlgebraicSymMatrix theMeasurementsCov
Definition: ReferenceTrajectoryBase.h:247
ReferenceTrajectoryBase::gblExtMeasurements
const Eigen::VectorXd & gblExtMeasurements() const
Definition: ReferenceTrajectoryBase.h:183
ReferenceTrajectoryBase::theTrajectoryPositions
AlgebraicVector theTrajectoryPositions
Definition: ReferenceTrajectoryBase.h:249
ReferenceTrajectoryBase::trajectoryPositions
const AlgebraicVector & trajectoryPositions() const
Definition: ReferenceTrajectoryBase.h:155
ReferenceTrajectoryBase::multipleScattering
Definition: ReferenceTrajectoryBase.h:111
ReferenceTrajectoryBase::nMeasPerHit
static constexpr unsigned int nMeasPerHit
Definition: ReferenceTrajectoryBase.h:269
ReferenceTrajectoryBase::theRecHits
TransientTrackingRecHit::ConstRecHitContainer theRecHits
Definition: ReferenceTrajectoryBase.h:244
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
ReferenceTrajectoryBase::Config::allowZeroMaterial
bool allowZeroMaterial
Definition: ReferenceTrajectoryBase.h:137
ReferenceTrajectoryBase::breakPoints
Definition: ReferenceTrajectoryBase.h:114
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
ReferenceTrajectoryBase::gblInput
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > & gblInput()
Definition: ReferenceTrajectoryBase.h:175
ReferenceTrajectoryBase::brokenLinesCoarse
Definition: ReferenceTrajectoryBase.h:115
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
ReferenceTrajectoryBase::trajectoryPositionErrors
const AlgebraicSymMatrix & trajectoryPositionErrors() const
Definition: ReferenceTrajectoryBase.h:159
ReferenceTrajectoryBase::parameterErrorsAvailable
bool parameterErrorsAvailable() const
Definition: ReferenceTrajectoryBase.h:195
riemannFit::MatrixXd
Eigen::MatrixXd MatrixXd
Definition: FitUtils.h:13
PropagationDirection.h
ReferenceTrajectoryBase::none
Definition: ReferenceTrajectoryBase.h:110
ReferenceCounted.h
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
ReferenceTrajectoryBase::Config::hitsAreReverse
bool hitsAreReverse
Definition: ReferenceTrajectoryBase.h:133
ReferenceTrajectoryBase::Config::Config
Config(MaterialEffects matEff, PropagationDirection direction, double m=-std::numeric_limits< double >::infinity(), double est=-std::numeric_limits< double >::infinity())
Definition: ReferenceTrajectoryBase.h:122
ReferenceTrajectoryBase::parameters
const AlgebraicVector & parameters() const
Definition: ReferenceTrajectoryBase.h:191
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
ReferenceTrajectoryBase::Config::materialEffects
MaterialEffects materialEffects
Definition: ReferenceTrajectoryBase.h:128
ReferenceTrajectoryBase::theNumberOfPars
unsigned int theNumberOfPars
Definition: ReferenceTrajectoryBase.h:239
ReferenceTrajectoryBase::Config::useBeamSpot
bool useBeamSpot
Definition: ReferenceTrajectoryBase.h:132
ReferenceTrajectoryBase::ReferenceTrajectoryPtr
ReferenceCountingPointer< ReferenceTrajectoryBase > ReferenceTrajectoryPtr
Definition: ReferenceTrajectoryBase.h:107
ReferenceTrajectoryBase::theInnerTrajectoryToCurvilinear
AlgebraicMatrix theInnerTrajectoryToCurvilinear
Definition: ReferenceTrajectoryBase.h:258
ReferenceTrajectoryBase::localGBL
Definition: ReferenceTrajectoryBase.h:117
ReferenceTrajectoryBase::localToTrajectory
const AlgebraicMatrix & localToTrajectory() const
Definition: ReferenceTrajectoryBase.h:171
ReferenceTrajectoryBase::theTsosVec
std::vector< TrajectoryStateOnSurface > theTsosVec
Definition: ReferenceTrajectoryBase.h:243
ReferenceTrajectoryBase::gblExtDerivatives
const Eigen::MatrixXd & gblExtDerivatives() const
Definition: ReferenceTrajectoryBase.h:179
Config
Definition: Config.py:1
ReferenceTrajectoryBase::clone
virtual ReferenceTrajectoryBase * clone() const =0
ReferenceTrajectoryBase::theGblExtDerivatives
Eigen::MatrixXd theGblExtDerivatives
Definition: ReferenceTrajectoryBase.h:265
ReferenceTrajectoryBase::theParameterCov
AlgebraicSymMatrix theParameterCov
Definition: ReferenceTrajectoryBase.h:253
ReferenceCounted
ReferenceTrajectoryBase::trajectoryToCurv
const AlgebraicMatrix & trajectoryToCurv() const
Definition: ReferenceTrajectoryBase.h:168
riemannFit::VectorXd
Eigen::VectorXd VectorXd
Definition: FitUtils.h:12
ReferenceTrajectoryBase::isValid
bool isValid()
Definition: ReferenceTrajectoryBase.h:142
ReferenceTrajectoryBase::theGblExtMeasurements
Eigen::VectorXd theGblExtMeasurements
Definition: ReferenceTrajectoryBase.h:266
ReferenceTrajectoryBase::Config::propDir
PropagationDirection propDir
Definition: ReferenceTrajectoryBase.h:129
ReferenceTrajectoryBase::theValidityFlag
bool theValidityFlag
Definition: ReferenceTrajectoryBase.h:235
ReferenceTrajectoryBase::theParamCovFlag
bool theParamCovFlag
Definition: ReferenceTrajectoryBase.h:236
ReferenceTrajectoryBase::theNomField
int theNomField
Definition: ReferenceTrajectoryBase.h:263