13#include "TrkReco/TFastFinder.h"
14#include "TrkReco/TConformalFinder0.h"
15#include "TrkReco/THistogram.h"
16#include "TrkReco/TMDCUtil.h"
17#include "TrkReco/TMLink.h"
18#include "TrkReco/TTrack.h"
21 _selector.nLinks( 4 );
22 _selector.nSuperLayers( 2 );
23 _selector.minPt( 0.05 );
24 _selector.maxImpact( 100. );
25 _selector.maxSigma( 30. );
26 _selector.nLinksStereo( 3 );
27 _selector.maxDistance( 30. );
28 _builder.trackSelector( _selector );
41 _axialHits.removeAll();
42 _stereoHits.removeAll();
43 HepAListDeleteAll( _axialLinks );
44 HepAListDeleteAll( _stereoLinks );
51 selectHits2( axialHits, stereoHits );
59 hist.
fillX( _axialLinks );
63 unsigned n = clusters.length();
64 for (
unsigned i = 0; i <
n; i++ )
68 TTrack*
t = _builder.buildRphi( clusters[i]->links() );
69 if (
t == NULL )
continue;
70#ifdef TRKRECO_DEBUG_DETAIL
71 std::cout <<
"TFastFinder::doit ... 2D track found" << std::endl;
76 ts = _builder.buildStereo( *
t, findCloseHits( _stereoLinks, *
t ) );
77 if ( ts == NULL )
continue;
78#ifdef TRKRECO_DEBUG_DETAIL
79 std::cout <<
"TFastFinder::doit ... 3D track found" << std::endl;
87 _stereoLinks.remove(
t->links() );
91 HepAListDeleteAll( clusters );
97 unsigned n = axialHits.length();
98 for (
unsigned i = 0; i <
n; i++ )
104 n = stereoHits.length();
105 for (
unsigned i = 0; i <
n; i++ )
107 const TMDCWireHit& h = *stereoHits[i];
109 _stereoHits.append( (TMDCWireHit&)h );
115 selectSimpleSegments( axialHits, _axialHits );
116 selectSimpleSegments( stereoHits, _stereoHits );
120 const TTrack& track )
const {
127 if ( track.
links().length() == 0 )
129#ifdef TRKRECO_DEBUG_DETAIL
130 std::cout <<
"TConformalFinder::findCloseHits !!! ";
131 std::cout <<
" no links found in a track : This should not be happened";
132 std::cout << std::endl;
140 float dRcut[11] = { 0., 4.3, 0., 6.5, 0., 7.5, 0., 8.0, 0., 9.5, 0. };
144 double xInnerWire = track.
links()[0]->wire()->xyPosition().x();
145 double yInnerWire = track.
links()[0]->wire()->xyPosition().y();
146 unsigned nall = links.length();
147 for (
unsigned j = 0; j < nall; j++ )
149 TMLink&
t = *links[j];
150 const TMDCWire&
w = *
t.wire();
152 double Rmag2 = X.mag2();
153 double DR = fabs( sqrt( Rmag2 ) - fabs( R0 ) );
156 if ( DR < dRcut[
w.superLayerId()] &&
157 ( xInnerWire *
w.xyPosition().x() + yInnerWire *
w.xyPosition().y() ) > 0. )
158 { list.append(
t ); }
166 AList<TMDCWireHit> hits = in;
167 while ( hits.last() )
169 TMDCWireHit& h = *hits.last();
173 AList<TMDCWireHit> cluster;
174 AList<TMDCWireHit> toBeChecked;
176 toBeChecked.append( h );
177 while ( toBeChecked.length() )
179 TMDCWireHit& a = *toBeChecked.last();
180 toBeChecked.remove( a );
181 if ( cluster.hasMember( a ) )
continue;
184 unsigned state = a.
state();
193 for (
unsigned i = 0; i < 6; i++ )
195 if ( ( ptn >> i ) % 2 )
198 toBeChecked.append( (TMDCWireHit&)b );
204 if ( ( cluster.length() < 4 ) || ( cluster.length() > 8 ) ) ok =
false;
207 if ( ok ) out.append( cluster );
210 hits.remove( cluster );
213#ifdef TRKRECO_DEBUG_DETAIL
214 std::cout <<
"TFastFinder::selectSimpleSegment ... cluster : ok = ";
215 std::cout << ok <<
" : ";
217 for (
unsigned i = 0; i < cluster.length(); i++ )
219 TMDCWireHit& h = *cluster[i];
220#ifdef TRKRECO_DEBUG_DETAIL
221 std::cout << h.
wire()->
name() <<
",";
225 unsigned state = h.
state();
231#ifdef TRKRECO_DEBUG_DETAIL
232 std::cout << std::endl;
HepGeom::Vector3D< double > HepVector3D
const HepPoint3D ORIGIN
Constants.
#define WireHitFastFinder
#define WireHitContinuous
#define WireHitNeighborPattern
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
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 ~TFastFinder()
Destructor.
TFastFinder()
Constructor.
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
A class for a histogram used in tracking.
AList< TSegment0 > clusters0(void) const
returns an AList<TSegment0> of clusters.
void fillX(const AList< TMLink > &links)
fills with hits.
unsigned state(void) const
returns state.
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
const TMDCWireHit *const hit(void) const
returns a pointer to a TMDCWireHit.
const TMDCWire *const neighbor(unsigned) const
returns a pointer to a neighbor wire.
std::string name(void) const
returns name.
const AList< TMLink > & links(unsigned mask=0) const
A class to represent a track in tracking.
const Helix & helix(void) const
returns helix parameter.