14 vector < reco::TransientTrack > newtrks;
16 static const float minweight = 1.e-8;
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 );
88 float primcut,
float seccut,
float min_weight,
bool smoothing ) :
89 thePrimaryFitter ( 0 ), theSecondaryFitter ( 0 ),
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,
103 float secr,
bool smoothing )
135 : thePrimaryFitter(0), theSecondaryFitter(0), theMinWeight(0.5), theWeightThreshold ( 0.001 )
139 bool smoothing=
false;
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 )
210 if ( ret.size() == 0 )
214 vector < reco::TransientTrack > fittrks;
215 fittrks.reserve ( remainingtrks.size() );
217 copy(remainingtrks.begin(), remainingtrks.end(), back_inserter(fittrks));
220 if ( (ret.size() == 0) && has_primaries )
223 copy ( primaries.begin(), primaries.end(), back_inserter(fittrks) );
225 if ( (ret.size() == 0) && 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 );
virtual char const * what() const
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
float totalChiSquared() const
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
AdaptiveVertexFitter * thePrimaryFitter
bool hasRefittedTracks() const
~AdaptiveVertexReconstructor()
std::vector< reco::TransientTrack > originalTracks() const
void setupFitters(float primcut, float primT, float primr, float seccut, float secT, float secr, bool smoothing)
void setWeightThreshold(float w)
float degreesOfFreedom() const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &v) const
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const
std::vector< TransientVertex > cleanUpVertices(const std::vector< TransientVertex > &) const
VertexState vertexState() const
AdaptiveVertexFitter * theSecondaryFitter
float trackWeight(const reco::TransientTrack &track) const
std::vector< reco::TransientTrack > refittedTracks() const
GlobalPoint priorPosition() const
void erase(const TransientVertex &newvtx, std::set< reco::TransientTrack > &remainingtrks, float w) const
TransientTrackToFloatMap weightMap() const