1 #ifndef TrackVertexArbitration_H
2 #define TrackVertexArbitration_H
55 std::vector<VTX> & secondaryVertices
81 primaryVertexCollection (params.getParameter<edm::InputTag>(
"primaryVertices")),
82 secondaryVertexCollection (params.getParameter<edm::InputTag>(
"secondaryVertices")),
83 trackCollection (params.getParameter<edm::InputTag>(
"tracks")),
84 beamSpotCollection (params.getParameter<edm::InputTag>(
"beamSpot")),
85 dRCut (params.getParameter<double>(
"dRCut")),
86 distCut (params.getParameter<double>(
"distCut")),
87 sigCut (params.getParameter<double>(
"sigCut")),
88 dLenFraction (params.getParameter<double>(
"dLenFraction")),
89 fitterSigmacut (params.getParameter<double>(
"fitterSigmacut")),
90 fitterTini (params.getParameter<double>(
"fitterTini")),
91 fitterRatio (params.getParameter<double>(
"fitterRatio")),
92 trackMinLayers (params.getParameter<int32_t>(
"trackMinLayers")),
93 trackMinPt (params.getParameter<double>(
"trackMinPt")),
94 trackMinPixels (params.getParameter<int32_t>(
"trackMinPixels"))
105 if (track.
track().
pt() < trackMinPt)
121 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
140 std::vector<VTX> & secondaryVertices)
142 using namespace reco;
155 std::vector<VTX> recoVertices;
159 std::map<unsigned int, Measurement1D> cachedIP;
160 for(
typename std::vector<VTX>::const_iterator sv = secondaryVertices.begin();
161 sv != secondaryVertices.end(); ++sv) {
163 GlobalPoint ssv(sv->position().x(),sv->position().y(),sv->position().z());
167 std::vector<reco::TransientTrack> selTracks;
168 for(
unsigned int itrack = 0; itrack < selectedTracks.size(); itrack++){
170 if (!trackFilterArbitrator(tt))
continue;
174 if(cachedIP.find(itrack)!=cachedIP.end()) {
175 ipv=cachedIP[itrack];
178 cachedIP[itrack]=ipvp.second;
184 if(! tsos.isValid())
continue;
186 GlobalError refPointErr = tsos.cartesianError().position();
201 selTracks.push_back(tt);
209 if(w > 0.5 && isv.
value() <= ipv.
value() && dR < dRCut) {
210 selTracks.push_back(tt);
215 if(w > 0.5 && isv.
value() <= ipv.
value() && dR >= dRCut) {
226 std::cout <<
"t : " << itrack <<
" ref " << ref.key() <<
" w: " << w
237 std::cout <<
" . t : " << itrack <<
" ref " << ref.key()<<
" w: " << w
239 <<
" pvip: " << ipv.
significance() <<
" " << ipv.
value() <<
" dr: " << dR << std::endl;
245 if(selTracks.size() >= 2)
248 singleFitVertex = theAdaptiveFitter.
vertex(selTracks,ssv);
249 if(singleFitVertex.
isValid()) { recoVertices.push_back(VTX(singleFitVertex));
252 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
CandidatePtr candidate() const
reco::Vertex::Error convertError(const GlobalError &ge)
bool trackFilterArbitrator(const reco::TransientTrack &track) const
const MagneticField * field() const
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
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
double pt() const
track transverse momentum
edm::InputTag secondaryVertexCollection
double residualX(int position) const
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const
double deltaR2(const T1 &t1, const T2 &t2)
double deltaR(double eta1, double eta2, double phi1, double phi2)
const BasicTransientTrack * basicTransientTrack() const
double significance() const
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)
const Track & track() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
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 residualY(int position) const
const daughters & daughterPtrVector() const
references to daughtes
TrackVertexArbitration(const edm::ParameterSet ¶ms)
int numberOfValidPixelHits() const
TrajectoryStateOnSurface impactPointState() const
edm::InputTag beamSpotCollection
edm::InputTag trackCollection
Global3DVector GlobalVector