96{
98
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());
102 }
103
104
106
107 HepSymMatrix evWideVertex(3, 0);
108 evWideVertex[0][0] = 1.0E12;
109 evWideVertex[1][1] = 1.0E12;
110 evWideVertex[2][2] = 1.0E12;
111
113 wideVertex.
setVx(vWideVertex);
114 wideVertex.
setEvx(evWideVertex);
115
116 if (vtxfit->m_vpar_infit.size() == 0) {
117 std::cerr << "Not set Vertex?" << std::endl;
118 return false;
119 }
120
123 bool ZFit = false;
124 HepVector ZVx = vtxfit->
Vx(0);
125 HepSymMatrix ZEVx = evWideVertex;
126
127
128 if (vtxfit->
Fit(0)) {
131
132 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
133 m_p4Infit[i] = vtxfit->
pfit(i);
134 m_x3Infit[i] = vtxfit->
xfit(i);
135 }
136
139 ZEVx = vtxfit->
Evx(0);
142 ZFit = true;
143 }
144
145 if (ZFit) {
146 if (ZDP.perp() > obeampipe) {
147
149
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());
156 }
157 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
158 }
159
160 wideVertex.
setVx(ZVx);
161
162 wideVertex.
setEvx(evWideVertex);
163
164
165 vtxfit->
AddVertex(0, wideVertex, m_trkIdxOrigin);
166
167 if (vtxfit->
Fit(0)) {
172 ZEVx = vtxfit->
Evx(0);
173 thePath = 3;
174 } else {
176 thePath = 2;
177 }
178 } else {
180 thePath = 1;
181 }
182 } else {
183
185
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());
192 }
193 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
194 }
195
196 if (vtxfit->
Fit(0)) {
201 ZEVx = vtxfit->
Evx(0);
202 thePath = 4;
203 } else {
204 thePath = 5;
205 return false;
206 }
207 }
208
210
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]);
218 }
219 m_p4Infit[i] = m_wtrkInfit[i].p();
220 m_x3Infit[i] = m_wtrkInfit[i].x();
221
222 vtxfit->
AddTrack(i, m_wtrkInfit[i]);
223 }
224
226
227 wideVertex.
setEvx(evWideVertex);
228
229 vtxfit->
AddVertex(0, wideVertex, m_trkIdxOrigin);
230
231
232 if (vtxfit->
Fit(0)) {
235 } else {
236 thePath = 6;
237 }
238
239 return true;
240}
HepGeom::Point3D< double > HepPoint3D
HepPoint3D vx(int n) const
HepVector Vx(int n) const
HepPoint3D vx(int n) const
HepLorentzVector pfit(int n) const
HepPoint3D xfit(int n) const
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)