BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Analysis/VertexFit/include/VertexFit/SecondVertexFit.h
Go to the documentation of this file.
1#ifndef VertexFit_SecondVertexFit_H
2#define VertexFit_SecondVertexFit_H
3#include "VertexFit/TrackPool.h"
4#include "VertexFit/VertexFit.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
20class SecondVertexFit : public TrackPool {
21public:
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 ) {
32 m_chicut = chicut;
33 m_chiter = chiter;
34 }
35 // set decay point
36 void setVpar( const VertexParameter vpar ) { m_vpar_secondary = vpar; }
37 // set production point
39 m_vpar_primary.setVx( vpar.Vx() );
40 m_vpar_primary.setEvx( vpar.Evx() );
41 }
42 // set magnet correction factor
43 void setMagCorrFactor( const double factor = 1.000 ) { m_factor = factor; }
44
45 // fit function
46 bool Fit();
47
48 // fit results
49 double chisq() const { return m_chisq; }
50 double decayLength() const { return m_lxyz; }
51 double decayLengthError() const { return m_lxyz_error; }
52 double ctau() const { return m_ctau; }
53 double ctauError() const { return m_ctau_error; }
54 double factor() const { return m_factor; }
55
56 HepLorentzVector p4par() const { return m_p4par; }
57 WTrackParameter wpar() const { return m_wtrk; }
58 VertexParameter vpar() const { return m_vpar_secondary; }
59 inline HepPoint3D crossPoint() const;
60 inline Hep3Vector crossVector() const;
61
62private:
63 int m_niter; // number of iteration for second vertex fitting
64 double m_chisq; // fitting chisquare
65 double m_chicut; // chisquare upper limit
66 double m_chiter; // precision of iteration
67 double m_lxyz; // decay length
68 double m_lxyz_error; // error of decay length
69 double m_ctau; // c times tau
70 double m_ctau_error; // error of ctau
71 double m_factor; // B Field correction factor
72
73 HepVector m_crxyz; // decay vertex in HepVector format
74 HepLorentzVector m_p4par; // HepLorentzVector of particle at decay vertex
75 WTrackParameter m_wtrk; // WTrackParameter of particle at decay vertex
76 VertexParameter m_vpar_primary; // production vertex
77 VertexParameter m_vpar_secondary; // decay vertex
78
79 // Singleton Design
81 static SecondVertexFit* m_pointer;
82};
83
85 return HepPoint3D( m_crxyz[0], m_crxyz[1], m_crxyz[2] );
86}
87
88inline Hep3Vector SecondVertexFit::crossVector() const {
89 return Hep3Vector( m_crxyz[0] - m_vpar_primary.Vx()[0], m_crxyz[1] - m_vpar_primary.Vx()[1],
90 m_crxyz[2] - m_vpar_primary.Vx()[2] );
91}
92
93#endif // VertexFit_SecondVertexFit_H
HepGeom::Point3D< double > HepPoint3D
void setPrimaryVertex(const VertexParameter vpar)
static SecondVertexFit * instance()
void setChisqCut(const double chicut=500, const double chiter=1.0e-2)