CMS 3D CMS Logo

GsfMultiStateUpdator.cc
Go to the documentation of this file.
12 
14  const TrackingRecHit& aRecHit) const {
15  GetComponents comps(tsos);
16  auto const& predictedComponents = comps();
17  if (predictedComponents.empty()) {
18  edm::LogError("GsfMultiStateUpdator") << "Trying to update trajectory state with zero components! ";
19  return TrajectoryStateOnSurface();
20  }
21 
22  auto&& weights = PosteriorWeightsCalculator(predictedComponents).weights(aRecHit);
23  if (weights.empty()) {
24  edm::LogError("GsfMultiStateUpdator") << " no weights could be retreived. invalid updated state !.";
25  return TrajectoryStateOnSurface();
26  }
27 
29 
30  int i = 0;
31  for (auto const& tsosI : predictedComponents) {
32  TrajectoryStateOnSurface updatedTSOS = KFUpdator().update(tsosI, aRecHit);
33 
34  if (double det;
35  updatedTSOS.isValid() && updatedTSOS.localError().valid() && updatedTSOS.localError().posDef() &&
36  (det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix22>(0, 0).Det(det) && det > 0) &&
37  (det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix33>(0, 0).Det(det) && det > 0) &&
38  (det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix44>(0, 0).Det(det) && det > 0) &&
39  (det = 0., updatedTSOS.curvilinearError().matrix().Det2(det) && det > 0)) {
41  updatedTSOS.localParameters(),
42  updatedTSOS.localError(),
43  updatedTSOS.surface(),
44  &(tsos.globalParameters().magneticField()),
45  tsosI.surfaceSide()));
46  } else {
47  edm::LogError("GsfMultiStateUpdator") << "KF updated state " << i << " is invalid. skipping.";
48  }
49  ++i;
50  }
51 
52  return result.combinedState();
53 }
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
GeometricSearchDet Det
Definition: DetBelowR.h:8
const LocalTrajectoryParameters & localParameters() const
Log< level::Error, false > LogError
const SurfaceType & surface() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:177
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
const CurvilinearTrajectoryError & curvilinearError() const
const AlgebraicSymMatrix55 & matrix() const
const MagneticField & magneticField() const
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override