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

#include <TrkCompTrk.h>

+ Inheritance diagram for TrkCompTrk:

Public Member Functions

int charge () const
 
double chisq () const
 
int nDof () const
 
const TrkDifTrajtraj () const
 
const BFieldbField () const
 
HepPoint3D position (double fltL) const
 
Hep3Vector direction (double fltL) const
 
Hep3Vector momentum (double fltL=0.) const
 
double pt (double fltL=0.) const
 
BesPointErr positionErr (double fltL) const
 
BesVectorErr directionErr (double fltL) const
 
BesVectorErr momentumErr (double fltL) const
 
double startValidRange () const
 
double endValidRange () const
 
virtual HepMatrix posmomCov (double fltL) const
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual void getAllWeights (const HepPoint3D &pt, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual void print (std::ostream &) const
 
virtual void printAll (std::ostream &) const
 
 TrkCompTrk (const BesPointErr &pos, const BesVectorErr &mom, const HepMatrix &xpCov, int charge, double chisq, int nDoF, const BField *bf)
 
 TrkCompTrk (const TrkCompTrk &right)
 
virtual ~TrkCompTrk ()
 
const TrkCompTrkoperator= (const TrkCompTrk &right)
 
int charge () const
 
double chisq () const
 
int nDof () const
 
const TrkDifTrajtraj () const
 
const BFieldbField () const
 
HepPoint3D position (double fltL) const
 
Hep3Vector direction (double fltL) const
 
Hep3Vector momentum (double fltL=0.) const
 
double pt (double fltL=0.) const
 
BesPointErr positionErr (double fltL) const
 
BesVectorErr directionErr (double fltL) const
 
BesVectorErr momentumErr (double fltL) const
 
double startValidRange () const
 
double endValidRange () const
 
virtual HepMatrix posmomCov (double fltL) const
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual void getAllWeights (const HepPoint3D &pt, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual void print (std::ostream &) const
 
virtual void printAll (std::ostream &) const
 
 TrkCompTrk (const BesPointErr &pos, const BesVectorErr &mom, const HepMatrix &xpCov, int charge, double chisq, int nDoF, const BField *bf)
 
 TrkCompTrk (const TrkCompTrk &right)
 
virtual ~TrkCompTrk ()
 
const TrkCompTrkoperator= (const TrkCompTrk &right)
 
virtual int charge () const =0
 
virtual double chisq () const =0
 
virtual int nDof () const =0
 
virtual const TrkDifTrajtraj () const =0
 
virtual HepPoint3D position (double fltL) const =0
 
virtual Hep3Vector direction (double fltL) const =0
 
virtual Hep3Vector momentum (double fltL=0.) const =0
 
virtual double pt (double fltL=0.) const =0
 
virtual BesPointErr positionErr (double fltL) const =0
 
virtual BesVectorErr directionErr (double fltL) const =0
 
virtual BesVectorErr momentumErr (double fltL) const =0
 
virtual HepMatrix posmomCov (double fltL) const =0
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const =0
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const =0
 
virtual double startValidRange () const =0
 
virtual double endValidRange () const =0
 
virtual void printAll (std::ostream &ostr) const =0
 
virtual void print (std::ostream &ostr) const =0
 
virtual int charge () const =0
 
virtual double chisq () const =0
 
virtual int nDof () const =0
 
virtual const TrkDifTrajtraj () const =0
 
virtual HepPoint3D position (double fltL) const =0
 
virtual Hep3Vector direction (double fltL) const =0
 
virtual Hep3Vector momentum (double fltL=0.) const =0
 
virtual double pt (double fltL=0.) const =0
 
virtual BesPointErr positionErr (double fltL) const =0
 
virtual BesVectorErr directionErr (double fltL) const =0
 
virtual BesVectorErr momentumErr (double fltL) const =0
 
virtual HepMatrix posmomCov (double fltL) const =0
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const =0
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const =0
 
virtual double startValidRange () const =0
 
virtual double endValidRange () const =0
 
virtual void printAll (std::ostream &ostr) const =0
 
virtual void print (std::ostream &ostr) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from TrkAbsFit
 TrkAbsFit ()
 
virtual ~TrkAbsFit ()
 
 TrkAbsFit ()
 
virtual ~TrkAbsFit ()
 

Detailed Description

Constructor & Destructor Documentation

◆ TrkCompTrk() [1/4]

TrkCompTrk::TrkCompTrk ( const BesPointErr pos,
const BesVectorErr mom,
const HepMatrix &  xpCov,
int  charge,
double  chisq,
int  nDoF,
const BField bf 
)

Definition at line 28 of file TrkCompTrk.cxx.

31 :
32 _chisq(chisq),_nDof(nDof) {
33//---------------------------------------------------------------------------
34 _bf = bf;
35 _charge=charge;
36 if(_charge!=0) {
38 _traj.reset( new HelixTraj(par1.params(), par1.covariance()) );
39 }
40 else {
41 _traj.reset( new NeutTraj(TrkHelixUtils::lineFromMomErr(pos,mom,xpCov,1,bField())) );
42 }
43}
double chisq() const
Definition: TrkCompTrk.cxx:80
int charge() const
Definition: TrkCompTrk.cxx:89
int nDof() const
Definition: TrkCompTrk.cxx:73
static NeutParams lineFromMomErr(const BesPointErr &vertex, const BesVectorErr &p, const HepMatrix &cxp, double sign, const BField &)
static TrkExchangePar helixFromMomErr(const BesPointErr &vertex, const BesVectorErr &p, const HepMatrix &cxp, double sign, const BField &)

◆ TrkCompTrk() [2/4]

TrkCompTrk::TrkCompTrk ( const TrkCompTrk right)

Definition at line 47 of file TrkCompTrk.cxx.

47 : _bf(rhs._bf),_chisq(rhs._chisq),_nDof(rhs._nDof) {
48//---------------------------------------------
49 _traj.reset((TrkSimpTraj*)rhs.traj().clone());
50 _charge=rhs.charge();
51}

◆ ~TrkCompTrk() [1/2]

TrkCompTrk::~TrkCompTrk ( )
virtual

Definition at line 54 of file TrkCompTrk.cxx.

54 {
55//----------------------------------------------------------------------
56}

◆ TrkCompTrk() [3/4]

TrkCompTrk::TrkCompTrk ( const BesPointErr pos,
const BesVectorErr mom,
const HepMatrix &  xpCov,
int  charge,
double  chisq,
int  nDoF,
const BField bf 
)

◆ TrkCompTrk() [4/4]

TrkCompTrk::TrkCompTrk ( const TrkCompTrk right)

◆ ~TrkCompTrk() [2/2]

virtual TrkCompTrk::~TrkCompTrk ( )
virtual

Member Function Documentation

◆ bField() [1/2]

const BField & TrkCompTrk::bField ( ) const
inline

◆ bField() [2/2]

const BField & TrkCompTrk::bField ( ) const
inline

Definition at line 36 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkCompTrk.h.

36{return *_bf;}

◆ charge() [1/2]

int TrkCompTrk::charge ( ) const
virtual

Implements TrkAbsFit.

Definition at line 89 of file TrkCompTrk.cxx.

89 {
90//------------------------------------------------------------------------
91 return _charge;
92}

Referenced by operator=(), and TrkCompTrk().

◆ charge() [2/2]

int TrkCompTrk::charge ( ) const
virtual

Implements TrkAbsFit.

◆ chisq() [1/2]

double TrkCompTrk::chisq ( ) const
virtual

Implements TrkAbsFit.

Definition at line 80 of file TrkCompTrk.cxx.

80 {
81//------------------------------------------------------------------------
82 return _chisq;
83}

Referenced by operator=().

◆ chisq() [2/2]

double TrkCompTrk::chisq ( ) const
virtual

Implements TrkAbsFit.

◆ direction() [1/2]

Hep3Vector TrkCompTrk::direction ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 111 of file TrkCompTrk.cxx.

111 {
112//------------------------------------------------------------------------
113 return traj().direction(fltL);
114}
virtual Hep3Vector direction(double) const =0
const TrkDifTraj & traj() const
Definition: TrkCompTrk.cxx:97

◆ direction() [2/2]

Hep3Vector TrkCompTrk::direction ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ directionErr() [1/2]

BesVectorErr TrkCompTrk::directionErr ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 138 of file TrkCompTrk.cxx.

139{
140 // If getDFInfo is split up, use faster version - done JEA 020300
141 DifPoint posD;
142 DifVector dirD;
143 traj().getDFInfo2(fltL, posD, dirD);
144 HepMatrix err = dirD.errorMatrix( dirD.x.indepPar()->covariance() );
145 BesError symErr(3);
146 symErr.assign(err);
147 Hep3Vector dir(dirD.x.number(), dirD.y.number(), dirD.z.number());
148 return BesVectorErr(dir, symErr);
149}
HepSymMatrix errorMatrix(const HepSymMatrix &e) const
Definition: DifVector.cxx:54
virtual void getDFInfo2(double fltLen, DifPoint &pos, DifVector &direction) const
Definition: TrkDifTraj.cxx:25

◆ directionErr() [2/2]

BesVectorErr TrkCompTrk::directionErr ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ endValidRange() [1/2]

double TrkCompTrk::endValidRange ( ) const
virtual

Implements TrkAbsFit.

Definition at line 174 of file TrkCompTrk.cxx.

175{
176 return traj().hiRange();
177}

◆ endValidRange() [2/2]

double TrkCompTrk::endValidRange ( ) const
virtual

Implements TrkAbsFit.

◆ getAllCovs() [1/2]

void TrkCompTrk::getAllCovs ( double  fltL,
HepSymMatrix &  xxCov,
HepSymMatrix &  ppCov,
HepMatrix &  xpCov 
) const
virtual

Implements TrkAbsFit.

Definition at line 215 of file TrkCompTrk.cxx.

219{
220 const BField& theField = bField();
221 TrkMomCalculator::getAllCovs(*_traj, theField, fltL,
222 xxCov,ppCov,xpCov);
223}
static void getAllCovs(const TrkSimpTraj &, const BField &, double fltlen, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov)

◆ getAllCovs() [2/2]

virtual void TrkCompTrk::getAllCovs ( double  fltL,
HepSymMatrix &  xxCov,
HepSymMatrix &  ppCov,
HepMatrix &  xpCov 
) const
virtual

Implements TrkAbsFit.

◆ getAllWeights() [1/4]

void TrkCompTrk::getAllWeights ( const HepPoint3D pt,
HepVector &  pos,
HepVector &  mom,
HepSymMatrix &  xxWeight,
HepSymMatrix &  ppWeight,
HepMatrix &  xpWeight 
) const
virtual

Definition at line 239 of file TrkCompTrk.cxx.

245{
246 double fltL=0;
247 TrkPoca poca(traj(),fltL, pt);
248 fltL = poca.flt1();
249 getAllWeights(fltL,pos,mom,xxWeight,ppWeight,xpWeight);
250}
double pt(double fltL=0.) const
Definition: TrkCompTrk.cxx:158
virtual void getAllWeights(double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
Definition: TrkCompTrk.cxx:225

◆ getAllWeights() [2/4]

virtual void TrkCompTrk::getAllWeights ( const HepPoint3D pt,
HepVector &  pos,
HepVector &  mom,
HepSymMatrix &  xxWeight,
HepSymMatrix &  ppWeight,
HepMatrix &  xpWeight 
) const
virtual

◆ getAllWeights() [3/4]

void TrkCompTrk::getAllWeights ( double  fltL,
HepVector &  pos,
HepVector &  mom,
HepSymMatrix &  xxWeight,
HepSymMatrix &  ppWeight,
HepMatrix &  xpWeight 
) const
virtual

Implements TrkAbsFit.

Definition at line 225 of file TrkCompTrk.cxx.

231{
232 const BField& theField = bField();
233 TrkMomCalculator::getAllWeights(*_traj, theField, fltL,
234 pos,mom,xxWeight,ppWeight,xpWeight);
235
236}
static void getAllWeights(const TrkSimpTraj &, const BField &, double fltlen, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight)

Referenced by getAllWeights().

◆ getAllWeights() [4/4]

virtual void TrkCompTrk::getAllWeights ( double  fltL,
HepVector &  pos,
HepVector &  mom,
HepSymMatrix &  xxWeight,
HepSymMatrix &  ppWeight,
HepMatrix &  xpWeight 
) const
virtual

Implements TrkAbsFit.

◆ momentum() [1/2]

Hep3Vector TrkCompTrk::momentum ( double  fltL = 0.) const
virtual

Implements TrkAbsFit.

Definition at line 117 of file TrkCompTrk.cxx.

118{
119 return TrkMomCalculator::vecMom(*_traj, bField(), fltL);
120
121}
static Hep3Vector vecMom(const TrkSimpTraj &, const BField &, double fltlen)

◆ momentum() [2/2]

Hep3Vector TrkCompTrk::momentum ( double  fltL = 0.) const
virtual

Implements TrkAbsFit.

◆ momentumErr() [1/2]

BesVectorErr TrkCompTrk::momentumErr ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 152 of file TrkCompTrk.cxx.

153{
154 return TrkMomCalculator::errMom(*_traj, bField(), fltL);
155}
static BesVectorErr errMom(const TrkSimpTraj &, const BField &, double fltlen)

◆ momentumErr() [2/2]

BesVectorErr TrkCompTrk::momentumErr ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ nDof() [1/2]

int TrkCompTrk::nDof ( ) const
virtual

Implements TrkAbsFit.

Definition at line 73 of file TrkCompTrk.cxx.

73 {
74//------------------------------------------------------------------------
75 return _nDof;
76}

Referenced by operator=().

◆ nDof() [2/2]

int TrkCompTrk::nDof ( ) const
virtual

Implements TrkAbsFit.

◆ operator=() [1/2]

const TrkCompTrk & TrkCompTrk::operator= ( const TrkCompTrk right)

Definition at line 60 of file TrkCompTrk.cxx.

60 {
61//----------------------------------------------------------------------
62 if (&right == this) return *this;
63 _bf = right._bf;
64 _traj.reset((TrkSimpTraj*)right.traj().clone());
65 _chisq=right.chisq();
66 _nDof=right.nDof();
67 _charge=right.charge();
68 return *this;
69}
virtual Trajectory * clone() const =0

◆ operator=() [2/2]

const TrkCompTrk & TrkCompTrk::operator= ( const TrkCompTrk right)

◆ position() [1/2]

HepPoint3D TrkCompTrk::position ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 104 of file TrkCompTrk.cxx.

104 {
105//------------------------------------------------------------------------
106 return traj().position(fltL);
107}
virtual HepPoint3D position(double) const =0

◆ position() [2/2]

HepPoint3D TrkCompTrk::position ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ positionErr() [1/2]

BesPointErr TrkCompTrk::positionErr ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 124 of file TrkCompTrk.cxx.

125{
126 // If getDFInfo is split up, use faster version - done JEA 020300
127 DifPoint posD;
128 DifVector dirD;
129 traj().getDFInfo2(fltL, posD, dirD);
130 HepMatrix err = posD.errorMatrix( posD.x.indepPar()->covariance() );
131 BesError symErr(3);
132 symErr.assign(err);
133 HepPoint3D point(posD.x.number(), posD.y.number(), posD.z.number());
134 return BesPointErr(point, symErr);
135}

◆ positionErr() [2/2]

BesPointErr TrkCompTrk::positionErr ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ posmomCov() [1/2]

HepMatrix TrkCompTrk::posmomCov ( double  fltL) const
virtual

Implements TrkAbsFit.

Definition at line 209 of file TrkCompTrk.cxx.

210{
211 const BField& theField = bField();
212 return TrkMomCalculator::posmomCov(*_traj, theField, fltL);
213}
static HepMatrix posmomCov(const TrkSimpTraj &, const BField &, double fltlen)

◆ posmomCov() [2/2]

virtual HepMatrix TrkCompTrk::posmomCov ( double  fltL) const
virtual

Implements TrkAbsFit.

◆ print() [1/2]

virtual void TrkCompTrk::print ( std::ostream &  ) const
virtual

Implements TrkAbsFit.

◆ print() [2/2]

virtual void TrkCompTrk::print ( std::ostream &  ) const
virtual

Implements TrkAbsFit.

◆ printAll() [1/2]

virtual void TrkCompTrk::printAll ( std::ostream &  ) const
virtual

Implements TrkAbsFit.

◆ printAll() [2/2]

virtual void TrkCompTrk::printAll ( std::ostream &  ) const
virtual

Implements TrkAbsFit.

◆ pt() [1/2]

double TrkCompTrk::pt ( double  fltL = 0.) const
virtual

Implements TrkAbsFit.

Definition at line 158 of file TrkCompTrk.cxx.

159{
160 return TrkMomCalculator::ptMom(*_traj, bField(), fltL);
161 // This could probably be made more efficient.
162// Hep3Vector pVec = momentum(fltL);
163// return sqrt( pVec.x() * pVec.x() + pVec.y() * pVec.y() );
164}
static double ptMom(const TrkSimpTraj &, const BField &, double fltlen)

Referenced by getAllWeights().

◆ pt() [2/2]

double TrkCompTrk::pt ( double  fltL = 0.) const
virtual

Implements TrkAbsFit.

◆ startValidRange() [1/2]

double TrkCompTrk::startValidRange ( ) const
virtual

Implements TrkAbsFit.

Definition at line 168 of file TrkCompTrk.cxx.

169{
170 return traj().lowRange();
171}

◆ startValidRange() [2/2]

double TrkCompTrk::startValidRange ( ) const
virtual

Implements TrkAbsFit.

◆ traj() [1/2]

const TrkDifTraj & TrkCompTrk::traj ( ) const
virtual

Implements TrkAbsFit.

Definition at line 97 of file TrkCompTrk.cxx.

97 {
98//------------------------------------------------------------------------
99 return *_traj;
100}

Referenced by direction(), directionErr(), endValidRange(), getAllWeights(), operator=(), position(), positionErr(), startValidRange(), and TrkCompTrk().

◆ traj() [2/2]

const TrkDifTraj & TrkCompTrk::traj ( ) const
virtual

Implements TrkAbsFit.


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