BOSS 7.1.1
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
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}
#define Circle
Definition TTrackBase.h:28
#define Track
Definition TTrackBase.h:30
A class to represent a circle in tracking.
Definition TCircle.h:42
double impact(void) const
returns impact parameter to the origin.
Definition TCircle.h:136
double pt(void) const
returns Pt.
Definition TCircle.h:126
A class to select a TTrackBase object.
Definition TMSelector.h:32
TMSelector()
Constructor.
virtual ~TMSelector()
Destructor.
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.
A virtual class for a track class in tracking.
Definition TTrackBase.h:46
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.
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
A class to represent a track in tracking.
Definition TTrack.h:129
double impact(void) const
returns signed impact parameter to the origin.
Definition TTrack.h:571
double pt(void) const
returns Pt.
Definition TTrack.h:528
const double b
Definition slope.cxx:9