1 #ifndef TrackVertexArbitration_H
2 #define TrackVertexArbitration_H
81 primaryVertexCollection (params.getParameter<edm::
InputTag>(
"primaryVertices")),
82 secondaryVertexCollection (params.getParameter<edm::
InputTag>(
"secondaryVertices")),
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")),
90 fitterTini (params.getParameter<double>(
"fitterTini")),
91 fitterRatio (params.getParameter<double>(
"fitterRatio")),
93 trackMinPt (params.getParameter<double>(
"trackMinPt")),
121 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
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);
210 selTracks.push_back(tt);
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
double pt() const
track transverse momentum
edm::InputTag secondaryVertexCollection
double residualX(int position) const
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
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)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
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