BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrackBase.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TTrackBase.h,v 1.14 2011/10/08 01:56:15 maoh Exp $
3//-----------------------------------------------------------------------------
4// Filename : TTrackBase.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A virtual class for a track class in tracking.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TTrackBase_FLAG_
14#define TTrackBase_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17#ifndef TRKRECO_DEBUG
18#define TRKRECO_DEBUG
19#endif
20#endif
21
22#define TrackAxialLayer 0
23#define TrackStereoLayer 1
24#define TrackBothLayer 2
25
26//...Definition of objectType...
27#define TrackBase 1
28#define Circle 2
29#define Line 4
30#define Track 8
31#define Segment 16
32
33#include <string>
34
35#define HEP_SHORT_NAMES
36#include "CLHEP/Alist/AList.h"
37
38#include "TrkReco/TMDCUtil.h"
39
40class TMLink;
41class TTrackMC;
42class TMFitter;
43class TTrackHEP;
44
45/// A virtual class for a track class in tracking.
47
48 public:
49 /// Constructor.
50 TTrackBase();
51
52 /// Constructor.
54
55 /// Destructor
56 virtual ~TTrackBase();
57
58 public:// General information
59 /// returns object type.
60 virtual unsigned objectType(void) const;
61
62 /// returns type. Definition is depending on an object class.
63 virtual unsigned type(void) const;
64
65 /// dumps debug information.
66 virtual void dump(const std::string & message = std::string(""),
67 const std::string & prefix = std::string("")) const;
68
69 public:// Hit information
70 /// returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
71 const AList<TMLink> & links(unsigned mask = 0) const;
72
73 /// returns \# of masked TMLinks assigned to this track object.
74 unsigned nLinks(unsigned mask = 0) const;
75
76 /// returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
77 const AList<TMLink> & cores(unsigned mask = 0) const;
78
79 /// returns \# of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
80 unsigned nCores(unsigned mask = 0) const;
81
82 public:// Hit manipulation
83 /// update cache.
84 void update(void) const;
85
86 /// appends a TMLink.
87 void append(TMLink &);
88
89 /// appends TMLinks.
90 void append(const AList<TMLink> &);
91
92 /// appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
93 void appendByApproach(AList<TMLink> & list, double maxSigma);
94
95 /// appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
96 void appendByDistance(AList<TMLink> & list, double maxDistance);
97
98 /// removes a TMLink.
99 void remove(TMLink & a);
100
101 /// removes TMLinks.
102 void remove(const AList<TMLink> &);
103
104 /// removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
105 virtual void refine(AList<TMLink> & list, double maxSigma);
106
107 /// removes bad points by pull. The bad points are masked not to be used in fit.
108 virtual void refine(double maxSigma);
109
110 virtual int DropWorst();
111
112 virtual void removeLinks(void);
113
114 /// returns distance to a position of TMLink in TMLink space.
115 virtual double distance(const TMLink &) const;
116
117 /// calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
118 virtual int approach(TMLink &) const;
119
120 /// returns \# of good hits to be appended.
121 unsigned testByApproach(const TMLink & list, double sigma) const;
122 unsigned testByApproach(const AList<TMLink> & list, double sigma) const;
123
124 /// fits itself by a default fitter. Error was happened if return value is not zero.
125 virtual int fit(void);
126
127 /// returns a pointer to a default fitter.
128 const TMFitter * const fitter(void) const;
129
130 /// sets a default fitter.
131 const TMFitter * const fitter(const TMFitter *);
132
133 /// false Fit
134 void falseFit(); // added by matsu ( 1999/05/24 )
135
136 public:// Operators
137 TMLink * operator[](unsigned i) const;
138
139 public:// MC information
140 /// returns TTrackHEP.
141 const TTrackHEP * const hep(void) const;
142
143 /// returns \# of contributed TTrackHEP tracks.
144 unsigned nHeps(void) const;
145
146 /// returns a pointer to TTrackMC.
147 const TTrackMC * const mc(void) const;
148
149 public:// Obsolete functions. Followings should be removed in TrkReco 2.
150 /// returns true if fitted.
151 bool fitted(void) const;
152
153 /// returns true if fitted with cathode hits(TEMPORARY).
154 bool fittedWithCathode(void) const;
155
156 private:
157 /// refine core part.
158 AList<TMLink> refineMain(double maxSigma);
159
160 protected:// Always updated
162 mutable bool _fitted;
163 mutable bool _fittedWithCathode;
164 // unsigned _state;
166
167 private:// Always updated
168 mutable bool _updated;
169
170 private:// Updated when accessed
171 mutable AList<TMLink> _cores;
172
173 private:// Always updated when accessed
174 mutable const TTrackHEP * _hep;
175 mutable unsigned _nHeps;
176
177 private:
178 const TMFitter * _fitter;
179 float _time;
180
181 friend class TMFitter;
182 friend class THelixFitter;
183 friend class TCosmicFitter;
184
185#ifdef TRKRECO_DEBUG
186 public:
187 bool fitted(bool) const;
188#endif
189};
190
191//-----------------------------------------------------------------------------
192
193#ifdef TTrackBase_NO_INLINE
194#define inline
195#else
196#undef inline
197#define TTrackBase_INLINE_DEFINE_HERE
198#endif
199
200#ifdef TTrackBase_INLINE_DEFINE_HERE
201
202inline
203void
205 _links.remove(a);
206 _updated = false;
207 _fitted = false;
208 _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
209}
210
211inline
212void
214 _links.remove(a);
215 _updated = false;
216 _fitted = false;
217 _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
218}
219
220inline
221bool
223 return _fitted;
224}
225
226// added by matsu ( 1999/05/24 )
227inline
228void
230 _fitted = false;
231 _fittedWithCathode = false;
232}
233// end of addition
234
235inline
236TMLink *
237TTrackBase::operator[](unsigned i) const {
238 return _links[i];
239}
240
241inline
242bool
244 return _fittedWithCathode;
245}
246
247inline
248const TTrackMC * const
249TTrackBase::mc(void) const {
250 return _mc;
251}
252
253inline
254const TMFitter * const
256 return _fitter;
257}
258
259inline
260const TMFitter * const
262 _fitted = false;
263 return _fitter = a;
264}
265
266inline
267unsigned
269 return TrackBase;
270}
271
272inline
273unsigned
274TTrackBase::type(void) const {
275 return 0;
276}
277
278#ifdef TRKRECO_DEBUG
279inline
280bool
281TTrackBase::fitted(bool a) const {
282 return _fitted = a;
283}
284#endif
285
286#endif
287
288#undef inline
289
290#endif /* TTrackBase_FLAG_ */
TTree * sigma
#define TrackBase
Definition: TTrackBase.h:27
A class to fit a TTrackBase object to a helix.
Definition: TCosmicFitter.h:45
A class to fit a TTrackBase object to a helix.
Definition: THelixFitter.h:48
A class to fit a TTrackBase object.
Definition: TMFitter.h:34
A virtual class for a track class in tracking.
Definition: TTrackBase.h:46
virtual int approach(TMLink &) const
calculates the closest approach to a wire in real space. Results are stored in TMLink....
Definition: TTrackBase.cxx:95
void falseFit()
false Fit
Definition: TTrackBase.h:229
virtual double distance(const TMLink &) const
returns distance to a position of TMLink in TMLink space.
Definition: TTrackBase.cxx:89
bool _fittedWithCathode
Definition: TTrackBase.h:163
virtual int fit(void)
fits itself by a default fitter. Error was happened if return value is not zero.
Definition: TTrackBase.cxx:357
AList< TMLink > _links
Definition: TTrackBase.h:161
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TTrackBase.cxx:58
virtual void refine(AList< TMLink > &list, double maxSigma)
removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
Definition: TTrackBase.cxx:170
bool fitted(void) const
returns true if fitted.
Definition: TTrackBase.h:222
virtual void removeLinks(void)
Definition: TTrackBase.cxx:189
bool fittedWithCathode(void) const
returns true if fitted with cathode hits(TEMPORARY).
Definition: TTrackBase.h:243
void appendByDistance(AList< TMLink > &list, double maxDistance)
appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when ...
Definition: TTrackBase.cxx:152
TTrackMC * _mc
Definition: TTrackBase.h:165
unsigned testByApproach(const TMLink &list, double sigma) const
returns # of good hits to be appended.
Definition: TTrackBase.cxx:255
const TTrackMC *const mc(void) const
returns a pointer to TTrackMC.
Definition: TTrackBase.h:249
bool _fitted
Definition: TTrackBase.h:162
virtual int DropWorst()
Definition: TTrackBase.cxx:212
unsigned nHeps(void) const
returns # of contributed TTrackHEP tracks.
Definition: TTrackBase.cxx:443
void append(TMLink &)
appends a TMLink.
Definition: TTrackBase.cxx:362
const AList< TMLink > & links(unsigned mask=0) const
returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
Definition: TTrackBase.cxx:297
const TMFitter *const fitter(void) const
returns a pointer to a default fitter.
Definition: TTrackBase.h:255
virtual unsigned type(void) const
returns type. Definition is depending on an object class.
Definition: TTrackBase.h:274
void remove(TMLink &a)
removes a TMLink.
Definition: TTrackBase.h:204
const TTrackHEP *const hep(void) const
returns TTrackHEP.
Definition: TTrackBase.cxx:407
unsigned nCores(unsigned mask=0) const
returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
Definition: TTrackBase.cxx:325
void appendByApproach(AList< TMLink > &list, double maxSigma)
appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when ...
Definition: TTrackBase.cxx:101
TMLink * operator[](unsigned i) const
Definition: TTrackBase.h:237
virtual ~TTrackBase()
Destructor.
Definition: TTrackBase.cxx:54
TTrackBase()
Constructor.
Definition: TTrackBase.cxx:40
virtual unsigned objectType(void) const
returns object type.
Definition: TTrackBase.h:268
const AList< TMLink > & cores(unsigned mask=0) const
returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
Definition: TTrackBase.cxx:317
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
Definition: TTrackBase.cxx:305
void update(void) const
update cache.
Definition: TTrackBase.cxx:75
A class to represent a GEN_HEPEVT particle in tracking.
Definition: TTrackHEP.h:37
A class to have MC information of TTrack.
Definition: TTrackMC.h:54