BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMDCWireHit.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TMDCWireHit.h,v 1.7 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TMDCWireHit.h
5// Section : Tracking MDC
6// Owner : Yoshi Iwasaki
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A class to represent a wire hit in MDC.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TMDCWireHit_FLAG_
14#define TMDCWireHit_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17#ifndef TRKRECO_DEBUG
18#define TRKRECO_DEBUG
19#endif
20#endif
21#define WireHitLeft 0
22#define WireHitRight 1
23
24//...Masks for state()...
25
26#define WireHitTimeValid 1048576
27#define WireHitChargeValid 2097152
28#define WireHitFindingValid 4194304
29#define WireHitFittingValid 0x40000000
30#define WireHitAxial 8
31#define WireHitStereo 48
32
33#define WireHitPatternLeft 256
34#define WireHitPatternRight 512
35#define WireHitIsolated 1024
36#define WireHitContinuous 2048
37#define WireHitNeighborHit 12
38#define WireHitNeighborPattern 258048
39#define WireHitNeighborHit0 4096
40#define WireHitNeighborHit1 8192
41#define WireHitNeighborHit2 16384
42#define WireHitNeighborHit3 32768
43#define WireHitNeighborHit4 65536
44#define WireHitNeighborHit5 131072
45
46#define WireHitLocked 128
47#define WireHitUsed 64
48#define WireHitLeftMask 1
49#define WireHitRightMask 2
50#define WireHitMultiTrack 8388608
51#define WireHitConformalFinder 16777216
52#define WireHitCurlFinder 33554432
53#define WireHitClustFinder 67108864
54#define WireHitTrackManager 134217728
55#define WireHitInvalidForFit 268435456
56#define WireHitFastFinder 536870912
57
58#include <string>
59
60#define HEP_SHORT_NAMES
61#include "CLHEP/Alist/AList.h"
62#ifndef CLHEP_POINT3D_H
63#include "CLHEP/Geometry/Point3D.h"
64#endif
65#ifndef ENABLE_BACKWARDS_COMPATIBILITY
67#endif
68
69//zangsl 040518 change the class declaration to included files
70//struct reccdc_wirhit;
71//class MdcRec_wirhit
72//class TMDCWire;
73class TTrack;
74//class TMDCWireHitMC;
75#include "MdcTables/MdcTables.h"
76#include "TrkReco/TMDCWire.h"
77//#include "TrkReco/TTrack.h"
79
80// A class to represent a wire hit in MDC.
82
83 public:
84 /// Constructor.
85 TMDCWireHit(TMDCWire *, MdcRec_wirhit *, float fudgeFactor);
86
87 /// Destructor
88 virtual ~TMDCWireHit();
89
90 public:// Selectors
91 /// dumps debug information.
92 void dump(const std::string & message = std::string(""),
93 const std::string & prefix = std::string("")) const;
94
95 /// returns a pointer to a TMDCWire.
96 const TMDCWire * const wire(void) const;
97
98 /// returns a pointer to RECMDC_WIRHIT.
99 struct MdcRec_wirhit * reccdc(void) const;
100
101 /// returns state.
102 unsigned state(void) const;
103
104 /// returns drift distance.
105 float drift(unsigned) const;
106
107 /// returns drift distance error.
108 float dDrift(unsigned) const;
109
110 /// returns drift distance.
111 float drift(void) const;
112
113 /// returns drift distance error.
114 float dDrift(void) const;
115
116
117
118 /// returns drift time
119// double DriftTime(double,double) const;
120
121
122
123 /// returns position in the middle of wire. z is always zero, however.
124 const HepPoint3D & xyPosition(void) const;
125
126 /// returns left position. z is always zero.
127 HepPoint3D position(unsigned) const;
128
129 /// assigns a pointer to a TTrack.
130 const TTrack * const track(void) const;
131
132 /// returns sequential Length in one segment : this parameter is used in TCurlFinder now.
133 unsigned sequence(void) const;
134
135 /// returns a pointer to TMDCWireHitMC.
136 const TMDCWireHitMC * const mc(void) const;
137
138 public:// Modifiers
139 /// sets state. Meaning of bits are written below.
140 unsigned state(unsigned newState);
141
142 /// sets state. Meaning of bits are written below. (tmp)
143 unsigned state(unsigned newState) const;
144
145 /// assigns a pointer to a TTrack.
146 const TTrack * const track(const TTrack *);
147
148 /// assigns a pointer to a TTrack. (tmp)
149 const TTrack * const track(const TTrack *) const;
150
151 /// sets a pointer to TMDCWireHitMC.
152 const TMDCWireHitMC * const mc(TMDCWireHitMC *);
153
154 /// sets sequential length in one segment : this parameter is used in TCurlFinder now.
155 unsigned sequence(unsigned) const;
156
157 private:
158 mutable unsigned _state;
159 float _drift[2]; // 0:left, 1:right
160 float _driftError[2];
161 const TMDCWire * _wire;
162 MdcRec_wirhit * const _r;
163 const HepPoint3D & _xyPosition;
164 mutable const TTrack * _track;
165 const TMDCWireHitMC * _mc;
166 mutable unsigned _sequentialLength;
167
168 // _state bit definition
169
170 // Pre-detemined
171 // 20 : drift time valid
172 // 21 : charge(dE/dx) valid
173 // 22 : valid for finding
174 // 30 : valid for fit
175 // 3 : axial hit
176 // 4, 5 : stereo hit
177
178 // Hit pattern
179 // 8 : hit pattern left
180 // 9 : hit pattern right
181 // 10 : isolated hit pattern
182 // 11 : continuous hit pattern
183 // 12 : neighbor hit 0
184 // 13 : neighbor hit 1
185 // 14 : neighbor hit 2
186 // 15 : neighbor hit 3
187 // 16 : neighbor hit 4
188 // 17 : neighbor hit 5
189
190 // Tracking results
191 // 7 : locked
192 // 6 : used for tracking
193 // 0 : left hit
194 // 1 : right hit
195 // 23 : shared by multi-track
196 // 24 : found by conforaml finder
197 // 25 : found by curl finder
198 // 26 : found by clust finder
199 // 27 : found by track manager
200 // 28 : NOT valid for fitting
201
202 // Fitting results
203};
204
205//-----------------------------------------------------------------------------
206
207#ifdef TMDCWireHit_NO_INLINE
208#define inline
209#else
210#undef inline
211#define TMDCWireHit_INLINE_DEFINE_HERE
212#endif
213
214#ifdef TMDCWireHit_INLINE_DEFINE_HERE
215
216inline
217const TMDCWire * const
218TMDCWireHit::wire(void) const {
219 return _wire;
220}
221
222inline
223struct MdcRec_wirhit *
225 return _r;
226}
227
228inline
229unsigned
231 return _state;
232}
233
234inline
235float
236TMDCWireHit::drift(unsigned i) const {
237 if (i) return _drift[1];
238 return _drift[0];
239}
240
241inline
242float
243TMDCWireHit::dDrift(unsigned i) const {
244 if (i) return _driftError[1];
245 return _driftError[0];
246}
247
248inline
249float
251 return (_drift[0] + _drift[1]) / 2.;
252}
253
254inline
255float
257 return (_driftError[0] + _driftError[1]) / 2.;
258}
259
260inline
261const HepPoint3D &
263 return _xyPosition;
264}
265
266inline
267unsigned
269 return _state = i;
270}
271
272inline
273unsigned
274TMDCWireHit::state(unsigned i) const {
275 return _state = i;
276}
277
278inline
279const TTrack * const
281 return _track;
282}
283
284inline
285const TTrack * const
287 return _track = a;
288}
289
290inline
291const TTrack * const
292TMDCWireHit::track(const TTrack * a) const {
293 return _track = a;
294}
295
296inline
297const TMDCWireHitMC * const
298TMDCWireHit::mc(void) const {
299 return _mc;
300}
301
302inline
303const TMDCWireHitMC * const
305 return _mc = a;
306}
307
308inline
309unsigned
311 return _sequentialLength;
312}
313
314inline
315unsigned
316TMDCWireHit::sequence(unsigned a) const {
317 return _sequentialLength = a;
318}
319
320#endif
321
322#undef inline
323
324#endif /* TMDCWireHit_FLAG_ */
HepGeom::Point3D< double > HepPoint3D
Definition: TMDCWireHit.h:66
A class to represent a MC wire hit in MDC.
Definition: TMDCWireHitMC.h:46
HepPoint3D position(unsigned) const
returns left position. z is always zero.
Definition: TMDCWireHit.cxx:93
float drift(void) const
returns drift distance.
Definition: TMDCWireHit.h:250
float dDrift(void) const
returns drift distance error.
Definition: TMDCWireHit.h:256
struct MdcRec_wirhit * reccdc(void) const
returns a pointer to RECMDC_WIRHIT.
Definition: TMDCWireHit.h:224
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TMDCWireHit.cxx:64
unsigned state(void) const
returns state.
Definition: TMDCWireHit.h:230
virtual ~TMDCWireHit()
Destructor.
Definition: TMDCWireHit.cxx:60
const TTrack *const track(void) const
assigns a pointer to a TTrack.
Definition: TMDCWireHit.h:280
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
Definition: TMDCWireHit.h:218
const HepPoint3D & xyPosition(void) const
returns drift time
Definition: TMDCWireHit.h:262
unsigned sequence(void) const
returns sequential Length in one segment : this parameter is used in TCurlFinder now.
Definition: TMDCWireHit.h:310
const TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
Definition: TMDCWireHit.h:298
A class to represent a wire in MDC.
Definition: TMDCWire.h:55
A class to represent a track in tracking.
Definition: TTrack.h:129