14const double&
muon = 0.1056583745;
15const double&
pion = 0.13957039;
16const double&
kaon = 0.493677;
27const double VertexFitRefine::obeampipe = 3.370;
32VertexFitRefine::VertexFitRefine() {}
42 m_trkIdxOrigin.clear();
43 m_tracksOrigin.clear();
44 m_trkPidOrigin.clear();
63 m_trkIdxOrigin.push_back(index);
64 m_tracksOrigin.push_back(p);
65 m_trkPidOrigin.push_back(pid);
66 if (index != m_trkIdxOrigin.size() - 1) {
67 std::cerr <<
"TrackPool: wrong track index " << index <<
", "
68 << m_trkIdxOrigin.size() << std::endl;
71 int idx = m_trkIdxOrigin.size() - 1;
72 m_tracksOrigin[idx]->setPidType(m_trkPidOrigin[idx]);
74 m_tracksOrigin[idx]->helix(),
75 m_tracksOrigin[idx]->err()));
76 vtxfit->
AddTrack(m_trkIdxOrigin[idx], m_wtrkInfit[idx]);
83 for (
int i = 0; i != m_trkIdxOrigin.size(); ++i) {
84 m_p4Infit.push_back(m_wtrkInfit[i].p());
85 m_x3Infit.push_back(m_wtrkInfit[i].
x());
91 HepSymMatrix evWideVertex(3, 0);
92 evWideVertex[0][0] = 1.0E12;
93 evWideVertex[1][1] = 1.0E12;
94 evWideVertex[2][2] = 1.0E12;
97 wideVertex.
setVx(vWideVertex);
98 wideVertex.
setEvx(evWideVertex);
100 if (vtxfit->m_vpar_infit.size() == 0) {
101 std::cerr <<
"Not set Vertex?" << std::endl;
104 double ZChi2 = 9999.9;
108 HepVector ZVx = vtxfit->
Vx(0);
109 HepSymMatrix ZEVx = evWideVertex;
112 if (vtxfit->
Fit(0)) {
116 ZChi2 = vtxfit->
chisq(0);
118 for (
int i = 0; i != m_trkIdxOrigin.size(); ++i) {
119 m_p4Infit[i] = vtxfit->
pfit(i);
120 m_x3Infit[i] = vtxfit->
xfit(i);
125 ZEVx = vtxfit->
Evx(0);
132 if (ZDP.perp() > obeampipe) {
136 for (
int i = 0; i != m_trkIdxOrigin.size(); ++i) {
137 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
140 m_tracksOrigin[i]->fhelix(), m_tracksOrigin[i]->ferr());
141 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
144 wideVertex.
setVx(ZVx);
146 wideVertex.
setEvx(evWideVertex);
151 if (vtxfit->
Fit(0)) {
156 ZEVx = vtxfit->
Evx(0);
170 for (
int i = 0; i != m_trkIdxOrigin.size(); ++i) {
171 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
173 m_tracksOrigin[i]->fhelix(),
174 m_tracksOrigin[i]->ferr());
175 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
178 if (vtxfit->
Fit(0)) {
183 ZEVx = vtxfit->
Evx(0);
193 for (
int i = 0; i != m_trkIdxOrigin.size(); ++i) {
194 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
195 vtxext->
KalFitExt(
vx, m_tracksOrigin[i], m_trkPidOrigin[i]);
199 m_p4Infit[i] = m_wtrkInfit[i].p();
200 m_x3Infit[i] = m_wtrkInfit[i].x();
202 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
207 wideVertex.
setEvx(evWideVertex);
212 if (vtxfit->
Fit(0)) {
HepGeom::Point3D< double > HepPoint3D
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
void AddTrack(const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
static VertexFitRefine * instance()
HepPoint3D vx(int n) const
HepVector Vx(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
HepSymMatrix Evx(int n) const
HepPoint3D vx(int n) const
HepLorentzVector pfit(int n) const
HepPoint3D xfit(int n) const
static VertexFit * instance()
void BuildVirtualParticle(int number)
double errorVx(int n, int i) const
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)