14 vector < reco::TransientTrack > newtrks;
17 for ( vector< reco::TransientTrack >::const_iterator
i=trks.begin();
22 newtrks.push_back ( *
i );
43 vector < reco::TransientTrack > newrfs;
45 vector < reco::TransientTrack >::const_iterator origtrkiter=trks.begin();
46 for ( vector< reco::TransientTrack >::const_iterator
i=oldrfs.begin();
i!=oldrfs.end() ; ++
i )
50 newrfs.push_back ( *
i );
60 <<
"More refitted tracks than original tracks!";
68 set < reco::TransientTrack > & remainingtrks,
75 const vector < reco::TransientTrack > & origtrks = newvtx.
originalTracks();
76 for ( vector< reco::TransientTrack >::const_iterator
i=origtrks.begin();
77 i!=origtrks.end(); ++
i )
82 remainingtrks.erase ( *
i );
90 theMinWeight( min_weight ), theWeightThreshold ( 0.001 )
92 setupFitters ( primcut, 256., 0.25, seccut, 256., 0.25, smoothing );
102 float primT,
float primr,
float seccut,
float secT,
161 setupFitters ( primcut, primT, primr, seccut, secT, secr, smoothing );
164 vector<TransientVertex>
168 return vertices ( vector<reco::TransientTrack>(), t, s,
false,
true );
171 vector<TransientVertex>
175 return vertices ( primaries, tracks, s,
true,
true );
180 const vector<reco::TransientTrack> &
tracks )
const 187 const vector<reco::TransientTrack> & primaries,
188 const vector<reco::TransientTrack> &
tracks,
191 vector < TransientVertex > ret;
192 set < reco::TransientTrack > remainingtrks;
194 copy(tracks.begin(), tracks.end(),
195 inserter(remainingtrks, remainingtrks.begin()));
198 unsigned int n_tracks = remainingtrks.size();
202 while ( remainingtrks.size() > 1 )
214 vector < reco::TransientTrack > fittrks;
215 fittrks.reserve ( remainingtrks.size() );
217 copy(remainingtrks.begin(), remainingtrks.end(), back_inserter(fittrks));
220 if ( (ret.empty()) && has_primaries )
223 copy ( primaries.begin(), primaries.end(), back_inserter(fittrks) );
225 if ( (ret.empty()) && usespot )
227 tmpvtx=fitter->
vertex ( fittrks, s );
229 tmpvtx=fitter->
vertex ( fittrks );
232 ret.push_back ( newvtx );
234 if ( n_tracks == remainingtrks.size() )
240 LogDebug(
"AdaptiveVertexReconstructor")
241 <<
"no tracks in vertex. trying again without beamspot constraint!";
244 LogDebug(
"AdaptiveVertexReconstructor") <<
"all tracks (" << n_tracks
245 <<
") would be recycled for next fit. Trying with low threshold!";
246 erase ( newvtx, remainingtrks, 1.
e-5 );
247 if ( n_tracks == remainingtrks.size() )
249 LogDebug(
"AdaptiveVertexReconstructor") <<
"low threshold didnt help! " 250 <<
"Discontinue procedure!";
256 n_tracks = remainingtrks.size();
267 const vector < TransientVertex > & old )
const 269 vector < TransientVertex > ret;
270 for ( vector< TransientVertex >::const_iterator
i=old.begin();
i!=old.end() ; ++
i )
272 if (!(
i->hasTrackWeight()))
274 ret.push_back ( *
i );
282 for ( TransientVertex::TransientTrackToFloatMap::const_iterator
w=wm.begin();
w!=wm.end() ; ++
w )
286 if ( nsig > 1 ) ret.push_back ( *
i );
AdaptiveVertexReconstructor(float primcut=2.0, float seccut=6.0, float minweight=0.5, bool smoothing=false)
T getParameter(std::string const &) const
GlobalError priorError() const
TransientVertex cleanUp(const TransientVertex &old) const
~AdaptiveVertexReconstructor() override
float totalChiSquared() const
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
char const * what() const override
AdaptiveVertexFitter * thePrimaryFitter
bool hasRefittedTracks() const
void setupFitters(float primcut, float primT, float primr, float seccut, float secT, float secr, bool smoothing)
void setWeightThreshold(float w)
std::vector< reco::TransientTrack > const & originalTracks() const
float degreesOfFreedom() const
std::vector< TransientVertex > cleanUpVertices(const std::vector< TransientVertex > &) const
AdaptiveVertexFitter * theSecondaryFitter
float trackWeight(const reco::TransientTrack &track) const
GlobalPoint priorPosition() const
std::vector< reco::TransientTrack > const & refittedTracks() const
void erase(const TransientVertex &newvtx, std::set< reco::TransientTrack > &remainingtrks, float w) const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &v) const override
VertexState const & vertexState() const
TransientTrackToFloatMap weightMap() const