BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TCurlFinder.h
Go to the documentation of this file.
1#ifndef TCURLFINDER_FLAG_
2#define TCURLFINDER_FLAG_
3
4#ifdef TRKRECO_DEBUG_DETAIL
5# ifndef TRKRECO_DEBUG
6# define TRKRECO_DEBUG
7# endif
8#endif
9// #define HEP_SHORT_NAMES
10#include "CLHEP/Matrix/DiagMatrix.h"
11
12#include "TrkReco/TBuilderCurl.h"
13#include "TrkReco/TCurlFinderParameters.h"
14#include "TrkReco/TFinderBase.h"
15#include "TrkReco/TMSelector.h"
16
17using CLHEP::HepDiagMatrix;
18
19class TMDCWire;
20class TMLink;
21class TTrack;
22class TMDCWireHit;
23class TCircle;
24class TSegmentCurl;
25
26class TCurlFinder : public TFinderBase {
27
28public:
29 TCurlFinder( void );
30 ~TCurlFinder( void );
31 std::string name( void ) const;
32 std::string version( void ) const;
33
34 TCurlFinder( const unsigned min_segment, const unsigned min_salvage,
35 const double bad_distance_for_salvage, const double good_distance_for_salvage,
36 const unsigned min_sequence, const unsigned min_fullwire,
37 const double range_for_axial_search, const double range_for_stereo_search,
38 const unsigned superlayer_for_stereo_search,
39 const double range_for_axial_last2d_search,
40 const double range_for_stereo_last2d_search, const double trace2d_distance,
41 const double trace2d_first_distance, const double trace3d_distance,
42 const unsigned determine_one_track, const double selector_max_impact,
43 const double selector_max_sigma, const double selector_strange_pz,
44 const double selector_replace_dz, const unsigned stereo_2dfind,
45 const unsigned merge_exe, const double merge_ratio, const double merge_z_diff,
46 const double mask_distance, const double ratio_used_wire,
47 const double range_for_stereo1, const double range_for_stereo2,
48 const double range_for_stereo3, const double range_for_stereo4,
49 const double range_for_stereo5, const double range_for_stereo6,
50 const double z_cut, const double z_diff_for_last_attend,
51 const unsigned svd_reconstruction, const double min_svd_electrons,
52 const unsigned on_correction, const unsigned output_2dtracks,
53 const unsigned curl_version,
54 // jialk
55 const double minimum_seedLength, const double minimum_2DTrackLength,
56 const double minimum_3DTrackLength, const double minimum_closeHitsLength,
57 const double MIN_RADIUS_OF_STRANGE_TRACK,
58 const double ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK );
59
60 /// main function
61 int doit( const AList<TMDCWireHit>& axialHits, const AList<TMDCWireHit>& stereoHits,
62 AList<TTrack>& tracks, AList<TTrack>& tracks2D );
63
64 /// cleans all members of this class
65 void clear( void );
66
67private:
68 IBesMagFieldSvc* getPmgnIMF() const;
69 mutable IBesMagFieldSvc* m_pmgnIMF;
70 /// Utility Section
71 double distance( const double, const double ) const;
72 unsigned offset( const unsigned ) const;
73 unsigned layerId( const double& ) const;
74 unsigned maxLocalLayerId( const unsigned ) const;
75 int nextSuperAxialLayerId( const unsigned, const int ) const;
76 int nextSuperStereoLayerId( const unsigned, const int ) const;
77 void makeList( AList<TMLink>&, const AList<TSegmentCurl>&, const AList<TMLink>& );
78 void makeList( AList<TMLink>&, const AList<TMLink>&, const AList<TMLink>& );
79 unsigned nAxialHits( const double& ) const;
80
81 /// Sub Main Section #1
82 void makeWireHitsListsSegments( const AList<TMDCWireHit>&, const AList<TMDCWireHit>& );
83
84 /// Sub Main Section #2
85 int checkSortSegments( void );
86
87 /// Sub Main Section #3
88 void makeCurlTracks( AList<TTrack>& tracks, AList<TTrack>& tracks2D );
89
90 /// Utility of #1
91 void linkNeighboringWires( AList<TMLink>*, const unsigned );
92 void setNeighboringWires( TMLink*, const TMLink* );
93 void createSuperLayer( void );
94 void createSegments( AList<TMLink>& );
95 void searchSegment( TMLink*, AList<TMLink>&, AList<TMLink>&, TSegmentCurl* );
96 TMLink* findLink( const TMLink*, const AList<TMLink>& );
97
98 /// Utility of #2
99 void checkExceptionalSegmentsType01( void );
100 void checkExceptionalSegmentsType02( void );
101 void checkExceptionalSegmentsType03( void );
102
103 /// Utility of #3
104 /// 3D Track
105 TTrack* make3DTrack( const TCircle* );
106 TTrack* make3DTrack( const TCircle*, AList<TSegmentCurl>& );
107 void findCloseHits( AList<TMLink>&, TTrack&, AList<TMLink>& );
108 void salvage3DTrack( TTrack*, bool = true );
109 TTrack* merge3DTrack( TTrack*, AList<TTrack>& );
110 bool check3DTrack( TTrack* );
111 int trace3DTrack( TTrack* );
112 void mask3DTrack( TTrack*, AList<TMLink>& );
113 void assignTracks( void );
114 void checkRelation( AList<TTrack>& );
115 void check2DTracks( void );
116
117 /// 2D Track
118 TCircle* make2DTrack( const AList<TMLink>&, const AList<TSegmentCurl>&, const unsigned );
119 void searchAxialCand( AList<TMLink>&, const AList<TMLink>&, const TCircle*, const int,
120 const unsigned, const double );
121 void searchStereoCand( AList<TMLink>&, const AList<TMLink>&, const TCircle*, const int,
122 const unsigned, const double );
123 unsigned searchHits( const TMLink*, const TCircle*, const double ) const;
124 unsigned searchHits( AList<TMLink>&, const AList<TMLink>&, const TCircle*,
125 const double ) const;
126 unsigned checkAppendHits( const AList<TMLink>&, AList<TMLink>& ) const;
127 double distance( const TTrack&, const TMLink& ) const;
128 int trace2DTrack( TCircle* );
129 bool check2DCircle( TCircle* );
130 TCircle* dividing2DTrack( TCircle* );
131 bool fitWDD( TCircle&, double&, int& ) const;
132 void removeStereo( TCircle& ) const;
133
134 /// MC
135 int makeWithMC( const AList<TMDCWireHit>&, const AList<TMDCWireHit>&, AList<TTrack>& );
136
137 /// Plot
138 void makeCdcFrame( void );
139 void plotSegment( const AList<TMLink>&, const int flag = 1 );
140 void plotCircle( const TCircle&, const int flag = 1 );
141 void plotTrack( const TTrack&, const int flag = 1 );
142 void writeSegment( const AList<TMLink>&, const int type = 0 );
143
144 /// Dump
145 void dumpType1( TTrack* );
146 void dumpType2( TTrack* );
147
148 AList<TMLink> m_unusedAxialHitsOriginal;
149 AList<TMLink> m_unusedAxialHits;
150 AList<TMLink> m_allAxialHitsOriginal;
151
152 AList<TMLink> m_unusedStereoHitsOriginal;
153 AList<TMLink> m_unusedStereoHits;
154 AList<TMLink> m_allStereoHitsOriginal;
155
156 AList<TMLink> m_removedHits;
157
158 AList<TCircle> m_circles;
159 AList<TCircle> m_allCircles;
160 AList<TTrack> m_tracks;
161 AList<TTrack> m_allTracks;
162 AList<TTrack> m_svdTracks;
163 AList<TTrack> m_2dTracks;
164
165 AList<TMDCWireHit> m_hitsOnInnerSuperLayer;
166
167 // Liuqg
168 AList<TMLink> m_unusedAxialHitsOnEachLayer[19]; // origin is 32
169 AList<TMLink> m_unusedStereoHitsOnEachLayer[24]; // origin is 18
170 AList<TMLink> m_unusedAxialHitsOnEachSuperLayer[5]; // origin is 6
171 AList<TMLink> m_unusedStereoHitsOnEachSuperLayer[6]; // origin is 5
172 AList<TSegmentCurl> m_segmentList;
173
174 TCurlFinderParameter m_param;
175
176 TBuilderCurl m_builder;
177 TMSelector m_trackSelector;
178
179 THelixFitter m_fitter;
180
181 // for debug
182 void debugCheckSegments0( void );
183 void debugCheckSegments1( void );
184 void debugCheckSegments2( void );
185 void debugCheckSegments( const double localId, const double layerId, const double localId2,
186 const double layerId2 );
187
188 bool m_debugCdcFrame;
189 int m_debugPlotFlag;
190 int m_debugFileNumber;
191};
192
193#endif /* TCURLFINDER_FLAG_ */
A class to represent a circle in tracking.
TCurlFinder(const unsigned min_segment, const unsigned min_salvage, const double bad_distance_for_salvage, const double good_distance_for_salvage, const unsigned min_sequence, const unsigned min_fullwire, const double range_for_axial_search, const double range_for_stereo_search, const unsigned superlayer_for_stereo_search, const double range_for_axial_last2d_search, const double range_for_stereo_last2d_search, const double trace2d_distance, const double trace2d_first_distance, const double trace3d_distance, const unsigned determine_one_track, const double selector_max_impact, const double selector_max_sigma, const double selector_strange_pz, const double selector_replace_dz, const unsigned stereo_2dfind, const unsigned merge_exe, const double merge_ratio, const double merge_z_diff, const double mask_distance, const double ratio_used_wire, const double range_for_stereo1, const double range_for_stereo2, const double range_for_stereo3, const double range_for_stereo4, const double range_for_stereo5, const double range_for_stereo6, const double z_cut, const double z_diff_for_last_attend, const unsigned svd_reconstruction, const double min_svd_electrons, const unsigned on_correction, const unsigned output_2dtracks, const unsigned curl_version, const double minimum_seedLength, const double minimum_2DTrackLength, const double minimum_3DTrackLength, const double minimum_closeHitsLength, const double MIN_RADIUS_OF_STRANGE_TRACK, const double ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK)
std::string name(void) const
returns name.
int doit(const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks2D)
main function
std::string version(void) const
returns version.
~TCurlFinder(void)
void clear(void)
cleans all members of this class
TCurlFinder(void)
A virtual class for a track finder in tracking.
A class to fit a TTrackBase object to a helix.
A class to represent a track in tracking.