CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiVertexFitter.cc
Go to the documentation of this file.
2 // #include "Vertex/VertexPrimitives/interface/TransientVertex.h"
3 #include <map>
4 #include <algorithm>
5 #include <iomanip>
6 // #include "Vertex/VertexRecoAnalysis/interface/RecTrackNamer.h"
7 // #include "Vertex/MultiVertexFit/interface/TransientVertexNamer.h"
14 
15 // #define MVFHarvestingDebug
16 #ifdef MVFHarvestingDebug
17 #include "Vertex/VertexSimpleVis/interface/PrimitivesHarvester.h"
18 #endif
19 
20 using namespace std;
21 using namespace reco;
22 
23 namespace
24 {
25  typedef MultiVertexFitter::TrackAndWeight TrackAndWeight;
26  typedef MultiVertexFitter::TrackAndSeedToWeightMap TrackAndSeedToWeightMap;
27  typedef MultiVertexFitter::SeedToWeightMap SeedToWeightMap;
28  typedef CachingVertex<5>::RefCountedVertexTrack RefCountedVertexTrack;
29 
30  int verbose()
31  {
32  static const int ret = 0; /*SimpleConfigurable<int>
33  (0, "MultiVertexFitter:Debug").value(); */
34  return ret;
35  }
36 
37  double minWeightFraction()
38  {
39  // minimum weight that a track has to have
40  // in order to be taken into account for the
41  // vertex fit.
42  // Given as a fraction of the total weight.
43  static const float ret = 1e-6; /* SimpleConfigurable<float>
44  (1e-6, "MultiVertexFitter:MinimumWeightFraction").value(); */
45  return ret;
46  }
47 
48  bool discardLightWeights()
49  {
50  static const bool ret = true; /* SimpleConfigurable<bool>
51  (true, "MultiVertexFitter:DiscardLightWeights").value();*/
52  return ret;
53  }
54 
55  /*
56  struct CompareRaveTracks
57  {
58  bool operator() ( const TransientTrack & r1,
59  const TransientTrack & r2 ) const
60  {
61  return r1 < r2;
62  };
63  }*/
64 
65  CachingVertex<5> createSeedFromLinPt ( const GlobalPoint & gp )
66  {
67  return CachingVertex<5> ( gp, GlobalError (),
68  vector<RefCountedVertexTrack> (), 0.0 );
69  }
70 
71  double validWeight ( double weight )
72  {
73  if ( weight > 1.0 )
74  {
75  cout << "[MultiVertexFitter] weight=" << weight << "??" << endl;
76  return 1.0;
77  };
78 
79  if ( weight < 0.0 )
80  {
81  cout << "[MultiVertexFitter] weight=" << weight << "??" << endl;
82  return 0.0;
83  };
84  return weight;
85  }
86 }
87 
89 {
90  theAssComp->resetAnnealing();
91  theTracks.clear();
92  thePrimaries.clear();
93  theVertexStates.clear();
94  theWeights.clear();
95  theCache.clear();
96 }
97 
98 // creates the seed, additionally it pushes all tracks
99 // onto theTracks
100 
101 void MultiVertexFitter::createSeed( const vector < TransientTrack > & tracks )
102 {
103  if ( tracks.size() > 1 )
104  {
105  CachingVertex<5> vtx = createSeedFromLinPt (
106  theSeeder->getLinearizationPoint ( tracks ) );
107  int snr= seedNr();
108  theVertexStates.push_back ( pair < int, CachingVertex<5> > ( snr, vtx ) );
109  for ( vector< TransientTrack >::const_iterator track=tracks.begin();
110  track!=tracks.end() ; ++track )
111  {
112  theWeights[*track][snr]=1.;
113  theTracks.push_back ( *track );
114  };
115  };
116 }
117 
118 void MultiVertexFitter::createPrimaries ( const std::vector < reco::TransientTrack > tracks )
119 {
120  // cout << "[MultiVertexFitter] creating primaries: ";
121  for ( vector< reco::TransientTrack >::const_iterator i=tracks.begin();
122  i!=tracks.end() ; ++i )
123  {
124  thePrimaries.insert ( *i );
125  // cout << i->id() << " ";
126  }
127  // cout << endl;
128 }
129 
131 {
132  return theVertexStateNr++;
133 }
134 
136 {
137  theVertexStateNr=0;
138 }
139 
140 void MultiVertexFitter::createSeed( const vector < TrackAndWeight > & tracks )
141 {
142  // create initial seed for every bundle
143  vector < RefCountedVertexTrack> newTracks;
144 
145  for ( vector< TrackAndWeight >::const_iterator track=tracks.begin();
146  track!=tracks.end() ; ++track )
147  {
148  double weight = validWeight ( track->second );
149  const GlobalPoint & pos = track->first.impactPointState().globalPosition();
150  GlobalError err; // FIXME
151  VertexState realseed ( pos, err );
152 
154  theCache.linTrack ( pos, track->first );
155 
156  VertexTrackFactory<5> vTrackFactory;
157  RefCountedVertexTrack vTrData = vTrackFactory.vertexTrack(
158  lTrData, realseed, weight );
159  newTracks.push_back ( vTrData );
160  };
161 
162  if ( newTracks.size() > 1 )
163  {
164  CachingVertex<5> vtx = KalmanVertexFitter().vertex ( newTracks );
165  int snr = seedNr();
166  theVertexStates.push_back ( pair < int, CachingVertex<5> > ( snr, vtx ) );
167 
168  // We initialise the weights with the original
169  // user supplied weights.
170  for ( vector< TrackAndWeight >::const_iterator track=tracks.begin();
171  track!=tracks.end() ; ++track )
172  {
173  if ( thePrimaries.count ( track->first ) )
174  {
175  /*
176  cout << "[MultiVertexFitter] " << track->first.id() << " is a primary."
177  << " setting weight for state " << theVertexStates[0].first
178  << " to " << track->second
179  << endl;
180  */
181  theWeights[track->first][theVertexStates[0].first]=track->second;
182  continue;
183  };
184  float weight = track->second;
185  if ( weight > 1.0 )
186  {
187  cout << "[MultiVertexFitter] error weight " << weight << " > 1.0 given."
188  << endl;
189  cout << "[MultiVertexFitter] will revert to 1.0" << endl;
190  weight=1.0;
191  };
192  if ( weight < 0.0 )
193  {
194  cout << "[MultiVertexFitter] error weight " << weight << " < 0.0 given."
195  << endl;
196  cout << "[MultiVertexFitter] will revert to 0.0" << endl;
197  weight=0.0;
198  };
199  theWeights[track->first][snr]=weight;
200  theTracks.push_back ( track->first );
201  };
202  };
203 
204  // this thing will actually have to discard tracks
205  // that have been submitted - attached to a different vertex - already.
206  // sort ( theTracks.begin(), theTracks.end(), CompareRaveTracks() );
207  sort ( theTracks.begin(), theTracks.end() );
208  for ( vector< TransientTrack >::iterator i=theTracks.begin();
209  i<theTracks.end() ; ++i )
210  {
211  if ( i != theTracks.begin() )
212  {
213  if ( (*i) == ( *(i-1) ) )
214  {
215  theTracks.erase ( i );
216  };
217  };
218  };
219 }
220 
221 vector < CachingVertex<5> > MultiVertexFitter::vertices (
222  const vector < TransientVertex > & vtces,
223  const vector < TransientTrack > & primaries )
224 {
225  // FIXME if vtces.size < 1 return sth that includes the primaries
226  if ( vtces.size() < 1 )
227  {
228  return vector < CachingVertex<5> > ();
229  };
230  vector < vector < TrackAndWeight > > bundles;
231  for ( vector< TransientVertex >::const_iterator vtx=vtces.begin();
232  vtx!=vtces.end() ; ++vtx )
233  {
234  vector < TransientTrack > trks = vtx->originalTracks();
235  vector < TrackAndWeight > tnws;
236  for ( vector< TransientTrack >::const_iterator trk=trks.begin();
237  trk!=trks.end() ; ++trk )
238  {
239  float w = vtx->trackWeight ( *trk );
240  if ( w > 1e-5 )
241  {
242  TrackAndWeight tmp ( *trk, w );
243  tnws.push_back ( tmp );
244  };
245  };
246  bundles.push_back ( tnws );
247  };
248  return vertices ( bundles, primaries );
249 }
250 
251 vector < CachingVertex<5> > MultiVertexFitter::vertices (
252  const vector < CachingVertex<5> > & initials,
253  const vector < TransientTrack > & primaries )
254 {
255  clear();
256  createPrimaries ( primaries );
257  // FIXME if initials size < 1 return sth that includes the primaries
258  if ( initials.size() < 1 ) return initials;
259  for ( vector< CachingVertex<5> >::const_iterator vtx=initials.begin();
260  vtx!=initials.end() ; ++vtx )
261  {
262  int snr = seedNr();
263  theVertexStates.push_back ( pair < int, CachingVertex<5> >
264  ( snr, *vtx ) );
265  TransientVertex rvtx = *vtx;
266  const vector < TransientTrack > & trks = rvtx.originalTracks();
267  for ( vector< TransientTrack >::const_iterator trk=trks.begin();
268  trk!=trks.end() ; ++trk )
269  {
270  if ( !(thePrimaries.count (*trk )) )
271  {
272  // cout << "[MultiVertexFitter] free track " << trk->id() << endl;
273  theTracks.push_back ( *trk );
274  } else {
275  // cout << "[MultiVertexFitter " << trk->id() << " is not free." << endl;
276  }
277  cout << "[MultiVertexFitter] error! track weight currently set to one"
278  << " FIXME!!!" << endl;
279  theWeights[*trk][snr]=1.0;
280  };
281  };
282  #ifdef MVFHarvestingDebug
283  for ( vector< CachingVertex<5> >::const_iterator i=theVertexStates.begin();
284  i!=theVertexStates.end() ; ++i )
285  PrimitivesHarvester::file()->save(*i);
286  #endif
287  return fit();
288 }
289 
290 vector < CachingVertex<5> > MultiVertexFitter::vertices (
291  const vector < vector < TransientTrack > > & tracks,
292  const vector < TransientTrack > & primaries )
293 {
294  clear();
295  createPrimaries ( primaries );
296 
297  for ( vector< vector < TransientTrack > >::const_iterator cluster=
298  tracks.begin(); cluster!=tracks.end() ; ++cluster )
299  {
300  createSeed ( *cluster );
301  };
302  if ( verbose() )
303  {
304  printSeeds();
305  };
306  #ifdef MVFHarvestingDebug
307  for ( vector< CachingVertex<5> >::const_iterator i=theVertexStates.begin();
308  i!=theVertexStates.end() ; ++i )
309  PrimitivesHarvester::file()->save(*i);
310  #endif
311  return fit();
312 }
313 
314 vector < CachingVertex<5> > MultiVertexFitter::vertices (
315  const vector < vector < TrackAndWeight > > & tracks,
316  const vector < TransientTrack > & primaries )
317 {
318  clear();
319  createPrimaries ( primaries );
320 
321  for ( vector< vector < TrackAndWeight > >::const_iterator cluster=
322  tracks.begin(); cluster!=tracks.end() ; ++cluster )
323  {
324  createSeed ( *cluster );
325  };
326  if ( verbose() )
327  {
328  printSeeds();
329  };
330 
331  return fit();
332 }
333 
335  const LinearizationPointFinder & seeder,
336  float revive_below ) :
337  theVertexStateNr ( 0 ), theReviveBelow ( revive_below ),
338  theAssComp ( ann.clone() ), theSeeder ( seeder.clone() )
339 {}
340 
342  theVertexStateNr ( o.theVertexStateNr ), theReviveBelow ( o.theReviveBelow ),
343  theAssComp ( o.theAssComp->clone() ), theSeeder ( o.theSeeder->clone() )
344 {}
345 
347 {
348  delete theAssComp;
349  delete theSeeder;
350 }
351 
353 {
354  theWeights.clear();
355  if ( verbose() & 4 )
356  {
357  cout << "[MultiVertexFitter] Start weight update." << endl;
358  };
359 
361 
365  for ( set < TransientTrack >::const_iterator trk=thePrimaries.begin();
366  trk!=thePrimaries.end() ; ++trk )
367  {
368  int seednr = theVertexStates[0].first;
369  CachingVertex<5> seed = theVertexStates[0].second;
370  pair<bool, double> result = theComp.estimate ( seed, theCache.linTrack ( seed.position(), *trk ) );
371  double weight = 0.;
372  if (result.first) weight = theAssComp->phi ( result.second );
373  theWeights[*trk][seednr]= weight; // FIXME maybe "hard" 1.0 or "soft" weight?
374  }
375 
379  for ( vector< TransientTrack >::const_iterator trk=theTracks.begin();
380  trk!=theTracks.end() ; ++trk )
381  {
382  double tot_weight=theAssComp->phi ( theAssComp->cutoff() * theAssComp->cutoff() );
383 
384  for ( vector < pair < int, CachingVertex<5> > >::const_iterator
385  seed=theVertexStates.begin(); seed!=theVertexStates.end(); ++seed )
386  {
387 
388  pair<bool, double> result = theComp.estimate ( seed->second, theCache.linTrack ( seed->second.position(),
389  *trk ) );
390  double weight = 0.;
391  if (result.first) weight = theAssComp->phi ( result.second );
392  tot_weight+=weight;
393  theWeights[*trk][seed->first]=weight;
394  /* cout << "[MultiVertexFitter] w[" << TransientTrackNamer().name(*trk)
395  << "," << seed->position() << "] = " << weight << endl;*/
396  };
397 
398  // normalize to sum of all weights of one track equals 1.
399  // (if we include the "cutoff", as well)
400  if ( tot_weight > 0.0 )
401  {
402  for ( vector < pair < int, CachingVertex<5> > >::const_iterator
403  seed=theVertexStates.begin();
404  seed!=theVertexStates.end(); ++seed )
405  {
406  double normedweight=theWeights[*trk][seed->first]/tot_weight;
407  if ( normedweight > 1.0 )
408  {
409  cout << "[MultiVertexFitter] he? w[" // << TransientTrackNamer().name(*trk)
410  << "," << seed->second.position() << "] = " << normedweight
411  << " totw=" << tot_weight << endl;
412  normedweight=1.0;
413  };
414  if ( normedweight < 0.0 )
415  {
416  cout << "[MultiVertexFitter] he? weight=" << normedweight
417  << " totw=" << tot_weight << endl;
418  normedweight=0.0;
419  };
420  theWeights[*trk][seed->first]=normedweight;
421  };
422  } else {
423  // total weight equals zero? restart, with uniform distribution!
424  cout << "[MultiVertexFitter] track found with no assignment - ";
425  cout << "will assign uniformly." << endl;
426  float w = .5 / (float) theVertexStates.size();
427  for ( vector < pair < int, CachingVertex<5> > >::const_iterator seed=theVertexStates.begin();
428  seed!=theVertexStates.end(); ++seed )
429  {
430  theWeights[*trk][seed->first]=w;
431  };
432  };
433  };
434  if ( verbose() & 2 ) printWeights();
435 }
436 
438 {
439  double max_disp=0.;
440  // need to fit with the right weights.
441  // also trigger an updateWeights.
442  // if the seeds dont move much we return true
443 
444  vector < pair < int, CachingVertex<5> > > newSeeds;
445 
446  for ( vector< pair < int, CachingVertex<5> > >::const_iterator seed=theVertexStates.begin();
447  seed!=theVertexStates.end() ; ++seed )
448  {
449  // for each seed get the tracks with the right weights.
450  // TransientVertex rv = seed->second;
451  // const GlobalPoint & seedpos = seed->second.position();
452  int snr = seed->first;
453  VertexState realseed ( seed->second.position(), seed->second.error() );
454 
455  double totweight=0.;
456  for ( vector< TransientTrack >::const_iterator track=theTracks.begin();
457  track!=theTracks.end() ; ++track )
458  {
459  totweight+=theWeights[*track][snr];
460  };
461 
462 
463  int nr_good_trks=0; // how many tracks above weight limit
464  // we count those tracks, because that way
465  // we can discard lightweights if there are enough tracks
466  // and not discard the lightweights if that would give us
467  // fewer than two tracks ( we would loose a seed, then ).
468  if ( discardLightWeights() )
469  {
470  for ( vector< TransientTrack >::const_iterator track=theTracks.begin();
471  track!=theTracks.end() ; ++track )
472  {
473  if ( theWeights[*track][snr] > totweight * minWeightFraction() )
474  {
475  nr_good_trks++;
476  };
477  };
478  };
479 
480  vector<RefCountedVertexTrack> newTracks;
481  for ( vector< TransientTrack >::const_iterator track=theTracks.begin();
482  track!=theTracks.end() ; ++track )
483  {
484  double weight = validWeight ( theWeights[*track][snr] );
485  // Now we add a track, if
486  // a. we consider all tracks or
487  // b. we discard the lightweights but the track's weight is high enough or
488  // c. we discard the lightweights but there arent enough good tracks,
489  // so we add all lightweights again (too expensive to figure out
490  // which lightweights are the most important)
491  if ( !discardLightWeights() || weight > minWeightFraction() * totweight
492  || nr_good_trks < 2 )
493  {
494  // if the linearization point didnt move too much,
495  // we take the old LinTrackState.
496  // Otherwise we relinearize.
497 
499  theCache.linTrack ( seed->second.position(), *track );
500 
501  VertexTrackFactory<5> vTrackFactory;
502  RefCountedVertexTrack vTrData = vTrackFactory.vertexTrack(
503  lTrData, realseed, weight );
504  newTracks.push_back ( vTrData );
505  };
506  };
507 
508  for ( set< TransientTrack >::const_iterator track=thePrimaries.begin();
509  track!=thePrimaries.end() ; ++track )
510  {
511  double weight = validWeight ( theWeights[*track][snr] );
512 
514  theCache.linTrack ( seed->second.position(), *track );
515 
516  VertexTrackFactory<5> vTrackFactory;
517  RefCountedVertexTrack vTrData = vTrackFactory.vertexTrack(
518  lTrData, realseed, weight );
519  newTracks.push_back ( vTrData );
520 
521  };
522 
523  try {
524  if ( newTracks.size() < 2 )
525  {
526  throw VertexException("less than two tracks in vector" );
527  };
528 
529  if ( verbose() )
530  {
531  cout << "[MultiVertexFitter] now fitting with Kalman: ";
532  for ( vector< RefCountedVertexTrack >::const_iterator i=newTracks.begin();
533  i!=newTracks.end() ; ++i )
534  {
535  cout << (**i).weight() << " ";
536  };
537  cout << endl;
538  };
539 
540  if ( newTracks.size() > 1 )
541  {
542  KalmanVertexFitter fitter;
543  // warning! first track determines lin pt!
544  CachingVertex<5> newVertex = fitter.vertex ( newTracks );
545  int snr = seedNr();
546  double disp = ( newVertex.position() - seed->second.position() ).mag();
547  if ( disp > max_disp ) max_disp = disp;
548  newSeeds.push_back (
549  pair < int, CachingVertex<5> > ( snr, newVertex ) );
550  };
551  } catch ( exception & e )
552  {
553  cout << "[MultiVertexFitter] exception: " << e.what() << endl;
554  } catch ( ... )
555  {
556  cout << "[MultiVertexFitter] unknown exception." << endl;
557  };
558  };
559 
560  // now discard all old seeds and weights, compute new ones.
561  theVertexStates.clear();
562  theWeights.clear();
563  theVertexStates=newSeeds;
564  #ifdef MVFHarvestingDebug
565  for ( vector< CachingVertex<5> >::const_iterator i=theVertexStates.begin();
566  i!=theVertexStates.end() ; ++i )
567  PrimitivesHarvester::file()->save(*i);
568  #endif
569  updateWeights();
570 
571  static const double disp_limit = 1e-4; /* SimpleConfigurable<double>
572  (0.0001, "MultiVertexFitter:DisplacementLimit" ).value(); */
573 
574  if ( verbose() & 2 )
575  {
576  printSeeds();
577  cout << "[MultiVertexFitter] max displacement in this iteration: "
578  << max_disp << endl;
579  };
580  if ( max_disp < disp_limit ) return false;
581  return true;
582 }
583 
584 // iterating over the fits
585 vector < CachingVertex<5> > MultiVertexFitter::fit()
586 {
587  if ( verbose() & 2 ) printWeights();
588  int ctr=1;
589  static const int ctr_max = 50; /* SimpleConfigurable<int>(100,
590  "MultiVertexFitter:MaxIterations").value(); */
591  while ( updateSeeds() || !(theAssComp->isAnnealed()) )
592  {
593  if ( ++ctr >= ctr_max ) break;
594  theAssComp->anneal();
595  // lostVertexClaimer(); // was a silly(?) idea to "revive" vertex candidates.
596  resetSeedNr();
597  };
598 
599  if ( verbose() )
600  {
601  cout << "[MultiVertexFitter] number of iterations: " << ctr << endl;
602  cout << "[MultiVertexFitter] remaining seeds: "
603  << theVertexStates.size() << endl;
604  printWeights();
605  };
606 
607  vector < CachingVertex<5> > ret;
608  for ( vector< pair < int, CachingVertex<5> > >::const_iterator
609  i=theVertexStates.begin(); i!=theVertexStates.end() ; ++i )
610  {
611  ret.push_back ( i->second );
612  };
613 
614  return ret;
615 }
616 
618 {
619  // cout << "Trk " << t.id();
620  for ( vector < pair < int, CachingVertex<5> > >::const_iterator seed=theVertexStates.begin();
621  seed!=theVertexStates.end(); ++seed )
622  {
623  cout << " -- Vertex[" << seed->first << "] with " << setw(12)
624  << setprecision(3) << theWeights[t][seed->first];
625  };
626  cout << endl;
627 }
628 
630 {
631  cout << endl << "Weight table: " << endl << "=================" << endl;
632  for ( set < TransientTrack >::const_iterator trk=thePrimaries.begin();
633  trk!=thePrimaries.end() ; ++trk )
634  {
635  printWeights ( *trk );
636  };
637  for ( vector< TransientTrack >::const_iterator trk=theTracks.begin();
638  trk!=theTracks.end() ; ++trk )
639  {
640  printWeights ( *trk );
641  };
642 }
643 
645 {
646  cout << endl << "Seed table: " << endl << "=====================" << endl;
647  /*
648  for ( vector < pair < int, CachingVertex<5> > >::const_iterator seed=theVertexStates.begin();
649  seed!=theVertexStates.end(); ++seed )
650  {
651  cout << " Vertex[" << TransientVertexNamer().name(seed->second) << "] at "
652  << seed->second.position() << endl;
653  };*/
654 }
655 
657 {
658  if ( !theReviveBelow < 0. ) return;
659  // this experimental method is used to get almost lost vertices
660  // back into the play by upweighting vertices with very low total weights
661 
662  bool has_revived = false;
663  // find out about total weight
664  for ( vector< pair < int, CachingVertex<5> > >::const_iterator i=theVertexStates.begin();
665  i!=theVertexStates.end() ; ++i )
666  {
667  double totweight=0.;
668  for ( vector< TransientTrack >::const_iterator trk=theTracks.begin();
669  trk!=theTracks.end() ; ++trk )
670  {
671  totweight+=theWeights[*trk][i->first];
672  };
673 
674  /*
675  cout << "[MultiVertexFitter] vertex seed " << TransientVertexNamer().name(*i)
676  << " total weight=" << totweight << endl;*/
677 
678  if ( totweight < theReviveBelow && totweight > 0.0 )
679  {
680  cout << "[MultiVertexFitter] now trying to revive vertex"
681  << " revive_below=" << theReviveBelow << endl;
682  has_revived=true;
683  for ( vector< TransientTrack >::const_iterator trk=theTracks.begin();
684  trk!=theTracks.end() ; ++trk )
685  {
686  theWeights[*trk][i->first]/=totweight;
687  };
688  };
689  };
690  if ( has_revived && verbose() ) printWeights();
691 }
virtual bool isAnnealed() const =0
std::vector< CachingVertex< 5 > > vertices(const std::vector< std::vector< reco::TransientTrack > > &, const std::vector< reco::TransientTrack > &primaries=std::vector< reco::TransientTrack >())
MultiVertexFitter(const AnnealingSchedule &sched=DefaultMVFAnnealing(), const LinearizationPointFinder &seeder=DefaultLinearizationPointFinder(), float revive_below=-1.)
int i
Definition: DBlmapReader.cc:9
std::pair< reco::TransientTrack, float > TrackAndWeight
virtual BDpair estimate(const CachingVertex< N > &vrt, const RefCountedVertexTrack track) const
std::map< reco::TransientTrack, SeedToWeightMap > TrackAndSeedToWeightMap
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
Common base class.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
void printWeights() const
std::vector< reco::TransientTrack > originalTracks() const
LinearizationPointFinder * theSeeder
std::set< reco::TransientTrack > thePrimaries
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:11
virtual double phi(double chi2) const =0
std::vector< reco::TransientTrack > theTracks
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
tuple result
Definition: query.py:137
LinTrackCache theCache
std::vector< std::pair< int, CachingVertex< 5 > > > theVertexStates
tuple tracks
Definition: testEve_cfg.py:39
void createPrimaries(const std::vector< reco::TransientTrack > tracks)
void printSeeds() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void createSeed(const std::vector< reco::TransientTrack > &tracks)
RefCountedLinearizedTrackState linTrack(const GlobalPoint &, const reco::TransientTrack &)
GlobalPoint position() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
std::vector< CachingVertex< 5 > > fit()
virtual void anneal()=0
tuple cout
Definition: gather_cfg.py:121
virtual double cutoff() const =0
AnnealingSchedule * theAssComp
TrackAndSeedToWeightMap theWeights
std::map< int, double > SeedToWeightMap
T w() const