BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MucRecEvent/MucRecEvent/RecMucTrack.h
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2004/03/08 Zhengyun You Peking University
7 *
8 * 2004/09/12 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
12#ifndef REC_MUC_TRACK_H
13#define REC_MUC_TRACK_H
14
15#include "GaudiKernel/ContainedObject.h"
16#include "GaudiKernel/SmartRef.h"
17#include "GaudiKernel/ObjectVector.h"
18#include "EventModel/EventModel.h"
19#include "Identifier/Identifier.h"
20#include "ExtEvent/RecExtTrack.h"
21#include "DstEvent/DstMucTrack.h"
22
23#include "MucRecEvent/MucRecHit.h"
24
25/**
26 * Describes a track found in the muon chamber.
27 *
28 * A track is originated from a track reconstructed in MDC, and has its
29 * intersection and direction on MUC start surface, which is extrapolated
30 * from MDC track. Methods include projecting along the trajectory to each
31 * gap, including hits in search window, modifing intersectins, and then
32 * projecting the trajectory to the next gap.
33 *
34 * @author Zhengyun You \URL{mailto:[email protected]}
35 *
36 */
37
38extern const CLID &CLID_RecMucTrack;
39
41{
42 public:
43
44 virtual const CLID& clID() const
45 {
46 return RecMucTrack::classID();
47 }
48
49 static const CLID& classID()
50 {
51 return CLID_RecMucTrack;
52 }
53
54
55 /// Constructor.
57
58 /// Assignment constructor.
59 RecMucTrack& operator=(const RecMucTrack& orig);
60
61 /// Copy constructor.
62 RecMucTrack(const RecMucTrack& source);
63
64 /// Assignment constructor from DstMucTrack.
65 RecMucTrack& operator=(const DstMucTrack& dstTrack);
66
67 /// Copy constructor from DstMucTrack.
68 RecMucTrack(const DstMucTrack& dstTrack);
69
70 /// Destructor.
72
73 void SetDefault();
74
75 /// set the index for this track.
76 void setTrackId(const int trackId);
77
78 /// set start position of the track in Mdc.
79 void SetMdcPos(const float x,
80 const float y,
81 const float z);
82
83 /// set start moment of the track in Mdc.
84 void SetMdcMomentum(const float px,
85 const float py,
86 const float pz);
87
88 /// set start position of ext track in Muc. (compute from MdcPos MdcMomentum or get from ExtTrack)
89 void SetExtMucPos(const float x,
90 const float y,
91 const float z);
92
93 /// set start moment of ext track in Muc.
94 void SetExtMucMomentum(const float px,
95 const float py,
96 const float pz);
97
98 /// set start position of the track in Muc. (after line fit and correction)
99 void SetMucPos(const float x,
100 const float y,
101 const float z);
102
103 void SetMucPosSigma(const float sigmax,
104 const float sigmay,
105 const float sigmaz);
106
107
108 /// set start moment of the track in Muc.
109 void SetMucMomentum(const float px,
110 const float py,
111 const float pz);
112
113 /// set current position of the trajectory.
114 void SetCurrentPos(const float x,
115 const float y,
116 const float z);
117
118 /// set current direction of the trajectory.
119 void SetCurrentDir(const float x,
120 const float y,
121 const float z);
122
123 /// set current intersection of the trajectory with strip plane.
124 void SetCurrentInsct(const float x,
125 const float y,
126 const float z);
127
128 /// set Ext track point.
129 void SetExtTrack(RecExtTrack* extTrack);
130
131 /// set Ext track id. for compute from mdc myself
132 void SetExtTrackID(int id) { m_ExtTrackID = id; }
133
134 /// compute ext track myself from mdc.
135 void GetMdcExtTrack(Hep3Vector mdcStartPos, Hep3Vector mdcStartMomentum, int charge,
136 Hep3Vector& mucStartPos, Hep3Vector& mucStartMomentum);
137
138
139 bool IsInsideSuperConductor(Hep3Vector pos);
140
141 /// set corresponding monte carlo track pointer.
142 //void SetMCTrack(const BesPersTrack* mcTrack);
143
144 /// Attach the given hit to this track.
145 void AttachHit(MucRecHit* hit);
146
147 /// Where does the trajectory of this track intersect a specific gap?
148 void Project(const int& part, const int& gap,
149 float& x, float& y, float& z,
150 int& seg);
151
152 /// Calculate the distance of the hit to the intersection in read direction.
153 float GetHitDistance(const MucRecHit* hit);
154
155 /// no abs value
156 float GetHitDistance2(const MucRecHit* hit);
157
158 /// Calculate intersection from all hits attached on this gap.
159 Hep3Vector CalculateInsct(const int part,
160 const int seg,
161 const int gap);
162
163 /// Attach the intersection to this trajectory.
164 void AttachInsct(Hep3Vector insct);
165
166 /// Attach the direction to this trajectory.
167 void AttachDirection(Hep3Vector dir);
168
169 /// Correct direction of this trajectory.
170 void CorrectDir();
171
172 /// Correct current position of this trajectory.
173 void CorrectPos();
174
175 /// Where does the trajectory of this track intersect the reference plane?
176 //void ProjectToReference(float& x, float& y, float& z);
177
178 /// Where does the trajectory of this track intersect a z=const plane?
179 //void ProjectToZ(float& x, float& y, float& zplane);
180
181 /// Transform the Phi, ZR cord. to ZX, ZY cord.
182 //void TransformPhiRToXY(const float& vk, const float& vr,
183 // const float& k0, const float& r0,
184 // float& vx, float& vy,
185 // float& x0, float& y0) const;
186
187
188 /// The identifier of the Ext track as seed.
189 int getExtTrackID() const { return m_ExtTrackID; }
190
191 /// start position of the Ext track in Muc.
192 Hep3Vector getExtMucPos() const { return m_ExtMucPos/10; }
193
194 /// Start momentum of the Ext track in Muc.
195 Hep3Vector getExtMucMomentum() const { return m_ExtMucMomentum/1000; }
196
197 /// start position of this track in Muc.
198 Hep3Vector getMucPos() const { return m_MucPos/10; }
199
200 Hep3Vector getMucPosSigma() const { return m_MucPosSigma/10; }
201
202 /// Start momentum of this track in Muc.
203 Hep3Vector getMucMomentum() const { return m_MucMomentum/1000; }
204
205 /// momentum of this track in Mdc
206 Hep3Vector getMdcMomentum() const { return m_MdcMomentum/1000; }
207
208 /// Current position.
209 Hep3Vector GetCurrentPos() const { return m_CurrentPos/10; }
210
211 /// Current direction.
212 Hep3Vector GetCurrentDir() const { return m_CurrentDir/1000; }
213
214 /// Current intersection.
215 Hep3Vector GetCurrentInsct() const { return m_CurrentInsct; } //internal
216
217 /// Comute last gap in barrel and endcap.
218 void ComputeLastGap();
219
220 /// Which gap on Barrel is the first one with hits attached to this track?
221 int brFirstLayer() const { return m_brFirstLayer; }
222
223 /// Which gap on EndCap is the first one with hits attached to this track?
224 int ecFirstLayer() const { return m_ecFirstLayer; }
225
226
227 /// Line fit with hits on a seg with max hits.
228 void LineFit(int fittingMethod);
229
230 /// chi2 of line fit
231 //float GetChi2() const { return m_Chi2; }
232
233 /// degree of freedom in line fit
234 //float GetDof() const { return m_Dof; }
235
236 /// rms of distance from hit to track
237 //float GetRms() const { return m_Rms; }
238
239 /// Compute depth.
240 void ComputeDepth();
241
242 /// Compute depth.
243 int ComputeDepth(int method);
244
245 /// Compute distance match //2006.11.08
247
248 /// Extend mucpos and extmucpos to first layer of muc
249 void Extend();
250
251 /// Length of the track penetrating in iron absorber.
252 float GetDepth3() const { return m_depth_3/10; }
253
254 void SetRecMode(int recmode) {m_recmode = recmode;}
255
256 int GetRecMode() const {return m_recmode;}
257
258 /// Distance match of the ext track with muc track in first layer
259 Hep3Vector GetExtMucDistance() const { return m_Dist_muc_ext;}
260
261 Hep3Vector GetMucStripPos() const { return m_StripPhi;}
262
263 /// ComputeNGapsWithHits;
264 void ComputeNGapsWithHits();
265
266 /// How many gaps provide hits attached to this track?
267 int GetNGapsWithHits() const { return m_numLayers; }
268
269 /// How many hits in all does this track contain?
270 int GetTotalHits() const;
271
272 /// How many hits per gap does this track contain?
273 int GetHitInGap(const int part, const int gap) const;
274
275 /// How many hits does a segment contains.
276 int GetHitInSeg(const int part, const int seg) const;
277
278 /// How many hits does a segment contains in one orient.
279 int GetHitInSegOrient(const int part, const int seg, const int orient) const;
280
281 /// Find the segment which contains most hits, return max hits number.
282 int FindSegWithMaxHits(int &part, int &seg);
283
284 /// ComputeMaxHitsInGap;
285 void ComputeMaxHitsInGap();
286
287 /// How many hits were attached in the gap with the most attached hits?
288 //int GetMaxHitsInGap() const { return m_MaxHitsInLayer; }
289
290 /// Does this track contains an assigned hit?
291 bool HasHit(const int part, const int seg, const int gap, const int strip) const;
292
293 /// Does this track contain any hits in the given gap?
294 bool HasHitInGap(const int part, const int gap) const;
295
296 /// How many hits do two tracks share?
297 int GetNSharedHits(const RecMucTrack* track) const;
298
299 /// Get a pointer to the first hit attached in a particular gap.
300 MucRecHit* GetHit(const int part, const int gap) const;
301
302 /// Get all hits on this track
303 vector<MucRecHit*> GetHits() const;
304
305 vector<int> getVecHits() const { return m_vecHits ;}
306
307 vector<MucRecHit*> GetExpectedHits() const;
308
309 vector<int> getExpHits() const { return m_expHits ;}
310
311 vector<float> getDistHits() const { return m_distHits ;}
312
313 vector<float> getQuadDistHits() const { return m_distHits_quad ;}
314
315 vector<float> getExtDistHits() const { return m_distHits_ext ;}
316
317 /// Get indices of all hits in the track.
318 vector<long> GetHitIndices() const;
319
320 /// Get corresponding monte carlo track pointer.
321 //BesPersTrack* GetMCTrack() const { return m_MCTrack; }
322
323 /// Compute all infomation of this track;
324 void ComputeTrackInfo(int fittingmethod);
325
326 /// Print Hits Infomation.
327 void PrintHitsInfo() const;
328
329 /// change unit
330 void OutputUnitChange();
331
332 /// reload setVecHits
333 void setVecHits(vector<MucRecHit*>& pHits);
334
335 void setExpHits(vector<MucRecHit*>& pHits);
336
337 void setVecHits(vector<int>& vechits){ m_vecHits = vechits;}
338
339 void setExpHits(vector<int>& exphits){ m_expHits = exphits;}
340
341 void setDistHits(vector<float>& disthits){ m_distHits = disthits;}
342
343 void setQuadDistHits(vector<float>& disthits){ m_distHits_quad = disthits;}
344
345 void setExtDistHits(vector<float>& disthits){ m_distHits_ext = disthits;}
346
347 void pushExtDistHits(float dist){m_distHits_ext.push_back(dist);}
348private:
349
350 int m_ExtTrackID; // identifier of the Ext track used as seed of this track
351 RecExtTrack *m_ExtTrack; // pointer to the Ext track as seed of this track
352
353 Hep3Vector m_MdcPos; // Start position of the ext track in Mdc
354 Hep3Vector m_MdcMomentum; // Start Momentum of the ext track in Mdc
355
356 Hep3Vector m_ExtMucPos; // position of the ext track in Muc
357 Hep3Vector m_ExtMucMomentum; // Momentum of the ext track in Muc
358
359 Hep3Vector m_MucPos; // Start position of the track in Muc
360 Hep3Vector m_MucMomentum; // Start Momentum of the track in Muc
361 Hep3Vector m_MucPosSigma;
362
363 Hep3Vector m_CurrentPos; // track current position
364 Hep3Vector m_CurrentDir; // track current direction
365 Hep3Vector m_CurrentInsct; // track current intersection
366 Hep3Vector m_Dist_muc_ext;
367 Hep3Vector m_StripPhi; // use to calc phi of strip in first layer
368
369 int m_brFirstLayer; // first gap of the track in barrel. 20070604
370 int m_ecFirstLayer; // first gap of the track in endcap. 20070604
371 int m_ecPart; // whic part of endcap
372
373 float m_depth_3; // compare with m_depth
374 int m_recmode; // 0: mdc ext; 1: emc ext
375 int m_Good3DLine;
376 int m_Good3DPart;
377 bool m_changeUnit;
378 Hep3Vector m_IntersectionInner[9]; //intersection of this track with inner surface this gap
379 Hep3Vector m_IntersectionOuter[9]; //intersection of this track with outer surface this gap
380
381 //BesPersTrack *m_MCTrack; // Pointer to monte carlo track
382 vector<int> m_vecHits;
383 vector<int> m_expHits;
384 vector<float> m_distHits;
385 vector<float> m_distHits_quad;
386 vector<float> m_distHits_ext;
387 vector<MucRecHit*> m_pHits; // Pointers to attached hits
388 vector<MucRecHit*> m_pExpectedHits; // Pointers to expected hits
389 vector<Hep3Vector> m_Intersections; // Container of intersection points
390 vector<Hep3Vector> m_Directions; // Container of track direction on intersection points
391
392};
393
394typedef ObjectVector<RecMucTrack> RecMucTrackCol;
395
396#endif /* MUC_TRACK_H */
397
ObjectVector< RecMucTrack > RecMucTrackCol
const CLID & CLID_RecMucTrack
Definition: EventModel.cxx:344
const CLID & CLID_RecMucTrack
Definition: EventModel.cxx:344
int GetTotalHits() const
How many hits in all does this track contain?
void LineFit(int fittingMethod)
Line fit with hits on a seg with max hits.
void CorrectPos()
Correct current position of this trajectory.
void PrintHitsInfo() const
Print Hits Infomation.
void CorrectDir()
Correct direction of this trajectory.
void ComputeTrackInfo(int fittingmethod)
Get corresponding monte carlo track pointer.
int GetNGapsWithHits() const
How many gaps provide hits attached to this track?
void SetDefault()
void SetMdcMomentum(const float px, const float py, const float pz)
set start moment of the track in Mdc.
void setExpHits(vector< MucRecHit * > &pHits)
void SetMucPosSigma(const float sigmax, const float sigmay, const float sigmaz)
MucRecHit * GetHit(const int part, const int gap) const
Get a pointer to the first hit attached in a particular gap.
Hep3Vector getMucPos() const
start position of this track in Muc.
bool IsInsideSuperConductor(Hep3Vector pos)
int GetHitInSeg(const int part, const int seg) const
How many hits does a segment contains.
~RecMucTrack()
Destructor.
void AttachInsct(Hep3Vector insct)
Attach the intersection to this trajectory.
int brFirstLayer() const
Which gap on Barrel is the first one with hits attached to this track?
void SetExtMucPos(const float x, const float y, const float z)
set start position of ext track in Muc. (compute from MdcPos MdcMomentum or get from ExtTrack)
Hep3Vector getExtMucMomentum() const
Start momentum of the Ext track in Muc.
int GetNSharedHits(const RecMucTrack *track) const
How many hits do two tracks share?
void ComputeNGapsWithHits()
ComputeNGapsWithHits;.
void SetExtTrackID(int id)
set Ext track id. for compute from mdc myself
void SetMdcPos(const float x, const float y, const float z)
set start position of the track in Mdc.
void SetCurrentDir(const float x, const float y, const float z)
set current direction of the trajectory.
void ComputeDepth()
chi2 of line fit
float GetHitDistance(const MucRecHit *hit)
Calculate the distance of the hit to the intersection in read direction.
void SetExtTrack(RecExtTrack *extTrack)
set Ext track point.
void setTrackId(const int trackId)
set the index for this track.
bool HasHit(const int part, const int seg, const int gap, const int strip) const
How many hits were attached in the gap with the most attached hits?
Hep3Vector GetExtMucDistance() const
Distance match of the ext track with muc track in first layer.
void GetMdcExtTrack(Hep3Vector mdcStartPos, Hep3Vector mdcStartMomentum, int charge, Hep3Vector &mucStartPos, Hep3Vector &mucStartMomentum)
compute ext track myself from mdc.
void ComputeMaxHitsInGap()
ComputeMaxHitsInGap;.
Hep3Vector GetCurrentDir() const
Current direction.
int GetHitInGap(const int part, const int gap) const
How many hits per gap does this track contain?
int FindSegWithMaxHits(int &part, int &seg)
Find the segment which contains most hits, return max hits number.
Hep3Vector getMdcMomentum() const
momentum of this track in Mdc
Hep3Vector CalculateInsct(const int part, const int seg, const int gap)
Calculate intersection from all hits attached on this gap.
void Project(const int &part, const int &gap, float &x, float &y, float &z, int &seg)
Where does the trajectory of this track intersect a specific gap?
void SetMucMomentum(const float px, const float py, const float pz)
set start moment of the track in Muc.
void setVecHits(vector< MucRecHit * > &pHits)
reload setVecHits
Hep3Vector GetCurrentInsct() const
Current intersection.
vector< long > GetHitIndices() const
Get indices of all hits in the track.
int GetHitInSegOrient(const int part, const int seg, const int orient) const
How many hits does a segment contains in one orient.
void SetExtMucMomentum(const float px, const float py, const float pz)
set start moment of ext track in Muc.
int getExtTrackID() const
Where does the trajectory of this track intersect the reference plane?
RecMucTrack & operator=(const RecMucTrack &orig)
Assignment constructor.
Definition: RecMucTrack.cxx:84
vector< MucRecHit * > GetHits() const
Get all hits on this track.
void AttachHit(MucRecHit *hit)
set corresponding monte carlo track pointer.
Hep3Vector GetCurrentPos() const
Current position.
void SetCurrentInsct(const float x, const float y, const float z)
set current intersection of the trajectory with strip plane.
void ComputeDistanceMatch()
Compute distance match //2006.11.08.
void OutputUnitChange()
change unit
Hep3Vector getMucMomentum() const
Start momentum of this track in Muc.
void SetCurrentPos(const float x, const float y, const float z)
set current position of the trajectory.
vector< MucRecHit * > GetExpectedHits() const
int ecFirstLayer() const
Which gap on EndCap is the first one with hits attached to this track?
Hep3Vector getExtMucPos() const
start position of the Ext track in Muc.
float GetDepth3() const
Length of the track penetrating in iron absorber.
void SetMucPos(const float x, const float y, const float z)
set start position of the track in Muc. (after line fit and correction)
float GetHitDistance2(const MucRecHit *hit)
no abs value
void Extend()
Extend mucpos and extmucpos to first layer of muc.
bool HasHitInGap(const int part, const int gap) const
Does this track contain any hits in the given gap?
void ComputeLastGap()
Comute last gap in barrel and endcap.
RecMucTrack()
Constructor.
Definition: RecMucTrack.cxx:26
void AttachDirection(Hep3Vector dir)
Attach the direction to this trajectory.
double y[1000]
float charge