CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
FTSegment.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Package: MdcFastTrkAlg
4// Module: FTSegment
5//
6// Description: segment class for MdcFastTrkAlg
7//
8
9#ifndef FTSegment_FLAG_
10#define FTSegment_FLAG_
11
17#include <iostream>
18
19class FTFinder;
20class FTWire;
21class FTLayer;
22class FTSuperLayer;
23class FTTrack;
25public:
26
27 /// constructors
29
30 /// destructors
31 ~FTSegment();
32
33public: // public member functions
34 /// examine segment
35 int examine(void);
36
37#ifndef OnlineMode
38 /// printout of the wireHits info.
39 /// added by X.-R. Lu
40 void printout(void);
41#endif
42
43 /// update information for axial segment
44 void update(void);
45
46 /// update information for stereo segment
47 int update3D(const FTTrack * track);
48
49 /// link stereo segments by tanLambda
50 void linkStereoSegments(void);
51
52 /// connect short segments
53 void connect_outer(const FTList<FTWire *> &, const FTList<FTWire *> &);
54 void connect_inner(const FTList<FTWire *> &, const FTList<FTWire *> &);
55
56 /// connect single hit
57 void connect_outer(const FTWire *);
58
59 /// connect single hit
60 void connect_inner(const FTWire *);
61
62public: // Selectors
63 /// returns wire-hit list
64 FTList<FTWire *>& wireHits(void) const;
65
66 /// returns super-layer
67 FTSuperLayer & superLayer(void) const;
68
69 /// returns innerBoundHits
70 FTList<FTWire *> & innerBoundHits(void) const;
71
72 /// returns outerBoundHits
73 FTList<FTWire *> & outerBoundHits(void) const;
74
75 /// returns x of outgoing position
76 float outgoingX(void) const;
77
78 /// returns y of outgoing position
79 float outgoingY(void) const;
80
81 /// returns x of incoming position
82 float incomingX(void) const;
83
84 /// returns y of incoming position
85 float incomingY(void) const;
86
87 /// returns phi of incoming position
88 float incomingPhi(void) const;
89
90 /// returns phi of outgoing position
91 float outgoingPhi(void) const;
92
93 /// returns the sin(dphi)/MOD(r_out-r_in)
94 float attr_const(void) const;
95
96 /// returns track
97 FTTrack * track(void) const;
98
99 /// returns kappa(axial)
100 float kappa(void) const;
101
102 /// returns r from origin
103 float r(void) const;
104
105 /// returns s for matched 2D track
106 float s(void) const;
107
108 /// returns z for matched 2D track
109 float z(void) const;
110
111public: // Modifiers
112 /// set track
113 FTTrack * track(FTTrack *);
115
116private: // private data members
117 IMagneticFieldSvc* m_pmgnIMF;
118 FTList<FTWire *>& _wireHits;
119 FTSuperLayer & _superLayer;
120 FTList<FTWire *> & _innerBoundHits;
121 FTList<FTWire *> & _outerBoundHits;
122 FTList<float> * _sList;
123 union{
124 float _kappa;
126 };
127 union{
130 };
131 float _r;
132 float _outgoing_x;
133 float _outgoing_y;
134 float _incoming_x;
135 float _incoming_y;
136};
137
138
139inline
141 : _wireHits(hits),
142 _superLayer(*super),
143 _innerBoundHits(*(new FTList<FTWire *>(3))),
144 _outerBoundHits(*(new FTList<FTWire *>(3))),
145 _sList(NULL),
146 _zList(NULL),
147 _track(NULL)
148{
149 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
150 if(scmgn!=StatusCode::SUCCESS) {
151 std::cout<< "Unable to open Magnetic field service"<<std::endl;
152 }
153}
154
155inline
157{
158 delete &_wireHits;
159 delete &_innerBoundHits;
160 delete &_outerBoundHits;
161 if (_sList){
162 delete _sList;
163 delete _zList;
164 delete _trackList;
165 }
166}
167
168inline
169void
171 const FTList<FTWire *> & outerBound)
172{
173 _wireHits.append(outerHits);
174 _outerBoundHits.clear();
175 _outerBoundHits.append(outerBound);
176}
177
178inline
179void
181 const FTList<FTWire *> & innerBound)
182{
183 _wireHits.append(innerHits);
184 _innerBoundHits.clear();
185 _innerBoundHits.append(innerBound);
186}
187
188inline
189void
191{
192 _wireHits.append((FTWire *)h);
193 _outerBoundHits.clear();
194 _outerBoundHits.append((FTWire *)h);
195}
196
197inline
198void
200{
201 _wireHits.append((FTWire *)h);
202 _innerBoundHits.clear();
203 _innerBoundHits.append((FTWire *)h);
204}
205
206inline
209{
210 return _superLayer;
211}
212
213inline
216{
217 return _wireHits;
218}
219
220inline
223{
224 return _innerBoundHits;
225}
226
227inline
230{
231 return _outerBoundHits;
232}
233
234inline
235float
237{
238 return _outgoing_x;
239}
240
241inline
242float
244{
245 return _outgoing_y;
246}
247
248inline
249float
251{
252 return _incoming_x;
253}
254
255inline
256float
258{
259 return _incoming_y;
260}
261
262inline
263float
265{
266 if (_innerBoundHits.length() ^ 1) {
267 float phi_1st = _innerBoundHits[0]->phi();
268 float phi_2nd = _innerBoundHits[1]->phi();
269 float phi = 0.5 * (phi_1st + phi_2nd);
270 if (fabs(phi_1st - phi_2nd) > M_PI) {
271 return (phi>M_PI) ? (phi-M_PI) : (phi+M_PI);
272 }
273 return phi;
274 }
275 return _innerBoundHits[0]->phi();
276}
277
278inline
279float
281{
282 if (_outerBoundHits.length() ^ 1) {
283 float phi_1st = _outerBoundHits[0]->phi();
284 float phi_2nd = _outerBoundHits[1]->phi();
285 float phi = 0.5 * (phi_1st + phi_2nd);
286 if (fabs(phi_1st - phi_2nd) > M_PI) {
287 return (phi>M_PI) ? (phi-M_PI) : (phi+M_PI);
288 }
289 return phi;
290 }
291 return _outerBoundHits[0]->phi();
292}
293
294inline
295float
297{
298 float x_len = _outgoing_x - _incoming_x;
299 float y_len = _outgoing_y - _incoming_y;
300 float phi_l = outgoingPhi() - incomingPhi();
301 return sin(phi_l) / sqrt(x_len*x_len + y_len*y_len);
302}
303
304inline
305float
306FTSegment::r(void) const
307{
308 return _r;
309}
310
311inline
312float
314{
315 return _kappa;
316}
317
318inline
319float
320FTSegment::s(void) const
321{
322 return _sList->first();
323}
324
325inline
326float
327FTSegment::z(void) const
328{
329 return _zList->first();
330}
331
332inline
333FTTrack *
335{
336 return _track;
337}
338
339inline
340FTTrack *
342{
343 return _track = src;
344}
345
346
347#endif /* FTSegment_FLAG_ */
348
double sin(const BesAngle a)
Definition: BesAngle.h:210
#define M_PI
Definition: TConstant.h:4
Definition: FTList.h:16
T & first(void) const
returns the first object in the list
Definition: FTList.h:224
void clear(void)
clear lists but the allocated memory remains same
Definition: FTList.h:182
int length(void) const
returns the length of the list
Definition: FTList.h:245
int append(const T &x)
append an object into the end of the list
Definition: FTList.h:127
float incomingPhi(void) const
returns phi of incoming position
Definition: FTSegment.h:264
FTSuperLayer & superLayer(void) const
returns super-layer
Definition: FTSegment.h:208
void printout(void)
Definition: FTSegment.cxx:193
float outgoingY(void) const
returns y of outgoing position
Definition: FTSegment.h:243
~FTSegment()
destructors
Definition: FTSegment.h:156
float outgoingPhi(void) const
returns phi of outgoing position
Definition: FTSegment.h:280
float attr_const(void) const
returns the sin(dphi)/MOD(r_out-r_in)
Definition: FTSegment.h:296
FTList< FTWire * > & innerBoundHits(void) const
returns innerBoundHits
Definition: FTSegment.h:222
float s(void) const
returns s for matched 2D track
Definition: FTSegment.h:320
FTList< FTTrack * > * _trackList
Definition: FTSegment.h:129
float z(void) const
returns z for matched 2D track
Definition: FTSegment.h:327
float incomingY(void) const
returns y of incoming position
Definition: FTSegment.h:257
FTList< float > * _zList
Definition: FTSegment.h:125
void update(void)
update information for axial segment
Definition: FTSegment.cxx:83
FTList< FTWire * > & wireHits(void) const
returns wire-hit list
Definition: FTSegment.h:215
void connect_inner(const FTList< FTWire * > &, const FTList< FTWire * > &)
Definition: FTSegment.h:180
FTSegment(FTSuperLayer *super, FTList< FTWire * > &hits)
constructors
Definition: FTSegment.h:140
void linkStereoSegments(void)
link stereo segments by tanLambda
Definition: FTSegment.cxx:167
FTTrack * _track
Definition: FTSegment.h:128
FTTrack * track(void) const
returns track
Definition: FTSegment.h:334
float outgoingX(void) const
returns x of outgoing position
Definition: FTSegment.h:236
float kappa(void) const
returns kappa(axial)
Definition: FTSegment.h:313
float _kappa
Definition: FTSegment.h:124
float r(void) const
returns r from origin
Definition: FTSegment.h:306
static MdcParameter * param
Definition: FTSegment.h:114
void connect_outer(const FTList< FTWire * > &, const FTList< FTWire * > &)
connect short segments
Definition: FTSegment.h:170
FTList< FTWire * > & outerBoundHits(void) const
returns outerBoundHits
Definition: FTSegment.h:229
int update3D(const FTTrack *track)
update information for stereo segment
Definition: FTSegment.cxx:115
float incomingX(void) const
returns x of incoming position
Definition: FTSegment.h:250
int examine(void)
examine segment
Definition: FTSegment.cxx:20
Definition: FTWire.h:43