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());
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();
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