CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KFSplittingFitter.cc
Go to the documentation of this file.
5 
6 
7 
8 void KFSplittingFitter::sorter(const RecHitContainer& hits, PropagationDirection dir, RecHitContainer & result) const {
9  result.reserve(hits.size());
10  for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end();
11  ihit++) {
12  if(!(**ihit).isValid()) result.push_back(*ihit);
13  else if((**ihit).transientHits().size() == 1) result.push_back(*ihit);
14  else {
15  RecHitContainer splitted = RecHitSplitter().split((**ihit).transientHits());
16  RecHitContainer sorted =
17  RecHitSorter().sortHits(splitted, dir);
18  for (RecHitContainer::iterator srt = sorted.begin(); srt != sorted.end(); srt++) {
19  result.push_back(*srt);
20  // result.insert(result.end(), sorted.begin(), sorted.end());
21  }
22  }
23  }
24 }
25 
26 
27 Trajectory KFSplittingFitter::fitOne(const Trajectory& aTraj, fitType type) const {
28 
29  if(aTraj.empty()) return Trajectory();
30 
31  TM firstTM = aTraj.firstMeasurement();
32  TSOS firstTsos =
33  TrajectoryStateWithArbitraryError()(firstTM.predictedState());
34 
35  RecHitContainer const & hits = aTraj.recHits();
36  RecHitContainer result;
37  sorter(hits,aTraj.direction(),result);
38 
39 
40  return fitter.fitOne(aTraj.seed(), result, firstTsos,type);
41 
42 }
43 
44 Trajectory KFSplittingFitter::fitOne(const TrajectorySeed& aSeed,
45  const RecHitContainer& hits,
46  fitType type) const {
47 
48  RecHitContainer result;
49  sorter(hits,aSeed.direction(),result);
50 
51 
52  return fitter.fitOne(aSeed, result, type);
53 
54 
55 }
56 
57 Trajectory KFSplittingFitter::fitOne(const TrajectorySeed& aSeed,
58  const RecHitContainer& hits,
59  const TSOS& firstPredTsos, fitType type) const {
60 
61  RecHitContainer result;
62  sorter(hits,aSeed.direction(),result);
63 
64 
65  return fitter.fitOne(aSeed, result, firstPredTsos,type);
66 
67 }
68 
PropagationDirection direction() const
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:244
type
Definition: HCALResponse.h:21
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:275
RecHitContainer sortHits(const RecHitContainer &hits, const PropagationDirection &dir) const
Definition: RecHitSorter.cc:6
PropagationDirection
PropagationDirection const & direction() const
Definition: Trajectory.cc:118
tuple result
Definition: query.py:137
RecHitContainer split(const RecHitContainer &hits) const
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:194
dbl *** dir
Definition: mlp_gen.cc:35