BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
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 : [email protected]
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 <string>
23#include <iostream>
24
25#define HEP_SHORT_NAMES
26
27
28class TTrackBase;
29class TCircle;
30
31/// A class to select a TTrackBase object.
33
34 public:
35 /// Constructor.
36 TMSelector();
37
38 /// Copy constructor.
39 TMSelector(const TMSelector &);
40
41 /// Destructor
42 virtual ~TMSelector();
43
44 public:// Selectors
45 /// dumps debug information.
46 void dump(const std::string & message = std::string(""),
47 const std::string & prefix = std::string("")) const;
48
49 /// returns min. \# of hits(TMLinks) requried.
50 unsigned nLinks(void) const;
51
52 /// returns min. \# of super layers required.
53 unsigned nSuperLayers(void) const;
54
55 /// returns min. pt required.
56 double minPt(void) const;
57
58 /// returns max. impact(2D) required.
59 double maxImpact(void) const;
60
61 /// returns min. \# of stereo hits(TMLinks) requried.
62 unsigned nLinksStereo(void) const;
63
64 /// returns max. distance required for stereo hits.
65 double maxDistance(void) const;
66
67 /// returns max. sigma for each TMLink.
68 double maxSigma(void) const;
69
70 /// returns true if given track satisfys criteria after fitting.
71 bool select(TTrackBase &) const;
72
73 /// returns true if given track satisfys criteria before fitting.
74 bool preSelect(const TTrackBase &) const;
75
76 public:// Modifiers
77 /// sets \# of hits(TMLinks) requried.
78 unsigned nLinks(unsigned);
79
80 /// sets \# of super layers required.
81 unsigned nSuperLayers(unsigned);
82
83 /// sets min. pt required.
84 double minPt(double);
85
86 /// sets max. impact(2D) required.
87 double maxImpact(double);
88
89 /// sets min. \# of stereo hits(TMLinks) requried.
90 unsigned nLinksStereo(unsigned);
91
92 /// sets max. distance required for stereo hits.
93 double maxDistance(double);
94
95 /// sets max. sigma for each TMLink.
96 double maxSigma(double);
97
98 private:
99
100 private:
101 bool _nLinksDefined;
102 bool _nSuperLayersDefined;
103 bool _minPtDefined;
104 bool _maxImpactDefined;
105 bool _maxSigmaDefined;
106
107 unsigned _nLinks;
108 unsigned _nSuperLayers;
109 double _minPt;
110 double _maxImpact;
111 double _maxSigma;
112
113 bool _nLinksStereoDefined;
114 bool _maxDistanceDefined;
115
116 unsigned _nLinksStereo;
117 double _maxDistance;
118};
119
120//-----------------------------------------------------------------------------
121
122#ifdef TMSelector_NO_INLINE
123#define inline
124#else
125#undef inline
126#define TMSelector_INLINE_DEFINE_HERE
127#endif
128
129#ifdef TMSelector_INLINE_DEFINE_HERE
130
131inline
132unsigned
134#ifdef TRKRECO_DEBUG
135 if (! _nLinksDefined)
136 std::cout << "TMSelector !!! min. nLinks is not defined" << std::endl;
137#endif
138 return _nLinks;
139}
140
141inline
142unsigned
144 _nLinksDefined = true;
145 return _nLinks = a;
146}
147
148inline
149unsigned
151#ifdef TRKRECO_DEBUG
152 if (! _nSuperLayers)
153 std::cout << "TMSelector !!! min. nSuperLayers is not defined" << std::endl;
154#endif
155 return _nSuperLayers;
156}
157
158inline
159unsigned
161 _nSuperLayersDefined = true;
162 return _nSuperLayers = a;
163}
164
165inline
166double
167TMSelector::minPt(void) const {
168#ifdef TRKRECO_DEBUG
169 if (! _minPtDefined)
170 std::cout << "TMSelector !!! min. pt is not defined" << std::endl;
171#endif
172 return _minPt;
173}
174
175inline
176double
178 _minPtDefined = true;
179 return _minPt = a;
180}
181
182inline
183double
185#ifdef TRKRECO_DEBUG
186 if (! _maxImpactDefined)
187 std::cout << "TMSelector !!! max. impact is not defined" << std::endl;
188#endif
189 return _maxImpact;
190}
191
192inline
193double
195 _maxImpactDefined = true;
196 return _maxImpact = a;
197}
198
199inline
200double
202#ifdef TRKRECO_DEBUG
203 if (! _maxSigmaDefined)
204 std::cout << "TMSelector !!! max. sigma is not defined" << std::endl;
205#endif
206 return _maxSigma;
207}
208
209inline
210double
212 _maxSigmaDefined = true;
213 return _maxSigma = a;
214}
215
216inline
217unsigned
219#ifdef TRKRECO_DEBUG
220 if (! _nLinksStereoDefined)
221 std::cout << "TMSelector !!! min. nLinksStereo is not defined" << std::endl;
222#endif
223 return _nLinksStereo;
224}
225
226inline
227unsigned
229 _nLinksStereoDefined = true;
230 return _nLinksStereo = a;
231}
232
233inline
234double
236#ifdef TRKRECO_DEBUG
237 if (! _maxDistanceDefined)
238 std::cout << "TMSelector !!! max. distance is not defined" << std::endl;
239#endif
240 return _maxDistance;
241}
242
243inline
244double
246 _maxDistanceDefined = true;
247 return _maxDistance = a;
248}
249
250#endif
251
252#undef inline
253
254#endif /* TMSelector_FLAG_ */
A class to represent a circle in tracking.
Definition: TCircle.h:42
A class to select a TTrackBase object.
Definition: TMSelector.h:32
double maxDistance(void) const
returns max. distance required for stereo hits.
Definition: TMSelector.h:235
unsigned nSuperLayers(void) const
returns min. # of super layers required.
Definition: TMSelector.h:150
TMSelector()
Constructor.
Definition: TMSelector.cxx:19
virtual ~TMSelector()
Destructor.
Definition: TMSelector.cxx:49
double maxImpact(void) const
returns max. impact(2D) required.
Definition: TMSelector.h:184
unsigned nLinks(void) const
returns min. # of hits(TMLinks) requried.
Definition: TMSelector.h:133
double maxSigma(void) const
returns max. sigma for each TMLink.
Definition: TMSelector.h:201
unsigned nLinksStereo(void) const
returns min. # of stereo hits(TMLinks) requried.
Definition: TMSelector.h:218
double minPt(void) const
returns min. pt required.
Definition: TMSelector.h:167
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.
Definition: TMSelector.cxx:123
bool select(TTrackBase &) const
returns true if given track satisfys criteria after fitting.
Definition: TMSelector.cxx:53
A virtual class for a track class in tracking.
Definition: TTrackBase.h:46