BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
TMSelector.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TMSelector.cxx,v 1.1 2006/10/12 07:52:00 liuqg Exp $
3//-----------------------------------------------------------------------------
4// Filename : TMSelector.cc
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#include "TrkReco/TMSelector.h"
14#include "TrkReco/TTrackBase.h"
15#include "TrkReco/TTrack.h"
16#include "TrkReco/TCircle.h"
17#include "TrkReco/TMLink.h"
18
20: _nLinksDefined(false),
21 _nLinks(0),
22 _nSuperLayersDefined(false),
23 _nSuperLayers(0),
24 _minPtDefined(false),
25 _minPt(0.),
26 _maxImpactDefined(false),
27 _maxImpact(0.),
28 _nLinksStereoDefined(false),
29 _nLinksStereo(0),
30 _maxDistanceDefined(false),
31 _maxDistance(0.) {
32}
33
35: _nLinksDefined(a._nLinksDefined),
36 _nLinks(a._nLinks),
37 _nSuperLayersDefined(a._nSuperLayersDefined),
38 _nSuperLayers(a._nSuperLayers),
39 _minPtDefined(a._minPtDefined),
40 _minPt(a._minPt),
41 _maxImpactDefined(a._maxImpactDefined),
42 _maxImpact(a._maxImpact),
43 _nLinksStereoDefined(a._nLinksStereoDefined),
44 _nLinksStereo(a._nLinksStereo),
45 _maxDistanceDefined(a._maxDistanceDefined),
46 _maxDistance(a._maxDistance) {
47}
48
50}
51
52bool
54
55#ifdef TRKRECO_DEBUG_DETAIL
56 if (! b.fitted()) {
57 std::cout << " TSelect::select !!! not fitted yet" << std::endl;
58 }
59#endif
60
61 if (b.objectType() == Track) {
62 TTrack & a = (TTrack &) b;
63
64 if (_minPtDefined) {
65 if (a.pt() < _minPt) {
66#ifdef TRKRECO_DEBUG_DETAIL
67 std::cout << " TSelect ... rejected by min. pt(";
68 std::cout << a.pt() << ") < ";
69 std::cout << _minPt << std::endl;
70#endif
71 return false;
72 }
73 }
74
75 if (_maxImpactDefined) {
76 if (fabs(a.impact()) > _maxImpact) {
77#ifdef TRKRECO_DEBUG_DETAIL
78 std::cout << " TSelect ... rejected by max. impact(";
79 std::cout << a.impact() << ") < ";
80 std::cout << _maxImpact << std::endl;
81#endif
82 return false;
83 }
84 }
85 }
86 else if (b.objectType() == Circle) {
87 TCircle & a = (TCircle &) b;
88
89 if (_minPtDefined) {
90 if (a.pt() < _minPt) {
91#ifdef TRKRECO_DEBUG_DETAIL
92 std::cout << " TSelect ... rejected by min. pt(";
93 std::cout << a.pt() << ") < ";
94 std::cout << _minPt << std::endl;
95#endif
96 return false;
97 }
98 }
99
100 if (_maxImpactDefined) {
101 if (fabs(a.impact()) > _maxImpact) {
102#ifdef TRKRECO_DEBUG_DETAIL
103 std::cout << " TSelect ... rejected by max. impact(";
104 std::cout << a.impact() << ") < ";
105 std::cout << _maxImpact << std::endl;
106#endif
107 return false;
108 }
109 }
110 }
111 else {
112 std::cout << "TMSelector !!! Unknown object type" << std::endl;
113 return false;
114 }
115
116#ifdef TRKRECO_DEBUG_DETAIL
117 std::cout << " TSelect::select ... accepted" << std::endl;
118#endif
119 return true;
120}
121
122bool
124 if (_nLinksDefined) {
125 if (a.nLinks() < _nLinks) {
126#ifdef TRKRECO_DEBUG_DETAIL
127 std::cout << " TSelect ... rejected by nLinks(";
128 std::cout << a.nLinks() << ") < ";
129 std::cout << _nLinks << std::endl;
130#endif
131 return false;
132 }
133 }
134
135 if (_nSuperLayersDefined) {
136 if (NSuperLayers(a.links()) < _nSuperLayers) {
137#ifdef TRKRECO_DEBUG_DETAIL
138 std::cout << " TSelect ... rejected by nSuperLayers(";
139 std::cout << NSuperLayers(a.links()) << ") < ";
140 std::cout << _nSuperLayers << std::endl;
141#endif
142 return false;
143 }
144 }
145
146#ifdef TRKRECO_DEBUG_DETAIL
147 std::cout << " TSelect::preSelect ... accepted" << std::endl;
148#endif
149 return true;
150}
A class to represent a circle in tracking.
double impact(void) const
returns impact parameter to the origin.
double pt(void) const
returns Pt.
A class to select a TTrackBase object.
TMSelector()
Constructor.
Definition: TMSelector.cxx:19
virtual ~TMSelector()
Destructor.
Definition: TMSelector.cxx:49
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.
bool fitted(void) const
returns true if fitted.
const AList< TMLink > & links(unsigned mask=0) const
returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
Definition: TTrackBase.cxx:297
virtual unsigned objectType(void) const
returns object type.
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
Definition: TTrackBase.cxx:305
A class to represent a track in tracking.
double impact(void) const
returns signed impact parameter to the origin.
double pt(void) const
returns Pt.