BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrack Class Reference

A class to represent a track in tracking. More...

#include <TTrack.h>

Inheritance diagram for TTrack:

Public Member Functions

 TTrack ()
 Default constructor.
 TTrack (const TCircle &)
 Constructor.
 TTrack (const TTrack &)
 Copy constructor.
 TTrack (const T3DLine &)
 Constructor.
 TTrack (const Helix &)
 Constructor.
 TTrack (const TRunge &)
virtual ~TTrack ()
 Destructor.
const std::string & name (void) const
 returns/sets name.
const std::string & name (const std::string &newName)
TTrackmother (void) const
 sets/returns mother/daughter.
TTrackmother (TTrack *)
TTrackdaughter (void) const
TTrackdaughter (TTrack *)
unsigned objectType (void) const
 returns type.
unsigned type (void) const
 returns type. Definition is depending on an object type.
unsigned finder (void) const
 sets/returns finder.
unsigned finder (unsigned finderMask)
void setFinderType (unsigned)
unsigned getFinderType (void) const
unsigned quality (void) const
 sets/returns quality.
unsigned quality (unsigned qualityMask)
unsigned fitting (void) const
 sets/returns fitting status.
unsigned fitting (unsigned fitMask)
unsigned state (void) const
 returns/sets internal state.(for bank output)
void assign (unsigned maskForWireHit)
 assigns wire hits to this track.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
double charge (void) const
 returns charge.
const Helixhelix (void) const
 returns helix parameter.
Hep3Vector p (void) const
 returns momentum.
double ptot (void) const
 returns magnitude of momentum.
double pt (void) const
 returns Pt.
double pz (void) const
 returns Pz.
double impact (void) const
 returns signed impact parameter to the origin.
TPoint2D center (void) const
 returns position of helix center.
double radius (void) const
 returns signed radius.
unsigned ndf (void) const
 returns NDF.
double chi2 (void) const
 returns chi2.
double confidenceLevel (void) const
 returns confidence level.
AList< TSegment > & segments (void)
 returns AList<TSegment>.
const AList< TSegment > & segments (void) const
int approach (TMLink &) const
int approach (TMLink &, bool sagCorrection) const
int approach2D (TMLink &) const
int szPosition (TMLink &link) const
 calculates arc length and z for a stereo hit.
int szPosition (const TSegment &segment, TMLink &link) const
 calculates arc length and z for a segment. Results are stored in TMLink.
int szPosition (const HepPoint3D &p, HepPoint3D &szPosition) const
 calculates arc length for a point.
int stereoHitForCurl (TMLink &link, AList< HepPoint3D > &arcZList) const
int stereoHitForCurl (TMLink &link, TMLink &link1) const
int stereoHitForCurl (TMLink &link, TMLink &link1, TMLink &link2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2, AList< HepPoint3D > &l3) const
int stereoHitForCurl (AList< TMLink > &) const
double charge (double)
 sets charge.
int fit2D (unsigned=0, double=0.1, double=0.015)
 fits itself. Error was happened if return value is not zero.
void refine2D (AList< TMLink > &list, float maxSigma)
 fits itself with cathode hits.
void movePivot (void)
 moves pivot to the inner most hit.
int HelCyl (double rhole, double rcyl, double zb, double zf, double epsl, double &phi, HepPoint3D &xp) const
 returns a cathode hit list.
const AList< TMLink > & finalHits (void) const
 finds cathode hits associated to this track.
const AList< TMLink > & finalHits (const AList< TMLink > &hits)
const AList< TMLink > & associateHits (void) const
 sets/returns a list of associated TMLink which are used for table output.
const AList< TMLink > & associateHits (const AList< TMLink > &hits)
 TTrack ()
 Default constructor.
 TTrack (const TCircle &)
 Constructor.
 TTrack (const TTrack &)
 Copy constructor.
 TTrack (const T3DLine &)
 Constructor.
 TTrack (const Helix &)
 Constructor.
 TTrack (const TRunge &)
virtual ~TTrack ()
 Destructor.
const std::string & name (void) const
 returns/sets name.
const std::string & name (const std::string &newName)
TTrackmother (void) const
 sets/returns mother/daughter.
TTrackmother (TTrack *)
TTrackdaughter (void) const
TTrackdaughter (TTrack *)
unsigned objectType (void) const
 returns type.
unsigned type (void) const
 returns type. Definition is depending on an object type.
unsigned finder (void) const
 sets/returns finder.
unsigned finder (unsigned finderMask)
void setFinderType (unsigned)
unsigned getFinderType (void) const
unsigned quality (void) const
 sets/returns quality.
unsigned quality (unsigned qualityMask)
unsigned fitting (void) const
 sets/returns fitting status.
unsigned fitting (unsigned fitMask)
unsigned state (void) const
 returns/sets internal state.(for bank output)
void assign (unsigned maskForWireHit)
 assigns wire hits to this track.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
double charge (void) const
 returns charge.
const Helixhelix (void) const
 returns helix parameter.
Hep3Vector p (void) const
 returns momentum.
double ptot (void) const
 returns magnitude of momentum.
double pt (void) const
 returns Pt.
double pz (void) const
 returns Pz.
double impact (void) const
 returns signed impact parameter to the origin.
TPoint2D center (void) const
 returns position of helix center.
double radius (void) const
 returns signed radius.
unsigned ndf (void) const
 returns NDF.
double chi2 (void) const
 returns chi2.
double confidenceLevel (void) const
 returns confidence level.
AList< TSegment > & segments (void)
 returns AList<TSegment>.
const AList< TSegment > & segments (void) const
int approach (TMLink &) const
int approach (TMLink &, bool sagCorrection) const
int approach2D (TMLink &) const
int szPosition (TMLink &link) const
 calculates arc length and z for a stereo hit.
int szPosition (const TSegment &segment, TMLink &link) const
 calculates arc length and z for a segment. Results are stored in TMLink.
int szPosition (const HepPoint3D &p, HepPoint3D &szPosition) const
 calculates arc length for a point.
int stereoHitForCurl (TMLink &link, AList< HepPoint3D > &arcZList) const
int stereoHitForCurl (TMLink &link, TMLink &link1) const
int stereoHitForCurl (TMLink &link, TMLink &link1, TMLink &link2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2, AList< HepPoint3D > &l3) const
int stereoHitForCurl (AList< TMLink > &) const
double charge (double)
 sets charge.
int fit2D (unsigned=0, double=0.1, double=0.015)
 fits itself. Error was happened if return value is not zero.
void refine2D (AList< TMLink > &list, float maxSigma)
 fits itself with cathode hits.
void movePivot (void)
 moves pivot to the inner most hit.
int HelCyl (double rhole, double rcyl, double zb, double zf, double epsl, double &phi, HepPoint3D &xp) const
 returns a cathode hit list.
const AList< TMLink > & finalHits (void) const
 finds cathode hits associated to this track.
const AList< TMLink > & finalHits (const AList< TMLink > &hits)
const AList< TMLink > & associateHits (void) const
 sets/returns a list of associated TMLink which are used for table output.
const AList< TMLink > & associateHits (const AList< TMLink > &hits)
 TTrack ()
 Default constructor.
 TTrack (const TCircle &)
 Constructor.
 TTrack (const TTrack &)
 Copy constructor.
 TTrack (const T3DLine &)
 Constructor.
 TTrack (const Helix &)
 Constructor.
 TTrack (const TRunge &)
virtual ~TTrack ()
 Destructor.
const std::string & name (void) const
 returns/sets name.
const std::string & name (const std::string &newName)
TTrackmother (void) const
 sets/returns mother/daughter.
TTrackmother (TTrack *)
TTrackdaughter (void) const
TTrackdaughter (TTrack *)
unsigned objectType (void) const
 returns type.
unsigned type (void) const
 returns type. Definition is depending on an object type.
unsigned finder (void) const
 sets/returns finder.
unsigned finder (unsigned finderMask)
void setFinderType (unsigned)
unsigned getFinderType (void) const
unsigned quality (void) const
 sets/returns quality.
unsigned quality (unsigned qualityMask)
unsigned fitting (void) const
 sets/returns fitting status.
unsigned fitting (unsigned fitMask)
unsigned state (void) const
 returns/sets internal state.(for bank output)
void assign (unsigned maskForWireHit)
 assigns wire hits to this track.
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
double charge (void) const
 returns charge.
const Helixhelix (void) const
 returns helix parameter.
Hep3Vector p (void) const
 returns momentum.
double ptot (void) const
 returns magnitude of momentum.
double pt (void) const
 returns Pt.
double pz (void) const
 returns Pz.
double impact (void) const
 returns signed impact parameter to the origin.
TPoint2D center (void) const
 returns position of helix center.
double radius (void) const
 returns signed radius.
unsigned ndf (void) const
 returns NDF.
double chi2 (void) const
 returns chi2.
double confidenceLevel (void) const
 returns confidence level.
AList< TSegment > & segments (void)
 returns AList<TSegment>.
const AList< TSegment > & segments (void) const
int approach (TMLink &) const
int approach (TMLink &, bool sagCorrection) const
int approach2D (TMLink &) const
int szPosition (TMLink &link) const
 calculates arc length and z for a stereo hit.
int szPosition (const TSegment &segment, TMLink &link) const
 calculates arc length and z for a segment. Results are stored in TMLink.
int szPosition (const HepPoint3D &p, HepPoint3D &szPosition) const
 calculates arc length for a point.
int stereoHitForCurl (TMLink &link, AList< HepPoint3D > &arcZList) const
int stereoHitForCurl (TMLink &link, TMLink &link1) const
int stereoHitForCurl (TMLink &link, TMLink &link1, TMLink &link2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2) const
void deleteListForCurl (AList< HepPoint3D > &l1, AList< HepPoint3D > &l2, AList< HepPoint3D > &l3) const
int stereoHitForCurl (AList< TMLink > &) const
double charge (double)
 sets charge.
int fit2D (unsigned=0, double=0.1, double=0.015)
 fits itself. Error was happened if return value is not zero.
void refine2D (AList< TMLink > &list, float maxSigma)
 fits itself with cathode hits.
void movePivot (void)
 moves pivot to the inner most hit.
int HelCyl (double rhole, double rcyl, double zb, double zf, double epsl, double &phi, HepPoint3D &xp) const
 returns a cathode hit list.
const AList< TMLink > & finalHits (void) const
 finds cathode hits associated to this track.
const AList< TMLink > & finalHits (const AList< TMLink > &hits)
const AList< TMLink > & associateHits (void) const
 sets/returns a list of associated TMLink which are used for table output.
const AList< TMLink > & associateHits (const AList< TMLink > &hits)
Public Member Functions inherited from TTrackBase
 TTrackBase ()
 Constructor.
 TTrackBase (const AList< TMLink > &links)
 Constructor.
virtual ~TTrackBase ()
 Destructor.
const AList< TMLink > & links (unsigned mask=0) const
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
void update (void) const
 update cache.
void append (TMLink &)
 appends a TMLink.
void append (const AList< TMLink > &)
 appends TMLinks.
void appendByApproach (AList< TMLink > &list, double maxSigma)
void appendByDistance (AList< TMLink > &list, double maxDistance)
void remove (TMLink &a)
 removes a TMLink.
void remove (const AList< TMLink > &)
 removes TMLinks.
virtual void refine (AList< TMLink > &list, double maxSigma)
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
virtual int DropWorst ()
virtual void removeLinks (void)
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
void falseFit ()
 false Fit
TMLinkoperator[] (unsigned i) const
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
bool fitted (void) const
 returns true if fitted.
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 TTrackBase ()
 Constructor.
 TTrackBase (const AList< TMLink > &links)
 Constructor.
virtual ~TTrackBase ()
 Destructor.
const AList< TMLink > & links (unsigned mask=0) const
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
void update (void) const
 update cache.
void append (TMLink &)
 appends a TMLink.
void append (const AList< TMLink > &)
 appends TMLinks.
void appendByApproach (AList< TMLink > &list, double maxSigma)
void appendByDistance (AList< TMLink > &list, double maxDistance)
void remove (TMLink &a)
 removes a TMLink.
void remove (const AList< TMLink > &)
 removes TMLinks.
virtual void refine (AList< TMLink > &list, double maxSigma)
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
virtual int DropWorst ()
virtual void removeLinks (void)
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
void falseFit ()
 false Fit
TMLinkoperator[] (unsigned i) const
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
bool fitted (void) const
 returns true if fitted.
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 TTrackBase ()
 Constructor.
 TTrackBase (const AList< TMLink > &links)
 Constructor.
virtual ~TTrackBase ()
 Destructor.
const AList< TMLink > & links (unsigned mask=0) const
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
void update (void) const
 update cache.
void append (TMLink &)
 appends a TMLink.
void append (const AList< TMLink > &)
 appends TMLinks.
void appendByApproach (AList< TMLink > &list, double maxSigma)
void appendByDistance (AList< TMLink > &list, double maxDistance)
void remove (TMLink &a)
 removes a TMLink.
void remove (const AList< TMLink > &)
 removes TMLinks.
virtual void refine (AList< TMLink > &list, double maxSigma)
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
virtual int DropWorst ()
virtual void removeLinks (void)
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
void falseFit ()
 false Fit
TMLinkoperator[] (unsigned i) const
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
bool fitted (void) const
 returns true if fitted.
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).

Friends

class TTrackManager
class TrkReco
class THelixFitter
class TCosmicFitter
class Refit
class TBuilder
class TBuilder0
class TBuilderCosmic
class TBuilderCurl
class TPMCurlFinder
class TCurlFinder

Additional Inherited Members

Protected Attributes inherited from TTrackBase
AList< TMLink_links
bool _fitted
bool _fittedWithCathode
TTrackMC_mc

Detailed Description

A class to represent a track in tracking.

Definition at line 128 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

Constructor & Destructor Documentation

◆ TTrack() [1/18]

TTrack::TTrack ( )

Default constructor.

Definition at line 190 of file TTrack.cxx.

191 : TTrackBase()
192 , _charge( 1. )
193 , _helix( new Helix( ORIGIN, Vector( 5, 0 ), SymMatrix( 5, 0 ) ) )
194 , _ndf( 0 )
195 , _chi2( 0. )
196 , _name( "empty track" )
197 , _state( 0 )
198 , _mother( 0 )
199 , _daughter( 0 )
200 , m_pmgnIMF( nullptr ) {}
const HepPoint3D ORIGIN
Constants.
Definition TMDCUtil.cxx:47
TTrackBase()
Constructor.

Referenced by assign(), associateHits(), daughter(), daughter(), deleteListForCurl(), mother(), mother(), TTrack(), and TTrack().

◆ TTrack() [2/18]

TTrack::TTrack ( const TCircle & c)

Constructor.

Definition at line 77 of file TTrack.cxx.

78 : TTrackBase( c.links() )
79 , _helix( new Helix( ORIGIN, Vector( 5, 0 ), SymMatrix( 5, 0 ) ) )
80 , _charge( c.charge() )
81 , _ndf( 0 )
82 , _chi2( 0. )
83 , _name( "none" )
84 , _type( 0 )
85 , _state( 0 )
86 , _mother( 0 )
87 , _daughter( 0 )
88 , m_pmgnIMF( nullptr ) {
89
90 //_fitter.setMagneticFieldPointer(m_pmgnIMF);//yzhang add 2012-05-04
91 // cout<<"TTrack: "<<getPmgnIMF()->getReferField()<<endl;
92 //...Set a defualt fitter...
93 fitter( &TTrack::_fitter );
94
95 //...Calculate helix parameters...
96 Vector a( 5 );
97 a[1] = fmod( atan2( _charge * ( c.center().y() - ORIGIN.y() ),
98 _charge * ( c.center().x() - ORIGIN.x() ) ) +
99 4. * M_PI,
100 2. * M_PI );
101 // a[2] = Helix::ConstantAlpha / c.radius();
102 // a[2] = 333.564095 / c.radius();
103 const double Bz = -1000 * getPmgnIMF()->getReferField();
104 a[2] = 333.564095 / ( c.radius() * Bz );
105 a[0] = ( c.center().x() - ORIGIN.x() ) / cos( a[1] ) - c.radius();
106 a[3] = 0.;
107 a[4] = 0.;
108 _helix->a( a );
109
110 //...Update links...
111 unsigned n = _links.length();
112 for ( unsigned i = 0; i < n; i++ ) _links[i]->track( this );
113
114 _fitted = false;
115 _fittedWithCathode = false;
116 /*
117 //jialk
118 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
119 if(scmgn!=StatusCode::SUCCESS) {
120 std::cout<< __FILE__<<" "<<__LINE__<<" Unable to open Magnetic field
121 service"<<std::endl;
122 }
123 */
124}
const Int_t n
Double_t x[10]
#define M_PI
Definition TConstant.h:4
const HepPoint3D & center(void) const
returns position of center.
const AList< TMLink > & links(unsigned mask=0) const
const TMFitter *const fitter(void) const
returns a pointer to a default fitter.

◆ TTrack() [3/18]

TTrack::TTrack ( const TTrack & a)

Copy constructor.

Definition at line 126 of file TTrack.cxx.

127 : TTrackBase( (TTrackBase&)a )
128 , _charge( a._charge )
129 , _segments( a._segments )
130 , _helix( new Helix( *a._helix ) )
131 , _ndf( a._ndf )
132 , _chi2( a._chi2 )
133 , _name( "copy of " + a._name )
134 , _type( a._type )
135 , _state( a._state )
136 , _mother( a._mother )
137 , _daughter( a._daughter )
138 , m_pmgnIMF( nullptr ) {}

◆ TTrack() [4/18]

TTrack::TTrack ( const T3DLine & )

Constructor.

◆ TTrack() [5/18]

TTrack::TTrack ( const Helix & h)

Constructor.

Definition at line 168 of file TTrack.cxx.

169 : TTrackBase()
170 , _helix( new Helix( h ) )
171 , _ndf( 0 )
172 , _chi2( 0. )
173 , _name( "none" )
174 , _type( 0 )
175 , _state( 0 )
176 , _mother( 0 )
177 , _daughter( 0 )
178 , m_pmgnIMF( nullptr ) {
179
180 //...Set a defualt fitter...
181 fitter( &TTrack::_fitter );
182
183 if ( _helix->kappa() > 0. ) _charge = 1.;
184 else _charge = -1.;
185
186 _fitted = false;
187 _fittedWithCathode = false;
188}

◆ TTrack() [6/18]

TTrack::TTrack ( const TRunge & a)

Definition at line 153 of file TTrack.cxx.

154 : TTrackBase( (TTrackBase&)a )
155 , _helix( new Helix( a.helix() ) )
156 , _ndf( a.ndf() )
157 , _chi2( a.chi2() )
158 , _name( "no" )
159 , _type( 0 )
160 , _state( 0 )
161 , _mother( 0 )
162 , _daughter( 0 )
163 , m_pmgnIMF( nullptr ) {
164 if ( _helix->kappa() > 0. ) _charge = 1.;
165 else _charge = -1.;
166}
Helix helix(void) const
returns helix class
Definition TRunge.cxx:253
unsigned ndf(void) const
returns NDF
Definition TRunge.cxx:255
double chi2(void) const
returns chi2.
Definition TRunge.cxx:257

◆ ~TTrack() [1/3]

TTrack::~TTrack ( )
virtual

Destructor.

Definition at line 202 of file TTrack.cxx.

202{ delete _helix; }

◆ TTrack() [7/18]

TTrack::TTrack ( )

Default constructor.

◆ TTrack() [8/18]

TTrack::TTrack ( const TCircle & )

Constructor.

◆ TTrack() [9/18]

TTrack::TTrack ( const TTrack & )

Copy constructor.

◆ TTrack() [10/18]

TTrack::TTrack ( const T3DLine & )

Constructor.

◆ TTrack() [11/18]

TTrack::TTrack ( const Helix & )

Constructor.

◆ TTrack() [12/18]

TTrack::TTrack ( const TRunge & )

◆ ~TTrack() [2/3]

virtual TTrack::~TTrack ( )
virtual

Destructor.

◆ TTrack() [13/18]

TTrack::TTrack ( )

Default constructor.

◆ TTrack() [14/18]

TTrack::TTrack ( const TCircle & )

Constructor.

◆ TTrack() [15/18]

TTrack::TTrack ( const TTrack & )

Copy constructor.

◆ TTrack() [16/18]

TTrack::TTrack ( const T3DLine & )

Constructor.

◆ TTrack() [17/18]

TTrack::TTrack ( const Helix & )

Constructor.

◆ TTrack() [18/18]

TTrack::TTrack ( const TRunge & )

◆ ~TTrack() [3/3]

virtual TTrack::~TTrack ( )
virtual

Destructor.

Member Function Documentation

◆ approach() [1/6]

int TTrack::approach ( TMLink & l) const
virtual

calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.

Reimplemented from TTrackBase.

Definition at line 265 of file TTrack.cxx.

265{ return approach( l, false ); }
int approach(TMLink &) const
Definition TTrack.cxx:265

Referenced by approach(), and TTrackManager::closest().

◆ approach() [2/6]

int TTrack::approach ( TMLink & ) const
virtual

calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.

Reimplemented from TTrackBase.

◆ approach() [3/6]

int TTrack::approach ( TMLink & ) const
virtual

calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.

Reimplemented from TTrackBase.

◆ approach() [4/6]

int TTrack::approach ( TMLink & link,
bool sagCorrection ) const

Definition at line 3080 of file TTrack.cxx.

3080 {
3081 //...Cal. dPhi to rotate...
3082 const TMDCWire& w = *link.wire();
3083 double wp[3];
3084 w.xyPosition( wp );
3085 double wb[3];
3086 w.backwardPosition( wb );
3087 double v[3];
3088 v[0] = w.direction().x();
3089 v[1] = w.direction().y();
3090 v[2] = w.direction().z();
3091 //...Sag correction...
3092 if ( doSagCorrection )
3093 {
3094 HepVector3D dir = w.direction();
3095 HepPoint3D xw( wp[0], wp[1], wp[2] );
3096 HepPoint3D wireBackwardPosition( wb[0], wb[1], wb[2] );
3097 w.wirePosition( link.positionOnTrack().z(), xw, wireBackwardPosition, dir );
3098 v[0] = dir.x();
3099 v[1] = dir.y();
3100 v[2] = dir.z();
3101 wp[0] = xw.x();
3102 wp[1] = xw.y();
3103 wp[2] = xw.z();
3104 wb[0] = wireBackwardPosition.x();
3105 wb[1] = wireBackwardPosition.y();
3106 wb[2] = wireBackwardPosition.z();
3107 }
3108 //...Cal. dPhi to rotate...
3109 const HepPoint3D& xc = _helix->center();
3110 double xt[3];
3111 _helix->x( 0., xt );
3112 double x0 = -xc.x();
3113 double y0 = -xc.y();
3114 double x1 = wp[0] + x0;
3115 double y1 = wp[1] + y0;
3116 x0 += xt[0];
3117 y0 += xt[1];
3118 double dPhi = atan2( x0 * y1 - y0 * x1, x0 * x1 + y0 * y1 );
3119 //...Setup...
3120 double kappa = _helix->kappa();
3121 double phi0 = _helix->phi0();
3122// yzhang 2012-08-30
3123//...Axial case...
3124// if (w.axial()) {
3125// link.positionOnTrack(_helix->x(dPhi));
3126// HepPoint3D x(wp[0], wp[1], wp[2]);
3127// x.setZ(link.positionOnTrack().z());
3128// link.positionOnWire(x);
3129// link.dPhi(dPhi);
3130// return 0;
3131// }
3132#ifdef TRKRECO_DEBUG
3133 double firstdfdphi = 0.;
3134 static bool first = true;
3135 if ( first )
3136 {
3137 // extern BelleTupleManager * BASF_Histogram;
3138 // BelleTupleManager * m = BASF_Histogram;
3139 // h_nTrial = m->histogram("TTrack::approach nTrial", 100, 0., 100.);
3140 }
3141#endif
3142
3143 //...Stereo case...
3144 // double rho = Helix::ConstantAlpha / kappa;
3145 // double rho = 333.564095 / kappa;
3146 // yzhang 2012-05-03 delete
3147 // double rho = 333.564095/ kappa;
3148 // yzhang add
3149 Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
3150 if ( m_pmgnIMF == NULL )
3151 {
3152 std::cout << __FILE__ << " " << __LINE__ << " Unable to open Magnetic field service"
3153 << std::endl;
3154 }
3155 const double Bz = -1000 * getPmgnIMF()->getReferField();
3156 double rho = 333.564095 / ( kappa * Bz );
3157 // zhangy
3158 double tanLambda = _helix->tanl();
3159 static Vector x( 3 );
3160 double t_x[3];
3161 double t_dXdPhi[3];
3162 const double convergence = 1.0e-5;
3163 double l;
3164 unsigned nTrial = 0;
3165 while ( nTrial < 100 )
3166 {
3167
3168 x = link.positionOnTrack( _helix->x( dPhi ) );
3169 t_x[0] = x[0];
3170 t_x[1] = x[1];
3171 t_x[2] = x[2];
3172
3173 l = v[0] * t_x[0] + v[1] * t_x[1] + v[2] * t_x[2] - v[0] * wb[0] - v[1] * wb[1] -
3174 v[2] * wb[2];
3175
3176 double rcosPhi = rho * cos( phi0 + dPhi );
3177 double rsinPhi = rho * sin( phi0 + dPhi );
3178 t_dXdPhi[0] = rsinPhi;
3179 t_dXdPhi[1] = -rcosPhi;
3180 t_dXdPhi[2] = -rho * tanLambda;
3181
3182 //...f = d(Distance) / d phi...
3183 double t_d2Xd2Phi[2];
3184 t_d2Xd2Phi[0] = rcosPhi;
3185 t_d2Xd2Phi[1] = rsinPhi;
3186
3187 //...iw new...
3188 double n[3];
3189 n[0] = t_x[0] - wb[0];
3190 n[1] = t_x[1] - wb[1];
3191 n[2] = t_x[2] - wb[2];
3192
3193 double a[3];
3194 a[0] = n[0] - l * v[0];
3195 a[1] = n[1] - l * v[1];
3196 a[2] = n[2] - l * v[2];
3197 double dfdphi = a[0] * t_dXdPhi[0] + a[1] * t_dXdPhi[1] + a[2] * t_dXdPhi[2];
3198
3199#ifdef TRKRECO_DEBUG
3200 if ( nTrial == 0 )
3201 {
3202 // break;
3203 firstdfdphi = dfdphi;
3204 }
3205
3206 //...Check bad case...
3207 if ( nTrial > 3 )
3208 {
3209 std::cout << "TTrack::approach ... " << w.name() << " "
3210 << "dfdphi(0)=" << firstdfdphi << ",(" << nTrial << ")=" << dfdphi << endl;
3211 }
3212#endif
3213
3214 //...Is it converged?...
3215 if ( fabs( dfdphi ) < convergence ) break;
3216
3217 double dv = v[0] * t_dXdPhi[0] + v[1] * t_dXdPhi[1] + v[2] * t_dXdPhi[2];
3218 double t0 =
3219 t_dXdPhi[0] * t_dXdPhi[0] + t_dXdPhi[1] * t_dXdPhi[1] + t_dXdPhi[2] * t_dXdPhi[2];
3220 double d2fd2phi = t0 - dv * dv + a[0] * t_d2Xd2Phi[0] + a[1] * t_d2Xd2Phi[1];
3221 // + a[2] * t_d2Xd2Phi[2];
3222
3223 dPhi -= dfdphi / d2fd2phi;
3224
3225 // cout << "nTrial=" << nTrial << endl;
3226 // cout << "iw f,df,dphi=" << dfdphi << "," << d2fd2phi << "," << dPhi << endl;
3227
3228 ++nTrial;
3229 }
3230
3231 //...Cal. positions...
3232 link.positionOnWire( HepPoint3D( wb[0] + l * v[0], wb[1] + l * v[1], wb[2] + l * v[2] ) );
3233 link.dPhi( dPhi );
3234
3235#ifdef TRKRECO_DEBUG
3236// h_nTrial->accumulate((float) nTrial + .5);
3237#endif
3238
3239 return nTrial;
3240}
HepGeom::Vector3D< double > HepVector3D
double w
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
HepGeom::Point3D< double > HepPoint3D
const HepPoint3D & xyPosition(void) const
returns middle position of a wire. z componet is 0.
Index first(Pair i)

◆ approach() [5/6]

int TTrack::approach ( TMLink & ,
bool sagCorrection ) const

◆ approach() [6/6]

int TTrack::approach ( TMLink & ,
bool sagCorrection ) const

◆ approach2D() [1/3]

int TTrack::approach2D ( TMLink & l) const

Definition at line 2919 of file TTrack.cxx.

2919 {
2920
2921 const TMDCWire& w = *l.wire();
2922 double kappa = _helix->a()[2];
2923 double phi0 = _helix->a()[1];
2924 HepPoint3D xc( _helix->center() );
2925 HepPoint3D xw( w.xyPosition() );
2926 HepPoint3D xt( _helix->x() );
2927 HepVector3D v0( xt - xc );
2928 HepVector3D v1( xw - xc );
2929
2930 double vCrs = v0.x() * v1.y() - v0.y() * v1.x();
2931 double vDot = v0.x() * v1.x() + v0.y() * v1.y();
2932 double dPhi = atan2( vCrs, vDot );
2933
2934 xt = _helix->x( dPhi );
2935 xt.setZ( 0. );
2936 l.positionOnTrack( xt );
2937 xw.setZ( 0. );
2938 l.positionOnWire( xw );
2939 l.dPhi( dPhi );
2940 return 0;
2941}

Referenced by fit2D().

◆ approach2D() [2/3]

int TTrack::approach2D ( TMLink & ) const

◆ approach2D() [3/3]

int TTrack::approach2D ( TMLink & ) const

◆ assign() [1/3]

void TTrack::assign ( unsigned maskForWireHit)

assigns wire hits to this track.

Definition at line 3648 of file TTrack.cxx.

3648 {
3649 hitMask |= WireHitUsed;
3650
3651 unsigned n = _links.length();
3652 for ( unsigned i = 0; i < n; i++ )
3653 {
3654 TMLink* l = _links[i];
3655 const TMDCWireHit* h = l->hit();
3656#ifdef TRKRECO_DEBUG
3657 if ( h->track() )
3658 {
3659 std::cout << "TTrack::assign !!! hit(" << h->wire()->name();
3660 std::cout << ") already assigned" << std::endl;
3661 }
3662#endif
3663
3664 //...This function will be moved to TTrackManager...
3665 h->track( (TTrack*)this );
3666 h->state( h->state() | hitMask );
3667 }
3668}
const TTrack *const track(void) const
assigns a pointer to a TTrack.
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
std::string name(void) const
returns name.
TTrack()
Default constructor.
Definition TTrack.cxx:190

◆ assign() [2/3]

void TTrack::assign ( unsigned maskForWireHit)

assigns wire hits to this track.

◆ assign() [3/3]

void TTrack::assign ( unsigned maskForWireHit)

assigns wire hits to this track.

◆ associateHits() [1/6]

const AList< TMLink > & TTrack::associateHits ( const AList< TMLink > & hits)
inline

Definition at line 559 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

559 {
560 _associateHits = list;
561 return _associateHits;
562}

◆ associateHits() [2/6]

const AList< TMLink > & TTrack::associateHits ( const AList< TMLink > & hits)

◆ associateHits() [3/6]

const AList< TMLink > & TTrack::associateHits ( const AList< TMLink > & hits)

◆ associateHits() [4/6]

const AList< TMLink > & TTrack::associateHits ( void ) const
inline

sets/returns a list of associated TMLink which are used for table output.

Definition at line 564 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

564{ return _associateHits; }

◆ associateHits() [5/6]

const AList< TMLink > & TTrack::associateHits ( void ) const

sets/returns a list of associated TMLink which are used for table output.

◆ associateHits() [6/6]

const AList< TMLink > & TTrack::associateHits ( void ) const

sets/returns a list of associated TMLink which are used for table output.

◆ center() [1/3]

TPoint2D TTrack::center ( void ) const
inline

returns position of helix center.

Definition at line 493 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

493{ return TPoint2D( _helix->center() ); }

Referenced by stereoHitForCurl(), szPosition(), and szPosition().

◆ center() [2/3]

TPoint2D TTrack::center ( void ) const

returns position of helix center.

◆ center() [3/3]

TPoint2D TTrack::center ( void ) const

returns position of helix center.

◆ charge() [1/6]

double TTrack::charge ( double a)
inline

sets charge.

Definition at line 457 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

457{ return _charge = a; }

◆ charge() [2/6]

double TTrack::charge ( double )

sets charge.

◆ charge() [3/6]

double TTrack::charge ( double )

sets charge.

◆ charge() [4/6]

◆ charge() [5/6]

double TTrack::charge ( void ) const

returns charge.

◆ charge() [6/6]

double TTrack::charge ( void ) const

returns charge.

◆ chi2() [1/3]

double TTrack::chi2 ( void ) const
inline

returns chi2.

Definition at line 448 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

448 {
449# ifdef TRKRECO_DEBUG
450 if ( !_fitted ) std::cout << "TTrack::chi2 !!! chi2 not updated" << std::endl;
451# endif
452 return _chi2;
453}

Referenced by fit2D(), TTrackManager::sortTracksByQuality(), and TTrack().

◆ chi2() [2/3]

double TTrack::chi2 ( void ) const

returns chi2.

◆ chi2() [3/3]

double TTrack::chi2 ( void ) const

returns chi2.

◆ confidenceLevel() [1/3]

double TTrack::confidenceLevel ( void ) const
inline

returns confidence level.

Definition at line 473 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

473 {
474 return chisq2confLevel( (int)_ndf, _chi2 );
475}
double chisq2confLevel(int, double)
ALPHA = 10000. / 2.99792458 / 15.
Definition TMDCUtil.cxx:147

◆ confidenceLevel() [2/3]

double TTrack::confidenceLevel ( void ) const

returns confidence level.

◆ confidenceLevel() [3/3]

double TTrack::confidenceLevel ( void ) const

returns confidence level.

◆ daughter() [1/6]

TTrack * TTrack::daughter ( TTrack * a)
inline

Definition at line 533 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

533 {
534 if ( a ) _state |= ( TrackHasDaughter << TrackRelationShift );
535 else _state &= ( ~( TrackHasDaughter << TrackRelationShift ) );
536 return _daughter = a;
537}

◆ daughter() [2/6]

TTrack * TTrack::daughter ( TTrack * )

◆ daughter() [3/6]

TTrack * TTrack::daughter ( TTrack * )

◆ daughter() [4/6]

TTrack * TTrack::daughter ( void ) const
inline

Definition at line 531 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

531{ return _daughter; }

Referenced by TTrackManager::setCurlerFlags().

◆ daughter() [5/6]

TTrack * TTrack::daughter ( void ) const

◆ daughter() [6/6]

TTrack * TTrack::daughter ( void ) const

◆ deleteListForCurl() [1/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2 ) const

◆ deleteListForCurl() [2/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2 ) const

◆ deleteListForCurl() [3/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2 ) const

◆ deleteListForCurl() [4/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2,
AList< HepPoint3D > & l3 ) const

◆ deleteListForCurl() [5/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2,
AList< HepPoint3D > & l3 ) const

◆ deleteListForCurl() [6/6]

void TTrack::deleteListForCurl ( AList< HepPoint3D > & l1,
AList< HepPoint3D > & l2,
AList< HepPoint3D > & l3 ) const

◆ dump() [1/3]

void TTrack::dump ( const std::string & message = std::string( "" ),
const std::string & prefix = std::string( "" ) ) const
virtual

dumps debug information.

Reimplemented from TTrackBase.

Definition at line 204 of file TTrack.cxx.

204 {
205 bool def = false;
206 if ( msg == "" ) def = true;
207 std::string pre = pre0;
208 std::string tab;
209 for ( unsigned i = 0; i < pre.length(); i++ ) tab += " ";
210 if ( def || msg.find( "track" ) != std::string::npos ||
211 msg.find( "detail" ) != std::string::npos )
212 {
213 std::cout << pre << p() << "(pt=" << pt() << ")" << std::endl
214 << tab << "links=" << _links.length() << "(cores=" << nCores()
215 << "),chrg=" << _charge << ",ndf=" << _ndf << ",chi2=" << _chi2 << std::endl;
216 pre = tab;
217 }
218 if ( msg.find( "helix" ) != std::string::npos || msg.find( "detail" ) != std::string::npos )
219 {
220 std::cout << pre << "pivot=" << _helix->pivot() << ",center=" << _helix->center()
221 << std::endl
222 << pre << "helix=(" << _helix->a()[0] << "," << _helix->a()[1] << ","
223 << _helix->a()[2] << "," << _helix->a()[3] << "," << _helix->a()[4] << ")"
224 << std::endl;
225 pre = tab;
226 }
227 if ( !def ) TTrackBase::dump( msg, pre );
228}
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
unsigned nCores(unsigned mask=0) const
returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
Hep3Vector p(void) const
returns momentum.

◆ dump() [2/3]

void TTrack::dump ( const std::string & message = std::string(""),
const std::string & prefix = std::string("") ) const
virtual

dumps debug information.

Reimplemented from TTrackBase.

◆ dump() [3/3]

void TTrack::dump ( const std::string & message = std::string(""),
const std::string & prefix = std::string("") ) const
virtual

dumps debug information.

Reimplemented from TTrackBase.

◆ finalHits() [1/6]

const AList< TMLink > & TTrack::finalHits ( const AList< TMLink > & hits)
inline

Definition at line 552 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

552 {
553 _finalHits = list;
554 return _finalHits;
555}

◆ finalHits() [2/6]

const AList< TMLink > & TTrack::finalHits ( const AList< TMLink > & hits)

◆ finalHits() [3/6]

const AList< TMLink > & TTrack::finalHits ( const AList< TMLink > & hits)

◆ finalHits() [4/6]

const AList< TMLink > & TTrack::finalHits ( void ) const
inline

finds cathode hits associated to this track.

relation between cluster and wire relation between cluster and layer appends Svd Hits(TSvdHit) returns Svd Hits List sets/returns a list of TMLink which are used for table output.

Definition at line 557 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

557{ return _finalHits; }

◆ finalHits() [5/6]

const AList< TMLink > & TTrack::finalHits ( void ) const

finds cathode hits associated to this track.

relation between cluster and wire relation between cluster and layer appends Svd Hits(TSvdHit) returns Svd Hits List sets/returns a list of TMLink which are used for table output.

◆ finalHits() [6/6]

const AList< TMLink > & TTrack::finalHits ( void ) const

finds cathode hits associated to this track.

relation between cluster and wire relation between cluster and layer appends Svd Hits(TSvdHit) returns Svd Hits List sets/returns a list of TMLink which are used for table output.

◆ finder() [1/6]

unsigned TTrack::finder ( unsigned finderMask)
inline

Definition at line 497 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

497 {
498 _state |= ( a & TrackFinderMask );
499 return finder();
500}
unsigned finder(void) const
sets/returns finder.

◆ finder() [2/6]

unsigned TTrack::finder ( unsigned finderMask)

◆ finder() [3/6]

unsigned TTrack::finder ( unsigned finderMask)

◆ finder() [4/6]

unsigned TTrack::finder ( void ) const
inline

sets/returns finder.

Definition at line 495 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

495{ return _state & TrackFinderMask; }

Referenced by finder(), and TTrackManager::salvage().

◆ finder() [5/6]

unsigned TTrack::finder ( void ) const

sets/returns finder.

◆ finder() [6/6]

unsigned TTrack::finder ( void ) const

sets/returns finder.

◆ fit2D() [1/3]

int TTrack::fit2D ( unsigned ipFlag = 0,
double ipDistance = 0.1,
double ipError = 0.015 )

fits itself. Error was happened if return value is not zero.

fits itself with r-phi view. Error was happened if return value is not zero.

Definition at line 2524 of file TTrack.cxx.

2524 {
2525# ifdef TRKRECO_DEBUG_DETAIL
2526 std::cout << " TTrack::fit2D(r-phi) ..." << std::endl;
2527# endif
2528 // if(_fitted)return 0;
2529
2530 //...Check # of hits...
2531
2532 // std::cout << "# = " << _links.length() << std::endl;
2533 //...Setup...
2534 unsigned nTrial( 0 );
2535 Vector a( _helix->a() );
2536 double chi2;
2537 double chi2Old = 1.0e+99;
2538 Vector dchi2da( 3 );
2539 SymMatrix d2chi2d2a( 3, 0 );
2540 Vector da( 5 ), dxda( 3 ), dyda( 3 );
2541 Vector dDda( 3 );
2542 const double convergence = 1.0e-5;
2543 Vector f( 3 );
2544 int err = 0;
2545 double factor = 1.0;
2546 unsigned usedWireNumber = 0;
2547
2548 //...Fitting loop...
2549 while ( nTrial < 100 )
2550 {
2551 //...Set up...
2552 chi2 = 0.;
2553 for ( unsigned j = 0; j < 3; ++j ) dchi2da[j] = 0.;
2554 d2chi2d2a = SymMatrix( 3, 0 );
2555 usedWireNumber = 0;
2556
2557 //...Loop with hits...
2558 unsigned i = 0;
2559 while ( TMLink* l = _links[i++] )
2560 {
2561 if ( l->fit2D() == 0 ) continue;
2562 const TMDCWireHit& h = *l->hit();
2563
2564 //...Cal. closest points...
2565 if ( approach2D( *l ) != 0 ) continue;
2566 double dPhi = l->dPhi();
2567 const HepPoint3D& onTrack = l->positionOnTrack();
2568 const HepPoint3D& onWire = l->positionOnWire();
2569 HepPoint3D onTrack2( onTrack.x(), onTrack.y(), 0. );
2570 HepPoint3D onWire2( onWire.x(), onWire.y(), 0. );
2571
2572 //...Obtain drift distance and its error...
2573 unsigned leftRight = WireHitRight;
2574 if ( onWire2.cross( onTrack2 ).z() < 0. ) leftRight = WireHitLeft;
2575 double distance = h.drift( leftRight );
2576 double eDistance = h.dDrift( leftRight );
2577 double eDistance2 = eDistance * eDistance;
2578 if ( eDistance == 0. )
2579 {
2580 std::cout << "Error(?) : Drift Distance Error = 0 in fit2D of TrkReco." << std::endl;
2581 continue;
2582 }
2583
2584 //...Residual...
2585 HepVector3D v = onTrack2 - onWire2;
2586 double vmag = v.mag();
2587 double dDistance = vmag - distance;
2588
2589 //...dxda...
2590 if ( this->dxda2D( *l, dPhi, dxda, dyda ) != 0 ) continue;
2591
2592 //...Chi2 related...
2593 // Vector3 vw(0.,0.,1.);
2594 dDda = ( vmag > 0. ) ? ( v.x() * dxda + v.y() * dyda ) / vmag : Vector( 3, 0 );
2595 if ( vmag <= 0.0 )
2596 {
2597 std::cout << " in fit2D " << onTrack << ", " << onWire;
2598 h.dump();
2599 continue;
2600 }
2601 dchi2da += ( dDistance / eDistance2 ) * dDda;
2602 d2chi2d2a += vT_times_v( dDda ) / eDistance2;
2603 double pChi2 = dDistance * dDistance / eDistance2;
2604 chi2 += pChi2;
2605
2606 //...Store results...
2607 l->update( onTrack2, onWire2, leftRight, pChi2 );
2608 ++usedWireNumber;
2609 }
2610 if ( ipFlag != 0 )
2611 {
2612 double kappa = _helix->a()[2];
2613 double phi0 = _helix->a()[1];
2614 HepPoint3D xc( _helix->center() );
2615 HepPoint3D onWire( 0., 0., 0. );
2616 HepPoint3D xt( _helix->x() );
2617 HepVector3D v0( xt - xc );
2618 HepVector3D v1( onWire - xc );
2619 double vCrs = v0.x() * v1.y() - v0.y() * v1.x();
2620 double vDot = v0.x() * v1.x() + v0.y() * v1.y();
2621 double dPhi = atan2( vCrs, vDot );
2622 HepPoint3D onTrack( _helix->x( dPhi ).x(), _helix->x( dPhi ).y(), 0. );
2623 double distance = ipDistance;
2624 double eDistance = ipError;
2625 double eDistance2 = eDistance * eDistance;
2626
2627 HepVector3D v = onTrack - onWire;
2628 double vmag = v.mag();
2629 double dDistance = vmag - distance;
2630
2631 if ( this->dxda2D( dPhi, dxda, dyda ) != 0 ) goto ipOff;
2632
2633 dDda = ( vmag > 0. ) ? ( v.x() * dxda + v.y() * dyda ) / vmag : Vector( 3, 0 );
2634 if ( vmag <= 0.0 ) { goto ipOff; }
2635 dchi2da += ( dDistance / eDistance2 ) * dDda;
2636 d2chi2d2a += vT_times_v( dDda ) / eDistance2;
2637 double pChi2 = dDistance * dDistance / eDistance2;
2638 chi2 += pChi2;
2639
2640 ++usedWireNumber;
2641 }
2642 ipOff:
2643 if ( usedWireNumber < 4 )
2644 {
2645 err = -2;
2646 break;
2647 }
2648
2649 //...Check condition...
2650 double change = chi2Old - chi2;
2651 if ( fabs( change ) < convergence ) break;
2652 if ( change < 0. )
2653 {
2654# ifdef TRKRECO_DEBUG_DETAIL
2655 std::cout << "chi2Old, chi2=" << chi2Old << " " << chi2 << std::endl;
2656# endif
2657 // change to the old value.
2658 a += factor * da;
2659 _helix->a( a );
2660
2661 chi2 = 0.;
2662 for ( unsigned j = 0; j < 3; ++j ) dchi2da[j] = 0.;
2663 d2chi2d2a = SymMatrix( 3, 0 );
2664 usedWireNumber = 0;
2665
2666 //...Loop with hits...
2667 unsigned i = 0;
2668 while ( TMLink* l = _links[i++] )
2669 {
2670 if ( l->fit2D() == 0 ) continue;
2671 const TMDCWireHit& h = *l->hit();
2672
2673 //...Cal. closest points...
2674 if ( approach2D( *l ) != 0 ) continue;
2675 double dPhi = l->dPhi();
2676 const HepPoint3D& onTrack = l->positionOnTrack();
2677 const HepPoint3D& onWire = l->positionOnWire();
2678 HepPoint3D onTrack2( onTrack.x(), onTrack.y(), 0. );
2679 HepPoint3D onWire2( onWire.x(), onWire.y(), 0. );
2680
2681 //...Obtain drift distance and its error...
2682 unsigned leftRight = WireHitRight;
2683 if ( onWire2.cross( onTrack2 ).z() < 0. ) leftRight = WireHitLeft;
2684 double distance = h.drift( leftRight );
2685 double eDistance = h.dDrift( leftRight );
2686 double eDistance2 = eDistance * eDistance;
2687
2688 //...Residual...
2689 HepVector3D v = onTrack2 - onWire2;
2690 double vmag = v.mag();
2691 double dDistance = vmag - distance;
2692
2693 //...dxda...
2694 if ( this->dxda2D( *l, dPhi, dxda, dyda ) != 0 ) continue;
2695
2696 //...Chi2 related...
2697 dDda = ( vmag > 0. ) ? ( v.x() * dxda + v.y() * dyda ) / vmag : Vector( 3, 0 );
2698 if ( vmag <= 0.0 )
2699 {
2700 std::cout << " in fit2D " << onTrack << ", " << onWire;
2701 h.dump();
2702 continue;
2703 }
2704 dchi2da += ( dDistance / eDistance2 ) * dDda;
2705 d2chi2d2a += vT_times_v( dDda ) / eDistance2;
2706 double pChi2 = dDistance * dDistance / eDistance2;
2707 chi2 += pChi2;
2708
2709 //...Store results...
2710 l->update( onTrack2, onWire2, leftRight, pChi2 );
2711 ++usedWireNumber;
2712 }
2713 if ( ipFlag != 0 )
2714 {
2715 double kappa = _helix->a()[2];
2716 double phi0 = _helix->a()[1];
2717 HepPoint3D xc( _helix->center() );
2718 HepPoint3D onWire( 0., 0., 0. );
2719 HepPoint3D xt( _helix->x() );
2720 HepVector3D v0( xt - xc );
2721 HepVector3D v1( onWire - xc );
2722 double vCrs = v0.x() * v1.y() - v0.y() * v1.x();
2723 double vDot = v0.x() * v1.x() + v0.y() * v1.y();
2724 double dPhi = atan2( vCrs, vDot );
2725 HepPoint3D onTrack( _helix->x( dPhi ).x(), _helix->x( dPhi ).y(), 0. );
2726 double distance = ipDistance;
2727 double eDistance = ipError;
2728 double eDistance2 = eDistance * eDistance;
2729
2730 HepVector3D v = onTrack - onWire;
2731 double vmag = v.mag();
2732 double dDistance = vmag - distance;
2733
2734 if ( this->dxda2D( dPhi, dxda, dyda ) != 0 ) goto ipOff2;
2735
2736 dDda = ( vmag > 0. ) ? ( v.x() * dxda + v.y() * dyda ) / vmag : Vector( 3, 0 );
2737 if ( vmag <= 0.0 ) { goto ipOff2; }
2738 dchi2da += ( dDistance / eDistance2 ) * dDda;
2739 d2chi2d2a += vT_times_v( dDda ) / eDistance2;
2740 double pChi2 = dDistance * dDistance / eDistance2;
2741 chi2 += pChi2;
2742
2743 ++usedWireNumber;
2744 }
2745 ipOff2:
2746 if ( usedWireNumber < 4 )
2747 {
2748 err = -2;
2749 break;
2750 }
2751 // break;
2752 factor *= 0.75;
2753# ifdef TRKRECO_DEBUG_DETAIL
2754 std::cout << "factor = " << factor << std::endl;
2755 std::cout << "chi2 = " << chi2 << std::endl;
2756# endif
2757 if ( factor < 0.01 ) break;
2758 }
2759
2760 chi2Old = chi2;
2761
2762 //...Cal. helix parameters for next loop...
2763 f = solve( d2chi2d2a, dchi2da );
2764 da[0] = f[0];
2765 da[1] = f[1];
2766 da[2] = f[2];
2767 da[3] = 0.;
2768 da[4] = 0.;
2769
2770 a -= factor * da;
2771 _helix->a( a );
2772 ++nTrial;
2773 }
2774 if ( err ) { return err; }
2775
2776 //...Cal. error matrix...
2777 SymMatrix Ea( 5, 0 );
2778 unsigned dim = 3;
2779 SymMatrix Eb = d2chi2d2a;
2780 SymMatrix Ec = Eb.inverse( err );
2781 Ea[0][0] = Ec[0][0];
2782 Ea[0][1] = Ec[0][1];
2783 Ea[0][2] = Ec[0][2];
2784 Ea[1][1] = Ec[1][1];
2785 Ea[1][2] = Ec[1][2];
2786 Ea[2][2] = Ec[2][2];
2787
2788 //...Store information...
2789 if ( !err )
2790 {
2791 _helix->a( a );
2792 _helix->Ea( Ea );
2793 }
2794 else { err = -2; }
2795
2796 _ndf = usedWireNumber - dim;
2797 _chi2 = chi2;
2798
2799 //_fitted = true;
2800
2801# define JJJTEST 0
2802# if JJJTEST
2803 double gmaxX = -9999., gminX = 9999.;
2804 double gmaxY = -9999., gminY = 9999.;
2805 FILE * gnuplot, *data;
2806 double step = 200.;
2807 double dStep = 2. * M_PI / step;
2808 for ( int i = 0, size = _links.length(); i < size; ++i )
2809 {
2810 TMLink* l = _links[i];
2811 double drift = l->hit()->distance( 0 );
2812 char name[100] = "dat";
2813 char counter[10] = "";
2814 sprintf( counter, "%02d", i );
2815 strcat( name, counter );
2816 if ( ( data = fopen( name, "w" ) ) != NULL )
2817 {
2818 for ( int ii = 0; ii < step; ++ii )
2819 {
2820 double X =
2821 l->wire()->xyPosition().x() + drift * cos( dStep * static_cast<double>( ii ) );
2822 double Y =
2823 l->wire()->xyPosition().y() + drift * sin( dStep * static_cast<double>( ii ) );
2824 fprintf( data, "%lf, %lf\n", X, Y );
2825 if ( gmaxX < X ) gmaxX = X;
2826 if ( gminX > X ) gminX = X;
2827 if ( gmaxY < Y ) gmaxY = Y;
2828 if ( gminY > Y ) gminY = Y;
2829 }
2830 fclose( data );
2831 }
2832 }
2833 step = 300.;
2834 dStep = 2. * M_PI / step;
2835 if ( ( data = fopen( "datc", "w" ) ) != NULL )
2836 {
2837 for ( int ii = 0; ii < step; ++ii )
2838 {
2839 double X =
2840 _helix->center().x() + _helix->radius() * cos( dStep * static_cast<double>( ii ) );
2841 double Y =
2842 _helix->center().y() + _helix->radius() * sin( dStep * static_cast<double>( ii ) );
2843 fprintf( data, "%lf, %lf\n", X, Y );
2844 }
2845 fclose( data );
2846 }
2847 if ( ( gnuplot = popen( "gnuplot", "w" ) ) != NULL )
2848 {
2849 fprintf( gnuplot, "set size 0.721,1.0 \n" );
2850 fprintf( gnuplot, "set xrange [%f:%f] \n", gminX, gmaxX );
2851 fprintf( gnuplot, "set yrange [%f:%f] \n", gminY, gmaxY );
2852 if ( _links.length() == 4 )
2853 {
2854 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2855 "\"dat02\" with line, "
2856 "\"dat03\" with line \n" );
2857 }
2858 else if ( _links.length() == 5 )
2859 {
2860 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2861 "\"dat02\" with line, "
2862 "\"dat03\" with line, \"dat04\" with line \n" );
2863 }
2864 else if ( _links.length() == 6 )
2865 {
2866 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2867 "\"dat02\" with line, "
2868 "\"dat03\" with line, \"dat04\" with line, \"dat05\" with line \n" );
2869 }
2870 else if ( _links.length() == 7 )
2871 {
2872 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2873 "\"dat02\" with line, "
2874 "\"dat03\" with line, \"dat04\" with line, \"dat05\" with line, "
2875 "\"dat06\" with line \n" );
2876 }
2877 else if ( _links.length() == 8 )
2878 {
2879 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2880 "\"dat02\" with line, \"dat03\" with "
2881 "line, \"dat04\" with line, \"dat05\" with line, \"dat06\" with line, "
2882 "\"dat07\" with line \n" );
2883 }
2884 else if ( _links.length() == 9 )
2885 {
2886 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2887 "\"dat02\" with line, "
2888 "\"dat03\" with line, \"dat04\" with line, \"dat05\" with line, "
2889 "\"dat06\" with line, \"dat07\" "
2890 "with line, \"dat08\" with line \n" );
2891 }
2892 else if ( _links.length() == 10 )
2893 {
2894 fprintf( gnuplot, "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, "
2895 "\"dat02\" with line, "
2896 "\"dat03\" with line, \"dat04\" with line, \"dat05\" with line, "
2897 "\"dat06\" with line, \"dat07\" "
2898 "with line, \"dat08\" with line, \"dat09\" with line \n" );
2899 }
2900 else if ( _links.length() >= 11 )
2901 {
2902 fprintf( gnuplot,
2903 "plot \"datc\" with line, \"dat00\" with line, \"dat01\" with line, \"dat02\" "
2904 "with line, "
2905 "\"dat03\" with line, \"dat04\" with line, \"dat05\" with line, \"dat06\" with "
2906 "line, \"dat07\" "
2907 "with line, \"dat08\" with line, \"dat09\" with line, \"dat10\" with line \n" );
2908 }
2909 fflush( gnuplot );
2910 char tmp[8];
2911 gets( tmp );
2912 pclose( gnuplot );
2913 }
2914# endif // JJJTEST
2915
2916 return err;
2917}
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
TTree * data
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
float dDrift(unsigned) const
returns drift distance error.
float drift(unsigned) const
returns drift distance.
virtual double distance(const TMLink &) const
returns distance to a position of TMLink in TMLink space.
const std::string & name(void) const
returns/sets name.
int approach2D(TMLink &) const
Definition TTrack.cxx:2919

Referenced by refine2D().

◆ fit2D() [2/3]

int TTrack::fit2D ( unsigned = 0,
double = 0.1,
double = 0.015 )

fits itself. Error was happened if return value is not zero.

fits itself with r-phi view. Error was happened if return value is not zero.

◆ fit2D() [3/3]

int TTrack::fit2D ( unsigned = 0,
double = 0.1,
double = 0.015 )

fits itself. Error was happened if return value is not zero.

fits itself with r-phi view. Error was happened if return value is not zero.

◆ fitting() [1/6]

unsigned TTrack::fitting ( unsigned fitMask)
inline

Definition at line 518 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

518 {
519 _state |= ( ( a << TrackFitShift ) & TrackFitMask );
520 return fitting();
521}
unsigned fitting(void) const
sets/returns fitting status.

◆ fitting() [2/6]

unsigned TTrack::fitting ( unsigned fitMask)

◆ fitting() [3/6]

unsigned TTrack::fitting ( unsigned fitMask)

◆ fitting() [4/6]

unsigned TTrack::fitting ( void ) const
inline

sets/returns fitting status.

Definition at line 514 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

514 {
515 return ( _state >> TrackFitShift ) & TrackFitMask;
516}

Referenced by fitting().

◆ fitting() [5/6]

unsigned TTrack::fitting ( void ) const

sets/returns fitting status.

◆ fitting() [6/6]

unsigned TTrack::fitting ( void ) const

sets/returns fitting status.

◆ getFinderType() [1/3]

unsigned TTrack::getFinderType ( void ) const
inline

Definition at line 542 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

542{ return _findertype; }

◆ getFinderType() [2/3]

unsigned TTrack::getFinderType ( void ) const

◆ getFinderType() [3/3]

unsigned TTrack::getFinderType ( void ) const

◆ HelCyl() [1/3]

int TTrack::HelCyl ( double rhole,
double rcyl,
double zb,
double zf,
double epsl,
double & phi,
HepPoint3D & xp ) const

returns a cathode hit list.

calculates an intersection of this track and a cylinder.

Definition at line 283 of file TTrack.cxx.

284 {
285
286 int status( 0 ); // return value
287 //---------------------------------------------------------------------
288 // value | ext | status
289 //---------------------------------------------------------------------
290 // 1. | OK |
291 // -1. | NO | charge = 0
292 // 0. | NO | | tanl | < 0.1 ( neglect | lamda | < 5.7 deg. )
293 // | | or | dPhi | > 2 pi ( neglect curly track )
294 // | | or cannot reach to r=rhole at z = zb or zf.
295 // 2. | OK | backward , ext point set on z = zb
296 // 3. | OK | forward , ext point set on z = zf
297 //---------------------------------------------------------------------
298 // * when value = 0,2,3 , ext(z) <= zb or ext(z) >= zf
299
300 //--- debug
301 // std::cout << " " << std::endl;
302 // std::cout << "HelCyl called .. rhole=" << rhole << " rCyl=" << rCyl ;
303 // std::cout << " zb=" << zb << " zf=" << zf << " epsl=" << epsl << std::endl;
304 //--- debug end
305
306 // Check of Charge
307
308 if ( int( _charge ) == 0 )
309 {
310 std::cout << "HelCyl gets a straight line !!" << std::endl;
311 return -1;
312 }
313
314 // parameters
315
316 HepPoint3D CenterCyl( 0., 0., 0. );
317 HepPoint3D CenterTrk = _helix->center();
318 double rTrk = fabs( _helix->radius() );
319
320 double rPivot = fabs( _helix->pivot().perp() );
321
322 double phi0 = _helix->a()[1];
323 double tanl = _helix->a()[4];
324 // double zdz = _helix->pivot().z() + _helix->a()[3];
325 double dPhi;
326 double zee;
327
328 // Calculate intersections between cylinder and track
329 // if return value = 2 track hitting barrel part
330
331 HepPoint3D Cross1, Cross2;
332
333 if ( intersection( CenterTrk, _charge * rTrk, CenterCyl, rCyl, epsl, Cross1, Cross2 ) == 2 )
334 {
335
336 double phiCyl = atan2( _charge * ( CenterTrk.y() - Cross1.y() ),
337 _charge * ( CenterTrk.x() - Cross1.x() ) );
338 phiCyl = ( phiCyl > 0. ) ? phiCyl : phiCyl + 2. * M_PI;
339
340 dPhi = phiCyl - phi0;
341
342 // dPhi region ( at cylinder )
343 // -pi <= dPhi < pi
344
345 double PhiYobun = 1. / fabs( _helix->radius() );
346 double zero = 0.00001;
347
348 if ( _charge >= 0. )
349 {
350 if ( dPhi > PhiYobun ) dPhi -= 2. * M_PI;
351 if ( -2. * M_PI - zero <= dPhi <= ( -2. * M_PI + PhiYobun ) ) dPhi += 2. * M_PI;
352 }
353
354 if ( _charge < 0. )
355 {
356 if ( dPhi < -PhiYobun ) dPhi += 2. * M_PI;
357 if ( 2. * M_PI + zero >= dPhi >= ( 2. * M_PI - PhiYobun ) ) dPhi -= 2. * M_PI;
358 }
359
360 if ( dPhi < -M_PI ) dPhi += 2. * M_PI;
361 if ( dPhi >= M_PI ) dPhi -= 2. * M_PI;
362
363 //--debug
364 // std::cout << "dPhi = " << dPhi << std::endl;
365 //--debug end
366
367 xp.setX( Cross1.x() );
368 xp.setY( Cross1.y() );
369 xp.setZ( _helix->x( dPhi ).z() );
370 // xp.setZ( zdz - _charge * rTrk * tanl * dPhi );
371
372 if ( xp.z() > zb && xp.z() < zf )
373 {
374 phi = dPhi;
375 //--- debug ---
376 // std::cout << "return1 ( ext success )" << std::endl;
377 // std::cout << " xp:= " << xp.x() << ", " << xp.y() << ", " << xp.z() << std::endl;
378 //--- debug ----
379 return 1;
380 }
381 }
382
383 // tracks hitting endcaps
384
385 if ( fabs( tanl ) < 0.1 )
386 {
387 //--- debug ---
388 // std::cout << "return0 ( ext failed , |tanl| < 0.1 )" << std::endl;
389 // std::cout << " xp:= " << xp.x() << ", " << xp.y() << ", " << xp.z() << std::endl;
390 //--- debug ---
391 return 0;
392 }
393
394 if ( tanl > 0. )
395 {
396 zee = zf;
397 status = 3;
398 }
399 else
400 {
401 zee = zb;
402 status = 2;
403 }
404
405 dPhi = _charge * ( _helix->x( 0. ).z() - zee ) / rTrk / tanl;
406 // dPhi = _charge * ( zdz - zee )/rTrk/tanl;
407
408 // Requre dPhi < 2*pi
409
410 if ( fabs( dPhi ) > 2. * M_PI )
411 {
412 //--- debug ---
413 // std::cout << " return0 ( ext failed , dPhi > 2pi )" << std::endl;
414 // std::cout << " xp:= " << xp.x() << ", " << xp.y() << ", " << xp.z() << std::endl;
415 //--- debug ---
416 return 0;
417 }
418
419 xp.setX( _helix->x( dPhi ).x() );
420 xp.setY( _helix->x( dPhi ).y() );
421 xp.setZ( zee );
422
423 double test = xp.perp2() - rhole * rhole;
424 if ( test < 0. )
425 {
426 //--- debug ---
427 // std::cout << "return0 ( cannot reach to rhole at z=edge )" << std::endl;
428 // std::cout << " xp:= " << xp.x() << ", " << xp.y() << ", " << xp.z() << std::endl;
429 //--- debug ---
430 return 0;
431 }
432
433 phi = dPhi;
434 //--- debug ---
435 // std::cout << "return" << status << std::endl;
436 // std::cout << " xp:= " << xp.x() << ", " << xp.y() << ", " << xp.z() << std::endl;
437 //--- debug ---
438
439 return status;
440}
std::string test
const DifNumber zero
int intersection(const HepPoint3D &c1, double r1, const HepPoint3D &c2, double r2, double eps, HepPoint3D &x1, HepPoint3D &x2)
Circle utilities.
Definition TMDCUtil.cxx:93

◆ HelCyl() [2/3]

int TTrack::HelCyl ( double rhole,
double rcyl,
double zb,
double zf,
double epsl,
double & phi,
HepPoint3D & xp ) const

returns a cathode hit list.

calculates an intersection of this track and a cylinder.

◆ HelCyl() [3/3]

int TTrack::HelCyl ( double rhole,
double rcyl,
double zb,
double zf,
double epsl,
double & phi,
HepPoint3D & xp ) const

returns a cathode hit list.

calculates an intersection of this track and a cylinder.

◆ helix() [1/3]

const Helix & TTrack::helix ( void ) const
inline

returns helix parameter.

Definition at line 434 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

434 {
435# ifdef TRKRECO_DEBUG
436 // if (! _fitted) std::cout << "TTrack::helix !!! helix not updated" << std::endl;
437# endif
438 return *_helix;
439}

Referenced by TBuilder0::buildStereo(), TBuilder::buildStereo(), TBuilderCosmic::buildStereo(), TBuilderCurl::buildStereo(), TBuilder0::buildStereo0(), TBuilderCurl::buildStereoMC(), calVirtualCircle(), TTrackManager::merge(), and TTrack().

◆ helix() [2/3]

const Helix & TTrack::helix ( void ) const

returns helix parameter.

◆ helix() [3/3]

const Helix & TTrack::helix ( void ) const

returns helix parameter.

◆ impact() [1/3]

double TTrack::impact ( void ) const
inline

returns signed impact parameter to the origin.

Definition at line 483 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

483 {
484 return fabs( _helix->radius() ) - _helix->center().mag();
485}

Referenced by TBuilderCurl::buildStereo(), TBuilderCurl::buildStereoMC(), and TMSelector::select().

◆ impact() [2/3]

double TTrack::impact ( void ) const

returns signed impact parameter to the origin.

◆ impact() [3/3]

double TTrack::impact ( void ) const

returns signed impact parameter to the origin.

◆ mother() [1/6]

TTrack * TTrack::mother ( TTrack * a)
inline

Definition at line 525 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

525 {
526 if ( a ) _state |= ( TrackHasMother << TrackRelationShift );
527 else _state &= ( ~( TrackHasMother << TrackRelationShift ) );
528 return _mother = a;
529}

◆ mother() [2/6]

TTrack * TTrack::mother ( TTrack * )

◆ mother() [3/6]

TTrack * TTrack::mother ( TTrack * )

◆ mother() [4/6]

TTrack * TTrack::mother ( void ) const
inline

sets/returns mother/daughter.

Definition at line 523 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

523{ return _mother; }

◆ mother() [5/6]

TTrack * TTrack::mother ( void ) const

sets/returns mother/daughter.

◆ mother() [6/6]

TTrack * TTrack::mother ( void ) const

sets/returns mother/daughter.

◆ movePivot() [1/3]

void TTrack::movePivot ( void )

moves pivot to the inner most hit.

Definition at line 230 of file TTrack.cxx.

230 {
231 unsigned n = _links.length();
232 if ( !n )
233 {
234 std::cout << "TTrack::movePivot !!! can't move a pivot"
235 << " because of no link";
236 std::cout << std::endl;
237 return;
238 }
239
240 //...Check cores...
241 const AList<TMLink>& cores = TTrackBase::cores();
242 const AList<TMLink>* links = &cores;
243 if ( cores.length() == 0 ) links = &_links;
244
245 //...Hit loop...
246 unsigned innerMost = 0;
247 unsigned innerMostLayer = ( *links )[0]->wire()->layerId();
248 n = links->length();
249 for ( unsigned i = 1; i < n; i++ )
250 {
251 TMLink* l = ( *links )[i];
252 if ( l->wire()->layerId() < innerMostLayer )
253 {
254 innerMost = i;
255 innerMostLayer = l->wire()->layerId();
256 }
257 }
258
259 //...Move pivot...
260 HepPoint3D newPivot = ( *links )[innerMost]->positionOnWire();
261 if ( quality() & TrackQuality2D ) newPivot.setZ( 0. );
262 _helix->pivot( newPivot );
263}
unsigned layerId(void) const
returns layer id.
const AList< TMLink > & cores(unsigned mask=0) const
returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
unsigned quality(void) const
sets/returns quality.

◆ movePivot() [2/3]

void TTrack::movePivot ( void )

moves pivot to the inner most hit.

◆ movePivot() [3/3]

void TTrack::movePivot ( void )

moves pivot to the inner most hit.

◆ name() [1/6]

const std::string & TTrack::name ( const std::string & newName)
inline

Definition at line 461 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

461{ return _name = a; }

◆ name() [2/6]

const std::string & TTrack::name ( const std::string & newName)

◆ name() [3/6]

const std::string & TTrack::name ( const std::string & newName)

◆ name() [4/6]

const std::string & TTrack::name ( void ) const
inline

returns/sets name.

Definition at line 459 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

459{ return _name; }

Referenced by fit2D(), and TTrackManager::salvageAssociateHits().

◆ name() [5/6]

const std::string & TTrack::name ( void ) const

returns/sets name.

◆ name() [6/6]

const std::string & TTrack::name ( void ) const

returns/sets name.

◆ ndf() [1/3]

unsigned TTrack::ndf ( void ) const
inline

returns NDF.

Definition at line 441 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

441 {
442# ifdef TRKRECO_DEBUG
443 if ( !_fitted ) std::cout << "TTrack::ndf !!! ndf not updated" << std::endl;
444# endif
445 return _ndf;
446}

Referenced by TTrackManager::sortTracksByQuality(), and TTrack().

◆ ndf() [2/3]

unsigned TTrack::ndf ( void ) const

returns NDF.

◆ ndf() [3/3]

unsigned TTrack::ndf ( void ) const

returns NDF.

◆ objectType() [1/3]

unsigned TTrack::objectType ( void ) const
inlinevirtual

returns type.

Reimplemented from TTrackBase.

Definition at line 479 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

◆ objectType() [2/3]

unsigned TTrack::objectType ( void ) const
virtual

returns type.

Reimplemented from TTrackBase.

◆ objectType() [3/3]

unsigned TTrack::objectType ( void ) const
virtual

returns type.

Reimplemented from TTrackBase.

◆ p() [1/3]

Hep3Vector TTrack::p ( void ) const
inline

returns momentum.

Definition at line 477 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

477{ return _helix->momentum( 0. ); }

Referenced by dump(), stereoHitForCurl(), szPosition(), szPosition(), and TTrack().

◆ p() [2/3]

Hep3Vector TTrack::p ( void ) const

returns momentum.

◆ p() [3/3]

Hep3Vector TTrack::p ( void ) const

returns momentum.

◆ pt() [1/3]

double TTrack::pt ( void ) const
inline

◆ pt() [2/3]

double TTrack::pt ( void ) const

returns Pt.

◆ pt() [3/3]

double TTrack::pt ( void ) const

returns Pt.

◆ ptot() [1/3]

double TTrack::ptot ( void ) const
inline

returns magnitude of momentum.

Definition at line 469 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

469 {
470 return ( 1. / fabs( _helix->a()[2] ) ) * sqrt( 1. + _helix->a()[4] * _helix->a()[4] );
471}

◆ ptot() [2/3]

double TTrack::ptot ( void ) const

returns magnitude of momentum.

◆ ptot() [3/3]

double TTrack::ptot ( void ) const

returns magnitude of momentum.

◆ pz() [1/3]

double TTrack::pz ( void ) const
inline

returns Pz.

Definition at line 465 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

465 {
466 return ( 1. / fabs( _helix->a()[2] ) ) * _helix->a()[4];
467}

Referenced by TBuilderCurl::buildStereo().

◆ pz() [2/3]

double TTrack::pz ( void ) const

returns Pz.

◆ pz() [3/3]

double TTrack::pz ( void ) const

returns Pz.

◆ quality() [1/6]

unsigned TTrack::quality ( unsigned qualityMask)
inline

Definition at line 506 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

506 {
507 // _state = ((a << TrackQualityShift) & TrackQualityMask) |
508 // (_state & (~ (TrackQualityMask << TrackQualityShift)));
509 _state = ( ( a & TrackQualityMask ) << TrackQualityShift ) |
510 ( _state & ( ~( TrackQualityMask << TrackQualityShift ) ) );
511 return quality();
512}

◆ quality() [2/6]

unsigned TTrack::quality ( unsigned qualityMask)

◆ quality() [3/6]

unsigned TTrack::quality ( unsigned qualityMask)

◆ quality() [4/6]

unsigned TTrack::quality ( void ) const
inline

sets/returns quality.

Definition at line 502 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

502 {
503 return ( _state >> TrackQualityShift ) & TrackQualityMask;
504}

Referenced by movePivot(), and quality().

◆ quality() [5/6]

unsigned TTrack::quality ( void ) const

sets/returns quality.

◆ quality() [6/6]

unsigned TTrack::quality ( void ) const

sets/returns quality.

◆ radius() [1/3]

double TTrack::radius ( void ) const
inline

returns signed radius.

Definition at line 487 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

487{ return _helix->radius(); }

Referenced by calVirtualCircle().

◆ radius() [2/3]

double TTrack::radius ( void ) const

returns signed radius.

◆ radius() [3/3]

double TTrack::radius ( void ) const

returns signed radius.

◆ refine2D() [1/3]

void TTrack::refine2D ( AList< TMLink > & list,
float maxSigma )

fits itself with cathode hits.

remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function. (using stereo wire as axial wire(z=0))

Definition at line 267 of file TTrack.cxx.

267 {
268 unsigned n = _links.length();
269 AList<TMLink> bad;
270 for ( unsigned i = 0; i < n; ++i )
271 {
272 if ( _links[i]->pull() > maxSigma ) bad.append( _links[i] );
273 }
274 _links.remove( bad );
275 if ( bad.length() )
276 {
277 _fitted = false;
278 fit2D();
279 }
280 list.append( bad );
281}
int fit2D(unsigned=0, double=0.1, double=0.015)
fits itself. Error was happened if return value is not zero.
Definition TTrack.cxx:2524

◆ refine2D() [2/3]

void TTrack::refine2D ( AList< TMLink > & list,
float maxSigma )

fits itself with cathode hits.

remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function. (using stereo wire as axial wire(z=0))

◆ refine2D() [3/3]

void TTrack::refine2D ( AList< TMLink > & list,
float maxSigma )

fits itself with cathode hits.

remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function. (using stereo wire as axial wire(z=0))

◆ segments() [1/6]

AList< TSegment > & TTrack::segments ( void )
inline

returns AList<TSegment>.

Definition at line 489 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

489{ return _segments; }

Referenced by TBuilder::buildStereoNew().

◆ segments() [2/6]

AList< TSegment > & TTrack::segments ( void )

returns AList<TSegment>.

◆ segments() [3/6]

AList< TSegment > & TTrack::segments ( void )

returns AList<TSegment>.

◆ segments() [4/6]

const AList< TSegment > & TTrack::segments ( void ) const
inline

Definition at line 491 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

491{ return _segments; }

◆ segments() [5/6]

const AList< TSegment > & TTrack::segments ( void ) const

◆ segments() [6/6]

const AList< TSegment > & TTrack::segments ( void ) const

◆ setFinderType() [1/3]

void TTrack::setFinderType ( unsigned type)
inline

Definition at line 541 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

541{ _findertype = type; }
unsigned type(void) const
returns type. Definition is depending on an object type.

◆ setFinderType() [2/3]

void TTrack::setFinderType ( unsigned )

◆ setFinderType() [3/3]

void TTrack::setFinderType ( unsigned )

◆ state() [1/3]

unsigned TTrack::state ( void ) const
inline

returns/sets internal state.(for bank output)

Definition at line 539 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

539{ return _state; }

◆ state() [2/3]

unsigned TTrack::state ( void ) const

returns/sets internal state.(for bank output)

◆ state() [3/3]

unsigned TTrack::state ( void ) const

returns/sets internal state.(for bank output)

◆ stereoHitForCurl() [1/12]

int TTrack::stereoHitForCurl ( AList< TMLink > & list) const

calculates arc length and z for a stereo hit. uses these functions for curl tracks(included svd version).

Definition at line 1966 of file TTrack.cxx.

1966 {
1967 if ( list.length() == 0 ) return -1;
1968
1969 HepPoint3D center = _helix->center();
1970 HepPoint3D tmp( -999., -999., 0. );
1971 double r = fabs( _helix->curv() );
1972 for ( unsigned i = 0, size = list.length(); i < size; ++i )
1973 {
1974 TMDCWireHit& h = *const_cast<TMDCWireHit*>( list[i]->hit() );
1975 HepVector3D X = 0.5 * ( h.wire()->forwardPosition() + h.wire()->backwardPosition() );
1976 HepVector3D x = HepVector3D( X.x(), X.y(), 0. );
1977 HepVector3D w = x - center;
1978 HepVector3D V = h.wire()->direction();
1979 HepVector3D v = HepVector3D( V.x(), V.y(), 0. );
1980 double vmag2 = v.mag2();
1981 double vmag = sqrt( vmag2 );
1982 //...temporary
1983 for ( unsigned j = 0; j < 4; ++j ) list[i]->arcZ( tmp, j );
1984
1985 //...stereo?
1986 if ( vmag == 0. ) continue;
1987
1988 double drift = h.drift( WireHitLeft );
1989 double R[2] = { r + drift, r - drift };
1990 double wv = w.dot( v );
1991 double d2[2];
1992 d2[0] = vmag2 * R[0] * R[0] +
1993 ( wv * wv - vmag2 * w.mag2() ); //...= v^2*(r^2 - w^2*sin()^2)...outer
1994 d2[1] = vmag2 * R[1] * R[1] +
1995 ( wv * wv - vmag2 * w.mag2() ); //...= v^2*(r^2 - w^2*sin()^2)...inner
1996
1997 //...No crossing in R/Phi plane...
1998 if ( d2[0] < 0. && d2[1] < 0. ) continue;
1999
2000 bool ok_inner( true );
2001 bool ok_outer( true );
2002 double d[2] = { -1., -1. };
2003 //...outer
2004 if ( d2[0] >= 0. ) { d[0] = sqrt( d2[0] ); }
2005 else { ok_outer = false; }
2006 if ( d2[1] >= 0. ) { d[1] = sqrt( d2[1] ); }
2007 else { ok_inner = false; }
2008
2009 //...Cal. length and z to crossing points...
2010 double l[2][2];
2011 double z[2][2];
2012 for (int i=0; i<2; i++){
2013 for (int j=0; j<2; j++){
2014 z[i][j] = 0.; // add initialize 25-05-15
2015 }
2016 }
2017 //...outer
2018 if ( ok_outer )
2019 {
2020 l[0][0] = ( -wv + d[0] ) /
2021 vmag2; //...= (-wvcos()+d)/v/v = (-wcos() + (r^2 - w^2*sin()^2)^0.5)/v
2022 l[1][0] = ( -wv - d[0] ) /
2023 vmag2; //...= (-wvcos()+d)/v/v = (-wcos() - (r^2 - w^2*sin()^2)^0.5)/v
2024 z[0][0] = X.z() + l[0][0] * V.z();
2025 z[1][0] = X.z() + l[1][0] * V.z();
2026 }
2027 //...inner
2028 if ( ok_inner )
2029 {
2030 l[0][1] = ( -wv + d[1] ) /
2031 vmag2; //...= (-wvcos()+d)/v/v = (-wcos() + (r^2 - w^2*sin()^2)^0.5)/v
2032 l[1][1] = ( -wv - d[1] ) /
2033 vmag2; //...= (-wvcos()+d)/v/v = (-wcos() - (r^2 - w^2*sin()^2)^0.5)/v
2034 z[0][1] = X.z() + l[0][1] * V.z();
2035 z[1][1] = X.z() + l[1][1] * V.z();
2036 }
2037
2038 //...Cal. xy position of crossing points...
2039 HepVector3D p[2][2];
2040#if 1
2041 HepVector3D tp[2][2];
2042#endif
2043 if ( ok_outer )
2044 {
2045 p[0][0] = x + l[0][0] * v;
2046 p[1][0] = x + l[1][0] * v;
2047#if 1
2048 tp[0][0] = p[0][0];
2049 tp[1][0] = p[1][0];
2050#endif
2051 HepVector3D tmp_pc = p[0][0] - center;
2052 HepVector3D pc0 = HepVector3D( tmp_pc.x(), tmp_pc.y(), 0. );
2053 p[0][0] -= drift / pc0.mag() * pc0;
2054 tmp_pc = p[1][0] - center;
2055 HepVector3D pc1 = HepVector3D( tmp_pc.x(), tmp_pc.y(), 0. );
2056 p[1][0] -= drift / pc1.mag() * pc1;
2057 }
2058#define JJTEST 0
2059 if ( ok_inner )
2060 {
2061 p[0][1] = x + l[0][1] * v;
2062 p[1][1] = x + l[1][1] * v;
2063#if JJTEST
2064 tp[0][1] = p[0][1];
2065 tp[1][1] = p[1][1];
2066#endif
2067 HepVector3D tmp_pc = p[0][1] - center;
2068 HepVector3D pc0 = HepVector3D( tmp_pc.x(), tmp_pc.y(), 0. );
2069 p[0][1] += drift / pc0.mag() * pc0;
2070 tmp_pc = p[1][1] - center;
2071 HepVector3D pc1 = HepVector3D( tmp_pc.x(), tmp_pc.y(), 0. );
2072 p[1][1] += drift / pc1.mag() * pc1;
2073 }
2074
2075 //...boolean
2076 bool ok_xy[2][2];
2077 if ( ok_outer )
2078 {
2079 ok_xy[0][0] = true;
2080 ok_xy[1][0] = true;
2081 }
2082 else
2083 {
2084 ok_xy[0][0] = false;
2085 ok_xy[1][0] = false;
2086 }
2087 if ( ok_inner )
2088 {
2089 ok_xy[0][1] = true;
2090 ok_xy[1][1] = true;
2091 }
2092 else
2093 {
2094 ok_xy[0][1] = false;
2095 ok_xy[1][1] = false;
2096 }
2097 if ( ok_outer )
2098 {
2099 if ( _charge * ( center.x() * p[0][0].y() - center.y() * p[0][0].x() ) < 0. )
2100 ok_xy[0][0] = false;
2101 if ( _charge * ( center.x() * p[1][0].y() - center.y() * p[1][0].x() ) < 0. )
2102 ok_xy[1][0] = false;
2103 }
2104 if ( ok_inner )
2105 {
2106 if ( _charge * ( center.x() * p[0][1].y() - center.y() * p[0][1].x() ) < 0. )
2107 ok_xy[0][1] = false;
2108 if ( _charge * ( center.x() * p[1][1].y() - center.y() * p[1][1].x() ) < 0. )
2109 ok_xy[1][1] = false;
2110 }
2111 if ( !ok_inner && ok_outer && ( !ok_xy[0][0] ) && ( !ok_xy[1][0] ) ) { continue; }
2112 if ( ok_inner && !ok_outer && ( !ok_xy[0][1] ) && ( !ok_xy[1][1] ) ) { continue; }
2113
2114 //...Check z position...
2115 if ( ok_xy[0][0] )
2116 {
2117 if ( z[0][0] < h.wire()->backwardPosition().z() ||
2118 z[0][0] > h.wire()->forwardPosition().z() )
2119 ok_xy[0][0] = false;
2120 }
2121 if ( ok_xy[1][0] )
2122 {
2123 if ( z[1][0] < h.wire()->backwardPosition().z() ||
2124 z[1][0] > h.wire()->forwardPosition().z() )
2125 ok_xy[1][0] = false;
2126 }
2127 if ( ok_xy[0][1] )
2128 {
2129 if ( z[0][1] < h.wire()->backwardPosition().z() ||
2130 z[0][1] > h.wire()->forwardPosition().z() )
2131 ok_xy[0][1] = false;
2132 }
2133 if ( ok_xy[1][1] )
2134 {
2135 if ( z[1][1] < h.wire()->backwardPosition().z() ||
2136 z[1][1] > h.wire()->forwardPosition().z() )
2137 ok_xy[1][1] = false;
2138 }
2139 if ( ( !ok_xy[0][0] ) && ( !ok_xy[1][0] ) && ( !ok_xy[0][1] ) && ( !ok_xy[1][1] ) )
2140 { continue; }
2141 double cosdPhi, dPhi;
2142 unsigned index;
2143 index = 0;
2144 if ( ok_xy[0][0] )
2145 {
2146 //...cal. arc length...
2147 cosdPhi = -center.dot( ( p[0][0] - center ).unit() ) / center.mag();
2148 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2149 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2150 else { dPhi = M_PI; }
2151 list[i]->arcZ( HepPoint3D( r * dPhi, z[0][0], 0. ), index );
2152 // std::cout << r*dPhi << ", " << z[0][0] << std::endl;
2153 ++index;
2154 }
2155 if ( ok_xy[1][0] )
2156 {
2157 //...cal. arc length...
2158 cosdPhi = -center.dot( ( p[1][0] - center ).unit() ) / center.mag();
2159 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2160 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2161 else { dPhi = M_PI; }
2162 list[i]->arcZ( HepPoint3D( r * dPhi, z[1][0], 0. ), index );
2163 // std::cout << r*dPhi << ", " << z[1][0] << std::endl;
2164 ++index;
2165 }
2166 if ( ok_xy[0][1] )
2167 {
2168 //...cal. arc length...
2169 cosdPhi = -center.dot( ( p[0][1] - center ).unit() ) / center.mag();
2170 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2171 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2172 else { dPhi = M_PI; }
2173 list[i]->arcZ( HepPoint3D( r * dPhi, z[0][1], 0. ), index );
2174 // std::cout << r*dPhi << ", " << z[0][1] << std::endl;
2175 ++index;
2176 }
2177 if ( ok_xy[1][1] )
2178 {
2179 //...cal. arc length...
2180 cosdPhi = -center.dot( ( p[1][1] - center ).unit() ) / center.mag();
2181 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2182 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2183 else { dPhi = M_PI; }
2184 list[i]->arcZ( HepPoint3D( r * dPhi, z[1][1], 0. ), index );
2185 // std::cout << r*dPhi << ", " << z[1][1] << std::endl;
2186 ++index;
2187 }
2188
2189#if JJTEST
2190 double gmaxX = -9999., gminX = 9999.;
2191 double gmaxY = -9999., gminY = 9999.;
2192 FILE * gnuplot, *data;
2193 double step = 100.;
2194 double dStep = 2. * M_PI / step;
2195 if ( ( data = fopen( "dat1", "w" ) ) != NULL )
2196 {
2197 if ( ok_xy[0][0] )
2198 {
2199 for ( int ii = 0; ii < step; ++ii )
2200 {
2201 double X = tp[0][0].x() + drift * cos( dStep * static_cast<double>( ii ) );
2202 double Y = tp[0][0].y() + drift * sin( dStep * static_cast<double>( ii ) );
2203 fprintf( data, "%lf, %lf\n", X, Y );
2204 if ( gmaxX < X ) gmaxX = X;
2205 if ( gminX > X ) gminX = X;
2206 if ( gmaxY < Y ) gmaxY = Y;
2207 if ( gminY > Y ) gminY = Y;
2208 }
2209 }
2210 fclose( data );
2211 }
2212 if ( ( data = fopen( "dat2", "w" ) ) != NULL )
2213 {
2214 if ( ok_xy[1][0] )
2215 {
2216 for ( int ii = 0; ii < step; ++ii )
2217 {
2218 double X = tp[1][0].x() + drift * cos( dStep * static_cast<double>( ii ) );
2219 double Y = tp[1][0].y() + drift * sin( dStep * static_cast<double>( ii ) );
2220 fprintf( data, "%lf, %lf\n", X, Y );
2221 if ( gmaxX < X ) gmaxX = X;
2222 if ( gminX > X ) gminX = X;
2223 if ( gmaxY < Y ) gmaxY = Y;
2224 if ( gminY > Y ) gminY = Y;
2225 }
2226 }
2227 fclose( data );
2228 }
2229 if ( ( data = fopen( "dat3", "w" ) ) != NULL )
2230 {
2231 if ( ok_xy[0][1] )
2232 {
2233 for ( int ii = 0; ii < step; ++ii )
2234 {
2235 double X = tp[0][1].x() + drift * cos( dStep * static_cast<double>( ii ) );
2236 double Y = tp[0][1].y() + drift * sin( dStep * static_cast<double>( ii ) );
2237 fprintf( data, "%lf, %lf\n", X, Y );
2238 if ( gmaxX < X ) gmaxX = X;
2239 if ( gminX > X ) gminX = X;
2240 if ( gmaxY < Y ) gmaxY = Y;
2241 if ( gminY > Y ) gminY = Y;
2242 }
2243 }
2244 fclose( data );
2245 }
2246 if ( ( data = fopen( "dat4", "w" ) ) != NULL )
2247 {
2248 if ( ok_xy[1][1] )
2249 {
2250 for ( int ii = 0; ii < step; ++ii )
2251 {
2252 double X = tp[1][1].x() + drift * cos( dStep * static_cast<double>( ii ) );
2253 double Y = tp[1][1].y() + drift * sin( dStep * static_cast<double>( ii ) );
2254 fprintf( data, "%lf, %lf\n", X, Y );
2255 if ( gmaxX < X ) gmaxX = X;
2256 if ( gminX > X ) gminX = X;
2257 if ( gmaxY < Y ) gmaxY = Y;
2258 if ( gminY > Y ) gminY = Y;
2259 }
2260 }
2261 fclose( data );
2262 }
2264 HepVector3D tDist( tX.x(), tX.y(), 0. );
2265 double tD = tDist.mag();
2266 double vvvM = 1. / v.mag();
2267 HepVector3D tDire = vvvM * v;
2268 step = 2.;
2269 dStep = tD / step;
2270 if ( ( data = fopen( "dat5", "w" ) ) != NULL )
2271 {
2272 for ( int ii = 0; ii < step + 1; ++ii )
2273 {
2274 double X =
2275 h.wire()->backwardPosition().x() + dStep * static_cast<double>( ii ) * tDire.x();
2276 double Y =
2277 h.wire()->backwardPosition().y() + dStep * static_cast<double>( ii ) * tDire.y();
2278 fprintf( data, "%lf, %lf\n", X, Y );
2279 if ( gmaxX < X ) gmaxX = X;
2280 if ( gminX > X ) gminX = X;
2281 if ( gmaxY < Y ) gmaxY = Y;
2282 if ( gminY > Y ) gminY = Y;
2283 }
2284 fclose( data );
2285 }
2286 if ( ( data = fopen( "dat6", "w" ) ) != NULL )
2287 {
2288 double X = h.wire()->backwardPosition().x();
2289 double Y = h.wire()->backwardPosition().y();
2290 fprintf( data, "%lf, %lf\n", X, Y );
2291 if ( gmaxX < X ) gmaxX = X;
2292 if ( gminX > X ) gminX = X;
2293 if ( gmaxY < Y ) gmaxY = Y;
2294 if ( gminY > Y ) gminY = Y;
2295 fclose( data );
2296 }
2297 if ( ( data = fopen( "dat7", "w" ) ) != NULL )
2298 {
2299 double X = h.wire()->forwardPosition().x();
2300 double Y = h.wire()->forwardPosition().y();
2301 fprintf( data, "%lf, %lf\n", X, Y );
2302 if ( gmaxX < X ) gmaxX = X;
2303 if ( gminX > X ) gminX = X;
2304 if ( gmaxY < Y ) gmaxY = Y;
2305 if ( gminY > Y ) gminY = Y;
2306 fclose( data );
2307 }
2308 step = 300.;
2309 dStep = 2. * M_PI / step;
2310 if ( ( data = fopen( "dat8", "w" ) ) != NULL )
2311 {
2312 for ( int ii = 0; ii < step; ++ii )
2313 {
2314 double X = center.x() + r * cos( dStep * static_cast<double>( ii ) );
2315 double Y = center.y() + r * sin( dStep * static_cast<double>( ii ) );
2316 fprintf( data, "%lf, %lf\n", X, Y );
2317 }
2318 fclose( data );
2319 }
2320 if ( ( data = fopen( "dat9", "w" ) ) != NULL )
2321 {
2322 if ( ok_xy[0][0] )
2323 {
2324 double X = p[0][0].x();
2325 double Y = p[0][0].y();
2326 fprintf( data, "%lf, %lf\n", X, Y );
2327 }
2328 fclose( data );
2329 }
2330 if ( ( data = fopen( "dat10", "w" ) ) != NULL )
2331 {
2332 if ( ok_xy[1][0] )
2333 {
2334 double X = p[1][0].x();
2335 double Y = p[1][0].y();
2336 fprintf( data, "%lf, %lf\n", X, Y );
2337 }
2338 fclose( data );
2339 }
2340 if ( ( data = fopen( "dat11", "w" ) ) != NULL )
2341 {
2342 if ( ok_xy[0][1] )
2343 {
2344 double X = p[0][1].x();
2345 double Y = p[0][1].y();
2346 fprintf( data, "%lf, %lf\n", X, Y );
2347 }
2348 fclose( data );
2349 }
2350 if ( ( data = fopen( "dat12", "w" ) ) != NULL )
2351 {
2352 if ( ok_xy[1][1] )
2353 {
2354 double X = p[1][1].x();
2355 double Y = p[1][1].y();
2356 fprintf( data, "%lf, %lf\n", X, Y );
2357 }
2358 fclose( data );
2359 }
2360 std::cout << "Drift Distance = " << drift << ", xy1cm -> z" << V.z() / v.mag()
2361 << "cm, xyDist(cm) = " << tD << std::endl;
2362 if ( tX.z() < 0. ) std::cout << "ERROR : F < B" << std::endl;
2363 if ( ( gnuplot = popen( "gnuplot", "w" ) ) != NULL )
2364 {
2365 fprintf( gnuplot, "set size 0.721,1.0 \n" );
2366 fprintf( gnuplot, "set xrange [%f:%f] \n", gminX, gmaxX );
2367 fprintf( gnuplot, "set yrange [%f:%f] \n", gminY, gmaxY );
2368 fprintf( gnuplot, "plot \"dat1\" with line, \"dat2\" with line, \"dat3\" with line, "
2369 "\"dat4\" with line, \"dat5\" with "
2370 "line, \"dat6\", \"dat7\", \"dat8\" with line, \"dat9\", \"dat10\", "
2371 "\"dat11\", \"dat12\" \n" );
2372 fflush( gnuplot );
2373 char tmp[8];
2374 gets( tmp );
2375 pclose( gnuplot );
2376 }
2377#endif
2378 }
2379 return 0;
2380}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
Definition FoamA.h:90
const HepVector3D & direction(void) const
returns direction vector of the wire.
const HepPoint3D & forwardPosition(void) const
returns position in forward endplate.
const HepPoint3D & backwardPosition(void) const
returns position in backward endplate.
TPoint2D center(void) const
returns position of helix center.
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition TUtil.h:22

◆ stereoHitForCurl() [2/12]

int TTrack::stereoHitForCurl ( AList< TMLink > & ) const

calculates arc length and z for a stereo hit. uses these functions for curl tracks(included svd version).

◆ stereoHitForCurl() [3/12]

int TTrack::stereoHitForCurl ( AList< TMLink > & ) const

calculates arc length and z for a stereo hit. uses these functions for curl tracks(included svd version).

◆ stereoHitForCurl() [4/12]

int TTrack::stereoHitForCurl ( TMLink & link,
AList< HepPoint3D > & arcZList ) const

◆ stereoHitForCurl() [5/12]

int TTrack::stereoHitForCurl ( TMLink & link,
AList< HepPoint3D > & arcZList ) const

◆ stereoHitForCurl() [6/12]

int TTrack::stereoHitForCurl ( TMLink & link,
AList< HepPoint3D > & arcZList ) const

◆ stereoHitForCurl() [7/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1 ) const

◆ stereoHitForCurl() [8/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1 ) const

◆ stereoHitForCurl() [9/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1 ) const

◆ stereoHitForCurl() [10/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1,
TMLink & link2 ) const

◆ stereoHitForCurl() [11/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1,
TMLink & link2 ) const

◆ stereoHitForCurl() [12/12]

int TTrack::stereoHitForCurl ( TMLink & link,
TMLink & link1,
TMLink & link2 ) const

◆ szPosition() [1/9]

int TTrack::szPosition ( const HepPoint3D & p,
HepPoint3D & szPosition ) const

calculates arc length for a point.

Definition at line 3628 of file TTrack.cxx.

3628 {
3629
3630 //...Cal. arc length...
3631 HepPoint3D center = _helix->center();
3632 HepPoint3D xy = p;
3633 xy.setZ( 0. );
3634 double cosdPhi = -center.dot( ( xy - center ).unit() ) / center.mag();
3635 double dPhi;
3636 if ( fabs( cosdPhi ) <= 1.0 ) { dPhi = acos( cosdPhi ); }
3637 else if ( cosdPhi > 1.0 ) { dPhi = 0.0; }
3638 else { dPhi = M_PI; }
3639
3640 //...Finish...
3641 sz.setX( _helix->curv() * dPhi );
3642 sz.setY( p.z() );
3643 sz.setZ( 0. );
3644
3645 return 0;
3646}

◆ szPosition() [2/9]

int TTrack::szPosition ( const HepPoint3D & p,
HepPoint3D & szPosition ) const

calculates arc length for a point.

◆ szPosition() [3/9]

int TTrack::szPosition ( const HepPoint3D & p,
HepPoint3D & szPosition ) const

calculates arc length for a point.

◆ szPosition() [4/9]

int TTrack::szPosition ( const TSegment & segment,
TMLink & link ) const

calculates arc length and z for a segment. Results are stored in TMLink.

Definition at line 3589 of file TTrack.cxx.

3589 {
3590
3591 //...Pick up a wire which represents segment position...
3592 AList<TMLink> links = segment.cores();
3593 unsigned n = links.length();
3594 // std::cout<<" szPosition TTrack:: segment.cores().length():"<<n<<endl;
3595 // for (unsigned i = 1; i < n; i++) {
3596 // std::cout<<"drift distance"<<links[i]->hit()->drift()<<endl;
3597 // }
3598 if ( !n ) return -1;
3599 TMLink* minL = links[0];
3600 float minDist = links[0]->drift();
3601#ifdef TRKRECO_DEBUG_DETAIL
3602 std::cout << "minDist szPosition TTrack:" << minDist << endl;
3603#endif
3604 for ( unsigned i = 1; i < n; i++ )
3605 {
3606 if ( links[i]->hit()->drift() < minDist )
3607 {
3608 minDist = links[i]->drift();
3609#ifdef TRKRECO_DEBUG_DETAIL
3610 std::cout << "minDist szPosition TTrack:" << minDist << endl;
3611#endif
3612 minL = links[i];
3613 }
3614 }
3615
3616 //...sz calculation...
3617 a.position( minL->position() );
3618 a.leftRight( 2 );
3619 a.hit( minL->hit() );
3620 int err = szPosition( a );
3621#ifdef TRKRECO_DEBUG_DETAIL
3622 std::cout << "err of szPosition TTrack:" << err << endl;
3623#endif
3624 if ( err ) return -2;
3625 return 0;
3626}
int szPosition(TMLink &link) const
calculates arc length and z for a stereo hit.
Definition TTrack.cxx:3387

◆ szPosition() [5/9]

int TTrack::szPosition ( const TSegment & segment,
TMLink & link ) const

calculates arc length and z for a segment. Results are stored in TMLink.

◆ szPosition() [6/9]

int TTrack::szPosition ( const TSegment & segment,
TMLink & link ) const

calculates arc length and z for a segment. Results are stored in TMLink.

◆ szPosition() [7/9]

int TTrack::szPosition ( TMLink & link) const

calculates arc length and z for a stereo hit.

Definition at line 3387 of file TTrack.cxx.

3387 {
3388 const TMDCWireHit& h = *link.hit();
3389 HepVector3D X = 0.5 * ( h.wire()->forwardPosition() + h.wire()->backwardPosition() );
3390 // double theta = atan2(X.y(), X.x());
3391 // HepVector3D lr(h.distance(WireHitLeft) * sin(theta),
3392 // - h.distance(WireHitLeft) * cos(theta),
3393 // 0.);
3394
3395 HepVector3D xx = HepVector3D( X.x(), X.y(), 0. );
3396 HepPoint3D center = _helix->center();
3397 HepVector3D yy = center - xx;
3398 HepVector3D ww = HepVector3D( yy.x(), yy.y(), 0. );
3399 double wwmag2 = ww.mag2();
3400 double wwmag = sqrt( wwmag2 );
3401 HepVector3D lr( h.drift( WireHitLeft ) / wwmag * ww.x(),
3402 h.drift( WireHitLeft ) / wwmag * ww.y(), 0. );
3403
3404#ifdef TRKRECO_DEBUG_DETAIL
3405 std::cout << "old lr " << lr << endl;
3406 std::cout << "old X " << X << endl;
3407 std::cout << "link.leftRight " << link.leftRight() << endl;
3408#endif
3409 //...Check left or right...
3410 // // change to bes3 .. test..
3411 // if (link.leftRight() == WireHitRight) {
3412 // lr = - lr;
3413 //}
3414 // if (link.leftRight() == WireHitLeft) lr = - lr;
3415 // else if (link.leftRight() == 2) lr = ORIGIN;
3416
3417 // yzhang 2012-05-07
3418 const double Bz = -1000 * getPmgnIMF()->getReferField();
3419#ifdef TRKRECO_DEBUG_DETAIL
3420 std::cout << "charge " << _charge << " Bz " << Bz << endl;
3421#endif
3422 if ( _charge * Bz > 0 )
3423 { // yzhang 2012-05-07
3424 if ( link.leftRight() == WireHitRight )
3425 {
3426 lr = -lr; // right
3427 }
3428 }
3429 else
3430 {
3431 if ( link.leftRight() == WireHitLeft )
3432 {
3433 lr = -lr; // left
3434 }
3435 }
3436 if ( link.leftRight() == 2 ) lr = ORIGIN;
3437 // zhangy
3438
3439 X += lr;
3440
3441 //...Prepare vectors...
3442 // HepPoint3D center = _helix->center();
3443 HepPoint3D tmp( -9999., -9999., 0. );
3444 HepVector3D x = HepVector3D( X.x(), X.y(), 0. );
3445 HepVector3D w = x - center;
3446 // //modified the next sentence because the direction are different from belle.
3447 HepVector3D V = h.wire()->direction();
3448 // // to bes3
3449 // // HepVector3D V = - h.wire()->direction();
3450
3451 HepVector3D v = HepVector3D( V.x(), V.y(), 0. );
3452 double vmag2 = v.mag2();
3453 double vmag = sqrt( vmag2 );
3454
3455 double r = _helix->curv();
3456 double wv = w.dot( v );
3457 // //zsl for bes3
3458 // wv = abs(wv);
3459 double d2 = wv * wv - vmag2 * ( w.mag2() - r * r );
3460#ifdef TRKRECO_DEBUG_DETAIL
3461 std::cout << "lr " << lr << endl;
3462 std::cout << "forwardPosition " << h.wire()->forwardPosition() << endl;
3463 std::cout << "backwardPosition " << h.wire()->backwardPosition() << endl;
3464 std::cout << "X " << X << endl;
3465 std::cout << "center " << center << endl;
3466 std::cout << "xx " << xx << endl;
3467 std::cout << "ww " << ww << endl;
3468 std::cout << "TTrack::wire direction:" << h.wire()->direction() << endl;
3469 std::cout << "x " << x << endl;
3470 std::cout << "w " << w << endl;
3471 std::cout << "sz,Track::vmag:" << vmag << ", helix_r:" << r << ", wv:" << wv
3472 << ", d:" << sqrt( d2 ) << endl;
3473#endif
3474
3475 //...No crossing in R/Phi plane... This is too tight...
3476
3477 if ( d2 < 0. )
3478 {
3479 link.position( tmp );
3480
3481#ifdef TRKRECO_DEBUG
3482 std::cout << "TTrack !!! stereo: 0. > d2 = " << d2 << " " << link.leftRight() << std::endl;
3483#endif
3484 return -1;
3485 }
3486 double d = sqrt( d2 );
3487
3488 //...Cal. length to crossing points...
3489 double l[2];
3490 l[0] = ( -wv + d ) / vmag2;
3491 l[1] = ( -wv - d ) / vmag2;
3492
3493 //...Cal. z of crossing points...
3494 bool ok[2];
3495 ok[0] = true;
3496 ok[1] = true;
3497 double z[2];
3498 z[0] = X.z() + l[0] * V.z();
3499 z[1] = X.z() + l[1] * V.z();
3500#ifdef TRKRECO_DEBUG_DETAIL
3501 std::cout << "X.z():" << X.z() << endl;
3502 std::cout << "szPosition::z(0) " << z[0] << " z(1)" << z[1] << " leftRight "
3503 << link.leftRight() << endl;
3504 std::cout << "szPosition::wire backwardPosition and forwardPosition:"
3505 << h.wire()->backwardPosition().z() << "," << h.wire()->forwardPosition().z()
3506 << endl;
3507 std::cout << " l0, l1 = " << l[0] << ", " << l[1] << std::endl;
3508 std::cout << " z0, z1 = " << z[0] << ", " << z[1] << std::endl;
3509 std::cout << " backward = " << h.wire()->backwardPosition().z() << std::endl;
3510 std::cout << " forward = " << h.wire()->forwardPosition().z() << std::endl;
3511#endif
3512
3513 //...Check z position... //yzhang change 2012-05-03
3514 // modified because Belle backward and forward are different from BESIII
3515
3516 /*
3517 if (link.leftRight() == 2) {
3518 if (z[0] > h.wire()->backwardPosition().z()+20.
3519 || z[0] < h.wire()->forwardPosition().z()-20.) ok[0] = false;
3520 if (z[1] > h.wire()->backwardPosition().z()+20.
3521 || z[1] < h.wire()->forwardPosition().z()-20.) ok[1] = false;
3522 }
3523 else {
3524 if (z[0] > h.wire()->backwardPosition().z()
3525 || z[0] < h.wire()->forwardPosition().z() ) ok[0] = false;
3526 if (z[1] > h.wire()->backwardPosition().z()
3527 || z[1] < h.wire()->forwardPosition().z() ) ok[1] = false;
3528 }
3529 if ((! ok[0]) && (! ok[1])) {
3530 link.position(tmp);
3531 return -2;
3532 }*/
3533 // belle...
3534 if ( link.leftRight() == 2 )
3535 {
3536 if ( z[0] < h.wire()->backwardPosition().z() - 20. ||
3537 z[0] > h.wire()->forwardPosition().z() + 20. )
3538 ok[0] = false;
3539 if ( z[1] < h.wire()->backwardPosition().z() - 20. ||
3540 z[1] > h.wire()->forwardPosition().z() + 20. )
3541 ok[1] = false;
3542 }
3543 else
3544 {
3545 if ( z[0] < h.wire()->backwardPosition().z() || z[0] > h.wire()->forwardPosition().z() )
3546 ok[0] = false;
3547 if ( z[1] < h.wire()->backwardPosition().z() || z[1] > h.wire()->forwardPosition().z() )
3548 ok[1] = false;
3549 }
3550 if ( ( !ok[0] ) && ( !ok[1] ) )
3551 {
3552 link.position( tmp );
3553 return -2;
3554 }
3555
3556 //...Cal. xy position of crossing points...
3557 HepVector3D p[2];
3558 p[0] = x + l[0] * v;
3559 p[1] = x + l[1] * v;
3560 /* if (_charge * (center.x() * p[0].y() - center.y() * p[0].x()) < 0.) //liuqg,
3561 cosmic... ok[0] = false; if (_charge * (center.x() * p[1].y() - center.y() * p[1].x()) <
3562 0.) ok[1] = false; if ((! ok[0]) && (! ok[1])){
3563 // double tmp1 = _charge * (center.x() * p[0].y() - center.y() * p[0].x());
3564 // double tmp2 = _charge * (center.x() * p[1].y() - center.y() * p[1].x()) ;
3565 // if (link.leftRight() == 2) std::cout<<tmp1<<" "<<tmp2<<std::endl;
3566 link.position(tmp);
3567 return -3;
3568 }
3569 */
3570 //...Which one is the best?... Study needed...
3571 unsigned best = 0;
3572 if ( ok[1] ) best = 1;
3573
3574 //...Cal. arc length...
3575 double cosdPhi = -center.dot( ( p[best] - center ).unit() ) / center.mag();
3576 double dPhi;
3577 if ( fabs( cosdPhi ) <= 1.0 ) { dPhi = acos( cosdPhi ); }
3578 else if ( cosdPhi > 1.0 ) { dPhi = 0.0; }
3579 else { dPhi = M_PI; }
3580
3581 //...Finish...
3582 tmp.setX( r * dPhi );
3583 tmp.setY( z[best] );
3584 link.position( tmp );
3585
3586 return 0;
3587}

Referenced by TBuilder0::buildStereo(), TBuilder::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), szPosition(), szPosition(), and TTrack().

◆ szPosition() [8/9]

int TTrack::szPosition ( TMLink & link) const

calculates arc length and z for a stereo hit.

◆ szPosition() [9/9]

int TTrack::szPosition ( TMLink & link) const

calculates arc length and z for a stereo hit.

◆ type() [1/3]

unsigned TTrack::type ( void ) const
inlinevirtual

returns type. Definition is depending on an object type.

Reimplemented from TTrackBase.

Definition at line 481 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TTrack.h.

481{ return defineType(); }

Referenced by TTrackManager::setCurlerFlags(), and setFinderType().

◆ type() [2/3]

unsigned TTrack::type ( void ) const
virtual

returns type. Definition is depending on an object type.

Reimplemented from TTrackBase.

◆ type() [3/3]

unsigned TTrack::type ( void ) const
virtual

returns type. Definition is depending on an object type.

Reimplemented from TTrackBase.

◆ Refit

Refit
friend

◆ TBuilder

TBuilder
friend

◆ TBuilder0

◆ TBuilderCosmic

◆ TBuilderCurl

◆ TCosmicFitter

◆ TCurlFinder

◆ THelixFitter

◆ TPMCurlFinder

TPMCurlFinder
friend

◆ TrkReco

TrkReco
friend

◆ TTrackManager


The documentation for this class was generated from the following files: