BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Analysis/VertexFitRefine/include/VertexFitRefine/VertexFitRefine.h
Go to the documentation of this file.
1/* <===<===<===<===<===<===<===<===<===~===>===>===>===>===>===>===>===>===>
2 * File Name: VertexFitRefine.h
3 * Author: Hao-Kai SUN
4 * Created: 2021-09-07 Tue 23:47:01 CST
5 * <<=====================================>>
6 * Last Updated: 2023-09-29 Thu 13:58:57 CST
7 * By: Hao-Kai SUN
8 * Update #: 87
9 * ============================== CODES ==============================>>> */
10#ifndef VERTEXFITREFINE_VERTEXFITREFINE_H
11# define VERTEXFITREFINE_VERTEXFITREFINE_H
12
13# include "VertexFit/VertexFit.h"
14# include "VertexFitRefine/VertexExtrapolate.h"
15
16namespace VTXPDGM {
17 extern const double& electron;
18 extern const double& muon;
19 extern const double& pion;
20 extern const double& kaon;
21 extern const double& proton;
22
23 extern const double empikp[5];
24 extern const double empikp2[5];
25} // namespace VTXPDGM
26
27class VertexFitRefine {
28 friend class VertexFit;
29
30public:
31 static VertexFitRefine* instance();
33
34 // initialization, cleanup.
35 void init();
36
37 void AddTrack( const int index, RecMdcKalTrack* p, const RecMdcKalTrack::PidType pid );
38 // for virtual track, Lambda
39 void AddTrack( const int number, const WTrackParameter wtrk );
40
41 // add methods
42 void AddVertex( int number, VertexParameter vpar, std::vector<int> lis );
43 void AddVertex( int number, VertexParameter vpar, int n1, int n2 );
44 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3 );
45 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4 );
46 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5 );
47 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
48 int n6 );
49 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
50 int n6, int n7 );
51 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
52 int n6, int n7, int n8 );
53 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
54 int n6, int n7, int n8, int n9 );
55 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
56 int n6, int n7, int n8, int n9, int n10 );
57 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
58 int n6, int n7, int n8, int n9, int n10, int n11 );
59 void AddVertex( int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5,
60 int n6, int n7, int n8, int n9, int n10, int n11, int n12 );
61 void AddBeamFit( int number, VertexParameter vpar, int n );
62
63 // set iteration number and chisq cut
64 void setIterNumber( const int niter = 10 );
65 void setChisqCut( const double chicut = 1000, const double chiter = 1.0e-3 );
66 void setMagCorrFactor( const double factor = 1.000 );
67
68 bool Fit();
69 bool Fit( int n );
70
71 // get
72 double chisq() const;
73 double chisq( int n ) const;
74
75 // updated WTrack parameter in vertex fit
76 HepLorentzVector pfit( int n ) const;
77 HepPoint3D xfit( int n ) const;
78 HepVector w( int n ) const;
79 HepSymMatrix Ew( int n ) const;
80 WTrackParameter wtrk( int n ) const;
81
82 // updated Vertex Parameter in vertex fit
83 HepPoint3D vx( int n ) const;
84 HepVector Vx( int n ) const;
85 HepSymMatrix Evx( int n ) const;
86 double errorVx( int n, int i ) const;
87 VertexParameter vpar( int n ) const;
88
89 // updated helix for charged daughters
90 HepVector helix( int n ) const;
91
92 // virtual particle from Vertex Fit
93 WTrackParameter wVirtualTrack( int n ) const;
94
95 // debug
96 int getPath() const;
97
98private:
99 // Singleton
100 VertexFitRefine();
101 static VertexFitRefine* m_instance;
102
103 VertexFit* vtxfit;
104 VertexExtrapolate* vtxext;
105
106 // static const double beampipe; // = 3.111;
107 static const double obeampipe; // = 3.370 + 0.0130 * 3;
108 // 6.3000 + 0.0130*3 cm inner mdc chamber wall
109 // static const double innerwall; // = 6.290 - 0.0130 * 3;
110 // static const double oinnerwall; // = 6.425 + 0.0130 * 3;
111
112 std::vector<int> m_trkIdxOrigin;
113 std::vector<RecMdcKalTrack*> m_tracksOrigin;
114 std::vector<RecMdcKalTrack::PidType> m_trkPidOrigin;
115 std::vector<WTrackParameter> m_wtrkInfit;
116 std::vector<HepLorentzVector> m_p4Infit;
117 std::vector<HepPoint3D> m_x3Infit;
118
119 std::vector<HepVector> m_helices;
120
121 // int m_vtxidx;
122 std::vector<VertexParameter> m_vtxsOrigin;
123
124 // debug
125 int thePath;
126};
127
128// forward declarations, inline definitions
129# include "VertexFitRefine/VertexFitRefine.cc"
130
131#endif /* VERTEXFITREFINE_VERTEXFITREFINE_H */
132/* ===================================================================<<< */
133/* ==================== VertexFitRefine.h ends here ===================== */
HepGeom::Point3D< double > HepPoint3D
const Int_t n
double w
int n2
Definition SD0Tag.cxx:59
int n1
Definition SD0Tag.cxx:58
void AddTrack(const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
void setChisqCut(const double chicut=1000, const double chiter=1.0e-3)
static VertexFitRefine * instance()
void AddBeamFit(int number, VertexParameter vpar, int n)
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
const double & electron
const double & muon
const double & kaon
const double empikp[5]
const double & pion
const double empikp2[5]
const double & proton