CMS 3D CMS Logo

GhostTrackFitter.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <vector>
3 
8 
10 
14 
16 
20 
21 using namespace reco;
22 
24  fitter = std::make_unique<AnnealingGhostTrackFitter>();
25  updater = std::make_unique<KalmanGhostTrackUpdater>();
26 }
27 
29 
31  const GlobalError &priorError,
32  const GlobalVector &direction,
33  double coneRadius,
34  const std::vector<TransientTrack> &tracks) const {
35  GhostTrackPrediction prior(priorPosition, priorError, direction, coneRadius);
36  return fit(prior, priorPosition, tracks);
37 }
38 
40  const GlobalError &priorError,
41  const GlobalVector &direction,
42  const GlobalError &directionError,
43  const std::vector<TransientTrack> &tracks) const {
44  GhostTrackPrediction prior(priorPosition, priorError, direction, directionError);
45  return fit(prior, priorPosition, tracks);
46 }
47 
49  const GlobalPoint &origin,
50  const std::vector<TransientTrack> &tracks) const {
51  double offset = prior.lambda(origin);
52 
53  std::vector<GhostTrackState> states;
54  for (std::vector<TransientTrack>::const_iterator iter = tracks.begin(); iter != tracks.end(); ++iter) {
55  GhostTrackState state(*iter);
56  state.linearize(prior, true, offset);
57  states.push_back(state);
58  }
59 
60  PositiveSideGhostTrackFitter actualFitter(origin, *fitter);
61  return fit(actualFitter, prior, states);
62 }
63 
64 GhostTrack GhostTrackFitter::fit(const GhostTrackPrediction &prior, const std::vector<TransientTrack> &tracks) const {
65  std::vector<GhostTrackState> states;
66  for (std::vector<TransientTrack>::const_iterator iter = tracks.begin(); iter != tracks.end(); ++iter) {
67  GhostTrackState state(*iter);
68  state.linearize(prior, true);
69  states.push_back(state);
70  }
71 
72  return fit(*fitter, prior, states);
73 }
74 
77  const std::vector<GhostTrackState> &states_) const {
78  std::vector<GhostTrackState> states = states_;
79 
80  double ndof, chi2;
81  GhostTrackPrediction pred = fitterImpl.fit(*updater, prior, states, ndof, chi2);
82 
83  GhostTrack result(prior, pred, states, ndof, chi2);
84 
85  return result;
86 }
virtual GhostTrackPrediction fit(const PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states, double &ndof, double &chi2)=0
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
auto const & tracks
cannot be loose
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
fixed size matrix
GhostTrack fit(const GlobalPoint &priorPosition, const GlobalError &priorError, const GlobalVector &direction, double coneRadius, const std::vector< TransientTrack > &tracks) const
std::unique_ptr< FitterImpl > fitter
std::unique_ptr< PredictionUpdater > updater