TMSelector Class Reference

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

#include <TMSelector.h>

List of all members.

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.

Private Attributes

bool _nLinksDefined
bool _nSuperLayersDefined
bool _minPtDefined
bool _maxImpactDefined
bool _maxSigmaDefined
unsigned _nLinks
unsigned _nSuperLayers
double _minPt
double _maxImpact
double _maxSigma
bool _nLinksStereoDefined
bool _maxDistanceDefined
unsigned _nLinksStereo
double _maxDistance


Detailed Description

A class to select a TTrackBase object.

Definition at line 32 of file TMSelector.h.


Constructor & Destructor Documentation

TMSelector::TMSelector (  ) 

Constructor.

Definition at line 19 of file TMSelector.cxx.

00020 : _nLinksDefined(false),
00021   _nLinks(0),
00022   _nSuperLayersDefined(false),
00023   _nSuperLayers(0),
00024   _minPtDefined(false),
00025   _minPt(0.),
00026   _maxImpactDefined(false),
00027   _maxImpact(0.),
00028   _nLinksStereoDefined(false),
00029   _nLinksStereo(0),
00030   _maxDistanceDefined(false),
00031   _maxDistance(0.) {
00032 }

TMSelector::TMSelector ( const TMSelector  ) 

Copy constructor.

Definition at line 34 of file TMSelector.cxx.

TMSelector::~TMSelector (  )  [virtual]

Destructor.

Definition at line 49 of file TMSelector.cxx.

00049                         {
00050 }


Member Function Documentation

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

dumps debug information.

double TMSelector::maxDistance ( double   )  [inline]

sets max. distance required for stereo hits.

Definition at line 245 of file TMSelector.h.

References _maxDistance, and _maxDistanceDefined.

00245                                 {
00246     _maxDistanceDefined = true;
00247     return _maxDistance = a;
00248 }

double TMSelector::maxDistance ( void   )  const [inline]

returns max. distance required for stereo hits.

Definition at line 235 of file TMSelector.h.

References _maxDistance, and _maxDistanceDefined.

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

00235                                   {
00236 #ifdef TRKRECO_DEBUG
00237     if (! _maxDistanceDefined)
00238         std::cout << "TMSelector !!! max. distance is not defined" << std::endl;
00239 #endif
00240     return _maxDistance;
00241 }

double TMSelector::maxImpact ( double   )  [inline]

sets max. impact(2D) required.

Definition at line 194 of file TMSelector.h.

References _maxImpact, and _maxImpactDefined.

00194                               {
00195     _maxImpactDefined = true;
00196     return _maxImpact = a;
00197 }

double TMSelector::maxImpact ( void   )  const [inline]

returns max. impact(2D) required.

Definition at line 184 of file TMSelector.h.

References _maxImpact, and _maxImpactDefined.

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

00184                                 {
00185 #ifdef TRKRECO_DEBUG
00186     if (! _maxImpactDefined)
00187         std::cout << "TMSelector !!! max. impact is not defined" << std::endl;
00188 #endif
00189     return _maxImpact;
00190 }

double TMSelector::maxSigma ( double   )  [inline]

sets max. sigma for each TMLink.

Definition at line 211 of file TMSelector.h.

References _maxSigma, and _maxSigmaDefined.

00211                              {
00212     _maxSigmaDefined = true;
00213     return _maxSigma = a;
00214 }

double TMSelector::maxSigma ( void   )  const [inline]

returns max. sigma for each TMLink.

Definition at line 201 of file TMSelector.h.

References _maxSigma, and _maxSigmaDefined.

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

00201                                {
00202 #ifdef TRKRECO_DEBUG
00203     if (! _maxSigmaDefined)
00204         std::cout << "TMSelector !!! max. sigma is not defined" << std::endl;
00205 #endif
00206     return _maxSigma;
00207 }

double TMSelector::minPt ( double   )  [inline]

sets min. pt required.

Definition at line 177 of file TMSelector.h.

References _minPt, and _minPtDefined.

00177                           {
00178     _minPtDefined = true;
00179     return _minPt = a;
00180 }

double TMSelector::minPt ( void   )  const [inline]

returns min. pt required.

Definition at line 167 of file TMSelector.h.

References _minPt, and _minPtDefined.

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

00167                             {
00168 #ifdef TRKRECO_DEBUG
00169     if (! _minPtDefined)
00170         std::cout << "TMSelector !!! min. pt is not defined" << std::endl;
00171 #endif
00172     return _minPt;
00173 }

unsigned TMSelector::nLinks ( unsigned   )  [inline]

sets # of hits(TMLinks) requried.

Definition at line 143 of file TMSelector.h.

References _nLinks, and _nLinksDefined.

00143                              {
00144     _nLinksDefined = true;
00145     return _nLinks = a;
00146 }

unsigned TMSelector::nLinks ( void   )  const [inline]

returns min. # of hits(TMLinks) requried.

Definition at line 133 of file TMSelector.h.

References _nLinks, and _nLinksDefined.

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

00133                              {
00134 #ifdef TRKRECO_DEBUG
00135     if (! _nLinksDefined)
00136         std::cout << "TMSelector !!! min. nLinks is not defined" << std::endl;
00137 #endif
00138     return _nLinks;
00139 }

unsigned TMSelector::nLinksStereo ( unsigned   )  [inline]

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

Definition at line 228 of file TMSelector.h.

References _nLinksStereo, and _nLinksStereoDefined.

00228                                    {
00229     _nLinksStereoDefined = true;
00230     return _nLinksStereo = a;
00231 }

unsigned TMSelector::nLinksStereo ( void   )  const [inline]

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

Definition at line 218 of file TMSelector.h.

References _nLinksStereo, and _nLinksStereoDefined.

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

00218                                    {
00219 #ifdef TRKRECO_DEBUG
00220     if (! _nLinksStereoDefined)
00221         std::cout << "TMSelector !!! min. nLinksStereo is not defined" << std::endl;
00222 #endif
00223     return _nLinksStereo;
00224 }

unsigned TMSelector::nSuperLayers ( unsigned   )  [inline]

sets # of super layers required.

Definition at line 160 of file TMSelector.h.

References _nSuperLayers, and _nSuperLayersDefined.

00160                                    {
00161     _nSuperLayersDefined = true;
00162     return _nSuperLayers = a;
00163 }

unsigned TMSelector::nSuperLayers ( void   )  const [inline]

returns min. # of super layers required.

Definition at line 150 of file TMSelector.h.

References _nSuperLayers.

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

00150                                    {
00151 #ifdef TRKRECO_DEBUG
00152     if (! _nSuperLayers)
00153         std::cout << "TMSelector !!! min. nSuperLayers is not defined" << std::endl;
00154 #endif
00155     return _nSuperLayers;
00156 }

bool TMSelector::preSelect ( const TTrackBase  )  const

returns true if given track satisfys criteria before fitting.

Definition at line 123 of file TMSelector.cxx.

References _nLinks, _nLinksDefined, _nSuperLayers, _nSuperLayersDefined, TTrackBase::links(), TTrackBase::nLinks(), and NSuperLayers().

Referenced by TBuilder0::buildRphi().

00123                                                 {
00124     if (_nLinksDefined) {
00125         if (a.nLinks() < _nLinks) {
00126 #ifdef TRKRECO_DEBUG_DETAIL
00127             std::cout << "    TSelect ... rejected by nLinks(";
00128             std::cout << a.nLinks() << ") < ";
00129             std::cout << _nLinks << std::endl;
00130 #endif
00131             return false;
00132         }
00133     }
00134 
00135     if (_nSuperLayersDefined) {
00136         if (NSuperLayers(a.links()) < _nSuperLayers) {
00137 #ifdef TRKRECO_DEBUG_DETAIL
00138             std::cout << "    TSelect ... rejected by nSuperLayers(";
00139             std::cout << NSuperLayers(a.links()) << ") < ";
00140             std::cout << _nSuperLayers << std::endl;
00141 #endif
00142             return false;
00143         }
00144     }
00145 
00146 #ifdef TRKRECO_DEBUG_DETAIL
00147     std::cout << "    TSelect::preSelect ... accepted" << std::endl;
00148 #endif
00149     return true;
00150 }

bool TMSelector::select ( TTrackBase  )  const

returns true if given track satisfys criteria after fitting.

Definition at line 53 of file TMSelector.cxx.

References _maxImpact, _maxImpactDefined, _minPt, _minPtDefined, Circle, TTrackBase::fitted(), TTrackBase::objectType(), and Track.

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

00053                                        {
00054 
00055 #ifdef TRKRECO_DEBUG_DETAIL
00056     if (! b.fitted()) {
00057         std::cout << "    TSelect::select !!! not fitted yet" << std::endl;
00058     }
00059 #endif
00060 
00061     if (b.objectType() == Track) {
00062         TTrack & a = (TTrack &) b;
00063 
00064         if (_minPtDefined) {
00065             if (a.pt() < _minPt) {
00066 #ifdef TRKRECO_DEBUG_DETAIL
00067                 std::cout << "    TSelect ... rejected by min. pt(";
00068                 std::cout << a.pt() << ") < ";
00069                 std::cout << _minPt << std::endl;
00070 #endif
00071                 return false;
00072             }
00073         }
00074 
00075         if (_maxImpactDefined) {
00076             if (fabs(a.impact()) > _maxImpact) {
00077 #ifdef TRKRECO_DEBUG_DETAIL
00078                 std::cout << "    TSelect ... rejected by max. impact(";
00079                 std::cout << a.impact() << ") < ";
00080                 std::cout << _maxImpact << std::endl;
00081 #endif
00082                 return false;
00083             }
00084         }
00085     }
00086     else if (b.objectType() == Circle) {
00087         TCircle & a = (TCircle &) b;
00088 
00089         if (_minPtDefined) {
00090             if (a.pt() < _minPt) {
00091 #ifdef TRKRECO_DEBUG_DETAIL
00092                 std::cout << "    TSelect ... rejected by min. pt(";
00093                 std::cout << a.pt() << ") < ";
00094                 std::cout << _minPt << std::endl;
00095 #endif
00096                 return false;
00097             }
00098         }
00099 
00100         if (_maxImpactDefined) {
00101             if (fabs(a.impact()) > _maxImpact) {
00102 #ifdef TRKRECO_DEBUG_DETAIL
00103                 std::cout << "    TSelect ... rejected by max. impact(";
00104                 std::cout << a.impact() << ") < ";
00105                 std::cout << _maxImpact << std::endl;
00106 #endif
00107                 return false;
00108             }
00109         }
00110     }
00111     else {
00112         std::cout << "TMSelector !!! Unknown object type" << std::endl;
00113         return false;
00114     }
00115 
00116 #ifdef TRKRECO_DEBUG_DETAIL
00117     std::cout << "    TSelect::select ... accepted" << std::endl;
00118 #endif
00119     return true;
00120 }


Member Data Documentation

double TMSelector::_maxDistance [private]

Definition at line 117 of file TMSelector.h.

Referenced by maxDistance().

bool TMSelector::_maxDistanceDefined [private]

Definition at line 114 of file TMSelector.h.

Referenced by maxDistance().

double TMSelector::_maxImpact [private]

Definition at line 110 of file TMSelector.h.

Referenced by maxImpact(), and select().

bool TMSelector::_maxImpactDefined [private]

Definition at line 104 of file TMSelector.h.

Referenced by maxImpact(), and select().

double TMSelector::_maxSigma [private]

Definition at line 111 of file TMSelector.h.

Referenced by maxSigma().

bool TMSelector::_maxSigmaDefined [private]

Definition at line 105 of file TMSelector.h.

Referenced by maxSigma().

double TMSelector::_minPt [private]

Definition at line 109 of file TMSelector.h.

Referenced by minPt(), and select().

bool TMSelector::_minPtDefined [private]

Definition at line 103 of file TMSelector.h.

Referenced by minPt(), and select().

unsigned TMSelector::_nLinks [private]

Definition at line 107 of file TMSelector.h.

Referenced by nLinks(), and preSelect().

bool TMSelector::_nLinksDefined [private]

Definition at line 101 of file TMSelector.h.

Referenced by nLinks(), and preSelect().

unsigned TMSelector::_nLinksStereo [private]

Definition at line 116 of file TMSelector.h.

Referenced by nLinksStereo().

bool TMSelector::_nLinksStereoDefined [private]

Definition at line 113 of file TMSelector.h.

Referenced by nLinksStereo().

unsigned TMSelector::_nSuperLayers [private]

Definition at line 108 of file TMSelector.h.

Referenced by nSuperLayers(), and preSelect().

bool TMSelector::_nSuperLayersDefined [private]

Definition at line 102 of file TMSelector.h.

Referenced by nSuperLayers(), and preSelect().


Generated on Tue Nov 29 23:36:02 2016 for BOSS_7.0.2 by  doxygen 1.4.7