TFastFinder Class Reference

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

#include <TFastFinder.h>

Inheritance diagram for TFastFinder:

TFinderBase List of all members.

Public Member Functions

 TFastFinder ()
 Constructor.
virtual ~TFastFinder ()
 Destructor.
std::string name (void) const
 returns name.
std::string version (void) const
 returns version.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
void clear (void)
 clear internal information.
int doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks)
 finds tracks.
virtual int debugLevel (void) const
 returns debug level.
virtual int debugLevel (int)
 sets debug level.
virtual bool doStereo (bool)
 sets flag to reconstruct 3D.
virtual bool doSalvage (bool)
 sets flag to salvage hits.
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).

Private Member Functions

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 selectSimpleSegments (const AList< TMDCWireHit > &hits, AList< TMDCWireHit > &output) const
 selects simple segments.
AList< TMLinkfindCloseHits (const AList< TMLink > &links, const TTrack &track) const
 finds close hits.

Private Attributes

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

Detailed Description

A class to find tracks with the conformal method.

Definition at line 26 of file TFastFinder.h.


Constructor & Destructor Documentation

TFastFinder::TFastFinder (  ) 

Constructor.

Definition at line 20 of file TFastFinder.cxx.

References _builder, _selector, TMSelector::maxDistance(), TMSelector::maxImpact(), TMSelector::maxSigma(), TMSelector::minPt(), TMSelector::nLinks(), TMSelector::nLinksStereo(), TMSelector::nSuperLayers(), and TBuilder0::trackSelector().

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.

Definition at line 31 of file TFastFinder.cxx.

00031                           {
00032 }


Member Function Documentation

void TFastFinder::clear ( void   )  [virtual]

clear internal information.

Implements TFinderBase.

Definition at line 46 of file TFastFinder.cxx.

References _axialHits, _axialLinks, _stereoHits, and _stereoLinks.

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

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

sets debug level.

Definition at line 96 of file TFinderBase.h.

References TFinderBase::_debugLevel.

00096                              {
00097     return _debugLevel = a;
00098 }

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

returns debug level.

Definition at line 90 of file TFinderBase.h.

References TFinderBase::_debugLevel.

Referenced by TConformalFinder0::doit(), TConformalFinder::doit(), TrkReco::initialize(), TConformalFinder0::specialFinding(), and TConformalFinder0::standardFinding().

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, and TPerfectFinder.

Referenced by TrkReco::execute().

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

finds tracks.

Definition at line 54 of file TFastFinder.cxx.

References _axialHits, _axialLinks, _builder, _stereoHits, _stereoLinks, TBuilder0::buildRphi(), TBuilder0::buildStereo(), THistogram::clusters0(), TConformalFinder0::conformalTransformationRphi(), THistogram::fillX(), findCloseHits(), genRecEmupikp::i, ORIGIN, selectHits2(), t(), TrackFastFinder, and WireHitFastFinder.

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 }

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

sets flag to salvage hits.

Reimplemented in TConformalFinder0.

Definition at line 108 of file TFinderBase.h.

Referenced by TrkReco::initialize().

00108                              {
00109     return a;
00110 }

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

sets flag to reconstruct 3D.

Reimplemented in TConformalFinder0.

Definition at line 102 of file TFinderBase.h.

Referenced by TrkReco::initialize().

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.

Definition at line 40 of file TFastFinder.cxx.

References TFinderBase::dump().

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.

Definition at line 133 of file TFastFinder.cxx.

References Helix::center(), Helix::curv(), TTrack::helix(), ganga-rec::j, TTrackBase::links(), t(), and w.

Referenced by doit().

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 [inline, virtual]

returns name.

Implements TFinderBase.

Definition at line 95 of file TFastFinder.h.

00095                             {
00096     return "Fast Finder";
00097 }

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

selects isolated hits.(conf.finder type)

Definition at line 109 of file TFastFinder.cxx.

References _axialHits, _stereoHits, genRecEmupikp::i, WireHitContinuous, and WireHitIsolated.

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)

Definition at line 126 of file TFastFinder.cxx.

References _axialHits, _stereoHits, and selectSimpleSegments().

Referenced by doit().

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.

Definition at line 178 of file TFastFinder.cxx.

References genRecEmupikp::i, WireHitContinuous, WireHitIsolated, and WireHitNeighborPattern.

Referenced by selectHits2().

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.

Definition at line 35 of file TFastFinder.cxx.

00035                                {
00036     return "0.00";
00037 }


Member Data Documentation

AList<TMDCWireHit> TFastFinder::_axialHits [private]

Definition at line 73 of file TFastFinder.h.

Referenced by clear(), doit(), selectHits(), and selectHits2().

AList<TMLink> TFastFinder::_axialLinks [private]

Definition at line 75 of file TFastFinder.h.

Referenced by clear(), and doit().

TBuilder0 TFastFinder::_builder [private]

Definition at line 78 of file TFastFinder.h.

Referenced by doit(), and TFastFinder().

TMSelector TFastFinder::_selector [private]

Definition at line 79 of file TFastFinder.h.

Referenced by TFastFinder().

AList<TMDCWireHit> TFastFinder::_stereoHits [private]

Definition at line 74 of file TFastFinder.h.

Referenced by clear(), doit(), selectHits(), and selectHits2().

AList<TMLink> TFastFinder::_stereoLinks [private]

Definition at line 76 of file TFastFinder.h.

Referenced by clear(), and doit().


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