BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
HelixTraj Class Reference

#include <HelixTraj.h>

+ Inheritance diagram for HelixTraj:

Public Types

enum  ParIndex {
  d0Index =0 , phi0Index , omegaIndex , z0Index ,
  tanDipIndex , d0Index =0 , phi0Index , omegaIndex ,
  z0Index , tanDipIndex
}
 
enum  { NHLXPRM = 5 }
 
enum  ParIndex {
  d0Index =0 , phi0Index , omegaIndex , z0Index ,
  tanDipIndex , d0Index =0 , phi0Index , omegaIndex ,
  z0Index , tanDipIndex
}
 
enum  { NHLXPRM = 5 }
 

Public Member Functions

 HelixTraj (const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkExchangePar &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const HelixTraj &)
 
HelixTrajclone () const
 
virtual ~HelixTraj ()
 
HelixTrajoperator= (const HelixTraj &)
 
virtual HepPoint3D position (double fltLen) const
 
virtual Hep3Vector direction (double fltLen) const
 
virtual Hep3Vector delDirect (double) const
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
 
virtual void getInfo (double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
 
virtual void getDFInfo (double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
 
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &dir) const
 
virtual double distTo1stError (double s, double tol, int pathDir) const
 
virtual double distTo2ndError (double s, double tol, int pathDir) const
 
double curvature (double fltLen) const
 
HepMatrix derivDeflect (double fltlen, deflectDirection) const
 
HepMatrix derivDisplace (double fltlen, deflectDirection idir) const
 
HepMatrix derivPFract (double fltlen) const
 
TranslateParams paramFunction () const
 
void invertParams (TrkParams *params, std::vector< bool > &flags) const
 
int nPar () const
 
double d0 () const
 
double phi0 () const
 
double omega () const
 
double z0 () const
 
double tanDip () const
 
virtual void visitAccept (TrkVisitor *vis) const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
 HelixTraj (const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkExchangePar &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const HelixTraj &)
 
HelixTrajclone () const
 
virtual ~HelixTraj ()
 
HelixTrajoperator= (const HelixTraj &)
 
virtual HepPoint3D position (double fltLen) const
 
virtual Hep3Vector direction (double fltLen) const
 
virtual Hep3Vector delDirect (double) const
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
 
virtual void getInfo (double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
 
virtual void getDFInfo (double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
 
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &dir) const
 
virtual double distTo1stError (double s, double tol, int pathDir) const
 
virtual double distTo2ndError (double s, double tol, int pathDir) const
 
double curvature (double fltLen) const
 
HepMatrix derivDeflect (double fltlen, deflectDirection) const
 
HepMatrix derivDisplace (double fltlen, deflectDirection idir) const
 
HepMatrix derivPFract (double fltlen) const
 
TranslateParams paramFunction () const
 
void invertParams (TrkParams *params, std::vector< bool > &flags) const
 
int nPar () const
 
double d0 () const
 
double phi0 () const
 
double omega () const
 
double z0 () const
 
double tanDip () const
 
virtual void visitAccept (TrkVisitor *vis) const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
- Public Member Functions inherited from TrkSimpTraj
 TrkSimpTraj (const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
 TrkSimpTraj (const TrkParams &params, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
virtual ~TrkSimpTraj ()
 
virtual TrkSimpTrajclone () const =0
 
TrkParamsparameters ()
 
const TrkParamsparameters () const
 
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const
 
const HepPoint3DreferencePoint () const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
virtual int nPar () const
 
void changePoint (const HepPoint3D &newpoint, double &fltlen)
 
void setPoint (const HepPoint3D &newpoint)
 
TrkSimpTrajinvert ()
 
virtual void invertParams (TrkParams *newparams, std::vector< bool > &flags) const =0
 
virtual TranslateParams paramFunction () const =0
 
virtual void visitAccept (TrkVisitor *vis) const =0
 
bool operator== (const TrkSimpTraj &) const
 
 TrkSimpTraj (const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
 TrkSimpTraj (const TrkParams &params, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
virtual ~TrkSimpTraj ()
 
virtual TrkSimpTrajclone () const =0
 
TrkParamsparameters ()
 
const TrkParamsparameters () const
 
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const
 
const HepPoint3DreferencePoint () const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
virtual int nPar () const
 
void changePoint (const HepPoint3D &newpoint, double &fltlen)
 
void setPoint (const HepPoint3D &newpoint)
 
TrkSimpTrajinvert ()
 
virtual void invertParams (TrkParams *newparams, std::vector< bool > &flags) const =0
 
virtual TranslateParams paramFunction () const =0
 
virtual void visitAccept (TrkVisitor *vis) const =0
 
bool operator== (const TrkSimpTraj &) const
 
- Public Member Functions inherited from TrkDifTraj
 TrkDifTraj (const double lowlim=-99999., const double hilim=99999.)
 
virtual ~TrkDifTraj ()
 
virtual void getDFInfo (double fltLen, DifPoint &pos, DifVector &direction, DifVector &delDirect) const =0
 
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &direction) const
 
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const =0
 
 TrkDifTraj (const double lowlim=-99999., const double hilim=99999.)
 
virtual ~TrkDifTraj ()
 
virtual void getDFInfo (double fltLen, DifPoint &pos, DifVector &direction, DifVector &delDirect) const =0
 
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &direction) const
 
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const =0
 
- Public Member Functions inherited from Trajectory
 Trajectory (double lowlim, double hilim)
 
virtual ~Trajectory ()
 
virtual HepPoint3D position (double) const =0
 
virtual Hep3Vector direction (double) const =0
 
virtual Hep3Vector delDirect (double) const =0
 
virtual double curvature (double) const =0
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &direction) const =0
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &direction, Hep3Vector &delDirect) const =0
 
double distTo0thError (double s, double tol, int pathDir) const
 
virtual double distTo1stError (double s, double tol, int pathDir) const =0
 
virtual double distTo2ndError (double s, double tol, int pathDir) const =0
 
virtual Trajectoryclone () const =0
 
bool validFlightDistance (double f, double tolerance=0.0) const
 
virtual void setFlightRange (double newrange[2])
 
double lowRange () const
 
double hiRange () const
 
double range () const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
 Trajectory (double lowlim, double hilim)
 
virtual ~Trajectory ()
 
virtual HepPoint3D position (double) const =0
 
virtual Hep3Vector direction (double) const =0
 
virtual Hep3Vector delDirect (double) const =0
 
virtual double curvature (double) const =0
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &direction) const =0
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &direction, Hep3Vector &delDirect) const =0
 
double distTo0thError (double s, double tol, int pathDir) const
 
virtual double distTo1stError (double s, double tol, int pathDir) const =0
 
virtual double distTo2ndError (double s, double tol, int pathDir) const =0
 
virtual Trajectoryclone () const =0
 
bool validFlightDistance (double f, double tolerance=0.0) const
 
virtual void setFlightRange (double newrange[2])
 
double lowRange () const
 
double hiRange () const
 
double range () const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
virtual HepMatrix derivDeflect (double fltlen, deflectDirection idir) const =0
 
virtual HepMatrix derivDisplace (double fltlen, deflectDirection idir) const =0
 
virtual HepMatrix derivPFract (double fltlen) const =0
 
virtual HepMatrix derivDeflect (double fltlen, deflectDirection idir) const =0
 
virtual HepMatrix derivDisplace (double fltlen, deflectDirection idir) const =0
 
virtual HepMatrix derivPFract (double fltlen) const =0
 

Additional Inherited Members

- Static Public Attributes inherited from TrkSimpTraj
static HepPoint3D _theOrigin
 
- Protected Member Functions inherited from Trajectory
Trajectoryoperator= (const Trajectory &)
 
Trajectoryoperator= (const Trajectory &)
 
- Protected Attributes inherited from TrkSimpTraj
TrkParams _dtparams
 
HepPoint3D _refpoint
 
- Protected Attributes inherited from Trajectory
double flightrange [2]
 

Detailed Description

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NHLXPRM 

Definition at line 31 of file InstallArea/include/TrkBase/TrkBase/HelixTraj.h.

◆ anonymous enum

anonymous enum
Enumerator
NHLXPRM 

Definition at line 31 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h.

31{NHLXPRM = 5};

◆ ParIndex [1/2]

◆ ParIndex [2/2]

Enumerator
d0Index 
phi0Index 
omegaIndex 
z0Index 
tanDipIndex 
d0Index 
phi0Index 
omegaIndex 
z0Index 
tanDipIndex 

Definition at line 30 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h.

Constructor & Destructor Documentation

◆ HelixTraj() [1/8]

HelixTraj::HelixTraj ( const HepVector &  pvec,
const HepSymMatrix &  pcov,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 28 of file HelixTraj.cxx.

29 :
30 TrkSimpTraj(pvec, pcov, lowlim,hilim,refpoint)
31{
32 // Make sure the dimensions of the input matrix and vector are correct
33
34 if( pvec.num_row() != NHLXPRM || pcov.num_row() != NHLXPRM ){
35 std::cout<<"ErrMsg(fatal) "
36 << "HelixTraj: incorrect constructor vector/matrix dimension" << std::endl;
37 ::abort();
38 }
39
40 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
41}

◆ HelixTraj() [2/8]

HelixTraj::HelixTraj ( const TrkExchangePar inpar,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 44 of file HelixTraj.cxx.

45 :
46 TrkSimpTraj(inpar.params(), inpar.covariance(), lowlim,hilim,refpoint)
47{
48 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
49}

◆ HelixTraj() [3/8]

HelixTraj::HelixTraj ( const TrkParams inpar,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 51 of file HelixTraj.cxx.

52 :
53 TrkSimpTraj(inpar, lowlim,hilim,refpoint)
54{
55 assert(inpar.parameter().num_row()==NHLXPRM);
56 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
57}

◆ HelixTraj() [4/8]

HelixTraj::HelixTraj ( const HelixTraj h)

◆ ~HelixTraj() [1/2]

HelixTraj::~HelixTraj ( )
virtual

Definition at line 82 of file HelixTraj.cxx.

83{
84}

◆ HelixTraj() [5/8]

HelixTraj::HelixTraj ( const HepVector &  ,
const HepSymMatrix &  ,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

◆ HelixTraj() [6/8]

HelixTraj::HelixTraj ( const TrkExchangePar ,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

◆ HelixTraj() [7/8]

HelixTraj::HelixTraj ( const TrkParams ,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

◆ HelixTraj() [8/8]

HelixTraj::HelixTraj ( const HelixTraj )

◆ ~HelixTraj() [2/2]

virtual HelixTraj::~HelixTraj ( )
virtual

Member Function Documentation

◆ clone() [1/2]

HelixTraj * HelixTraj::clone ( ) const
virtual

Implements TrkSimpTraj.

Definition at line 66 of file HelixTraj.cxx.

◆ clone() [2/2]

HelixTraj * HelixTraj::clone ( ) const
virtual

Implements TrkSimpTraj.

◆ curvature() [1/2]

double HelixTraj::curvature ( double  fltLen) const
virtual

Implements Trajectory.

Definition at line 499 of file HelixTraj.cxx.

500{
501// Compute the curvature as the magnitude of the 2nd derivative
502// of the position function with respect to the 3-d flight distance
503//
504 double cosd = cosDip();
505// return sqr(cosd)*fabs(omega());
506 return (cosd*cosd)*fabs(omega());
507}

◆ curvature() [2/2]

double HelixTraj::curvature ( double  fltLen) const
virtual

Implements Trajectory.

◆ d0() [1/2]

double HelixTraj::d0 ( ) const
inline

◆ d0() [2/2]

double HelixTraj::d0 ( ) const
inline

◆ delDirect() [1/2]

Hep3Vector HelixTraj::delDirect ( double  fltLen) const
virtual

Implements Trajectory.

Definition at line 123 of file HelixTraj.cxx.

124{
125 double ang = angle(fltLen);
126 double cDip = cosDip();
127 double delX = -omega() * cDip * cDip * sin(ang);
128 double delY = omega() * cDip * cDip * cos(ang);
129 return Hep3Vector(delX, delY, 0.0);
130}
double sin(const BesAngle a)
double cos(const BesAngle a)

◆ delDirect() [2/2]

virtual Hep3Vector HelixTraj::delDirect ( double  ) const
virtual

Implements Trajectory.

◆ derivDeflect() [1/2]

HepMatrix HelixTraj::derivDeflect ( double  fltlen,
deflectDirection  idirect 
) const
virtual

Implements TrkKalDeriv.

Definition at line 365 of file HelixTraj.cxx.

366{
367//
368// This function computes the column matrix of derrivatives for the change
369// in parameters for a change in the direction of a track at a point along
370// its flight, holding the momentum and position constant. The effects for
371// changes in 2 perpendicular directions (theta1 = dip and
372// theta2 = phi*cos(dip)) can sometimes be added, as scattering in these
373// are uncorrelated.
374//
375 HepMatrix ddflct(NHLXPRM,1);
376//
377// Compute some common things
378//
379 double omeg = omega();
380 double tand = tanDip();
381 double arcl = arc(fltlen);
382 double dx = cos(arcl);
383 double dy = sin(arcl);
384 double cosd = cosDip();
385 double darc = omeg*d0();
386//
387// Go through the parameters
388//
389 switch (idirect) {
390 case theta1:
391 ddflct(omegaIndex+1,1) = omeg*tand;
392// ddflct(tanDipIndex+1,1) = 1.0/sqr(cosd);
393 ddflct(tanDipIndex+1,1) = 1.0/(cosd*cosd);
394 ddflct(d0Index+1,1) = (1-dx)*tand/omeg;
395 ddflct(phi0Index+1,1) = -dy*tand/(1+darc);
396// ddflct(z0Index+1,1) = - translen(fltlen) - sqr(tand)*dy/(omeg*(1+darc));
397 ddflct(z0Index+1,1) = - translen(fltlen) - (tand*tand)*dy/(omeg*(1+darc));
398 break;
399 case theta2:
400 ddflct(omegaIndex+1,1) = 0;
401 ddflct(tanDipIndex+1,1) = 0;
402 ddflct(d0Index+1,1) = -dy/(cosd*omeg);
403 ddflct(phi0Index+1,1) = dx/(cosd*(1+darc));
404 ddflct(z0Index+1,1) = -tand*(1- dx/(1+darc))/(cosd*omeg);
405 break;
406 }
407
408 return ddflct;
409}

◆ derivDeflect() [2/2]

HepMatrix HelixTraj::derivDeflect ( double  fltlen,
deflectDirection   
) const
virtual

Implements TrkKalDeriv.

◆ derivDisplace() [1/2]

HepMatrix HelixTraj::derivDisplace ( double  fltlen,
deflectDirection  idir 
) const
virtual

Implements TrkKalDeriv.

Definition at line 413 of file HelixTraj.cxx.

414{
415//
416// This function computes the column matrix of derrivatives for the change
417// in parameters for a change in the position of a track at a point along
418// its flight, holding the momentum and direction constant. The effects for
419// changes in 2 perpendicular directions 'theta1' = (-sin(l)cos(p),-sin(l)sin(p),cos(l)) and
420// 'theta2' = (-sin(p),cos(p),0). These are by definition orthogonal and uncorrelated.
421// these displacements are correlated with the angular change above
422//
423 HepMatrix ddflct(NHLXPRM,1);
424//
425// Compute some common things
426//
427 double omeg = omega();
428 double tand = tanDip();
429 double arcl = arc(fltlen);
430 double dx = cos(arcl);
431 double dy = sin(arcl);
432 double cosd = cosDip();
433 double sind = sinDip();
434 double darc_1 = 1.0+omeg*d0();
435//
436// Go through the parameters
437//
438 switch (idirect) {
439 case theta1:
440 ddflct(omegaIndex+1,1) = 0.0;
441 ddflct(tanDipIndex+1,1) = 0.0;
442 ddflct(d0Index+1,1) = -sind*dy;
443 ddflct(phi0Index+1,1) = sind*dx*omeg/darc_1;
444 ddflct(z0Index+1,1) = sind*tand*dx/darc_1 + cosd;
445 break;
446 case theta2:
447 ddflct(omegaIndex+1,1) = 0;
448 ddflct(tanDipIndex+1,1) = 0;
449 ddflct(d0Index+1,1) = dx;
450 ddflct(phi0Index+1,1) = dy*omeg/darc_1;
451 ddflct(z0Index+1,1) = tand*dy/darc_1;
452 break;
453 }
454
455 return ddflct;
456}

◆ derivDisplace() [2/2]

HepMatrix HelixTraj::derivDisplace ( double  fltlen,
deflectDirection  idir 
) const
virtual

Implements TrkKalDeriv.

◆ derivPFract() [1/2]

HepMatrix HelixTraj::derivPFract ( double  fltlen) const
virtual

Implements TrkKalDeriv.

Definition at line 460 of file HelixTraj.cxx.

461{
462//
463// This function computes the column matrix of derrivatives for the change
464// in parameters from a (fractional) change in the track momentum,
465// holding the direction and position constant. The momentum change can
466// come from energy loss or bfield inhomogeneities.
467//
468// For a helix, dp/P = -domega/omega,
469// dParam/d(domega/omega) = -omega*dParam/ddomega
470//
471 HepMatrix dmomfrac(NHLXPRM,1);
472//
473// Compute some common things
474
475 double omeg = omega();
476 double tand = tanDip();
477 double tranl = translen(fltlen);
478 double arcl = tranl*omeg;
479 double dx = cos(arcl);
480 double dy = sin(arcl);
481 double darc = omeg*d0();
482
483// Go through the parameters
484// omega
485 dmomfrac(omegaIndex+1,1) = -omeg;
486// tanDip
487 dmomfrac(tanDipIndex+1,1) = 0.0;
488// d0
489 dmomfrac(d0Index+1,1) = -(1-dx)/omeg;
490// phi0
491 dmomfrac(phi0Index+1,1) = dy/(1+darc);
492// z0
493 dmomfrac(z0Index+1,1) = -tand*(tranl-dy/((1+darc)*omeg));
494//
495 return dmomfrac;
496}

◆ derivPFract() [2/2]

HepMatrix HelixTraj::derivPFract ( double  fltlen) const
virtual

Implements TrkKalDeriv.

◆ direction() [1/2]

Hep3Vector HelixTraj::direction ( double  fltLen) const
virtual

Implements Trajectory.

Definition at line 110 of file HelixTraj.cxx.

111{
112 // Angle formed by tangent vector after
113 // being rotated 'arclength' around orbit.
114 double alpha = angle( f );
115 // Construct 3-D tangent vector of unit magnitude.
116 double cDip = cosDip();
117 return Hep3Vector ( cos(alpha)*cDip,
118 sin(alpha)*cDip,
119 cDip*tanDip() );
120}
const double alpha
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")

◆ direction() [2/2]

virtual Hep3Vector HelixTraj::direction ( double  fltLen) const
virtual

Implements Trajectory.

◆ distTo1stError() [1/2]

double HelixTraj::distTo1stError ( double  s,
double  tol,
int  pathDir 
) const
virtual

Implements Trajectory.

Definition at line 133 of file HelixTraj.cxx.

134{
135// return sqrt(2.*tol/fabs(omega())*(1.+sqr(tanDip())));
136 return sqrt(2.*tol/fabs(omega())*(1.+tanDip()*tanDip()));
137}

◆ distTo1stError() [2/2]

virtual double HelixTraj::distTo1stError ( double  s,
double  tol,
int  pathDir 
) const
virtual

Implements Trajectory.

◆ distTo2ndError() [1/2]

double HelixTraj::distTo2ndError ( double  s,
double  tol,
int  pathDir 
) const
virtual

Implements Trajectory.

Definition at line 140 of file HelixTraj.cxx.

141{
142// return sqrt(1.+sqr(tanDip()))*cbrt(6.*tol/sqr(omega()));
143 return sqrt(1.+tanDip()*tanDip())*cbrt(6.*tol/omega()*omega());
144}

◆ distTo2ndError() [2/2]

virtual double HelixTraj::distTo2ndError ( double  s,
double  tol,
int  pathDir 
) const
virtual

Implements Trajectory.

◆ getDFInfo() [1/2]

void HelixTraj::getDFInfo ( double  fltLen,
DifPoint pos,
DifVector dir,
DifVector delDir 
) const
virtual

Implements TrkDifTraj.

Definition at line 280 of file HelixTraj.cxx.

282{
283 //Provides difNum version of information for calculation of derivatives.
284 // All arithmetic operations have been replaced by +=, etc. versions
285 // for speed.
286
287 // Create difNumber versions of parameters
288 DifNumber phi0Df(phi0(), phi0Index+1, NHLXPRM);
289 DifNumber d0Df(d0(), d0Index+1, NHLXPRM);
290 DifNumber z0Df(z0(), z0Index+1, NHLXPRM);
291 DifNumber tanDipDf(tanDip(), tanDipIndex+1, NHLXPRM);
292 DifNumber omegaDf(omega(), omegaIndex+1, NHLXPRM);
293 phi0Df.setIndepPar( parameters() );
294 d0Df.setIndepPar( parameters() );
295 z0Df.setIndepPar( parameters() );
296 tanDipDf.setIndepPar( parameters() );
297 omegaDf.setIndepPar( parameters() );
298 DifNumber dipDf = atan(tanDipDf);
299
300 static DifNumber cDip;
301 dipDf.cosAndSin(cDip, dir.z);
302 static DifNumber sinPhi0, cosPhi0;
303 phi0Df.cosAndSin(cosPhi0, sinPhi0);
304
305 bool lref = (referencePoint().x() != 0. || referencePoint().y() != 0. ||
306 referencePoint().z() != 0.);
307
308 DifNumber alphaDf = cDip;
309 alphaDf *= omegaDf;
310 alphaDf *= flt;
311 alphaDf += phi0Df;
312
313 // This is not the prettiest line imaginable for this operation:
315 // DifNumber sinAlpha, cosAlpha;
316 alphaDf.cosAndSin(dir.x, dir.y);
317
318 // DifNumber x = (sinAlpha - sinPhi0) / omegaDf - d0Df * sinPhi0 + px;
319 // DifNumber y = -(cosAlpha - cosPhi0) / omegaDf + d0Df * cosPhi0 + py;
320
321 pos.x = dir.y;
322 pos.x -= sinPhi0;
323 pos.x /= omegaDf;
324 DifNumber temp = d0Df;
325 temp *= sinPhi0;
326 pos.x -= temp;
327
328 pos.y = cosPhi0;
329 pos.y -= dir.x;
330 pos.y /= omegaDf;
331 temp = d0Df;
332 temp *= cosPhi0;
333 pos.y += temp;
334
335 pos.z = flt;
336 pos.z *= dir.z;
337 pos.z += z0Df;
338
339 if (lref) {
340 DifNumber px(referencePoint().x());
341 DifNumber py(referencePoint().y());
342 DifNumber pz(referencePoint().z());
343 pos.x += px;
344 pos.y += py;
345 pos.z += pz;
346 }
347
348 delDir.x = -omegaDf;
349 delDir.x *= cDip;
350 delDir.x *= cDip;
351 delDir.x *= dir.y;
352
353 delDir.y = omegaDf;
354 delDir.y *= cDip;
355 delDir.y *= cDip;
356 delDir.y *= dir.x;
357
358 delDir.z = 0.;
359
360 dir.x *= cDip;
361 dir.y *= cDip;
362}
Double_t x[10]
DifNumber & mod(double lo, double hi)
void cosAndSin(DifNumber &c, DifNumber &s) const
double phi0() const
Definition: HelixTraj.cxx:510

◆ getDFInfo() [2/2]

virtual void HelixTraj::getDFInfo ( double  fltLen,
DifPoint ,
DifVector dir,
DifVector delDir 
) const
virtual

Implements TrkDifTraj.

◆ getDFInfo2() [1/2]

void HelixTraj::getDFInfo2 ( double  fltLen,
DifPoint pos,
DifVector dir 
) const
virtual

Reimplemented from TrkDifTraj.

Definition at line 207 of file HelixTraj.cxx.

208{
209 //Provides difNum version of information for calculation of derivatives.
210 // All arithmetic operations have been replaced by +=, etc. versions
211 // for speed.
212
213 // Create difNumber versions of parameters
214 DifNumber phi0Df(phi0(), phi0Index+1, NHLXPRM);
215 phi0Df.setIndepPar( parameters() );
216 DifNumber d0Df(d0(), d0Index+1, NHLXPRM);
217 d0Df.setIndepPar( parameters() );
218 DifNumber z0Df(z0(), z0Index+1, NHLXPRM);
219 z0Df.setIndepPar( parameters() );
220 DifNumber tanDipDf(tanDip(), tanDipIndex+1, NHLXPRM);
221 tanDipDf.setIndepPar( parameters() );
222 DifNumber omegaDf(omega(), omegaIndex+1, NHLXPRM);
223 omegaDf.setIndepPar( parameters() );
224
225 DifNumber dipDf = atan(tanDipDf);
226
227 static DifNumber cDip;
228 dipDf.cosAndSin(cDip, dir.z);
229 static DifNumber sinPhi0, cosPhi0;
230 phi0Df.cosAndSin(cosPhi0, sinPhi0);
231
232 bool lref = (referencePoint().x() != 0. || referencePoint().y() != 0. ||
233 referencePoint().z() != 0.);
234
235 DifNumber alphaDf = cDip;
236 alphaDf *= omegaDf;
237 alphaDf *= flt;
238 alphaDf += phi0Df;
239
240 // This is not the prettiest line imaginable for this operation:
242 // DifNumber sinAlpha, cosAlpha;
243 alphaDf.cosAndSin(dir.x, dir.y);
244
245 // DifNumber x = (sinAlpha - sinPhi0) / omegaDf - d0Df * sinPhi0 + px;
246 // DifNumber y = -(cosAlpha - cosPhi0) / omegaDf + d0Df * cosPhi0 + py;
247
248 pos.x = dir.y;
249 pos.x -= sinPhi0;
250 pos.x /= omegaDf;
251 DifNumber temp = d0Df;
252 temp *= sinPhi0;
253 pos.x -= temp;
254
255 pos.y = cosPhi0;
256 pos.y -= dir.x;
257 pos.y /= omegaDf;
258 temp = d0Df;
259 temp *= cosPhi0;
260 pos.y += temp;
261
262 pos.z = flt;
263 pos.z *= dir.z;
264 pos.z += z0Df;
265
266 if (lref) {
267 DifNumber px(referencePoint().x());
268 DifNumber py(referencePoint().y());
269 DifNumber pz(referencePoint().z());
270 pos.x += px;
271 pos.y += py;
272 pos.z += pz;
273 }
274
275 dir.x *= cDip;
276 dir.y *= cDip;
277}

◆ getDFInfo2() [2/2]

virtual void HelixTraj::getDFInfo2 ( double  fltLen,
DifPoint pos,
DifVector dir 
) const
virtual

Reimplemented from TrkDifTraj.

◆ getInfo() [1/4]

void HelixTraj::getInfo ( double  fltLen,
HepPoint3D pos,
Hep3Vector &  dir,
Hep3Vector &  delDir 
) const
virtual

Implements Trajectory.

Definition at line 147 of file HelixTraj.cxx.

149{
150 // double ang = angle(fltLen);
151 double cDip = cosDip();
152 double sDip = tanDip() * cDip;
153 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
154 double ang = phi00 + cDip*fltLen*omega();
155 double cang = cos(ang);
156 double sang = sin(ang);
157 double sphi0 = sin(phi00);
158 double cphi0 = cos(phi00);
159
160 double xt = (sang - sphi0)/omega() - d0()*sphi0 +
161 referencePoint().x();
162 double yt = -(cang - cphi0)/omega() + d0()*cphi0 +
163 referencePoint().y();
164 double zt = z0() + fltLen*sDip + referencePoint().z();
165 pos.setX(xt);
166 pos.setY(yt);
167 pos.setZ(zt);
168
169 dir.setX(cang * cDip);
170 dir.setY(sang * cDip);
171 dir.setZ(sDip);
172
173 double delX = -omega() * cDip * cDip * sang;
174 double delY = omega() * cDip * cDip * cang;
175 delDir.setX(delX);
176 delDir.setY(delY);
177 delDir.setZ(0.0);
178}

◆ getInfo() [2/4]

virtual void HelixTraj::getInfo ( double  fltLen,
HepPoint3D ,
Hep3Vector &  dir,
Hep3Vector &  delDir 
) const
virtual

Implements Trajectory.

◆ getInfo() [3/4]

void HelixTraj::getInfo ( double  fltLen,
HepPoint3D pos,
Hep3Vector &  dir 
) const
virtual

Implements Trajectory.

Definition at line 181 of file HelixTraj.cxx.

182{
183 // double ang = angle(fltLen);
184 double cDip = cosDip();
185 double sDip = tanDip() * cDip;
186 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
187 double ang = phi00 + cDip*fltLen*omega();
188 double cang = cos(ang);
189 double sang = sin(ang);
190 double sphi0 = sin(phi00);
191 double cphi0 = cos(phi00);
192
193 double xt = (sang - sphi0)/omega() - d0()*sphi0 +
194 referencePoint().x();
195 double yt = -(cang - cphi0)/omega() + d0()*cphi0 +
196 referencePoint().y();
197 double zt = z0() + fltLen*sDip + referencePoint().z();
198 pos.setX(xt);
199 pos.setY(yt);
200 pos.setZ(zt);
201
202 dir.setX(cang * cDip);
203 dir.setY(sang * cDip);
204 dir.setZ(sDip);
205}

◆ getInfo() [4/4]

virtual void HelixTraj::getInfo ( double  fltLen,
HepPoint3D pos,
Hep3Vector &  dir 
) const
virtual

Implements Trajectory.

◆ invertParams() [1/2]

void HelixTraj::invertParams ( TrkParams params,
std::vector< bool > &  flags 
) const
virtual

Implements TrkSimpTraj.

Definition at line 598 of file HelixTraj.cxx.

599{
600 // Inverts parameters and returns true if the parameter inversion
601 // requires a change in sign of elements in the covariance matrix
602
603 for (unsigned iparam = 0; iparam < NHLXPRM; iparam++) {
604 switch ( iparam ) {
605 case d0Index: // changes sign
606 case omegaIndex: // changes sign
607 case tanDipIndex: // changes sign
608 params->parameter()[iparam] *= -1.0;
609 flags[iparam] = true;
610 break;
611 case phi0Index: // changes by pi, but covariance matrix shouldn't change
612 params->parameter()[iparam] =
613 BesAngle(params->parameter()[iparam] + Constants::pi);
614 flags[iparam] = false;
615 break;
616 case z0Index: // nochange
617 flags[iparam] = false;
618 }
619 }
620 return;
621}

◆ invertParams() [2/2]

void HelixTraj::invertParams ( TrkParams params,
std::vector< bool > &  flags 
) const
virtual

Implements TrkSimpTraj.

◆ nPar() [1/2]

int HelixTraj::nPar ( ) const
inlinevirtual

Reimplemented from TrkSimpTraj.

Definition at line 75 of file InstallArea/include/TrkBase/TrkBase/HelixTraj.h.

75{ return NHLXPRM;}

◆ nPar() [2/2]

int HelixTraj::nPar ( ) const
inlinevirtual

Reimplemented from TrkSimpTraj.

Definition at line 75 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h.

75{ return NHLXPRM;}

◆ omega() [1/2]

◆ omega() [2/2]

double HelixTraj::omega ( ) const
inline

◆ operator=() [1/2]

HelixTraj & HelixTraj::operator= ( const HelixTraj h)

Definition at line 72 of file HelixTraj.cxx.

73{
74 if( &h != this ){
76 _dtparams = *(h.parameters());
78 }
79 return *this;
80}
Trajectory & operator=(const Trajectory &)
Definition: Trajectory.cxx:86

◆ operator=() [2/2]

HelixTraj & HelixTraj::operator= ( const HelixTraj )

◆ paramFunction() [1/2]

TranslateParams HelixTraj::paramFunction ( ) const
inlinevirtual

Implements TrkSimpTraj.

Definition at line 69 of file InstallArea/include/TrkBase/TrkBase/HelixTraj.h.

69{ return HelixTraj::paramFunc; }

◆ paramFunction() [2/2]

TranslateParams HelixTraj::paramFunction ( ) const
inlinevirtual

Implements TrkSimpTraj.

Definition at line 69 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h.

69{ return HelixTraj::paramFunc; }

◆ phi0() [1/2]

double HelixTraj::phi0 ( ) const

Definition at line 510 of file HelixTraj.cxx.

511{
512 return BesAngle(parameters()->parameter()[phi0Index]).rad();
513}
double precision pisqo6 parameter(pi=3.14159265358979d0, pisq=pi *pi, pisqo6=pisq/6d0) double precision zip

Referenced by getDFInfo(), and getDFInfo2().

◆ phi0() [2/2]

double HelixTraj::phi0 ( ) const

◆ position() [1/2]

HepPoint3D HelixTraj::position ( double  fltLen) const
virtual

Implements Trajectory.

Definition at line 93 of file HelixTraj.cxx.

94{
95 double cDip = cosDip();
96 double sDip = tanDip() * cDip;
97 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
98 double ang = phi00 + cDip*f*omega();
99 double cang = cos(ang);
100 double sang = sin(ang);
101 double sphi0 = sin(phi00);
102 double cphi0 = cos(phi00);
103
104 return HepPoint3D((sang - sphi0)/omega() - d0()*sphi0+referencePoint().x(),
105 -(cang - cphi0)/omega() + d0()*cphi0+referencePoint().y(),
106 z0() + f*sDip +referencePoint().z());
107}

◆ position() [2/2]

virtual HepPoint3D HelixTraj::position ( double  fltLen) const
virtual

Implements Trajectory.

◆ print() [1/2]

virtual void HelixTraj::print ( std::ostream &  os) const
virtual

Reimplemented from TrkSimpTraj.

◆ print() [2/2]

virtual void HelixTraj::print ( std::ostream &  os) const
virtual

Reimplemented from TrkSimpTraj.

◆ printAll() [1/2]

virtual void HelixTraj::printAll ( std::ostream &  os) const
virtual

Reimplemented from TrkSimpTraj.

◆ printAll() [2/2]

virtual void HelixTraj::printAll ( std::ostream &  os) const
virtual

Reimplemented from TrkSimpTraj.

◆ tanDip() [1/2]

◆ tanDip() [2/2]

double HelixTraj::tanDip ( ) const
inline

◆ visitAccept() [1/2]

void HelixTraj::visitAccept ( TrkVisitor vis) const
virtual

Implements TrkSimpTraj.

Definition at line 591 of file HelixTraj.cxx.

592{
593// Visitor access--just use the Visitor class member function
594 vis->trkVisitHelixTraj(this);
595}
virtual void trkVisitHelixTraj(const HelixTraj *)=0

◆ visitAccept() [2/2]

virtual void HelixTraj::visitAccept ( TrkVisitor vis) const
virtual

Implements TrkSimpTraj.

◆ z0() [1/2]

double HelixTraj::z0 ( ) const
inline

Definition at line 82 of file InstallArea/include/TrkBase/TrkBase/HelixTraj.h.

82{return parameters()->parameter()[z0Index]; }

Referenced by getDFInfo(), getDFInfo2(), getInfo(), and position().

◆ z0() [2/2]

double HelixTraj::z0 ( ) const
inline

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