Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TFastFinder Class Reference

A class to find tracks with the conformal method. More...

#include <TFastFinder.h>

Inheritance diagram for TFastFinder:

TFinderBase TFinderBase List of all members.

Public Member Functions

void clear (void)
 clear internal information.
void clear (void)
 clear internal information.
virtual int debugLevel (int)
 sets debug level.
virtual int debugLevel (void) const
 returns debug level.
virtual int debugLevel (int)
 sets debug level.
virtual int debugLevel (void) const
 returns debug level.
virtual int doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks3D, AList< TTrack > &tracks2D)=0
 finds tracks. 'hits' are used to reconstruct. 'tracks' can be used for both inputs and outputs. Return value = (0, +, -) means (success, warning, fatal error).
int doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks)
 finds tracks.
int doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks)
 finds tracks.
virtual bool doSalvage (bool)
 sets flag to salvage hits.
virtual bool doSalvage (bool)
 sets flag to salvage hits.
virtual bool doStereo (bool)
 sets flag to reconstruct 3D.
virtual bool doStereo (bool)
 sets flag to reconstruct 3D.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
std::string name (void) const
 returns name.
std::string name (void) const
 returns name.
 TFastFinder ()
 Constructor.
 TFastFinder ()
 Constructor.
std::string version (void) const
 returns version.
std::string version (void) const
 returns version.
virtual ~TFastFinder ()
 Destructor.
virtual ~TFastFinder ()
 Destructor.

Private Member Functions

AList< TMLinkfindCloseHits (const AList< TMLink > &links, const TTrack &track) const
 finds close hits.
AList< TMLinkfindCloseHits (const AList< TMLink > &links, const TTrack &track) const
 finds close hits.
void selectHits (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits)
 selects isolated hits.(conf.finder type)
void selectHits (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits)
 selects isolated hits.(conf.finder type)
void selectHits2 (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits)
 selects isolated hits.(calling selectSimpleSegments)
void selectHits2 (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits)
 selects isolated hits.(calling selectSimpleSegments)
void selectSimpleSegments (const AList< TMDCWireHit > &hits, AList< TMDCWireHit > &output) const
 selects simple segments.
void selectSimpleSegments (const AList< TMDCWireHit > &hits, AList< TMDCWireHit > &output) const
 selects simple segments.

Private Attributes

AList< TMDCWireHit_axialHits
AList< TMDCWireHit_axialHits
AList< TMLink_axialLinks
AList< TMLink_axialLinks
TBuilder0 _builder
TMSelector _selector
AList< TMDCWireHit_stereoHits
AList< TMDCWireHit_stereoHits
AList< TMLink_stereoLinks
AList< TMLink_stereoLinks

Detailed Description

A class to find tracks with the conformal method.


Constructor & Destructor Documentation

TFastFinder::TFastFinder  ) 
 

Constructor.

00020                          : _builder("fast find builder", 30) {
00021     _selector.nLinks(4);
00022     _selector.nSuperLayers(2);
00023     _selector.minPt(0.05);
00024     _selector.maxImpact(100.);
00025     _selector.maxSigma(30.);
00026     _selector.nLinksStereo(3);
00027     _selector.maxDistance(30.);
00028     _builder.trackSelector(_selector);
00029 }

TFastFinder::~TFastFinder  )  [virtual]
 

Destructor.

00031                           {
00032 }

TFastFinder::TFastFinder  ) 
 

Constructor.

virtual TFastFinder::~TFastFinder  )  [virtual]
 

Destructor.


Member Function Documentation

void TFastFinder::clear void   )  [virtual]
 

clear internal information.

Implements TFinderBase.

void TFastFinder::clear void   )  [virtual]
 

clear internal information.

Implements TFinderBase.

00046                        {
00047     _axialHits.removeAll();
00048     _stereoHits.removeAll();
00049     HepAListDeleteAll(_axialLinks);
00050     HepAListDeleteAll(_stereoLinks);
00051 }

virtual int TFinderBase::debugLevel int   )  [virtual, inherited]
 

sets debug level.

virtual int TFinderBase::debugLevel void   )  const [virtual, inherited]
 

returns debug level.

int TFinderBase::debugLevel int   )  [inline, virtual, inherited]
 

sets debug level.

00096                              {
00097     return _debugLevel = a;
00098 }

int TFinderBase::debugLevel void   )  const [inline, virtual, inherited]
 

returns debug level.

00090                                   {
00091     return _debugLevel;
00092 }

virtual int TFinderBase::doit const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits,
AList< TTrack > &  tracks3D,
AList< TTrack > &  tracks2D
[pure virtual, inherited]
 

finds tracks. 'hits' are used to reconstruct. 'tracks' can be used for both inputs and outputs. Return value = (0, +, -) means (success, warning, fatal error).

Implemented in TConformalFinder, TConformalFinder0, TCurlFinder, TPerfectFinder, TConformalFinder, TConformalFinder0, TCurlFinder, and TPerfectFinder.

int TFastFinder::doit const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits,
AList< TTrack > &  tracks
 

finds tracks.

int TFastFinder::doit const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits,
AList< TTrack > &  tracks
 

finds tracks.

00056                                           {
00057 
00058     //...Select good hits...
00059     selectHits2(axialHits, stereoHits);
00060 
00061     //...Conformal transformation with IP constraint...
00062     TConformalFinder0::conformalTransformationRphi(ORIGIN,
00063                                                    _axialHits,
00064                                                    _axialLinks);
00065     TConformalFinder0::conformalTransformationRphi(ORIGIN,
00066                                                    _stereoHits,
00067                                                    _stereoLinks);
00068 
00069     //...Make a histogram...
00070     THistogram hist(288);
00071     hist.fillX(_axialLinks);
00072     AList<TSegment0> clusters = hist.clusters0();
00073 
00074     //...Cluster loop...
00075     unsigned n = clusters.length();
00076     for (unsigned i = 0; i < n; i++) {
00077 
00078         //...2D track...
00079         TTrack * t = _builder.buildRphi(clusters[i]->links());
00080         if (t == NULL) continue;
00081 #ifdef TRKRECO_DEBUG_DETAIL
00082         std::cout << "TFastFinder::doit ... 2D track found" << std::endl;
00083 #endif
00084 
00085         //...Make it 3D...
00086         TTrack * ts = t;
00087         ts = _builder.buildStereo(* t,
00088                                   findCloseHits(_stereoLinks,
00089                                                 * t));
00090         if (ts == NULL) continue;
00091 #ifdef TRKRECO_DEBUG_DETAIL
00092         std::cout << "TFastFinder::doit ... 3D track found" << std::endl;
00093 #endif
00094 
00095         //...OK...
00096         t->assign(WireHitFastFinder);
00097         t->finder(TrackFastFinder);
00098 //      t->assign(WireHitFastFinder, TrackFastFinder);
00099         tracks.append(t);
00100         _stereoLinks.remove(t->links());
00101     }
00102 
00103     //...Termination...
00104     HepAListDeleteAll(clusters);
00105     return 0;
00106 }

virtual bool TFinderBase::doSalvage bool   )  [virtual, inherited]
 

sets flag to salvage hits.

Reimplemented in TConformalFinder0, and TConformalFinder0.

bool TFinderBase::doSalvage bool   )  [inline, virtual, inherited]
 

sets flag to salvage hits.

Reimplemented in TConformalFinder0, and TConformalFinder0.

00108                              {
00109     return a;
00110 }

virtual bool TFinderBase::doStereo bool   )  [virtual, inherited]
 

sets flag to reconstruct 3D.

Reimplemented in TConformalFinder0, and TConformalFinder0.

bool TFinderBase::doStereo bool   )  [inline, virtual, inherited]
 

sets flag to reconstruct 3D.

Reimplemented in TConformalFinder0, and TConformalFinder0.

00102                             {
00103     return a;
00104 }

void TFastFinder::dump const std::string &  message = std::string(""),
const std::string &  prefix = std::string("")
const [virtual]
 

dumps debug information.

Reimplemented from TFinderBase.

void TFastFinder::dump const std::string &  message = std::string(""),
const std::string &  prefix = std::string("")
const [virtual]
 

dumps debug information.

Reimplemented from TFinderBase.

00040                                                                     {
00041     std::cout << pre;
00042     TFinderBase::dump(msg);
00043 }

AList<TMLink> TFastFinder::findCloseHits const AList< TMLink > &  links,
const TTrack track
const [private]
 

finds close hits.

AList< TMLink > TFastFinder::findCloseHits const AList< TMLink > &  links,
const TTrack track
const [private]
 

finds close hits.

00134                                                        {
00135     //
00136     // Coded by J.Suzuki
00137     //
00138     AList<TMLink> list;
00139 
00140     //...Check condition...
00141     if (track.links().length() == 0) {
00142 #ifdef TRKRECO_DEBUG_DETAIL
00143         std::cout << "TConformalFinder::findCloseHits !!! ";
00144         std::cout << " no links found in a track : This should not be happened";
00145         std::cout << std::endl;
00146 #endif
00147 
00148         return list;
00149     }
00150 
00151     //...Parameters...
00152     //    float dRcut[11] = {0, 3.5, 0., 5.5, 0., 6.5, 0., 7.5, 0., 9.5, 0.};
00153     float dRcut[11] = {0., 4.3, 0., 6.5, 0., 7.5, 0., 8.0, 0., 9.5, 0.};
00154 
00155     //...Select Stereo hits associated to the current r-phi curve...
00156     double R0 = track.helix().curv();
00157     double xInnerWire = track.links()[0]->wire()->xyPosition().x();
00158     double yInnerWire = track.links()[0]->wire()->xyPosition().y();
00159     unsigned nall = links.length();
00160     for (unsigned j = 0; j < nall; j++) {
00161         TMLink & t = * links[j];
00162         const TMDCWire & w = * t.wire();
00163         HepVector3D X = w.xyPosition() - track.helix().center();
00164         double Rmag2 = X.mag2();
00165         double DR = fabs(sqrt(Rmag2) - fabs(R0));
00166         t.zStatus(-10);
00167         t.zPair(0);
00168         if (DR < dRcut[w.superLayerId()] &&
00169             (xInnerWire*w.xyPosition().x()+yInnerWire*w.xyPosition().y())>0.){
00170             list.append(t);
00171         }
00172     }
00173 
00174     return list;
00175 }

std::string TFastFinder::name void   )  const [virtual]
 

returns name.

Implements TFinderBase.

std::string TFastFinder::name void   )  const [inline, virtual]
 

returns name.

Implements TFinderBase.

00095                             {
00096     return "Fast Finder";
00097 }

void TFastFinder::selectHits const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits
[private]
 

selects isolated hits.(conf.finder type)

void TFastFinder::selectHits const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits
[private]
 

selects isolated hits.(conf.finder type)

00110                                                                {
00111     unsigned n = axialHits.length();
00112     for (unsigned i = 0; i < n; i++) {
00113         const TMDCWireHit & h = * axialHits[i];
00114         if ((h.state() & WireHitIsolated) && (h.state() & WireHitContinuous))
00115             _axialHits.append((TMDCWireHit &) h);
00116     }
00117     n = stereoHits.length();
00118     for (unsigned i = 0; i < n; i++) {
00119         const TMDCWireHit & h = * stereoHits[i];
00120         if ((h.state() & WireHitIsolated) && (h.state() & WireHitContinuous))
00121             _stereoHits.append((TMDCWireHit &) h);
00122     }
00123 }

void TFastFinder::selectHits2 const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits
[private]
 

selects isolated hits.(calling selectSimpleSegments)

void TFastFinder::selectHits2 const AList< TMDCWireHit > &  axialHits,
const AList< TMDCWireHit > &  stereoHits
[private]
 

selects isolated hits.(calling selectSimpleSegments)

00127                                                                 {
00128     selectSimpleSegments(axialHits, _axialHits);
00129     selectSimpleSegments(stereoHits, _stereoHits);
00130 }

void TFastFinder::selectSimpleSegments const AList< TMDCWireHit > &  hits,
AList< TMDCWireHit > &  output
const [private]
 

selects simple segments.

void TFastFinder::selectSimpleSegments const AList< TMDCWireHit > &  hits,
AList< TMDCWireHit > &  output
const [private]
 

selects simple segments.

00179                                                                   {
00180     AList<TMDCWireHit> hits = in;
00181     while (hits.last()) {
00182         TMDCWireHit & h = * hits.last();
00183 
00184         //...Start clustering...
00185         // AList<TMDCWireHit> & cluster = * new AList<TMDCWireHit>();
00186         AList<TMDCWireHit> cluster;
00187         AList<TMDCWireHit> toBeChecked;
00188         bool ok = true;
00189         toBeChecked.append(h);
00190         while (toBeChecked.length()) {
00191             TMDCWireHit & a = * toBeChecked.last();
00192             toBeChecked.remove(a);
00193             if (cluster.hasMember(a)) continue;
00194 
00195             //...Check hit...
00196             unsigned state = a.state();
00197             if (! (state & WireHitIsolated)) ok = false;
00198             if (! (state & WireHitContinuous)) ok = false;
00199 
00200             //...Append...
00201             cluster.append(a);
00202 
00203             //...Neighbor hit...
00204             unsigned ptn = (state & WireHitNeighborPattern) >> 12;
00205             for (unsigned i = 0; i < 6; i++) {
00206                 if ((ptn >> i) % 2) {
00207                     const TMDCWireHit & b = * a.wire()->neighbor(i)->hit();
00208                     toBeChecked.append((TMDCWireHit &) b);
00209                 }
00210             }
00211         }
00212 
00213         //...Check cluster size...
00214         if ((cluster.length() < 4) || (cluster.length() > 8)) ok = false;
00215 
00216         //...OK. Good hits...
00217         if (ok) out.append(cluster);
00218 
00219         //...Remove cluster...
00220         hits.remove(cluster);
00221 
00222         //...For debug...
00223 #ifdef TRKRECO_DEBUG_DETAIL
00224         std::cout << "TFastFinder::selectSimpleSegment ... cluster : ok = ";
00225         std::cout << ok << " : ";
00226 #endif
00227         for (unsigned i = 0; i < cluster.length(); i++) {
00228             TMDCWireHit & h = * cluster[i];
00229 #ifdef TRKRECO_DEBUG_DETAIL
00230             std::cout << h.wire()->name() << ",";
00231 #endif
00232             if (! ok) {
00233                 unsigned state = h.state();
00234                 if (state & WireHitIsolated) state ^= WireHitIsolated;
00235                 if (state & WireHitContinuous) state ^= WireHitContinuous;
00236                 h.state(state);
00237             }
00238         }
00239 #ifdef TRKRECO_DEBUG_DETAIL
00240         std::cout << std::endl;
00241 #endif
00242 
00243     remove:
00244         hits.remove(h);
00245     }
00246 }

std::string TFastFinder::version void   )  const [virtual]
 

returns version.

Implements TFinderBase.

std::string TFastFinder::version void   )  const [virtual]
 

returns version.

Implements TFinderBase.

00035                                {
00036     return "0.00";
00037 }


Member Data Documentation

AList<TMDCWireHit> TFastFinder::_axialHits [private]
 

AList<TMDCWireHit> TFastFinder::_axialHits [private]
 

AList<TMLink> TFastFinder::_axialLinks [private]
 

AList<TMLink> TFastFinder::_axialLinks [private]
 

TBuilder0 TFastFinder::_builder [private]
 

TMSelector TFastFinder::_selector [private]
 

AList<TMDCWireHit> TFastFinder::_stereoHits [private]
 

AList<TMDCWireHit> TFastFinder::_stereoHits [private]
 

AList<TMLink> TFastFinder::_stereoLinks [private]
 

AList<TMLink> TFastFinder::_stereoLinks [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 18:53:19 2011 for BOSS6.5.5 by  doxygen 1.3.9.1