CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfMultiStateUpdator.cc
Go to the documentation of this file.
2 
12 
14  const TrackingRecHit& aRecHit) const {
15 
16  std::vector<TrajectoryStateOnSurface> && predictedComponents = tsos.components();
17  if (predictedComponents.empty()) {
18  edm::LogError("GsfMultiStateUpdator") << "Trying to update trajectory state with zero components! " ;
19  return TrajectoryStateOnSurface();
20  }
21 
22  std::vector<double> && 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 (std::vector<TrajectoryStateOnSurface>::const_iterator iter = predictedComponents.begin();
32  iter != predictedComponents.end(); iter++) {
33  TrajectoryStateOnSurface updatedTSOS = KFUpdator().update(*iter, aRecHit);
34  if (updatedTSOS.isValid()){
35  result.addState(TrajectoryStateOnSurface(weights[i],
36  updatedTSOS.localParameters(),
37  updatedTSOS.localError(), updatedTSOS.surface(),
38  &(tsos.globalParameters().magneticField()),
39  (*iter).surfaceSide()
40  ));
41  i++;
42  }
43  else{
44  edm::LogError("GsfMultiStateUpdator") << "one of the KF updated state is invalid. skipping.";
45  }
46 
47  }
48 
49  return result.combinedState();
50 }
int i
Definition: DBlmapReader.cc:9
const LocalTrajectoryParameters & localParameters() const
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
void addState(const TrajectoryStateOnSurface)
const SurfaceType & surface() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
Definition: KFUpdator.cc:10
tuple result
Definition: query.py:137
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
const MagneticField & magneticField() const
std::vector< TrajectoryStateOnSurface > components() const