21 m_iVertexFitter(
"Trk::AdaptiveVertexFitter", this )
23 declareInterface<IVertexMergingTool> (
this );
38 return StatusCode::FAILURE;
42 return StatusCode::SUCCESS;
47 return StatusCode::SUCCESS;
50 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
61 NewContainer->setStore(auxNewContainer);
93 std::vector<bool> remerged(MyVxCont.
size(),
false);
105 std::vector<const xAOD::TrackParticle*> combinedTracks;
106 std::vector<ElementLink<xAOD::TrackParticleContainer>> tpLinks1 =
108 if (!tpLinks1.empty()) {
109 for (
const auto& tp_EL : tpLinks1) {
111 combinedTracks.push_back(trk);
114 unsigned int Nj = Ni + 1;
115 bool newmerge =
false;
123 combinedTracks.clear();
125 if (tpLinks1.empty())
127 for (
const auto& tp_EL : tpLinks1) {
129 combinedTracks.push_back(trk);
142 const std::vector<ElementLink<xAOD::TrackParticleContainer>>
144 if (tpLinks2.empty())
147 for (
const auto& tp_EL : tpLinks2) {
149 combinedTracks.push_back(trk);
170 float pt1 = sqrt(mAcc_sumPt2(*vx));
171 float pt2 = sqrt(mAcc_sumPt2(*mergeCand));
175 0.6 * pt1 / (pt1 + pt2) + 0.4 * ntrk1 / (ntrk1 + ntrk2);
177 0.6 * pt2 / (pt1 + pt2) + 0.4 * ntrk2 / (ntrk1 + ntrk2);
181 float mas1 = mAcc_mass(*vx);
182 float mas2 = mAcc_mass(*mergeCand);
183 float e1 = mAcc_energy(*vx);
184 float e2 = mAcc_energy(*mergeCand);
185 int inNtrk1 = mAcc_intrk(*vx);
186 int inNtrk2 = mAcc_intrk(*mergeCand);
189 float md1 = 0., md2 = 0., hf1 = 0., hf2 = 0.;
190 std::vector<float> trkW1, trkW2, doe1, doe2;
192 doe1 = mAcc_trkdoe(*vx);
193 doe2 = mAcc_trkdoe(*mergeCand);
194 doe2.insert(doe2.end(), doe1.begin(), doe1.end());
195 md1 = mAcc_momdir(*vx);
196 md2 = mAcc_momdir(*mergeCand);
197 hf1 = mAcc_radpat(*vx);
198 hf2 = mAcc_radpat(*mergeCand);
199 trkW1 = mAcc_trkwt(*vx);
200 trkW2 = mAcc_trkwt(*mergeCand);
201 trkW2.insert(trkW2.end(), trkW1.begin(), trkW1.end());
202 ntrks = mAcc_numtav(*vx) + mAcc_numtav(*mergeCand);
215 mAcc_trkdoe(*vx) = doe2;
216 mAcc_momdir(*vx) = wght1 * md1 + wght2 * md2;
217 mAcc_radpat(*vx) = wght1 * hf1 + wght2 * hf2;
218 mAcc_trkwt(*vx) = trkW2;
219 mAcc_numtav(*vx) = ntrks;
222 mDecor_sumPt2(*vx) = pt1 * pt1 + pt2 * pt2;
223 mDecor_mass(*vx) = wght1 * mas1 + wght2 * mas2;
224 mDecor_energy(*vx) = wght1 *
e1 + wght2 *
e2;
225 mDecor_nrobbed(*vx) = 0;
226 mDecor_intrk(*vx) = (
int)(wght1 * inNtrk1 + wght1 * inNtrk2);
238 return std::make_pair(NewContainer, auxNewContainer);
250 AmgSymMatrix(3) vErrs = v1->covariancePosition() +
v2->covariancePosition() ;
251 vErrs = vErrs.inverse().eval();
255 sigma = sqrt( vdif.dot( vErrs * vdif ) ) ;
258 sigma = vdif(0)*vdif(0)*vErrs(0,0) + vdif(1)*vdif(1)*vErrs(1,1) + 2*vdif(0)*vdif(1)*vErrs(0,1) ;
263 sigma = vdif(2)*sqrt( vErrs(2,2) );