CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
bak_TrkFitter-00-01-12/src/TrkSimpleRep.cxx
Go to the documentation of this file.
1// File and Version Information:
2// $Id: TrkSimpleRep.cxx,v 1.1.1.1 2017/12/15 12:01:44 huangzhen Exp $
3//
4// Description:
5// implementation for TrkSimpleHelix
6//
7// Author(s): Steve Schaffner
8//------------------------------------------------------------------------
9//#include "BaBar/BaBar.h"
10#include "TrkFitter/TrkSimpleRep.h"
11#include "TrkBase/TrkHitOnTrk.h"
12#include "TrkBase/TrkSimpTraj.h"
13#include "TrkBase/TrkParams.h"
14#include "TrkBase/TrkPoca.h"
15#include "TrkBase/TrkMomCalculator.h"
16#include "TrkBase/TrkRecoTrk.h"
17#include "BField/BField.h"//yzhang debug
18class BField;
19#include "TrkBase/TrkErrCode.h"
20#include "MdcRecoUtil/BesVectorErr.h"
21#include "MdcRecoUtil/BesPointErr.h"
22#include "CLHEP/Vector/ThreeVector.h"
23
25 TrkRecoTrk* trk, PdtPid::PidType hypo) :
26 TrkRep(inHots, trk, hypo)
27{
28 setChisq(-1.);
29}
30
32 int nsv, int ndc, double chi2,
33 double stFndRng, double endFndRng) :
34 TrkRep(trk, hypo, nact, nsv, ndc, stFndRng, endFndRng)
35{
36 setChisq(chi2);
37}
38
39// copy ctor
41 TrkRecoTrk* trk, PdtPid::PidType hypo) :
42 TrkRep(right, trk, hypo), _fitter(right._fitter), _chisq(right._chisq)
43{
44 _hotList.reset( right.hotList()->clone(this) );
45}
46
48{
49}
50
53{
54 _chisq = right._chisq;
55 TrkRep::operator=(right);
56 return *this;
57}
58
61{
62 if (!hitCapable()) {
63 setValid(false);
65 "Tried to fit without a list of hits.");
66 }
67 TrkErrCode error = _fitter.fit(*hotList(), simpTraj());
68 if (error.failure()) {
69 setValid(false);
70 }
71 else {
72 setValid(true);
73 setCurrent(true);
74 }
75 setChisq(_fitter.lastChisq());
76 return error;
77}
78
79int
81{
82 return nActive() - simpTraj().parameters()->nPar();
83}
84
85double
87{
88 // Note possible inefficiency in calling virtual simpTraj(); implementation
89 // could be moved to derived classes instead.
90 return _chisq;
91 // return simpTraj().parameters()->chisquared();
92}
93
94void
96{
97 // See inefficiency comment above.
98 // simpTraj().parameters()->setChisquared(c);
99 _chisq = c;
100}
101
102Hep3Vector
103TrkSimpleRep::momentum(double fltL) const
104{
105 const BField& theField = parentTrack()->bField();
106 return TrkMomCalculator::vecMom(simpTraj(), theField, fltL);
107}
108
109double
110TrkSimpleRep::pt(double fltL) const
111{
112 const BField& theField = parentTrack()->bField();
113 return TrkMomCalculator::ptMom(simpTraj(), theField, fltL);
114}
115
116int
118{
119 const BField& theField = parentTrack()->bField();
120 return TrkMomCalculator::charge(simpTraj(), theField, 0.);
121}
122
125{
126 const BField& theField = parentTrack()->bField();
127 return TrkMomCalculator::errMom(simpTraj(), theField, fltL);
128}
129
130/*
131 * added on 7/17/98 to accomplish vertexing interface (M.Bondioli)
132 * implementation temporarily needed to assure no compile crashes
133 * elsewhere.
134 */
135
136HepMatrix
137TrkSimpleRep::posmomCov(double fltL) const
138{
139 const BField& theField = parentTrack()->bField();
140 return TrkMomCalculator::posmomCov(simpTraj(), theField, fltL);
141}
142
143void
145 HepSymMatrix& xxCov,
146 HepSymMatrix& ppCov,
147 HepMatrix& xpCov) const
148{
149 const BField& theField = parentTrack()->bField();
150 TrkMomCalculator::getAllCovs(simpTraj(), theField, fltL,
151 xxCov,ppCov,xpCov);
152}
153
155 HepVector& pos,
156 HepVector& mom,
157 HepSymMatrix& xxWeight,
158 HepSymMatrix& ppWeight,
159 HepMatrix& xpWeight) const
160{
161 const BField& theField = parentTrack()->bField();
163 pos,mom,xxWeight,ppWeight,xpWeight);
164}
165
167 HepVector& pos,
168 HepVector& mom,
169 HepSymMatrix& xxWeight,
170 HepSymMatrix& ppWeight,
171 HepMatrix& xpWeight)const
172{
173 double fltL=0;
174 TrkPoca poca(traj(),fltL, pt);
175 fltL = poca.flt1();
176 getAllWeights(fltL,pos,mom,xxWeight,ppWeight,xpWeight);
177}
virtual const TrkDifTraj & traj() const =0
void setValid(bool v)
TrkErrCode fit(TrkHotList &hitList, TrkSimpTraj &)
virtual TrkHotList * clone(TrkBase::Functors::cloneHot) const =0
static void getAllWeights(const TrkSimpTraj &, const BField &, double fltlen, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight)
static void getAllCovs(const TrkSimpTraj &, const BField &, double fltlen, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov)
static HepMatrix posmomCov(const TrkSimpTraj &, const BField &, double fltlen)
static BesVectorErr errMom(const TrkSimpTraj &, const BField &, double fltlen)
static Hep3Vector vecMom(const TrkSimpTraj &, const BField &, double fltlen)
static int charge(const TrkSimpTraj &, const BField &, double fltlen)
static double ptMom(const TrkSimpTraj &, const BField &, double fltlen)
std::auto_ptr< TrkHotList > _hotList
virtual int nActive() const
Definition: TrkRep.cxx:330
TrkRep & operator=(const TrkRep &)
Definition: TrkRep.cxx:111
virtual TrkHotList * hotList()
virtual BesVectorErr momentumErr(double fltL) const
virtual void getAllCovs(double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const
virtual TrkSimpTraj & simpTraj()=0
virtual HepMatrix posmomCov(double fltL) const
virtual void getAllWeights(double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
TrkSimpleRep & operator=(const TrkSimpleRep &right)
virtual double pt(double fltL=0.) const
TrkSimpleRep(const TrkHotList *, TrkRecoTrk *, PdtPid::PidType)
virtual Hep3Vector momentum(double fltL=0.) const