1 #ifndef TrackVertexArbitration_H 2 #define TrackVertexArbitration_H 5 #include <unordered_map> 94 primaryVertexCollection (params.getParameter<
edm::InputTag>(
"primaryVertices")),
95 secondaryVertexCollection (params.getParameter<
edm::InputTag>(
"secondaryVertices")),
97 beamSpotCollection (params.getParameter<
edm::InputTag>(
"beamSpot")),
98 dRCut (params.getParameter<double>(
"dRCut")),
99 distCut (params.getParameter<double>(
"distCut")),
100 sigCut (params.getParameter<double>(
"sigCut")),
101 dLenFraction (params.getParameter<double>(
"dLenFraction")),
102 fitterSigmacut (params.getParameter<double>(
"fitterSigmacut")),
103 fitterTini (params.getParameter<double>(
"fitterTini")),
104 fitterRatio (params.getParameter<double>(
"fitterRatio")),
105 trackMinLayers (params.getParameter<int32_t>(
"trackMinLayers")),
106 trackMinPt (params.getParameter<double>(
"trackMinPt")),
107 trackMinPixels (params.getParameter<int32_t>(
"trackMinPixels")),
108 maxTimeSignificance (params.getParameter<double>(
"maxTimeSignificance"))
135 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
156 using namespace reco;
169 std::vector<VTX> recoVertices;
173 std::unordered_map<unsigned int, Measurement1D> cachedIP;
174 for(
typename std::vector<VTX>::const_iterator sv = secondaryVertices.begin();
175 sv != secondaryVertices.end(); ++sv) {
178 const bool svHasTime = svTimeCov > 0.;
180 GlobalPoint ssv(sv->position().x(),sv->position().y(),sv->position().z());
184 std::vector<reco::TransientTrack> selTracks;
185 for(
unsigned int itrack = 0; itrack < selectedTracks.size(); itrack++){
191 if( cachedIP.count(itrack) ) {
192 ipv=cachedIP[itrack];
195 cachedIP[itrack]=ipvp.second;
201 if(! tsos.isValid())
continue;
203 GlobalError refPointErr = tsos.cartesianError().position();
224 selTracks.push_back(tt);
233 selTracks.push_back(tt);
249 std::cout <<
"t : " << itrack <<
" ref " << ref.key() <<
" w: " << w
260 std::cout <<
" . t : " << itrack <<
" ref " << ref.key()<<
" w: " << w
262 <<
" pvip: " << ipv.
significance() <<
" " << ipv.
value() <<
" dr: " << dR << std::endl;
268 if(selTracks.size() >= 2)
271 singleFitVertex = theAdaptiveFitter.
vertex(selTracks,ssv);
273 if(singleFitVertex.
isValid()) {
275 recoVertices.push_back(VTX(singleFitVertex));
279 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)
int trackerLayersWithMeasurement() const
const Point & position() const
position
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
double deltaR(double eta1, double eta2, double phi1, double phi2)
const BasicTransientTrack * basicTransientTrack() const
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
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
void updateVertexTime(TransientVertex &vtx)
double cov33(const reco::Vertex &sv)
const daughters & daughterPtrVector() const
references to daughtes
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