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 TransientTrackingRecHit& 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()){
36  updatedTSOS.localError(), updatedTSOS.surface(),
37  &(tsos.globalParameters().magneticField()),
38  (*iter).surfaceSide(), weights[i]));
39  i++;
40  }
41  else{
42  edm::LogError("GsfMultiStateUpdator") << "one of the KF updated state is invalid. skipping.";
43  }
44 
45  }
46 
47  return result.combinedState();
48 }
int i
Definition: DBlmapReader.cc:9
const LocalTrajectoryParameters & localParameters() const
void addState(const TrajectoryStateOnSurface)
tuple result
Definition: query.py:137
const LocalTrajectoryError & localError() const
std::vector< double > weights(const TransientTrackingRecHit &tsos) const
Create random state.
const GlobalTrajectoryParameters & globalParameters() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
Definition: KFUpdator.cc:10
const Surface & surface() const
const MagneticField & magneticField() const
std::vector< TrajectoryStateOnSurface > components() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const