CGEM BOSS 6.6.5.h
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// You can find the corresponding tutorial on the following web page:
18// http://docbes3.ihep.ac.cn/~offlinesoftware/index.php/Vertex_Fit
19
21{
22public:
23
24 // constructor & deconstructor
25 static SecondVertexFit *instance();
27
28 // initializtion must be called before SecondVertexFit each time
29 void init();
30
31 // set iteration number and chisq cut
32 void setIterNumber(const int niter = 10) {m_niter = niter;}
33 void setChisqCut(const double chicut = 500, const double chiter = 1.0e-2) {m_chicut = chicut;m_chiter=chiter;}
34 // set decay point
35 void setVpar(const VertexParameter vpar) {m_vpar_secondary = vpar;}
36 // set production point
37 void setPrimaryVertex(const VertexParameter vpar) {m_vpar_primary.setVx(vpar.Vx());m_vpar_primary.setEvx(vpar.Evx());}
38 // set magnet correction factor
39 void setMagCorrFactor(const double factor = 1.000) {m_factor = factor;}
40
41 // fit function
42 bool Fit();
43
44 // fit results
45 double chisq() const {return m_chisq;}
46 double decayLength() const {return m_lxyz;}
47 double decayLengthError() const {return m_lxyz_error;}
48 double ctau() const {return m_ctau;}
49 double ctauError() const {return m_ctau_error;}
50 double factor() const {return m_factor;}
51
52 HepLorentzVector p4par() const {return m_p4par;}
53 WTrackParameter wpar() const {return m_wtrk;}
54 VertexParameter vpar() const {return m_vpar_secondary;}
55 inline HepPoint3D crossPoint() const;
56 inline Hep3Vector crossVector() const;
57
58private:
59
60 int m_niter; // number of iteration for second vertex fitting
61 double m_chisq; // fitting chisquare
62 double m_chicut; // chisquare upper limit
63 double m_chiter; // precision of iteration
64 double m_lxyz; // decay length
65 double m_lxyz_error; // error of decay length
66 double m_ctau; // c times tau
67 double m_ctau_error; // error of ctau
68 double m_factor; // B Field correction factor
69
70 HepVector m_crxyz; // decay vertex in HepVector format
71 HepLorentzVector m_p4par; // HepLorentzVector of particle at decay vertex
72 WTrackParameter m_wtrk; // WTrackParameter of particle at decay vertex
73 VertexParameter m_vpar_primary; // production vertex
74 VertexParameter m_vpar_secondary; // decay vertex
75
76 // Singleton Design
78 static SecondVertexFit * m_pointer;
79};
80
82{
83 return HepPoint3D(m_crxyz[0], m_crxyz[1], m_crxyz[2]);
84}
85
86inline Hep3Vector SecondVertexFit::crossVector() const
87{
88 return Hep3Vector(m_crxyz[0] - m_vpar_primary.Vx()[0],
89 m_crxyz[1] - m_vpar_primary.Vx()[1],
90 m_crxyz[2] - m_vpar_primary.Vx()[2]);
91}
92
93#endif // VertexFit_SecondVertexFit_H
94
HepGeom::Point3D< double > HepPoint3D
Definition Gam4pikp.cxx:37
void setMagCorrFactor(const double factor=1.000)
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
double factor() 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)