1 #ifndef TrackVertexArbitration_H 2 #define TrackVertexArbitration_H 5 #include <unordered_map> 87 secondaryVertexCollection(
params.getParameter<
edm::
InputTag>(
"secondaryVertices")),
109 if (!
track.isValid())
122 return sv.trackWeight(
track.trackBaseRef());
128 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
131 if (
std::find(
sv.daughterPtrVector().begin(),
sv.daughterPtrVector().end(),
c) !=
sv.daughterPtrVector().end())
144 using namespace reco;
154 std::vector<VTX> recoVertices;
158 std::unordered_map<unsigned int, Measurement1D> cachedIP;
161 const bool svHasTime = svTimeCov > 0.;
168 std::vector<reco::TransientTrack> selTracks;
169 for (
unsigned int itrack = 0; itrack <
selectedTracks.size(); itrack++) {
171 if (!trackFilterArbitrator(
tt))
176 if (cachedIP.count(itrack)) {
177 ipv = cachedIP[itrack];
180 cachedIP[itrack] = ipvp.second;
190 GlobalError refPointErr = tsos.cartesianError().position();
201 timeSig =
std::abs(
tt.timeExt() - svTime) / tError;
214 selTracks.push_back(
tt);
224 selTracks.push_back(
tt);
237 std::cout <<
"t : " << itrack <<
" ref " << ref.key() <<
" w: " <<
w <<
" svip: " << isv.
significance() <<
" " 239 <<
tt.track().residualX(0) <<
"," <<
tt.track().residualY(0)
246 std::cout <<
" . t : " << itrack <<
" ref " << ref.key() <<
" w: " <<
w 253 if (selTracks.size() >= 2) {
255 singleFitVertex = theAdaptiveFitter.
vertex(selTracks, ssv);
257 if (singleFitVertex.
isValid()) {
258 if (
pv.covariance(3, 3) > 0.)
260 recoVertices.push_back(VTX(singleFitVertex));
263 const VTX &extVertex = recoVertices.back();
reco::Vertex::Point convertPos(const GlobalPoint &p)
CandidatePtr candidate() const override
reco::Vertex::Error convertError(const GlobalError &ge)
Log< level::Error, false > LogError
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
constexpr bool isFinite(T x)
edm::InputTag secondaryVertexCollection
Abs< T >::type abs(const T &t)
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
edm::InputTag primaryVertexCollection
std::vector< VTX > trackVertexArbitrator(edm::Handle< reco::BeamSpot > &beamSpot, const reco::Vertex &pv, std::vector< reco::TransientTrack > &selectedTracks, std::vector< VTX > &secondaryVertices)
double maxTimeSignificance
double significance() const
void updateVertexTime(TransientVertex &vtx)
bool trackFilterArbitrator(const reco::TransientTrack &track) const
double cov33(const reco::Vertex &sv)
TrackVertexArbitration(const edm::ParameterSet ¶ms)
edm::InputTag beamSpotCollection
Power< A, B >::type pow(const A &a, const B &b)
edm::InputTag trackCollection
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)
Global3DVector GlobalVector