1 #ifndef TrackVertexArbitration_H
2 #define TrackVertexArbitration_H
5 #include <unordered_map>
87 : primaryVertexCollection(params.getParameter<edm::
InputTag>(
"primaryVertices")),
88 secondaryVertexCollection(params.getParameter<edm::
InputTag>(
"secondaryVertices")),
90 beamSpotCollection(params.getParameter<edm::
InputTag>(
"beamSpot")),
91 dRCut(params.getParameter<double>(
"dRCut")),
92 distCut(params.getParameter<double>(
"distCut")),
93 sigCut(params.getParameter<double>(
"sigCut")),
94 dLenFraction(params.getParameter<double>(
"dLenFraction")),
96 fitterTini(params.getParameter<double>(
"fitterTini")),
97 fitterRatio(params.getParameter<double>(
"fitterRatio")),
99 trackMinPt(params.getParameter<double>(
"trackMinPt")),
129 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
145 using namespace reco;
155 std::vector<VTX> recoVertices;
159 std::unordered_map<unsigned int, Measurement1D> cachedIP;
160 for (
typename std::vector<VTX>::const_iterator sv = secondaryVertices.begin(); sv != secondaryVertices.end(); ++sv) {
162 const bool svHasTime = svTimeCov > 0.;
164 GlobalPoint ssv(sv->position().x(), sv->position().y(), sv->position().z());
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();
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
249 <<
" pvip: " << ipv.
significance() <<
" " << ipv.
value() <<
" dr: " << dR << std::endl;
254 if (selTracks.size() >= 2) {
256 singleFitVertex = theAdaptiveFitter.
vertex(selTracks, ssv);
258 if (singleFitVertex.
isValid()) {
261 recoVertices.push_back(VTX(singleFitVertex));
264 const VTX &extVertex = recoVertices.back();
reco::Vertex::Point convertPos(const GlobalPoint &p)
const edm::EventSetup & c
tuple maxTimeSignificance
void setBeamSpot(const reco::BeamSpot &beamSpot)
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
TrackBaseRef trackBaseRef() const
CandidatePtr candidate() const override
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 3
reco::Vertex::Error convertError(const GlobalError &ge)
bool trackFilterArbitrator(const reco::TransientTrack &track) const
const MagneticField * field() const
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
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)
int trackerLayersWithMeasurement() const
const Point & position() const
position
virtual const daughters & daughterPtrVector() const
references to daughtes
double pt() const
track transverse momentum
edm::InputTag secondaryVertexCollection
Abs< T >::type abs(const T &t)
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
const BasicTransientTrack * basicTransientTrack() const
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double significance() const
const Track & track() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
edm::InputTag primaryVertexCollection
double dtErrorExt() const
std::vector< VTX > trackVertexArbitrator(edm::Handle< reco::BeamSpot > &beamSpot, const reco::Vertex &pv, std::vector< reco::TransientTrack > &selectedTracks, std::vector< VTX > &secondaryVertices)
double maxTimeSignificance
void updateVertexTime(TransientVertex &vtx)
double cov33(const reco::Vertex &sv)
TrackVertexArbitration(const edm::ParameterSet ¶ms)
int numberOfValidPixelHits() const
TrajectoryStateOnSurface impactPointState() const
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