StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiKalmanTrackFinder.h
1 #ifndef StiKalmanTrackFinder_H_INCLUDED
4 #define StiKalmanTrackFinder_H_INCLUDED
5 #include "Sti/StiTrackFinder.h"
6 #include "Sti/Base/Named.h"
7 #include "Sti/Base/Described.h"
8 class TStopwatch;
9 class StiDetector;
10 class StiDetectorBuilder;
12 class StiToolkit;
13 class StiKalmanTrackFactory;
14 class StiHitContainer;
15 class StiTrackContainer;
16 class StiTrack;
17 class StiKalmanTrack;
18 class StiKalmanTrackNode;
19 template<class Factorized>class Factory;
20 
21 
32 {
33 public:
36  void addSeedFinder(StiTrackFinder* sf) {_seedFinders.push_back(sf);}
37  virtual ~StiKalmanTrackFinder() {}
39  virtual void initialize();
41  void setTiming();
43  virtual void findTracks();
45  bool find(StiTrack *track, int direction, double rmin=0);
47  virtual StiTrack * findTrack(double rMin=0);
49  void extendSeeds (double rMin);
50  void extendTracks(double rMin);
52  int extendTrack(StiKalmanTrack *track,double rMin);
53  void extendTracksToVertices(const std::vector<StiHit*> &vertices);
55  int getNTracks() const ;
56  int getNPrims() const { return _nPrimTracks;}
58  virtual void reset();
59  virtual void unset(){}
60 
62  virtual void clear();
64  virtual void finish() const;
65  virtual Int_t Fit(StiKalmanTrack *track, Double_t rMin=0);
67  virtual Filter<StiTrack> * getTrackFilter();
68  static void setDebug(int m = 0) {_debug = m;}
69  static int debug() {return _debug;}
70  typedef enum{ // type of return value for the Fit() procedure
71  kNoErrors = 0,
72  kApproxFail,
73  kFitFail,
74  kExtendFail,
75  kCheckFail
76  } TFitStatus;
77 
78  typedef enum{ // type of return value for the extendTrack() procedure
79  kExtended,
80  kNotExtended,
81  kNotRefitedIn,
82  kNotRefitedOut
83  } TExtendStatus;
84 
85 
86 private:
87 class QAFind;
88  void find(StiKalmanTrack *track, int direction,StiKalmanTrackNode *node,QAFind &qa);
89  void nodeQA(StiKalmanTrackNode *node, int position,int active,QAFind &qa);
90  int compQA(QAFind &qaBest,QAFind &qaTry,double maxChi2);
91 
92  protected:
93 
94  void printState();
95  StiToolkit * _toolkit;
96  Filter<StiTrack> * _trackFilter;
97  Factory<StiKalmanTrackNode> * _trackNodeFactory;
98  StiDetectorContainer * _detectorContainer;
99  StiHitContainer * _hitContainer;
100  StiTrackContainer * _trackContainer;
101  std::vector<StiTrackFinder*> _seedFinders;
102  int _nPrimTracks;
103  int mEventPerm; //Count number of permutations
104 
105 private:
106 
107  double chi2;
108  TStopwatch *mTimg[3]; //seeds,traks,prims
109  int mTrackPerm; //Count number of permutations
110  int mUseComb; //useComb() saved
111  static int _debug;
112 };
113 
115 {
116  return _trackFilter;
117 }
118 
119 
121 {
122  public:
123  CloserAngle(double refAngle);
124  bool operator()(const StiDetector*lhs, const StiDetector* rhs);
125  protected:
126  double _refAngle;
127 };
128 
129 #endif
130 
131 
132 
virtual void initialize()
Initialize the finder.
virtual void findTracks()
Find all tracks of the currently loaded event.
Definition of Kalman Track.
void extendSeeds(double rMin)
Extend seeds to tracks.
bool find(StiTrack *track, int direction, double rmin=0)
Find/extend the given track, in the given direction.
Abstract definition of a Track.
Definition: StiTrack.h:59
virtual StiTrack * findTrack(double rMin=0)
Find the next track.
virtual Filter< StiTrack > * getTrackFilter()
Get the track filter currently used by the tracker.
virtual void reset()
Reset the tracker.
int getNTracks() const
get number of tracks
int extendTrack(StiKalmanTrack *track, double rMin)
Extend track.
virtual void finish() const
Finish the tracker.
void setTiming()
Set timing of tracking.
virtual void clear()
Clear the tracker.
Definition of toolkit.
Definition: StiToolkit.h:55
An abstract class defining the interface to the track finder.