BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkSimpTraj Class Referenceabstract

#include <TrkSimpTraj.h>

+ Inheritance diagram for TrkSimpTraj:

Public Member Functions

 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
 
- 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
 
- Public Member Functions inherited from TrkKalDeriv
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
 

Static Public Attributes

static HepPoint3D _theOrigin
 

Protected Attributes

TrkParams _dtparams
 
HepPoint3D _refpoint
 
- Protected Attributes inherited from Trajectory
double flightrange [2]
 

Additional Inherited Members

- Protected Member Functions inherited from Trajectory
Trajectoryoperator= (const Trajectory &)
 

Detailed Description

Definition at line 55 of file TrkSimpTraj.h.

Constructor & Destructor Documentation

◆ TrkSimpTraj() [1/2]

TrkSimpTraj::TrkSimpTraj ( const HepVector &  params,
const HepSymMatrix &  cov,
const double  startRange = -99999.,
const double  endRange = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 30 of file TrkSimpTraj.cxx.

32 :
33//----------------------------------------------------------------------------
34 TrkDifTraj(lowlim, hilim),_dtparams(params, cov),_refpoint(refpoint)
35{;}
TrkParams _dtparams
Definition: TrkSimpTraj.h:117
HepPoint3D _refpoint
Definition: TrkSimpTraj.h:118

◆ TrkSimpTraj() [2/2]

TrkSimpTraj::TrkSimpTraj ( const TrkParams params,
const double  startRange = -99999.,
const double  endRange = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 37 of file TrkSimpTraj.cxx.

39 :
40//----------------------------------------------------------------------------
41 TrkDifTraj(lowlim, hilim),_dtparams(params),_refpoint(refpoint)
42{;}

◆ ~TrkSimpTraj()

TrkSimpTraj::~TrkSimpTraj ( )
virtual

Definition at line 53 of file TrkSimpTraj.cxx.

55{ }

Member Function Documentation

◆ changePoint()

void TrkSimpTraj::changePoint ( const HepPoint3D newpoint,
double &  fltlen 
)

Definition at line 70 of file TrkSimpTraj.cxx.

70 {
71//----------------------------------------------------------------------------
72 if(newpoint != _refpoint){
73// find POCA to the new point
74 TrkPocaXY endpoca(*this,fltlen,newpoint);
75 if(endpoca.status().failure()){
76 std::cout<<"ErrMsg(error)" << "poca failure changing reference point" << std::endl;
77 return;
78 } else {
79// update flight length
80 fltlen = endpoca.flt1();
81// make a symmatrix from the covariance: temporary kludge
82 int nrow = parameters()->covariance().num_row();
83 HepSymMatrix cov(nrow);
84 for(int irow=0;irow<nrow;irow++)
85 for(int icol=0;icol<=irow;icol++)
86 cov.fast(irow+1,icol+1) = parameters()->covariance().fast(irow+1,icol+1);
87// Get the translation function
89// Use it on the SimpTraj parameters
90 pfunc(_refpoint,newpoint,
91 parameters()->parameter(),cov,
92 _dtparams.parameter(),cov,
93 fltlen);
94// put back the covariance
95 _dtparams.covariance() = cov;
96 _refpoint = newpoint;
97// update the flight range to correspond to the same range in space as before
98 double newrange[2];
99 newrange[0] = lowRange() - fltlen;
100 newrange[1] = hiRange() - fltlen;
101 setFlightRange(newrange);
102 }
103 }
104 return;
105}
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
Definition: TrkSimpTraj.h:46
HepVector & parameter()
Definition: DifIndepPar.h:51
double lowRange() const
Definition: Trajectory.h:91
virtual void setFlightRange(double newrange[2])
Definition: Trajectory.cxx:57
double hiRange() const
Definition: Trajectory.h:92
HepSymMatrix & covariance()
Definition: TrkParams.h:54
virtual TranslateParams paramFunction() const =0
TrkParams * parameters()
Definition: TrkSimpTraj.h:80
double precision pisqo6 parameter(pi=3.14159265358979d0, pisq=pi *pi, pisqo6=pisq/6d0) double precision zip

◆ clone()

virtual TrkSimpTraj * TrkSimpTraj::clone ( ) const
pure virtual

◆ invert()

TrkSimpTraj & TrkSimpTraj::invert ( )

Definition at line 128 of file TrkSimpTraj.cxx.

129{
130 // Invert parameters
131 std::vector<bool> flags(parameters()->nPar(),false);
132 invertParams(parameters(), flags);
133 // loop over parameters and invert covariance matrix
134 for(int iparam=0;iparam<parameters()->nPar();iparam++){
135 bool iinvert = flags[iparam];
136// do covariance cross-terms too
137 for(int jparam=iparam+1;jparam<parameters()->nPar();jparam++){
138 bool jinvert = flags[jparam];
139 if( (iinvert && !jinvert) || (!iinvert && jinvert) ) {
140// cross-terms change sign
141 parameters()->covariance()[iparam][jparam] *= -1.0;
142 }
143 }
144 }
145// invert the flightlength
146 double range[2];
147 range[0] = -hiRange();
148 range[1] = -lowRange();
150// done
151 return *this;
152}
int nPar() const
Definition: DifIndepPar.h:55
double range() const
Definition: Trajectory.h:93
virtual void invertParams(TrkParams *newparams, std::vector< bool > &flags) const =0
virtual int nPar() const
Definition: TrkSimpTraj.h:88

◆ invertParams()

virtual void TrkSimpTraj::invertParams ( TrkParams newparams,
std::vector< bool > &  flags 
) const
pure virtual

Implemented in NeutTraj, HelixTraj, TrkCircleTraj, and TrkDifLineTraj.

Referenced by invert().

◆ localTrajectory()

const TrkSimpTraj * TrkSimpTraj::localTrajectory ( double  fltLen,
double &  localFlt 
) const
virtual

Implements TrkDifTraj.

Definition at line 59 of file TrkSimpTraj.cxx.

59 {
60//----------------------------------------------------------------------------
61 localFlt = fltLen;
62 return this;
63}

◆ nPar()

virtual int TrkSimpTraj::nPar ( ) const
inlinevirtual

Reimplemented in HelixTraj, NeutTraj, TrkCircleTraj, and TrkDifLineTraj.

Definition at line 88 of file TrkSimpTraj.h.

88{return parameters()->nPar();}

Referenced by TrkHelixFitter::fit(), and invert().

◆ operator==()

bool TrkSimpTraj::operator== ( const TrkSimpTraj x) const

Definition at line 156 of file TrkSimpTraj.cxx.

157{
158 if (lowRange()!=x.lowRange() || hiRange()!=x.hiRange()) return false;
159 const HepVector &m=_dtparams.parameter();
160 unsigned int mp=m.num_row();
161 const HepVector &n=x._dtparams.parameter();
162 unsigned int np=n.num_row();
163 if (np!=mp) return false;
164 for(unsigned i=0;i<np;++i){
165 if(m[i] != n[i]) return false;
166 }
167 return _refpoint==x._refpoint;
168}
const Int_t n
Double_t x[10]
const double mp
Definition: incllambda.cxx:45

◆ parameters() [1/2]

◆ parameters() [2/2]

const TrkParams * TrkSimpTraj::parameters ( ) const
inline

Definition at line 81 of file TrkSimpTraj.h.

81{return &_dtparams;}

◆ paramFunction()

virtual TranslateParams TrkSimpTraj::paramFunction ( ) const
pure virtual

Implemented in HelixTraj, NeutTraj, TrkCircleTraj, and TrkDifLineTraj.

Referenced by changePoint().

◆ print()

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

Reimplemented from Trajectory.

Reimplemented in HelixTraj.

Definition at line 119 of file TrkSimpTraj.cxx.

119 {
120//----------------------------------------------------------------------------
121 os << "Simple ";
123}
virtual void print(std::ostream &os) const
Definition: Trajectory.cxx:70

◆ printAll()

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

Reimplemented from Trajectory.

Reimplemented in HelixTraj.

Definition at line 108 of file TrkSimpTraj.cxx.

108 {
109//----------------------------------------------------------------------------
110 os << "Simple ";
112 os << "SimpTraj parameter vector = "
113 << _dtparams.parameter();
114 os << " and covariance matrix = "
116 }
virtual void printAll(std::ostream &os) const
Definition: Trajectory.cxx:78

◆ referencePoint()

◆ setPoint()

void TrkSimpTraj::setPoint ( const HepPoint3D newpoint)
inline

Definition at line 96 of file TrkSimpTraj.h.

96{_refpoint = newpoint;}

◆ visitAccept()

virtual void TrkSimpTraj::visitAccept ( TrkVisitor vis) const
pure virtual

Member Data Documentation

◆ _dtparams

◆ _refpoint

◆ _theOrigin

HepPoint3D TrkSimpTraj::_theOrigin
static

Definition at line 59 of file TrkSimpTraj.h.


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