1 #ifndef TrackVertexArbitration_H
2 #define TrackVertexArbitration_H
5 #include <unordered_map>
88 secondaryVertexCollection(
params.getParameter<
edm::
InputTag>(
"secondaryVertices")),
110 if (!
track.isValid())
123 return sv.trackWeight(
track.trackBaseRef());
127 dynamic_cast<const reco::CandidatePtrTransientTrack *>(
tt.basicTransientTrack());
129 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
132 if (
std::find(
sv.daughterPtrVector().begin(),
sv.daughterPtrVector().end(),
c) !=
sv.daughterPtrVector().end())
145 using namespace reco;
155 std::vector<VTX> recoVertices;
159 std::unordered_map<unsigned int, Measurement1D> cachedIP;
162 const bool svHasTime = svTimeCov > 0.;
169 std::vector<reco::TransientTrack> selTracks;
170 for (
unsigned int itrack = 0; itrack <
selectedTracks.size(); itrack++) {
172 if (!trackFilterArbitrator(
tt))
177 if (cachedIP.count(itrack)) {
178 ipv = cachedIP[itrack];
181 cachedIP[itrack] = ipvp.second;
191 GlobalError refPointErr = tsos.cartesianError().position();
202 timeSig =
std::abs(
tt.timeExt() - svTime) / tError;
215 selTracks.push_back(
tt);
225 selTracks.push_back(
tt);
238 std::cout <<
"t : " << itrack <<
" ref " << ref.key() <<
" w: " <<
w <<
" svip: " << isv.
significance() <<
" "
240 <<
tt.track().residualX(0) <<
"," <<
tt.track().residualY(0)
247 std::cout <<
" . t : " << itrack <<
" ref " << ref.key() <<
" w: " <<
w
254 if (selTracks.size() >= 2) {
256 singleFitVertex = theAdaptiveFitter.
vertex(selTracks, ssv);
258 if (singleFitVertex.
isValid()) {
259 if (
pv.covariance(3, 3) > 0.)
261 recoVertices.push_back(VTX(singleFitVertex));
264 const VTX &extVertex = recoVertices.back();