Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:18

0001 #include "RecoVertex/LinearizationPointFinders/interface/FallbackLinearizationPointFinder.h"
0002 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0003 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0004 #include "RecoVertex/VertexTools/interface/FsmwModeFinder3d.h"
0005 
0006 FallbackLinearizationPointFinder::FallbackLinearizationPointFinder(const ModeFinder3d& m) : theModeFinder(m.clone()) {}
0007 
0008 GlobalPoint FallbackLinearizationPointFinder::getLinearizationPoint(
0009     const std::vector<FreeTrajectoryState>& tracks) const {
0010   return GlobalPoint(0., 0., 0.);
0011 }
0012 
0013 GlobalPoint FallbackLinearizationPointFinder::getLinearizationPoint(
0014     const std::vector<reco::TransientTrack>& tracks) const {
0015   switch (tracks.size()) {
0016     case 0:
0017       return GlobalPoint(0., 0., 0.);
0018     case 1:
0019       return tracks.begin()->impactPointState().globalPosition();
0020     default: {
0021       std::vector<std::pair<GlobalPoint, float> > wtracks;
0022       wtracks.reserve(tracks.size() - 1);
0023       for (std::vector<reco::TransientTrack>::const_iterator i = tracks.begin(); i != tracks.end(); ++i) {
0024         std::pair<GlobalPoint, float> tmp(i->impactPointState().globalPosition(), 1.);
0025         wtracks.push_back(tmp);
0026       }
0027       return (*theModeFinder)(wtracks);
0028     }
0029   }
0030   return GlobalPoint(0., 0., 0.);
0031 }