1 #ifndef TrackVertexArbitration_H 2 #define TrackVertexArbitration_H 5 #include <unordered_map> 95 primaryVertexCollection (params.getParameter<
edm::InputTag>(
"primaryVertices")),
96 secondaryVertexCollection (params.getParameter<
edm::InputTag>(
"secondaryVertices")),
98 beamSpotCollection (params.getParameter<
edm::InputTag>(
"beamSpot")),
99 dRCut (params.getParameter<double>(
"dRCut")),
100 distCut (params.getParameter<double>(
"distCut")),
101 sigCut (params.getParameter<double>(
"sigCut")),
102 dLenFraction (params.getParameter<double>(
"dLenFraction")),
103 fitterSigmacut (params.getParameter<double>(
"fitterSigmacut")),
104 fitterTini (params.getParameter<double>(
"fitterTini")),
105 fitterRatio (params.getParameter<double>(
"fitterRatio")),
106 trackMinLayers (params.getParameter<int32_t>(
"trackMinLayers")),
107 trackMinPt (params.getParameter<double>(
"trackMinPt")),
108 trackMinPixels (params.getParameter<int32_t>(
"trackMinPixels")),
109 maxTimeSignificance (params.getParameter<double>(
"maxTimeSignificance"))
138 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
159 using namespace reco;
172 std::vector<VTX> recoVertices;
176 std::unordered_map<unsigned int, Measurement1D> cachedIP;
177 for(
typename std::vector<VTX>::const_iterator
sv = secondaryVertices.begin();
178 sv != secondaryVertices.end(); ++
sv) {
181 const bool svHasTime = svTimeCov > 0.;
187 std::vector<reco::TransientTrack> selTracks;
188 for(
unsigned int itrack = 0; itrack < selectedTracks.size(); itrack++){
194 if( cachedIP.count(itrack) ) {
195 ipv=cachedIP[itrack];
198 cachedIP[itrack]=ipvp.second;
204 if(! tsos.isValid())
continue;
206 GlobalError refPointErr = tsos.cartesianError().position();
227 selTracks.push_back(tt);
236 selTracks.push_back(tt);
252 std::cout <<
"t : " << itrack <<
" ref " << ref.key() <<
" w: " << w
263 std::cout <<
" . t : " << itrack <<
" ref " << ref.key()<<
" w: " << w
265 <<
" pvip: " << ipv.
significance() <<
" " << ipv.
value() <<
" dr: " << dR << std::endl;
271 if(selTracks.size() >= 2)
274 singleFitVertex = theAdaptiveFitter.
vertex(selTracks,ssv);
276 if(singleFitVertex.
isValid()) {
278 recoVertices.push_back(VTX(singleFitVertex));
282 const VTX & extVertex = recoVertices.back();
reco::Vertex::Point convertPos(const GlobalPoint &p)
void setBeamSpot(const reco::BeamSpot &beamSpot)
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
TrackBaseRef trackBaseRef() const
reco::Vertex::Error convertError(const GlobalError &ge)
bool trackFilterArbitrator(const reco::TransientTrack &track) const
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
const MagneticField * field() const
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
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
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
double pt() const
track transverse momentum
edm::InputTag secondaryVertexCollection
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 3
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.
CandidatePtr candidate() const override
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