BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
SecondVertexFit.h
Go to the documentation of this file.
1#ifndef VertexFit_SecondVertexFit_H
2#define VertexFit_SecondVertexFit_H
5
6//--------------------------------------------------------------------------------
7//
8// Fitting Parameters Format: (px, py, pz, E, xd, yd, zd, xp, yp, zp)
9//
10// Author Date Comments
11// K.L He 11/21/2005 original version
12// Xu Min 11/30/2006 Add interface of production vertex and decay vertex
13// Martin 09/02/2010 Add some kindly comments
14//
15//--------------------------------------------------------------------------------
16
17
19{
20public:
21
22 // constructor & deconstructor
23 static SecondVertexFit *instance();
25
26 // initializtion must be called before SecondVertexFit each time
27 void init();
28
29 // set iteration number and chisq cut
30 void setIterNumber(const int niter = 10) {m_niter = niter;}
31 void setChisqCut(const double chicut = 500, const double chiter = 1.0e-2) {m_chicut = chicut;m_chiter=chiter;}
32 // set decay point
33 void setVpar(const VertexParameter vpar) {m_vpar_secondary = vpar;}
34 // set production point
35 void setPrimaryVertex(const VertexParameter vpar){m_vpar_primary.setVx(vpar.Vx());m_vpar_primary.setEvx(vpar.Evx());}
36
37 // fit function
38 bool Fit();
39
40 // fit results
41 double chisq() const {return m_chisq;}
42 double decayLength() const {return m_lxyz;}
43 double decayLengthError() const {return m_lxyz_error;}
44 double ctau() const {return m_ctau;}
45 double ctauError() const {return m_ctau_error;}
46
47 HepLorentzVector p4par() const {return m_p4par;}
48 WTrackParameter wpar() const {return m_wtrk;}
49 VertexParameter vpar() const {return m_vpar_secondary;}
50 inline HepPoint3D crossPoint() const;
51 inline Hep3Vector crossVector() const;
52
53private:
54
55 int m_niter; // number of iteration for second vertex fitting
56 double m_chisq; // fitting chisquare
57 double m_chicut; // chisquare upper limit
58 double m_chiter; // precision of iteration
59 double m_lxyz; // decay length
60 double m_lxyz_error; // error of decay length
61 double m_ctau; // c times tau
62 double m_ctau_error; // error of ctau
63
64 HepVector m_crxyz; // decay vertex in HepVector format
65 HepLorentzVector m_p4par; // HepLorentzVector of particle at decay vertex
66 WTrackParameter m_wtrk; // WTrackParameter of particle at decay vertex
67 VertexParameter m_vpar_primary; // production vertex
68 VertexParameter m_vpar_secondary; // decay vertex
69
70 // Singleton Design
72 static SecondVertexFit * m_pointer;
73};
74
76{
77 return HepPoint3D(m_crxyz[0], m_crxyz[1], m_crxyz[2]);
78}
79
80inline Hep3Vector SecondVertexFit::crossVector() const
81{
82 return Hep3Vector(m_crxyz[0] - m_vpar_primary.Vx()[0],
83 m_crxyz[1] - m_vpar_primary.Vx()[1],
84 m_crxyz[2] - m_vpar_primary.Vx()[2]);
85}
86
87#endif // VertexFit_SecondVertexFit_H
88
HepGeom::Point3D< double > HepPoint3D
Definition: Gam4pikp.cxx:37
HepLorentzVector p4par() const
double ctau() const
void setPrimaryVertex(const VertexParameter vpar)
HepPoint3D crossPoint() const
void setIterNumber(const int niter=10)
double decayLength() const
double ctauError() const
VertexParameter vpar() const
double decayLengthError() const
Hep3Vector crossVector() const
static SecondVertexFit * instance()
void setVpar(const VertexParameter vpar)
double chisq() const
void setChisqCut(const double chicut=500, const double chiter=1.0e-2)
WTrackParameter wpar() const
HepSymMatrix Evx() const
void setEvx(const HepSymMatrix &eVx)
HepVector Vx() const
void setVx(const HepPoint3D &vx)