BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
TMSelector Class Reference

A class to select a TTrackBase object. More...

#include <TMSelector.h>

Public Member Functions

 TMSelector ()
 Constructor.
 
 TMSelector (const TMSelector &)
 Copy constructor.
 
virtual ~TMSelector ()
 Destructor.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
unsigned nLinks (void) const
 returns min. # of hits(TMLinks) requried.
 
unsigned nSuperLayers (void) const
 returns min. # of super layers required.
 
double minPt (void) const
 returns min. pt required.
 
double maxImpact (void) const
 returns max. impact(2D) required.
 
unsigned nLinksStereo (void) const
 returns min. # of stereo hits(TMLinks) requried.
 
double maxDistance (void) const
 returns max. distance required for stereo hits.
 
double maxSigma (void) const
 returns max. sigma for each TMLink.
 
bool select (TTrackBase &) const
 returns true if given track satisfys criteria after fitting.
 
bool preSelect (const TTrackBase &) const
 returns true if given track satisfys criteria before fitting.
 
unsigned nLinks (unsigned)
 sets # of hits(TMLinks) requried.
 
unsigned nSuperLayers (unsigned)
 sets # of super layers required.
 
double minPt (double)
 sets min. pt required.
 
double maxImpact (double)
 sets max. impact(2D) required.
 
unsigned nLinksStereo (unsigned)
 sets min. # of stereo hits(TMLinks) requried.
 
double maxDistance (double)
 sets max. distance required for stereo hits.
 
double maxSigma (double)
 sets max. sigma for each TMLink.
 

Detailed Description

A class to select a TTrackBase object.

Definition at line 32 of file TMSelector.h.

Constructor & Destructor Documentation

◆ TMSelector() [1/2]

TMSelector::TMSelector ( )

Constructor.

Definition at line 19 of file TMSelector.cxx.

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}

◆ TMSelector() [2/2]

TMSelector::TMSelector ( const TMSelector a)

Copy constructor.

Definition at line 34 of file TMSelector.cxx.

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}

◆ ~TMSelector()

TMSelector::~TMSelector ( )
virtual

Destructor.

Definition at line 49 of file TMSelector.cxx.

49 {
50}

Member Function Documentation

◆ dump()

void TMSelector::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const

dumps debug information.

◆ maxDistance() [1/2]

double TMSelector::maxDistance ( double  a)
inline

sets max. distance required for stereo hits.

Definition at line 245 of file TMSelector.h.

245 {
246 _maxDistanceDefined = true;
247 return _maxDistance = a;
248}

◆ maxDistance() [2/2]

double TMSelector::maxDistance ( void  ) const
inline

returns max. distance required for stereo hits.

Definition at line 235 of file TMSelector.h.

235 {
236#ifdef TRKRECO_DEBUG
237 if (! _maxDistanceDefined)
238 std::cout << "TMSelector !!! max. distance is not defined" << std::endl;
239#endif
240 return _maxDistance;
241}

Referenced by TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ maxImpact() [1/2]

double TMSelector::maxImpact ( double  a)
inline

sets max. impact(2D) required.

Definition at line 194 of file TMSelector.h.

194 {
195 _maxImpactDefined = true;
196 return _maxImpact = a;
197}

◆ maxImpact() [2/2]

double TMSelector::maxImpact ( void  ) const
inline

returns max. impact(2D) required.

Definition at line 184 of file TMSelector.h.

184 {
185#ifdef TRKRECO_DEBUG
186 if (! _maxImpactDefined)
187 std::cout << "TMSelector !!! max. impact is not defined" << std::endl;
188#endif
189 return _maxImpact;
190}

Referenced by TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ maxSigma() [1/2]

double TMSelector::maxSigma ( double  a)
inline

sets max. sigma for each TMLink.

Definition at line 211 of file TMSelector.h.

211 {
212 _maxSigmaDefined = true;
213 return _maxSigma = a;
214}

◆ maxSigma() [2/2]

double TMSelector::maxSigma ( void  ) const
inline

returns max. sigma for each TMLink.

Definition at line 201 of file TMSelector.h.

201 {
202#ifdef TRKRECO_DEBUG
203 if (! _maxSigmaDefined)
204 std::cout << "TMSelector !!! max. sigma is not defined" << std::endl;
205#endif
206 return _maxSigma;
207}

Referenced by TBuilder0::appendClusters(), TBuilder0::buildRphi(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ minPt() [1/2]

double TMSelector::minPt ( double  a)
inline

sets min. pt required.

Definition at line 177 of file TMSelector.h.

177 {
178 _minPtDefined = true;
179 return _minPt = a;
180}

◆ minPt() [2/2]

double TMSelector::minPt ( void  ) const
inline

returns min. pt required.

Definition at line 167 of file TMSelector.h.

167 {
168#ifdef TRKRECO_DEBUG
169 if (! _minPtDefined)
170 std::cout << "TMSelector !!! min. pt is not defined" << std::endl;
171#endif
172 return _minPt;
173}

Referenced by TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ nLinks() [1/2]

unsigned TMSelector::nLinks ( unsigned  a)
inline

sets # of hits(TMLinks) requried.

Definition at line 143 of file TMSelector.h.

143 {
144 _nLinksDefined = true;
145 return _nLinks = a;
146}

◆ nLinks() [2/2]

unsigned TMSelector::nLinks ( void  ) const
inline

returns min. # of hits(TMLinks) requried.

Definition at line 133 of file TMSelector.h.

133 {
134#ifdef TRKRECO_DEBUG
135 if (! _nLinksDefined)
136 std::cout << "TMSelector !!! min. nLinks is not defined" << std::endl;
137#endif
138 return _nLinks;
139}

Referenced by TBuilder0::buildRphi(), TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ nLinksStereo() [1/2]

unsigned TMSelector::nLinksStereo ( unsigned  a)
inline

sets min. # of stereo hits(TMLinks) requried.

Definition at line 228 of file TMSelector.h.

228 {
229 _nLinksStereoDefined = true;
230 return _nLinksStereo = a;
231}

◆ nLinksStereo() [2/2]

unsigned TMSelector::nLinksStereo ( void  ) const
inline

returns min. # of stereo hits(TMLinks) requried.

Definition at line 218 of file TMSelector.h.

218 {
219#ifdef TRKRECO_DEBUG
220 if (! _nLinksStereoDefined)
221 std::cout << "TMSelector !!! min. nLinksStereo is not defined" << std::endl;
222#endif
223 return _nLinksStereo;
224}

Referenced by TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ nSuperLayers() [1/2]

unsigned TMSelector::nSuperLayers ( unsigned  a)
inline

sets # of super layers required.

Definition at line 160 of file TMSelector.h.

160 {
161 _nSuperLayersDefined = true;
162 return _nSuperLayers = a;
163}

◆ nSuperLayers() [2/2]

unsigned TMSelector::nSuperLayers ( void  ) const
inline

returns min. # of super layers required.

Definition at line 150 of file TMSelector.h.

150 {
151#ifdef TRKRECO_DEBUG
152 if (! _nSuperLayers)
153 std::cout << "TMSelector !!! min. nSuperLayers is not defined" << std::endl;
154#endif
155 return _nSuperLayers;
156}

Referenced by TConformalFinder0::TConformalFinder0(), TFastFinder::TFastFinder(), and TBuilder0::trackSelector().

◆ preSelect()

bool TMSelector::preSelect ( const TTrackBase a) const

returns true if given track satisfys criteria before fitting.

Definition at line 123 of file TMSelector.cxx.

123 {
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}
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
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
Definition: TTrackBase.cxx:305

Referenced by TBuilder0::buildRphi().

◆ select()

bool TMSelector::select ( TTrackBase b) const

returns true if given track satisfys criteria after fitting.

Definition at line 53 of file TMSelector.cxx.

53 {
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}
#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
bool fitted(void) const
returns true if fitted.
Definition: TTrackBase.h:222
virtual unsigned objectType(void) const
returns object type.
Definition: TTrackBase.h:268
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

Referenced by TBuilder0::buildRphi(), TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), and TBuilder0::buildStereo0().


The documentation for this class was generated from the following files: