BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TConformalFinder.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TConformalFinder.h,v 1.24 2012/05/28 05:16:29 maoh Exp $
3//-----------------------------------------------------------------------------
4// Filename : TConformalFinder.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to find tracks with the conformal method.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TConformalFinder_FLAG_
14#define TConformalFinder_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17# ifndef TRKRECO_DEBUG
18# define TRKRECO_DEBUG
19# endif
20#endif
21// #define HEP_SHORT_NAMES
22#include "CLHEP/Alist/ConstAList.h"
23#include "TrkReco/TBuilder.h"
24#include "TrkReco/TFinderBase.h"
25#include "TrkReco/TMLink.h"
26#include "TrkReco/TSegment.h"
27
28#ifdef TRKRECO_DEBUG
29# define ConformalInitialization 0
30# define ConformalFast2DLevel0 10
31# define ConformalFast2DLevel1 11
32# define ConformalFast3DLevel0 20
33# define ConformalFast3DLevel1 21
34# define ConformalSlow2D 40
35# define ConformalSlow3D 41
36# define ConformalOutside 99
37#endif
38#ifdef TRKRECO_WINDOW
39# include "TrkReco/TWindow.h"
40#endif
41
42class TMDC;
43class TPoint2D;
44
45/// A class to find tracks with the conformal method.
46class TConformalFinder : public TFinderBase {
47
48public:
49 /// Constructor.
50 TConformalFinder( unsigned fastFinder, unsigned slowFinder, unsigned perfectSegmentFinding,
51 float maxSigma, float maxSigmaStereo, float salvageLevel,
52 unsigned minNLinksForSegment, unsigned minNCoreLinks,
53 unsigned minNSegments, unsigned salvageLoadWidth, unsigned stereoMode,
54 unsigned stereoLoadWidth, float szSegmentDistance, float szLinkDistance,
55 unsigned fittingFlag );
56
57 /// Destructor
59
60public: // Selectors
61 /// returns name.
62 std::string name( void ) const;
63
64 /// returns version.
65 std::string version( void ) const;
66
67 /// dumps debug information.
68 void dump( const std::string& message = std::string( "" ),
69 const std::string& prefix = std::string( "" ) ) const;
70
71 /// returns T0 reset is done.
72 bool T0ResetDone( void ) const;
73
74public: // Modifiers
75 /// clear internal information.
76 void clear( void );
77
78 /// finds tracks.
79 int doit( const AList<TMDCWireHit>& axialHits, const AList<TMDCWireHit>& stereoHits,
80 AList<TTrack>& tracks, AList<TTrack>& tracks2D );
81
82 /// sets a flag to do T0 reset in the fast 2D finding.
83 bool doT0Reset( bool );
84
85private:
86 /// selects good hits.
87 void selectGoodHits( void );
88
89 /// finds segments from _goodHits.
90 void findSegments( void );
91 void findSegmentsPerfect( void );
92 /// finds segments from all hits.
93 void findSegmentsTsf( void );
94
95 /// links segments.
96 void linkSegments( unsigned level );
97 void linkSegmentsTsf( void );
98
99 /// fast findings. level:0/1:selection of segments to be used
100 void fastFinding2D( unsigned level );
101 void fastFinding3D( unsigned level );
102
103 /// slow findings. level:0/1:selection of segments to be used
104 void slowFinding2D( unsigned level );
105 TTrack* expand( AList<TSegment>& ) const;
106 TTrack* expand( TTrack& ) const;
107 void targetSuperLayer( unsigned ptn, unsigned& in, unsigned& out ) const;
108 AList<TSegment> targetSegments( const TTrack&, unsigned sl ) const;
109 AList<TMLink> targetLinks( const TTrack&, unsigned sl ) const;
110 bool trackQuality( const TTrack& ) const;
111
112 /// finds setereo segments.
113 AList<TSegment> stereoSegments( const TTrack& t ) const;
114 AList<TSegment> stereoSegmentsFromBadHits( const TTrack& t ) const;
115
116 /// salvages segments.
117 void salvage( TTrack& track, unsigned axialStereoSwitch, const AList<TSegment>& bads ) const;
118
119 /// removes bad segments.
120 AList<TSegment> removeBadSegments( TTrack& ) const;
121 AList<TSegment> refineSegments( const TTrack& ) const;
122 void refineLinks( TTrack&, unsigned minNHits ) const;
123
124 /// resolves multi-assignment of segments/hits.
125 void resolveSegments( AList<TTrack>& tracks ) const;
126 void resolveHits( AList<TTrack>& tracks ) const;
127
128 /// remove used segments.
129 void removeUsedSegments( const AList<TTrack>& tracks );
130
131 /// deletes a track.
132 void deleteTrack( TTrack& ) const;
133
134 /// re-calculate TMLinks.
135 void updateTLinks( AList<TTrack>& tracks );
136
137 /// Utility functions
138 int crossPoints( const TTrack&, TPoint2D points[12] ) const;
139 int crossPointsInConformal( const AList<TSegment>&, HepPoint3D points[12] ) const;
140 AList<TSegment> pickUpSegments( const TPoint2D p[12], float loadWidth,
141 unsigned axialStereo ) const;
142 AList<TSegment> pickUpSegmentsInConformal( float phi[12], float loadWidth,
143 unsigned axialStereo ) const;
144 AList<TMLink> pickUpLinks( const TPoint2D p[12], float loadWidth,
145 unsigned axialStereo ) const;
146 AList<TMLink> pickUpLinksInConformal( float phi[12], float loadWidth,
147 unsigned axialStereo ) const;
148 AList<TMLink> trackSide( const TTrack&, const AList<TMLink>& ) const;
149 AList<TSegment> trackSide( const TTrack&, const AList<TSegment>& ) const;
150 bool quality2D( TTrack& t, unsigned level ) const;
151 TSegment* link( const TSegment& seed, const HepPoint3D& p, const HepVector3D& v,
152 const AList<TSegment>& candidates, AList<TSegment>& alternatives,
153 unsigned level ) const;
154 HepVector3D direction( const TSegment& ) const;
155
156public: // Utility functions
157 static const TMDCWire* conformal2Wire( const HepPoint3D& conformalPoint );
158
159private: // Parameters
160 bool _doT0Reset;
161 const unsigned _perfectSegmentFinding;
162 const unsigned _segmentSeparation;
163 const unsigned _minNLinksForSegment;
164 const unsigned _minNLinksForSegmentInRefine;
165 const unsigned _maxNLinksForSegment;
166 const unsigned _maxWidthForSegment;
167 const unsigned _minNCoreLinks;
168 const unsigned _minNSegments;
169 const float _minUsedFractionSlow2D;
170 const unsigned _appendLoad;
171 const unsigned _salvageLoadWidth;
172 const unsigned _stereoMode;
173 const unsigned _stereoLoadWidth;
174 float _linkMaxDistance[3];
175 float _linkMinDirAngle[3];
176
177private:
178 IBesMagFieldSvc* getPmgnIMF() const;
179 mutable IBesMagFieldSvc* m_pmgnIMF;
180 const bool _fastFinder;
181 const bool _slowFinder;
182 const TBuilder _builder;
183 const float _maxSigma2;
184
185 AList<TMLink> _allHits[3]; // 0:axial, 1:stereo, 2:both
186 AList<TMLink> _hits[3]; // 0:axial, 1:stereo, 2:both
187 AList<TMLink> _unused[3]; // 0:axial, 1:stereo, 2:both
188
189 AList<TSegment> _allSegments[2][6]; // 0:axial, 1:stereo
190 AList<TSegment> _allUnused[2][6]; // 0:axial, 1:stereo
191 AList<TSegment> _stereoBadSegments;
192
193 AList<TTrack> _2DTracks;
194 AList<TTrack> _3DTracks;
195
196 bool _T0ResetDone;
197
198 struct summary {
199 unsigned _nEvents;
200 unsigned _nTracksFast3D;
201 unsigned _nTracksSlow3D;
202 unsigned _nTracksFast2D;
203 unsigned _nTracksSlow2D;
204 unsigned _nTracksFast2DBadQuality;
205 unsigned _nTracksSlow2DBadQuality;
206 unsigned _dummy;
207 };
208 struct summary* _s;
209
210#ifdef TRKRECO_DEBUG
211public:
212 static unsigned _stage;
213#endif
214
215#ifdef TRKRECO_WINDOW
216private:
217 mutable TWindow _rphiWindow;
218
219public:
220 void displayStatus( const std::string& message ) const;
221 void displayAppendSegments( const AList<TSegment> a[2][6], leda_color = leda_black ) const;
222 void displayTracks( const AList<TTrack>&, const AList<TSegment> seg[2][6],
223 const std::string& text ) const;
224#endif
225};
226
227//-----------------------------------------------------------------------------
228
229#ifdef TConformalFinder_NO_INLINE
230# define inline
231#else
232# undef inline
233# define TConformalFinder_INLINE_DEFINE_HERE
234#endif
235
236#ifdef TConformalFinder_INLINE_DEFINE_HERE
237
238inline std::string TConformalFinder::name( void ) const { return "Conformal Finder"; }
239
240inline bool TConformalFinder::doT0Reset( bool a ) { return _doT0Reset = a; }
241
242inline bool TConformalFinder::T0ResetDone( void ) const { return _T0ResetDone; }
243
244#endif
245
246#undef inline
247
248#endif /* TConformalFinder_FLAG_ */
HepGeom::Vector3D< double > HepVector3D
HepGeom::Point3D< double > HepPoint3D
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
A class to find tracks with the conformal method.
virtual ~TConformalFinder()
Destructor.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
static const TMDCWire * conformal2Wire(const HepPoint3D &conformalPoint)
void clear(void)
clear internal information.
int doit(const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks2D)
finds tracks.
bool T0ResetDone(void) const
returns T0 reset is done.
std::string version(void) const
returns version.
bool doT0Reset(bool)
sets a flag to do T0 reset in the fast 2D finding.
std::string name(void) const
returns name.
TConformalFinder(unsigned fastFinder, unsigned slowFinder, unsigned perfectSegmentFinding, float maxSigma, float maxSigmaStereo, float salvageLevel, unsigned minNLinksForSegment, unsigned minNCoreLinks, unsigned minNSegments, unsigned salvageLoadWidth, unsigned stereoMode, unsigned stereoLoadWidth, float szSegmentDistance, float szLinkDistance, unsigned fittingFlag)
Constructor.
A virtual class for a track finder in tracking.
A class to relate TMDCWireHit and TTrack objects.
A class to represent a track in tracking.
int t()
Definition t.c:1