BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/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 : yoshihito.iwasaki@kek.jp
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
66typedef HepGeom::Point3D<double> HepPoint3D;
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"
78#include "TrkReco/TMDCWireHitMC.h"
79
80// A class to represent a wire hit in MDC.
81class TMDCWireHit {
82
83public:
84 /// Constructor.
85 TMDCWireHit( TMDCWire*, MdcRec_wirhit*, float fudgeFactor );
86
87 /// Destructor
88 virtual ~TMDCWireHit();
89
90public: // 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 /// returns drift time
117 // double DriftTime(double,double) const;
118
119 /// returns position in the middle of wire. z is always zero, however.
120 const HepPoint3D& xyPosition( void ) const;
121
122 /// returns left position. z is always zero.
123 HepPoint3D position( unsigned ) const;
124
125 /// assigns a pointer to a TTrack.
126 const TTrack* const track( void ) const;
127
128 /// returns sequential Length in one segment : this parameter is used in TCurlFinder now.
129 unsigned sequence( void ) const;
130
131 /// returns a pointer to TMDCWireHitMC.
132 const TMDCWireHitMC* const mc( void ) const;
133
134public: // Modifiers
135 /// sets state. Meaning of bits are written below.
136 unsigned state( unsigned newState );
137
138 /// sets state. Meaning of bits are written below. (tmp)
139 unsigned state( unsigned newState ) const;
140
141 /// assigns a pointer to a TTrack.
142 const TTrack* const track( const TTrack* );
143
144 /// assigns a pointer to a TTrack. (tmp)
145 const TTrack* const track( const TTrack* ) const;
146
147 /// sets a pointer to TMDCWireHitMC.
149
150 /// sets sequential length in one segment : this parameter is used in TCurlFinder now.
151 unsigned sequence( unsigned ) const;
152
153private:
154 mutable unsigned _state;
155 float _drift[2]; // 0:left, 1:right
156 float _driftError[2];
157 const TMDCWire* _wire;
158 MdcRec_wirhit* const _r;
159 const HepPoint3D& _xyPosition;
160 mutable const TTrack* _track;
161 const TMDCWireHitMC* _mc;
162 mutable unsigned _sequentialLength;
163
164 // _state bit definition
165
166 // Pre-detemined
167 // 20 : drift time valid
168 // 21 : charge(dE/dx) valid
169 // 22 : valid for finding
170 // 30 : valid for fit
171 // 3 : axial hit
172 // 4, 5 : stereo hit
173
174 // Hit pattern
175 // 8 : hit pattern left
176 // 9 : hit pattern right
177 // 10 : isolated hit pattern
178 // 11 : continuous hit pattern
179 // 12 : neighbor hit 0
180 // 13 : neighbor hit 1
181 // 14 : neighbor hit 2
182 // 15 : neighbor hit 3
183 // 16 : neighbor hit 4
184 // 17 : neighbor hit 5
185
186 // Tracking results
187 // 7 : locked
188 // 6 : used for tracking
189 // 0 : left hit
190 // 1 : right hit
191 // 23 : shared by multi-track
192 // 24 : found by conforaml finder
193 // 25 : found by curl finder
194 // 26 : found by clust finder
195 // 27 : found by track manager
196 // 28 : NOT valid for fitting
197
198 // Fitting results
199};
200
201//-----------------------------------------------------------------------------
202
203#ifdef TMDCWireHit_NO_INLINE
204# define inline
205#else
206# undef inline
207# define TMDCWireHit_INLINE_DEFINE_HERE
208#endif
209
210#ifdef TMDCWireHit_INLINE_DEFINE_HERE
211
212inline const TMDCWire* const TMDCWireHit::wire( void ) const { return _wire; }
213
214inline struct MdcRec_wirhit* TMDCWireHit::reccdc( void ) const { return _r; }
215
216inline unsigned TMDCWireHit::state( void ) const { return _state; }
217
218inline float TMDCWireHit::drift( unsigned i ) const {
219 if ( i ) return _drift[1];
220 return _drift[0];
221}
222
223inline float TMDCWireHit::dDrift( unsigned i ) const {
224 if ( i ) return _driftError[1];
225 return _driftError[0];
226}
227
228inline float TMDCWireHit::drift( void ) const { return ( _drift[0] + _drift[1] ) / 2.; }
229
230inline float TMDCWireHit::dDrift( void ) const {
231 return ( _driftError[0] + _driftError[1] ) / 2.;
232}
233
234inline const HepPoint3D& TMDCWireHit::xyPosition( void ) const { return _xyPosition; }
235
236inline unsigned TMDCWireHit::state( unsigned i ) { return _state = i; }
237
238inline unsigned TMDCWireHit::state( unsigned i ) const { return _state = i; }
239
240inline const TTrack* const TMDCWireHit::track( void ) const { return _track; }
241
242inline const TTrack* const TMDCWireHit::track( const TTrack* a ) { return _track = a; }
243
244inline const TTrack* const TMDCWireHit::track( const TTrack* a ) const { return _track = a; }
245
246inline const TMDCWireHitMC* const TMDCWireHit::mc( void ) const { return _mc; }
247
248inline const TMDCWireHitMC* const TMDCWireHit::mc( TMDCWireHitMC* a ) { return _mc = a; }
249
250inline unsigned TMDCWireHit::sequence( void ) const { return _sequentialLength; }
251
252inline unsigned TMDCWireHit::sequence( unsigned a ) const { return _sequentialLength = a; }
253
254#endif
255
256#undef inline
257
258#endif /* TMDCWireHit_FLAG_ */
HepGeom::Point3D< double > HepPoint3D
HepGeom::Point3D< double > HepPoint3D
HepPoint3D position(unsigned) const
returns left position. z is always zero.
float drift(void) const
returns drift distance.
unsigned state(unsigned newState)
sets state. Meaning of bits are written below.
float dDrift(void) const
returns drift distance error.
struct MdcRec_wirhit * reccdc(void) const
returns a pointer to RECMDC_WIRHIT.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
unsigned state(void) const
returns state.
const TTrack *const track(void) const
assigns a pointer to a TTrack.
float dDrift(unsigned) const
returns drift distance error.
unsigned sequence(unsigned) const
sets sequential length in one segment : this parameter is used in TCurlFinder now.
float drift(unsigned) const
returns drift distance.
const TMDCWireHitMC *const mc(TMDCWireHitMC *)
sets a pointer to TMDCWireHitMC.
unsigned state(unsigned newState) const
sets state. Meaning of bits are written below. (tmp)
virtual ~TMDCWireHit()
Destructor.
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
const HepPoint3D & xyPosition(void) const
returns drift time
unsigned sequence(void) const
returns sequential Length in one segment : this parameter is used in TCurlFinder now.
const TTrack *const track(const TTrack *)
assigns a pointer to a TTrack.
const TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
TMDCWireHit(TMDCWire *, MdcRec_wirhit *, float fudgeFactor)
Constructor.
const TTrack *const track(const TTrack *) const
assigns a pointer to a TTrack. (tmp)
A class to represent a track in tracking.