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();
62 m_trkIdxOrigin.push_back(index);
63 m_tracksOrigin.push_back(
nullptr);
65 int idx = m_trkIdxOrigin.size() - 1;
67 std::cerr <<
"TrackPool: wrong track index " << index <<
", "
68 << m_trkIdxOrigin.size() << std::endl;
71 m_tracksOrigin[idx]->setPidType(m_trkPidOrigin[idx]);
72 m_wtrkInfit.push_back(
wtrk);
73 vtxfit->
AddTrack(m_trkIdxOrigin[idx], m_wtrkInfit[idx]);
79 m_trkIdxOrigin.push_back(index);
80 m_tracksOrigin.push_back(p);
81 m_trkPidOrigin.push_back(pid);
82 int idx = m_trkIdxOrigin.size() - 1;
84 std::cerr <<
"TrackPool: wrong track index " << index <<
", "
85 << m_trkIdxOrigin.size() << std::endl;
88 m_tracksOrigin[idx]->setPidType(m_trkPidOrigin[idx]);
90 m_tracksOrigin[idx]->helix(),
91 m_tracksOrigin[idx]->err()));
92 vtxfit->
AddTrack(m_trkIdxOrigin[idx], m_wtrkInfit[idx]);
99 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
100 m_p4Infit.push_back(m_wtrkInfit[i].p());
101 m_x3Infit.push_back(m_wtrkInfit[i].
x());
107 HepSymMatrix evWideVertex(3, 0);
108 evWideVertex[0][0] = 1.0E12;
109 evWideVertex[1][1] = 1.0E12;
110 evWideVertex[2][2] = 1.0E12;
113 wideVertex.
setVx(vWideVertex);
114 wideVertex.
setEvx(evWideVertex);
116 if (vtxfit->m_vpar_infit.size() == 0) {
117 std::cerr <<
"Not set Vertex?" << std::endl;
124 HepVector ZVx = vtxfit->
Vx(0);
125 HepSymMatrix ZEVx = evWideVertex;
128 if (vtxfit->
Fit(0)) {
132 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
133 m_p4Infit[i] = vtxfit->
pfit(i);
134 m_x3Infit[i] = vtxfit->
xfit(i);
139 ZEVx = vtxfit->
Evx(0);
146 if (ZDP.perp() > obeampipe) {
150 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
151 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
155 m_tracksOrigin[i]->fhelix(), m_tracksOrigin[i]->ferr());
157 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
160 wideVertex.
setVx(ZVx);
162 wideVertex.
setEvx(evWideVertex);
165 vtxfit->
AddVertex(0, wideVertex, m_trkIdxOrigin);
167 if (vtxfit->
Fit(0)) {
172 ZEVx = vtxfit->
Evx(0);
186 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
187 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
191 m_tracksOrigin[i]->fhelix(), m_tracksOrigin[i]->ferr());
193 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
196 if (vtxfit->
Fit(0)) {
201 ZEVx = vtxfit->
Evx(0);
211 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
212 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
214 vtxext->
KalFitExt(
vx, m_tracksOrigin[i], m_trkPidOrigin[i]);
219 m_p4Infit[i] = m_wtrkInfit[i].p();
220 m_x3Infit[i] = m_wtrkInfit[i].x();
222 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
227 wideVertex.
setEvx(evWideVertex);
229 vtxfit->
AddVertex(0, wideVertex, m_trkIdxOrigin);
232 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)
WTrackParameter wtrk(int n) const
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)