BOSS 7.1.0
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)
 
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 ()
 

Detailed Description

Definition at line 24 of file TrkCompTrk.h.

Constructor & Destructor Documentation

◆ TrkCompTrk() [1/2]

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
const BField & bField() const
Definition: TrkCompTrk.h:36
int charge() const
Definition: TrkCompTrk.cxx:89
int nDof() const
Definition: TrkCompTrk.cxx:73
const HepVector & params() const
const HepSymMatrix & covariance() const
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/2]

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()

TrkCompTrk::~TrkCompTrk ( )
virtual

Definition at line 54 of file TrkCompTrk.cxx.

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

Member Function Documentation

◆ bField()

const BField & TrkCompTrk::bField ( ) const
inline

Definition at line 36 of file TrkCompTrk.h.

36{return *_bf;}

Referenced by getAllCovs(), getAllWeights(), momentum(), momentumErr(), posmomCov(), pt(), and TrkCompTrk().

◆ charge()

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().

◆ chisq()

double TrkCompTrk::chisq ( ) const
virtual

Implements TrkAbsFit.

Definition at line 80 of file TrkCompTrk.cxx.

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

Referenced by operator=().

◆ direction()

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

◆ directionErr()

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 & covariance()
Definition: DifIndepPar.h:53
double number() const
Definition: DifNumber.h:87
const DifIndepPar * indepPar() const
Definition: DifNumber.h:93
DifNumber y
Definition: DifVector.h:149
DifNumber x
Definition: DifVector.h:148
DifNumber z
Definition: DifVector.h:150
HepSymMatrix errorMatrix(const HepSymMatrix &e) const
Definition: DifVector.cxx:54
virtual void getDFInfo2(double fltLen, DifPoint &pos, DifVector &direction) const
Definition: TrkDifTraj.cxx:25

◆ endValidRange()

double TrkCompTrk::endValidRange ( ) const
virtual

Implements TrkAbsFit.

Definition at line 174 of file TrkCompTrk.cxx.

175{
176 return traj().hiRange();
177}
double hiRange() const
Definition: Trajectory.h:92

◆ getAllCovs()

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)

◆ getAllWeights() [1/2]

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/2]

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().

◆ momentum()

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)

◆ momentumErr()

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)

◆ nDof()

int TrkCompTrk::nDof ( ) const
virtual

Implements TrkAbsFit.

Definition at line 73 of file TrkCompTrk.cxx.

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

Referenced by operator=().

◆ operator=()

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

◆ position()

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

◆ positionErr()

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}

◆ posmomCov()

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)

◆ print()

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

Implements TrkAbsFit.

Definition at line 180 of file TrkCompTrk.cxx.

181{
182 ostr << "Traj: ";
183 if(_charge==-1 || _charge==1) {
184 ostr << "Charged Particle -> Helix Trajectory" << endl;
185 HelixTraj& theTraj=(HelixTraj&)traj();
186 ostr << " phi0=" << BesAngle(theTraj.phi0()).rad() << endl;
187 ostr << " d0=" << theTraj.d0() << endl;
188 ostr << " z0=" << theTraj.z0() << endl;
189 ostr << " omega=" << theTraj.omega() << endl;
190 ostr << " tanDip=" << theTraj.tanDip() << endl;
191 }
192 else {
193 ostr << "Neutral Particle -> NeutTraj" << endl;
194 NeutTraj& theTraj=(NeutTraj&)traj();
195 ostr << " phi0=" << BesAngle(theTraj.params().phi0()).rad() << endl;
196 ostr << " d0=" << theTraj.params().d0() << endl;
197 ostr << " z0=" << theTraj.params().z0() << endl;
198 ostr << " p=" << theTraj.params().p() << endl;
199 ostr << " tanDip=" << theTraj.params().tanDip() << endl;
200 }
201}
double rad() const
Definition: BesAngle.h:118
double omega() const
Definition: HelixTraj.h:81
double d0() const
Definition: HelixTraj.h:79
double phi0() const
Definition: HelixTraj.cxx:510
double z0() const
Definition: HelixTraj.h:82
double tanDip() const
Definition: HelixTraj.h:83
double & phi0()
Definition: NeutParams.h:38
double & z0()
Definition: NeutParams.h:40
double & tanDip()
Definition: NeutParams.h:41
double & p()
Definition: NeutParams.h:39
double & d0()
Definition: NeutParams.h:37
NeutParams & params()
Definition: NeutTraj.h:54

Referenced by printAll().

◆ printAll()

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

Implements TrkAbsFit.

Definition at line 204 of file TrkCompTrk.cxx.

205{
206 print(ostr);
207}
virtual void print(std::ostream &) const
Definition: TrkCompTrk.cxx:180

◆ pt()

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().

◆ startValidRange()

double TrkCompTrk::startValidRange ( ) const
virtual

Implements TrkAbsFit.

Definition at line 168 of file TrkCompTrk.cxx.

169{
170 return traj().lowRange();
171}
double lowRange() const
Definition: Trajectory.h:91

◆ traj()

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(), print(), startValidRange(), and TrkCompTrk().


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