13#include "TrkReco/TPerfectFinder.h"
14#include "TrkReco/TMDCWireHitMC.h"
15#include "TrkReco/TTrack.h"
16#include "TrkReco/TTrackHEP.h"
19#include "TrackUtil/Helix.h"
22 unsigned fittingFlag )
24 , _builder(
"conformal builder", maxSigma, maxSigmaStereo, 0, 0, 0, fittingFlag )
25 , _fitter(
"helix fitter" ) {}
43 hits.append( axialHits );
44 hits.append( stereoHits );
48 const unsigned nHits = hits.length();
49 for (
unsigned i = 0; i < nHits; i++ )
62 const unsigned nHitsMC = mcHits.length();
63 const unsigned nHeps = heps.length();
64 for (
unsigned i = 0; i < nHeps; i++ )
67 const float chg = charge( hep.
pType() );
74 unsigned lastLayer = 0;
75 for (
unsigned j = 0; j < mcHits.length(); j++ )
79 if ( !mc->
hit() )
continue;
80 if ( &hep != mc->
hep() )
continue;
81 if ( !hits.hasMember( mc->
hit() ) )
continue;
90 if ( ( ent.unit() ).dot( dir.unit() ) < 0.5 )
continue;
99 const float r = ent.mag();
114 if ( _links.length() == 0 )
continue;
119 Helix h( posOut, momOut, chg );
123 t->append( hepLinks );
140 if ( _perfectFitting == 0 )
142 std::cout <<
"special test in perfect finder" << std::endl;
144 for (
unsigned i = 0; i <
t->nLinks(); i++ )
147 if (
t->links()[i]->wire()->name() ==
"0-56" ) rem =
true;
148 else if (
t->links()[i]->wire()->name() ==
"2-56" ) rem =
true;
149 else if (
t->links()[i]->wire()->name() ==
"5-57" ) rem =
true;
150 else if (
t->links()[i]->wire()->name() ==
"6=68" ) rem =
true;
151 else if (
t->links()[i]->wire()->name() ==
"7=69" ) rem =
true;
152 else if (
t->links()[i]->wire()->name() ==
"8=68" ) rem =
true;
153 else if (
t->links()[i]->wire()->name() ==
"10-85" ) rem =
true;
154 else if (
t->links()[i]->wire()->name() ==
"20-126" ) rem =
true;
155 else if (
t->links()[i]->wire()->name() ==
"39-210" ) rem =
true;
156 else if (
t->links()[i]->wire()->name() ==
"41=221" ) rem =
true;
157 else if (
t->links()[i]->wire()->name() ==
"43=221" ) rem =
true;
158 else if (
t->links()[i]->wire()->name() ==
"46-251" ) rem =
true;
159 else if (
t->links()[i]->wire()->name() ==
"48-251" ) rem =
true;
162 std::cout <<
t->links()[i]->wire()->name() <<
" removed" << std::endl;
163 tmp.append( *
t->links()[i] );
167 t->dump(
"detail",
"@lastHit" );
170 t->dump(
"detail",
"@origin " );
172 t->dump(
"detail",
"fitted " );
173 static const HepVector3D p0( 1.226, -1.025, 0.120 );
174 std::cout <<
"Pdif mag=" << (
t->p() - p0 ).mag() << std::endl;
184float TPerfectFinder::charge(
int pType )
const {
187 if ( pType == 11 ) chg = -1;
188 else if ( pType == -11 ) chg = 1;
189 else if ( pType == 13 ) chg = -1;
190 else if ( pType == -13 ) chg = 1;
191 else if ( pType == 211 ) chg = 1;
192 else if ( pType == -211 ) chg = -1;
193 else if ( pType == 321 ) chg = 1;
194 else if ( pType == -321 ) chg = -1;
195 else if ( pType == 2212 ) chg = 1;
196 else if ( pType == -2212 ) chg = -1;
199 std::cout <<
"TPerfectFinder !!! charge of particle type=";
200 std::cout << pType <<
" is unknown" << std::endl;
HepGeom::Vector3D< double > HepVector3D
HepGeom::Point3D< double > HepPoint3D
const HepPoint3D & pivot(void) const
returns pivot position.
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
A class to represent a MC wire hit in MDC.
const Hep3Vector & momentum(void) const
returns momentum vector at the entrance.
const TTrackHEP *const hep(void) const
returns a pointer to a GEN_HEPEVT.
const HepVector3D & direction(void) const
returns vector from entrance to exit point.
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
const HepPoint3D & entrance(void) const
returns an entrance point.
const TMDCWireHit *const hit(void) const
returns a pointer to a TMDCWireHit.
int leftRight(void) const
returns left or right.
unsigned layerId(void) const
returns layer id.
const HepPoint3D & xyPosition(void) const
returns middle position of a wire. z componet is 0.
static TMDC * getTMDC(void)
const AList< TMDCWireHitMC > & hitsMC(void) const
A class to relate TMDCWireHit and TTrack objects.
unsigned leftRight(void) const
returns left-right. 0:left, 1:right, 2:wire
const TMDCWire *const wire(void) const
returns a pointer to a wire.
std::string version(void) const
returns version.
virtual ~TPerfectFinder()
Destructor.
void clear(void)
clear internal information.
TPerfectFinder(int perfectFitting, float maxSigma, float maxSigmaStereo, unsigned fittingFlag)
Constructor.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
int doit(const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks2D)
finds tracks.
bool perfectFitting(bool)
gets perfect momentum from MC info.
A class to represent a GEN_HEPEVT particle in tracking.
int pType(void) const
returns particle type.
A class to represent a track in tracking.