BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TMSelector.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TMSelector.h,v 1.7 2012/05/28 05:16:29 maoh Exp $
3//-----------------------------------------------------------------------------
4// Filename : TMSelector.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to select a TTrackBase object.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TMSelector_FLAG_
14#define TMSelector_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17# ifndef TRKRECO_DEBUG
18# define TRKRECO_DEBUG
19# endif
20#endif
21
22#include <iostream>
23#include <string>
24
25// #define HEP_SHORT_NAMES
26
27class TTrackBase;
28class TCircle;
29
30/// A class to select a TTrackBase object.
31class TMSelector {
32
33public:
34 /// Constructor.
36
37 /// Copy constructor.
39
40 /// Destructor
41 virtual ~TMSelector();
42
43public: // Selectors
44 /// dumps debug information.
45 void dump( const std::string& message = std::string( "" ),
46 const std::string& prefix = std::string( "" ) ) const;
47
48 /// returns min. \# of hits(TMLinks) requried.
49 unsigned nLinks( void ) const;
50
51 /// returns min. \# of super layers required.
52 unsigned nSuperLayers( void ) const;
53
54 /// returns min. pt required.
55 double minPt( void ) const;
56
57 /// returns max. impact(2D) required.
58 double maxImpact( void ) const;
59
60 /// returns min. \# of stereo hits(TMLinks) requried.
61 unsigned nLinksStereo( void ) const;
62
63 /// returns max. distance required for stereo hits.
64 double maxDistance( void ) const;
65
66 /// returns max. sigma for each TMLink.
67 double maxSigma( void ) const;
68
69 /// returns true if given track satisfys criteria after fitting.
70 bool select( TTrackBase& ) const;
71
72 /// returns true if given track satisfys criteria before fitting.
73 bool preSelect( const TTrackBase& ) const;
74
75public: // Modifiers
76 /// sets \# of hits(TMLinks) requried.
77 unsigned nLinks( unsigned );
78
79 /// sets \# of super layers required.
80 unsigned nSuperLayers( unsigned );
81
82 /// sets min. pt required.
83 double minPt( double );
84
85 /// sets max. impact(2D) required.
86 double maxImpact( double );
87
88 /// sets min. \# of stereo hits(TMLinks) requried.
89 unsigned nLinksStereo( unsigned );
90
91 /// sets max. distance required for stereo hits.
92 double maxDistance( double );
93
94 /// sets max. sigma for each TMLink.
95 double maxSigma( double );
96
97private:
98private:
99 bool _nLinksDefined;
100 bool _nSuperLayersDefined;
101 bool _minPtDefined;
102 bool _maxImpactDefined;
103 bool _maxSigmaDefined;
104
105 unsigned _nLinks;
106 unsigned _nSuperLayers;
107 double _minPt;
108 double _maxImpact;
109 double _maxSigma;
110
111 bool _nLinksStereoDefined;
112 bool _maxDistanceDefined;
113
114 unsigned _nLinksStereo;
115 double _maxDistance;
116};
117
118//-----------------------------------------------------------------------------
119
120#ifdef TMSelector_NO_INLINE
121# define inline
122#else
123# undef inline
124# define TMSelector_INLINE_DEFINE_HERE
125#endif
126
127#ifdef TMSelector_INLINE_DEFINE_HERE
128
129inline unsigned TMSelector::nLinks( void ) const {
130# ifdef TRKRECO_DEBUG
131 if ( !_nLinksDefined ) std::cout << "TMSelector !!! min. nLinks is not defined" << std::endl;
132# endif
133 return _nLinks;
134}
135
136inline unsigned TMSelector::nLinks( unsigned a ) {
137 _nLinksDefined = true;
138 return _nLinks = a;
139}
140
141inline unsigned TMSelector::nSuperLayers( void ) const {
142# ifdef TRKRECO_DEBUG
143 if ( !_nSuperLayers )
144 std::cout << "TMSelector !!! min. nSuperLayers is not defined" << std::endl;
145# endif
146 return _nSuperLayers;
147}
148
149inline unsigned TMSelector::nSuperLayers( unsigned a ) {
150 _nSuperLayersDefined = true;
151 return _nSuperLayers = a;
152}
153
154inline double TMSelector::minPt( void ) const {
155# ifdef TRKRECO_DEBUG
156 if ( !_minPtDefined ) std::cout << "TMSelector !!! min. pt is not defined" << std::endl;
157# endif
158 return _minPt;
159}
160
161inline double TMSelector::minPt( double a ) {
162 _minPtDefined = true;
163 return _minPt = a;
164}
165
166inline double TMSelector::maxImpact( void ) const {
167# ifdef TRKRECO_DEBUG
168 if ( !_maxImpactDefined )
169 std::cout << "TMSelector !!! max. impact is not defined" << std::endl;
170# endif
171 return _maxImpact;
172}
173
174inline double TMSelector::maxImpact( double a ) {
175 _maxImpactDefined = true;
176 return _maxImpact = a;
177}
178
179inline double TMSelector::maxSigma( void ) const {
180# ifdef TRKRECO_DEBUG
181 if ( !_maxSigmaDefined )
182 std::cout << "TMSelector !!! max. sigma is not defined" << std::endl;
183# endif
184 return _maxSigma;
185}
186
187inline double TMSelector::maxSigma( double a ) {
188 _maxSigmaDefined = true;
189 return _maxSigma = a;
190}
191
192inline unsigned TMSelector::nLinksStereo( void ) const {
193# ifdef TRKRECO_DEBUG
194 if ( !_nLinksStereoDefined )
195 std::cout << "TMSelector !!! min. nLinksStereo is not defined" << std::endl;
196# endif
197 return _nLinksStereo;
198}
199
200inline unsigned TMSelector::nLinksStereo( unsigned a ) {
201 _nLinksStereoDefined = true;
202 return _nLinksStereo = a;
203}
204
205inline double TMSelector::maxDistance( void ) const {
206# ifdef TRKRECO_DEBUG
207 if ( !_maxDistanceDefined )
208 std::cout << "TMSelector !!! max. distance is not defined" << std::endl;
209# endif
210 return _maxDistance;
211}
212
213inline double TMSelector::maxDistance( double a ) {
214 _maxDistanceDefined = true;
215 return _maxDistance = a;
216}
217
218#endif
219
220#undef inline
221
222#endif /* TMSelector_FLAG_ */
A class to represent a circle in tracking.
double maxSigma(double)
sets max. sigma for each TMLink.
double minPt(double)
sets min. pt required.
double maxImpact(double)
sets max. impact(2D) required.
double maxDistance(void) const
returns max. distance required for stereo hits.
unsigned nSuperLayers(void) const
returns min. # of super layers required.
TMSelector()
Constructor.
unsigned nSuperLayers(unsigned)
sets # of super layers required.
unsigned nLinksStereo(unsigned)
sets min. # of stereo hits(TMLinks) requried.
unsigned nLinks(unsigned)
sets # of hits(TMLinks) requried.
double maxImpact(void) const
returns max. impact(2D) required.
double maxDistance(double)
sets max. distance required for stereo hits.
unsigned nLinks(void) const
returns min. # of hits(TMLinks) requried.
double maxSigma(void) const
returns max. sigma for each TMLink.
virtual ~TMSelector()
Destructor.
unsigned nLinksStereo(void) const
returns min. # of stereo hits(TMLinks) requried.
double minPt(void) const
returns min. pt required.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
bool preSelect(const TTrackBase &) const
returns true if given track satisfys criteria before fitting.
bool select(TTrackBase &) const
returns true if given track satisfys criteria after fitting.
TMSelector(const TMSelector &)
Copy constructor.
A virtual class for a track class in tracking.