BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkReco/TrkReco/TSegment0.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TSegment0.h,v 1.7 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TSegment0.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A class to manage a group of TMLink's.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TSegment0_FLAG_
14#define TSegment0_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17#ifndef TRKRECO_DEBUG
18#define TRKRECO_DEBUG
19#endif
20#endif
21#ifndef CLHEP_POINT3D_H
22#include "CLHEP/Geometry/Point3D.h"
23#endif
24#ifndef ENABLE_BACKWARDS_COMPATIBILITY
26#endif
27#include "CLHEP/Geometry/Vector3D.h"
28#ifndef ENABLE_BACKWARDS_COMPATIBILITY
30#endif
31
32#include "TrkReco/TTrackBase.h"
33#include "TrkReco/TMDCUtil.h"
34#include "TrkReco/TMLink.h"
35
36class TTrack;
37class Range;
38template <class T> class CAList;
39
40/// A class to relate TMDCWireHit and TTrack objects.
41class TSegment0 : public TTrackBase {
42
43 public:
44 /// Constructor.
45 TSegment0();
46 TSegment0(const AList<TMLink> &);
47
48 /// Destructor
49 virtual ~TSegment0();
50
51 public:// Selectors
52 /// returns type.
53 virtual unsigned objectType(void) const;
54
55 /// dumps debug information.
56 void dump(const std::string & message = std::string(""),
57 const std::string & prefix = std::string("")) const;
58
59 /// returns super layer id.
60 unsigned superLayerId() const;
61
62 /// returns position.
63 const HepPoint3D & position(void) const;
64
65 /// returns direction.
66 const HepVector3D & direction(void) const;
67
68 /// calculates distance between two clusters. Smaller value indicates closer.
69 double distance(const TSegment0 &) const;
70 double distance(const HepPoint3D &, const HepVector3D &) const;
71
72 /// returns Range of x-coordinate of TMLinks.
73 Range rangeX(double min, double max) const;
74
75 /// returns inner width.
76 unsigned innerWidth(void) const;
77
78 /// returns outer width.
79 unsigned outerWidth(void) const;
80
81 /// returns inner most layer.
82 unsigned innerMostLayer(void) const;
83
84 /// returns outer most layer.
85 unsigned outerMostLayer(void) const;
86
87 /// returns cluster type. 0:empty, 1:short line, 2:long line, 3:V shage(from outside), 4:A shape, 5:X shape, 6:parallel, 7:complicated.
88 unsigned clusterType(void) const;
89
90 /// returns a list of sub TSegments in this cluster. If cluster type is 1, 2, or 7, no cluster is returned.
91 AList<TSegment0> split(void) const;
92
93 int solveDualHits(void);
94 double duality(void) const;
95
96 public:// TTrack relations
97 AList<TTrack> & tracks(void);
98
99 public:// Segment links
101
102 private:
103 AList<TSegment0> splitAV(void) const;
104 AList<TSegment0> splitParallel(void) const;
105 AList<TSegment0> splitComplicated(void) const;
106 AList<TSegment0> splitDual(void) const;
107
108 private:
109 /// updates cache.
110 void update(void) const;
111
112 /// updates type.
113 void updateType(void) const;
114
115 /// updates duality.
116 void updateDuality(void) const;
117
118 private:
119 // always updated.
120 AList<TTrack> _tracks;
121 AList<TSegment0> _innerLinks;
122
123 private:
124 mutable HepPoint3D _position;
125 mutable HepVector3D _direction;
126 mutable unsigned _innerWidth;
127 mutable unsigned _outerWidth;
128 mutable unsigned _innerMostLayer;
129 mutable unsigned _outerMostLayer;
130 mutable AList<TMLink> _inners;
131 mutable AList<TMLink> _outers;
132 mutable unsigned _nLayer;
133 mutable unsigned _clusterType;
134 mutable double _duality;
135 mutable unsigned _nDual;
136 mutable double _angle;
137};
138
139// Utility functions
140/// returns \# of core links in segments.
141unsigned NCoreLinks(const CAList<TSegment0> & list);
142
143/// returns AList of TMLink used for a track.
144AList<TMLink> Links(const TSegment0 &, const TTrack &);
145
146/*
147/// checks property of segments.
148void
149CheckSegments(const CAList<TSegment0> & segmentList);
150
151/// checks to link segments.
152void
153CheckSegmentLink(const TSegment0 & base,
154 const TSegment0 & next,
155 float distance,
156 float dirAngle);
157*/
158
159//-----------------------------------------------------------------------------
160
161#ifdef TSegment0_NO_INLINE
162#define inline
163#else
164#undef inline
165#define TSegment0_INLINE_DEFINE_HERE
166#endif
167
168#ifdef TSegment0_INLINE_DEFINE_HERE
169
170inline
171const HepPoint3D &
173 if (! _fitted) update();
174 return _position;
175}
176
177inline
178const HepVector3D &
180 if (! _fitted) update();
181 return _direction;
182}
183
184inline
185unsigned
187 if (! _fitted) update();
188 return _innerWidth;
189}
190
191inline
192unsigned
194 if (! _fitted) update();
195 return _outerWidth;
196}
197
198inline
199unsigned
201 if (! _fitted) update();
202 return _innerMostLayer;
203}
204
205inline
206unsigned
208 if (! _fitted) update();
209 return _outerMostLayer;
210}
211
212inline
213unsigned
215 if (! nLinks()) return 0;
216 if (_clusterType == 0) updateType();
217 return _clusterType;
218}
219
220inline
221double
223 return _duality;
224}
225
226inline
227unsigned
229 return Segment;
230}
231
232inline
233unsigned
235 unsigned id = (links())[0]->wire()->superLayerId();
236#ifdef TRKRECO_DEBUG
237 {
238 const AList<TMLink> & list = links();
239 unsigned n = list.length();
240 for (unsigned i = 1; i < n; i++) {
241 if (list[i]->hit()->wire()->superLayerId() != id) {
242 std::cout << "TSegment0::superLayerId !!! strange segment found";
243 std::cout << std::endl;
244 dump();
245 break;
246 }
247 }
248 }
249#endif
250 return id;
251}
252
253inline
256 return _tracks;
257}
258
259inline
262 return _innerLinks;
263}
264
265#endif
266
267#undef inline
268
269#endif /* TSegment0_FLAG_ */
270
const Int_t n
HepGeom::Point3D< double > HepPoint3D
unsigned NCoreLinks(const CAList< TSegment0 > &list)
returns # of core links in segments.
Definition: TSegment0.cxx:794
HepGeom::Vector3D< double > HepVector3D
AList< TMLink > Links(const TSegment0 &, const TTrack &)
returns AList of TMLink used for a track.
Definition: TSegment0.cxx:810
to specify 1-dim region or range by two floats
A class to relate TMDCWireHit and TTrack objects.
unsigned outerMostLayer(void) const
returns outer most layer.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TSegment0.cxx:51
virtual unsigned objectType(void) const
returns type.
AList< TSegment0 > & innerLinks(void)
int solveDualHits(void)
Definition: TSegment0.cxx:624
unsigned superLayerId() const
returns super layer id.
double distance(const TSegment0 &) const
calculates distance between two clusters. Smaller value indicates closer.
Definition: TSegment0.cxx:131
unsigned innerMostLayer(void) const
returns inner most layer.
Range rangeX(double min, double max) const
returns Range of x-coordinate of TMLinks.
Definition: TSegment0.cxx:155
AList< TSegment0 > split(void) const
returns a list of sub TSegments in this cluster. If cluster type is 1, 2, or 7, no cluster is returne...
Definition: TSegment0.cxx:281
TSegment0()
Constructor.
Definition: TSegment0.cxx:22
const HepVector3D & direction(void) const
returns direction.
unsigned innerWidth(void) const
returns inner width.
unsigned outerWidth(void) const
returns outer width.
virtual ~TSegment0()
Destructor.
Definition: TSegment0.cxx:47
const HepPoint3D & position(void) const
returns position.
unsigned clusterType(void) const
returns cluster type. 0:empty, 1:short line, 2:long line, 3:V shage(from outside),...
A virtual class for a track class in tracking.
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
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
Definition: TTrackBase.cxx:305
A class to represent a track in tracking.