CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AdaptiveVertexFitter.cc
Go to the documentation of this file.
8 
9 #include <algorithm>
10 
11 using namespace edm;
12 
13 // #define STORE_WEIGHTS
14 #ifdef STORE_WEIGHTS
15 #include <dataharvester/Writer.h>
16 #endif
17 
18 using namespace std;
19 
20 namespace {
21  void sortTracksByPt(std::vector<reco::TransientTrack> & cont) {
22  auto s = cont.size();
23  float pt2[s]; int ind[s]; int i=0;
24  for (auto const & tk : cont) { ind[i]=i; pt2[i++] = tk.impactPointState().globalMomentum().perp2();}
25  std::sort(ind,ind+s, [&](int i, int j){return pt2[i]>pt2[j];} );
26  std::vector<reco::TransientTrack> tmp; tmp.reserve(s);
27  for (auto i=0U; i<s; ++i) tmp.emplace_back(std::move( cont[ind[i]] ) );
28  cont.swap(tmp);
29  }
30 
31  // typedef ReferenceCountingPointer<VertexTrack<5> > RefCountedVertexTrack;
32  typedef AdaptiveVertexFitter::RefCountedVertexTrack RefCountedVertexTrack;
33 
34 
35  AlgebraicSymMatrix33 initFitError() {
36  // that's how we model the lin pt error for the initial seed!
37  const float initialError = 10000;
39  ret(0,0)=initialError;
40  ret(1,1)=initialError;
41  ret(2,2)=initialError;
42  return ret;
43  }
44 
45  GlobalError const fitError = initFitError();
46 
47  AlgebraicSymMatrix33 initLinePointError() {
48  // that's how we model the error of the linearization point.
49  // for track weighting!
51  ret(0,0)=.3; ret(1,1)=.3; ret(2,2)=3.;
52  // ret(0,0)=1e-7; ret(1,1)=1e-7; ret(2,2)=1e-7;
53  return ret;
54  }
55 
56  GlobalError const linPointError = initLinePointError();
57 
58 
59 
60 
61  void
62  sortByDistanceToRefPoint (std::vector<RefCountedVertexTrack> & cont, const GlobalPoint ref ) {
63  auto s = cont.size();
64  float d2[s]; int ind[s]; int i=0;
65  for (auto const & tk : cont) { ind[i]=i; d2[i++] = (tk->linearizedTrack()->track().initialFreeState().position() - ref ).mag2();}
66  std::sort(ind,ind+s, [&](int i, int j){return d2[i]<d2[j];} );
67  std::vector<RefCountedVertexTrack> tmp; tmp.reserve(s);
68  for (auto i=0U; i<s; ++i) tmp.emplace_back(std::move( cont[ind[i]] ) );
69  cont.swap(tmp);
70  }
71 
72 
73 
74  #ifdef STORE_WEIGHTS
75  //NOTE: This is not thread safe
76  map < RefCountedLinearizedTrackState, int > ids;
77  int iter=0;
78 
79  int getId ( const RefCountedLinearizedTrackState & r )
80  {
81  static int ctr=1;
82  if ( ids.count(r) == 0 )
83  {
84  ids[r]=ctr++;
85  }
86  return ids[r];
87  }
88  #endif
89 }
90 
92  const AnnealingSchedule & ann,
93  const LinearizationPointFinder & linP,
94  const VertexUpdator<5> & updator,
96  const VertexSmoother<5> & smoother,
97  const AbstractLTSFactory<5> & ltsf ) :
98  theNr(0),
99  theLinP(linP.clone()), theUpdator( updator.clone()),
100  theSmoother ( smoother.clone() ), theAssProbComputer( ann.clone() ),
101  theComp ( crit.clone() ), theLinTrkFactory ( ltsf.clone() ),
102  gsfIntermediarySmoothing_(false)
103 {
104  setParameters();
105 }
106 
108 {
110 }
111 
113  (const AdaptiveVertexFitter & o ) :
114  theMaxShift ( o.theMaxShift ), theMaxLPShift ( o.theMaxLPShift ),
115  theMaxStep ( o.theMaxStep ), theWeightThreshold ( o.theWeightThreshold ),
116  theNr ( o.theNr ),
117  theLinP ( o.theLinP->clone() ), theUpdator ( o.theUpdator->clone() ),
118  theSmoother ( o.theSmoother->clone() ),
119  theAssProbComputer ( o.theAssProbComputer->clone() ),
120  theComp ( o.theComp->clone() ),
121  theLinTrkFactory ( o.theLinTrkFactory->clone() ),
122  gsfIntermediarySmoothing_(o.gsfIntermediarySmoothing_)
123 {}
124 
126 {
127  delete theLinP;
128  delete theUpdator;
129  delete theSmoother;
130  delete theAssProbComputer;
131  delete theComp;
132  delete theLinTrkFactory;
133 }
134 
135 void AdaptiveVertexFitter::setParameters( double maxshift, double maxlpshift,
136  unsigned maxstep, double weightthreshold )
137 {
138  theMaxShift = maxshift;
139  theMaxLPShift = maxlpshift;
140  theMaxStep = maxstep;
141  theWeightThreshold=weightthreshold;
142 }
143 
144 
146 {
147  setParameters ( s.getParameter<double>("maxshift"),
148  s.getParameter<double>("maxlpshift"),
149  s.getParameter<int>("maxstep"),
150  s.getParameter<double>("weightthreshold") );
151 }
152 
154 AdaptiveVertexFitter::vertex(const vector<reco::TransientTrack> & unstracks) const
155 {
156  if ( unstracks.size() < 2 )
157  {
158  LogError("RecoVertex|AdaptiveVertexFitter")
159  << "Supplied fewer than two tracks. Vertex is invalid.";
160  return CachingVertex<5>(); // return invalid vertex
161  };
162  vector < reco::TransientTrack > tracks = unstracks;
163  sortTracksByPt( tracks);
164  // Linearization Point
165  GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
166  // Initial vertex seed, with a very large error matrix
167  VertexState lseed (linP, linPointError );
168  vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, lseed);
169 
170  VertexState seed (linP, fitError );
171  return fit(vtContainer, seed, false);
172 }
173 
175 AdaptiveVertexFitter::vertex(const vector<RefCountedVertexTrack> & tracks) const
176 {
177  if ( tracks.size() < 2 )
178  {
179  LogError("RecoVertex|AdaptiveVertexFitter")
180  << "Supplied fewer than two tracks. Vertex is invalid.";
181  return CachingVertex<5>(); // return invalid vertex
182  };
183  // Initial vertex seed, with a very small weight matrix
184  GlobalPoint linP = tracks[0]->linearizedTrack()->linearizationPoint();
185  VertexState seed (linP, fitError );
186  return fit(tracks, seed, false);
187 }
188 
190 AdaptiveVertexFitter::vertex(const vector<RefCountedVertexTrack> & tracks, const reco::BeamSpot & spot ) const
191 {
192  if ( tracks.size() < 1 )
193  {
194  LogError("RecoVertex|AdaptiveVertexFitter")
195  << "Supplied no tracks. Vertex is invalid.";
196  return CachingVertex<5>(); // return invalid vertex
197  };
198  VertexState beamSpotState(spot);
199  return fit(tracks, beamSpotState, true );
200 }
201 
202 
203 
208 AdaptiveVertexFitter::vertex(const vector<reco::TransientTrack> & tracks,
209  const GlobalPoint& linPoint) const
210 {
211  if ( tracks.size() < 2 )
212  {
213  LogError("RecoVertex|AdaptiveVertexFitter")
214  << "Supplied fewer than two tracks. Vertex is invalid.";
215  return CachingVertex<5>(); // return invalid vertex
216  };
217  // Initial vertex seed, with a very large error matrix
218  VertexState seed (linPoint, linPointError );
219  vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, seed);
220  VertexState fitseed (linPoint, fitError );
221  return fit(vtContainer, fitseed, false);
222 }
223 
224 
230 AdaptiveVertexFitter::vertex(const vector<reco::TransientTrack> & unstracks,
231  const reco::BeamSpot& beamSpot) const
232 {
233  if ( unstracks.size() < 1 )
234  {
235  LogError("RecoVertex|AdaptiveVertexFitter")
236  << "Supplied no tracks. Vertex is invalid.";
237  return CachingVertex<5>(); // return invalid vertex
238  };
239 
240  VertexState beamSpotState(beamSpot);
241  vector<RefCountedVertexTrack> vtContainer;
242 
243  vector < reco::TransientTrack > tracks = unstracks;
244  sortTracksByPt(tracks);
245 
246  if (tracks.size() > 1) {
247  // Linearization Point search if there are more than 1 track
248  GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
249  VertexState lpState(linP, linPointError );
250  vtContainer = linearizeTracks(tracks, lpState);
251  } else {
252  // otherwise take the beamspot position.
253  vtContainer = linearizeTracks(tracks, beamSpotState);
254  }
255 
256  return fit(vtContainer, beamSpotState, true);
257 }
258 
259 
265 CachingVertex<5> AdaptiveVertexFitter::vertex(const vector<reco::TransientTrack> & tracks,
266  const GlobalPoint& priorPos,
267  const GlobalError& priorError) const
268 
269 {
270  if ( tracks.size() < 1 )
271  {
272  LogError("RecoVertex|AdaptiveVertexFitter")
273  << "Supplied no tracks. Vertex is invalid.";
274  return CachingVertex<5>(); // return invalid vertex
275  };
276  VertexState seed (priorPos, priorError);
277  vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, seed);
278  return fit( vtContainer, seed, true );
279 }
280 
281 
287  const vector<RefCountedVertexTrack> & tracks,
288  const GlobalPoint& priorPos,
289  const GlobalError& priorError) const
290 {
291  if ( tracks.size() < 1 )
292  {
293  LogError("RecoVertex|AdaptiveVertexFitter")
294  << "Supplied no tracks. Vertex is invalid.";
295  return CachingVertex<5>(); // return invalid vertex
296  };
297  VertexState seed (priorPos, priorError);
298  return fit(tracks, seed, true);
299 }
300 
301 
309 vector<AdaptiveVertexFitter::RefCountedVertexTrack>
310 AdaptiveVertexFitter::linearizeTracks(const vector<reco::TransientTrack> & tracks,
311  const VertexState & seed ) const
312 {
313  const GlobalPoint & linP ( seed.position() );
314  vector<RefCountedLinearizedTrackState> lTracks;
315  for(vector<reco::TransientTrack>::const_iterator i = tracks.begin();
316  i != tracks.end(); ++i )
317  {
318  try {
321  lTracks.push_back(lTrData);
322  } catch ( exception & e ) {
323  LogInfo("RecoVertex/AdaptiveVertexFitter")
324  << "Exception " << e.what() << " in ::linearizeTracks."
325  << "Your future vertex has just lost a track.";
326  };
327  }
328  return weightTracks(lTracks, seed );
329 }
330 
336 vector<AdaptiveVertexFitter::RefCountedVertexTrack>
338  const vector<RefCountedVertexTrack> & tracks,
339  const CachingVertex<5> & vertex ) const
340 {
341  VertexState seed = vertex.vertexState();
342  GlobalPoint linP = seed.position();
343  vector<RefCountedLinearizedTrackState> lTracks;
344  for(vector<RefCountedVertexTrack>::const_iterator i = tracks.begin();
345  i != tracks.end(); i++)
346  {
347  try {
349  = theLinTrkFactory->linearizedTrackState( linP, (**i).linearizedTrack()->track() );
350  /*
351  RefCountedLinearizedTrackState lTrData =
352  (**i).linearizedTrack()->stateWithNewLinearizationPoint(linP);
353  */
354  lTracks.push_back(lTrData);
355  } catch ( exception & e ) {
356  LogInfo("RecoVertex/AdaptiveVertexFitter")
357  << "Exception " << e.what() << " in ::relinearizeTracks. "
358  << "Will not relinearize this track.";
359  lTracks.push_back ( (**i).linearizedTrack() );
360  };
361  };
362  return reWeightTracks(lTracks, vertex );
363 }
364 
366 {
367  return new AdaptiveVertexFitter( * this );
368 }
369 
370 double AdaptiveVertexFitter::getWeight ( float chi2 ) const
371 {
372  double weight = theAssProbComputer->weight(chi2);
373 
374  if ( weight > 1.0 )
375  {
376  LogInfo("RecoVertex/AdaptiveVertexFitter") << "Weight " << weight << " > 1.0!";
377  weight=1.0;
378  };
379 
380  if ( weight < 1e-20 )
381  {
382  // LogInfo("RecoVertex/AdaptiveVertexFitter") << "Weight " << weight << " < 0.0!";
383  weight=1e-20;
384  };
385  return weight;
386 }
387 
388 vector<AdaptiveVertexFitter::RefCountedVertexTrack>
390  const vector<RefCountedLinearizedTrackState> & lTracks,
391  const CachingVertex<5> & vertex ) const
392 {
393  VertexState seed = vertex.vertexState();
394  // cout << "[AdaptiveVertexFitter] now reweight around " << seed.position() << endl;
395  theNr++;
396  // GlobalPoint pos = seed.position();
397 
398  vector<RefCountedVertexTrack> finalTracks;
399  VertexTrackFactory<5> vTrackFactory;
400  #ifdef STORE_WEIGHTS
401  iter++;
402  #endif
403  for(vector<RefCountedLinearizedTrackState>::const_iterator i
404  = lTracks.begin(); i != lTracks.end(); i++)
405  {
406  double weight=0.;
407  // cout << "[AdaptiveVertexFitter] estimate " << endl;
408  pair < bool, double > chi2Res ( false, 0. );
409  try {
410  chi2Res = theComp->estimate ( vertex, *i, std::distance(lTracks.begin(),i) );
411  } catch ( exception const & e ) {};
412  // cout << "[AdaptiveVertexFitter] /estimate " << endl;
413  if (!chi2Res.first) {
414  // cout << "[AdaptiveVertexFitter] aie... vertex candidate is at " << vertex.position() << endl;
415  LogInfo("AdaptiveVertexFitter" ) << "When reweighting, chi2<0. Will add this track with w=0.";
416  // edm::LogInfo("AdaptiveVertexFitter" ) << "pt=" << (**i).track().pt();
417  }else {
418  weight = getWeight ( chi2Res.second );
419  }
420 
421  RefCountedVertexTrack vTrData
422  = vTrackFactory.vertexTrack(*i, seed, weight );
423 
424  #ifdef STORE_WEIGHTS
425  map < string, dataharvester::MultiType > m;
426  m["chi2"]=chi2;
427  m["w"]=theAssProbComputer->weight(chi2);
429  m["n"]=iter;
430  m["pos"]="reweight";
431  m["id"]=getId ( *i );
432  dataharvester::Writer::file("w.txt").save ( m );
433  #endif
434 
435  finalTracks.push_back(vTrData);
436  }
437  sortByDistanceToRefPoint( finalTracks, vertex.position() );
438  // cout << "[AdaptiveVertexFitter] /now reweight" << endl;
439  return finalTracks;
440 }
441 
442 vector<AdaptiveVertexFitter::RefCountedVertexTrack>
444  const vector<RefCountedLinearizedTrackState> & lTracks,
445  const VertexState & seed ) const
446 {
447  theNr++;
448  CachingVertex<5> seedvtx ( seed, vector<RefCountedVertexTrack> (), 0. );
452 
453  vector<RefCountedVertexTrack> finalTracks;
454  VertexTrackFactory<5> vTrackFactory;
455  #ifdef STORE_WEIGHTS
456  iter++;
457  #endif
458  for(vector<RefCountedLinearizedTrackState>::const_iterator i
459  = lTracks.begin(); i != lTracks.end(); i++)
460  {
461 
462  double weight = 0.;
463  pair<bool, double> chi2Res = theComp->estimate ( seedvtx, *i, std::distance(lTracks.begin(),i) );
464  if (!chi2Res.first) {
465  // cout << "[AdaptiveVertexFitter] Aiee! " << endl;
466  LogInfo ("AdaptiveVertexFitter" ) << "When weighting a track, chi2 calculation failed;"
467  << " will add with w=0.";
468  } else {
469  weight = getWeight ( chi2Res.second );
470  }
471  RefCountedVertexTrack vTrData
472  = vTrackFactory.vertexTrack(*i, seed, weight );
473  #ifdef STORE_WEIGHTS
474  map < string, dataharvester::MultiType > m;
475  m["chi2"]=chi2;
476  m["w"]=theAssProbComputer->weight(chi2);
478  m["n"]=iter;
479  m["id"]=getId ( *i );
480  m["pos"]="weight";
481  dataharvester::Writer::file("w.txt").save ( m );
482  #endif
483  finalTracks.push_back(vTrData);
484  }
485  return finalTracks;
486 }
487 
493 vector<AdaptiveVertexFitter::RefCountedVertexTrack>
495  const vector<RefCountedVertexTrack> & tracks,
496  const CachingVertex<5> & seed) const
497 {
498  vector<RefCountedLinearizedTrackState> lTracks;
499  for(vector<RefCountedVertexTrack>::const_iterator i = tracks.begin();
500  i != tracks.end(); i++)
501  {
502  lTracks.push_back((**i).linearizedTrack());
503  }
504 
505  return reWeightTracks(lTracks, seed);
506 }
507 
508 
509 /*
510  * The method where the vertex fit is actually done!
511  */
512 
514 AdaptiveVertexFitter::fit( const vector<RefCountedVertexTrack> & tracks,
515  const VertexState & priorSeed,
516  bool withPrior) const
517 {
518  // cout << "[AdaptiveVertexFit] fit with " << tracks.size() << endl;
520 
521  vector<RefCountedVertexTrack> initialTracks;
522  GlobalPoint priorVertexPosition = priorSeed.position();
523  GlobalError priorVertexError = priorSeed.error();
524 
525  CachingVertex<5> returnVertex( priorVertexPosition,priorVertexError,
526  initialTracks,0);
527  if (withPrior)
528  {
529  returnVertex = CachingVertex<5>(priorVertexPosition,priorVertexError,
530  priorVertexPosition,priorVertexError,initialTracks,0);
531  }
532 
533  std::vector<RefCountedVertexTrack> globalVTracks = tracks;
534  // sort the tracks, according to distance to seed!
535  sortByDistanceToRefPoint (globalVTracks, priorSeed.position() );
536 
537  // main loop through all the VTracks
538  int lpStep = 0; int step = 0;
539 
540  CachingVertex<5> initialVertex = returnVertex;
541 
542  GlobalPoint newPosition = priorVertexPosition;
543  GlobalPoint previousPosition = newPosition;
544 
545  int ns_trks=0; // number of significant tracks.
546  // If we have only two significant tracks, we return an invalid vertex
547 
548  // cout << "[AdaptiveVertexFit] start " << tracks.size() << endl;
549  /*
550  for ( vector< RefCountedVertexTrack >::const_iterator
551  i=globalVTracks.begin(); i!=globalVTracks.end() ; ++i )
552  {
553  cout << " " << (**i).linearizedTrack()->track().initialFreeState().momentum() << endl;
554  }*/
555  do {
556  ns_trks=0;
557  CachingVertex<5> fVertex = initialVertex;
558  // cout << "[AdaptiveVertexFit] step " << step << " at " << fVertex.position() << endl;
559  if ((previousPosition - newPosition).transverse() > theMaxLPShift)
560  {
561  // relinearize and reweight.
562  // (reLinearizeTracks also reweights tracks)
563  // cout << "[AdaptiveVertexFit] relinearize at " << returnVertex.position() << endl;
564  if (gsfIntermediarySmoothing_) returnVertex = theSmoother->smooth(returnVertex);
565  globalVTracks = reLinearizeTracks( globalVTracks, returnVertex );
566  lpStep++;
567  } else if (step) {
568  // reweight, if it is not the first step
569  // cout << "[AdaptiveVertexFit] reweight at " << returnVertex.position() << endl;
570  if (gsfIntermediarySmoothing_) returnVertex = theSmoother->smooth(returnVertex);
571  globalVTracks = reWeightTracks( globalVTracks, returnVertex );
572  }
573  // cout << "[AdaptiveVertexFit] relinarized, reweighted" << endl;
574  // update sequentially the vertex estimate
575  CachingVertex<5> nVertex;
576  for(vector<RefCountedVertexTrack>::const_iterator i
577  = globalVTracks.begin(); i != globalVTracks.end(); i++)
578  {
579  if ((**i).weight() > 0.) nVertex = theUpdator->add( fVertex, *i );
580  else nVertex = fVertex;
581  if (nVertex.isValid()) {
582  if ( (**i).weight() >= theWeightThreshold ) ns_trks++;
583 
584  if ( fabs ( nVertex.position().z() ) > 10000. ||
585  nVertex.position().perp()>120.)
586  {
587  // were more than 100 m off!!
588  LogInfo ("AdaptiveVertexFitter" ) << "Vertex candidate just took off to " << nVertex.position()
589  << "! Will discard this update!";
590 // //<< "track pt was " << (**i).linearizedTrack()->track().pt()
591 // << "track momentum was " << (**i).linearizedTrack()->track().initialFreeState().momentum()
592 // << "track position was " << (**i).linearizedTrack()->track().initialFreeState().position()
593 // << "track chi2 was " << (**i).linearizedTrack()->track().chi2()
594 // << "track ndof was " << (**i).linearizedTrack()->track().ndof()
595 // << "track w was " << (**i).weight()
596 // << "track schi2 was " << (**i).smoothedChi2();
597  } else {
598  fVertex = nVertex;
599  }
600  } else {
601  LogInfo("RecoVertex/AdaptiveVertexFitter")
602  << "The updator returned an invalid vertex when adding track "
603  << i-globalVTracks.begin()
604  << ".\n Your vertex might just have lost one good track.";
605  }
606  }
607  previousPosition = newPosition;
608  newPosition = fVertex.position();
609  returnVertex = fVertex;
611  step++;
612  if ( step >= theMaxStep ) break;
613 
614  } while (
615  // repeat as long as
616  // - vertex moved too much or
617  // - we're not yet annealed
618  ( ((previousPosition - newPosition).mag() > theMaxShift) ||
619  (!(theAssProbComputer->isAnnealed()) ) ) ) ;
620 
621  if ( theWeightThreshold > 0. && ns_trks < 2 && !withPrior )
622  {
623  LogDebug("AdaptiveVertexFitter")
624  << "fewer than two significant tracks (w>" << theWeightThreshold << ")."
625  << " Fitted vertex is invalid.";
626  return CachingVertex<5>(); // return invalid vertex
627  }
628 
629  #ifdef STORE_WEIGHTS
630  map < string, dataharvester::MultiType > m;
631  m["chi2"]=chi2;
632  m["w"]=theAssProbComputer->weight(chi2);
634  m["n"]=iter;
635  m["id"]=getId ( *i );
636  m["pos"]="final";
637  dataharvester::Writer::file("w.txt").save ( m );
638  #endif
639  // cout << "[AdaptiveVertexFit] /fit" << endl;
640  return theSmoother->smooth( returnVertex );
641 }
#define LogDebug(id)
virtual bool isAnnealed() const =0
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
T perp() const
Definition: PV3DBase.h:72
std::vector< RefCountedVertexTrack > reWeightTracks(const std::vector< RefCountedLinearizedTrackState > &, const CachingVertex< 5 > &seed) const
const double w
Definition: UKUtility.cc:23
virtual RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const =0
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
LinearizationPointFinder * theLinP
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
VertexState const & vertexState() const
Definition: CachingVertex.h:85
static unsigned int getId(void)
VertexUpdator< 5 > * theUpdator
virtual AnnealingSchedule * clone() const =0
virtual VertexSmoother * clone() const =0
CachingVertex< 5 > fit(const std::vector< RefCountedVertexTrack > &tracks, const VertexState &priorSeed, bool withPrior) const
virtual VertexTrackCompatibilityEstimator< N > * clone() const =0
virtual const AbstractLTSFactory * clone() const =0
GlobalPoint position() const
Definition: VertexState.h:50
std::vector< RefCountedVertexTrack > reLinearizeTracks(const std::vector< RefCountedVertexTrack > &tracks, const CachingVertex< 5 > &vertex) const
AdaptiveVertexFitter * clone() const
virtual CachingVertex< N > add(const CachingVertex< N > &v, const typename CachingVertex< N >::RefCountedVertexTrack t) const =0
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
virtual BDpair estimate(const CachingVertex< N > &v, const RefCountedLinearizedTrackState track, unsigned int hint=UINT_MAX) const =0
T z() const
Definition: PV3DBase.h:64
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const
int j
Definition: DBlmapReader.cc:9
VertexSmoother< 5 > * theSmoother
AnnealingSchedule * theAssProbComputer
virtual double currentTemp() const =0
void setParameters(double maxshift=0.0001, double maxlpshift=0.1, unsigned maxstep=30, double weightthreshold=.001)
double getWeight(float chi2) const
AdaptiveVertexFitter(const AnnealingSchedule &ann=GeometricAnnealing(), const LinearizationPointFinder &linP=DefaultLinearizationPointFinder(), const VertexUpdator< 5 > &updator=KalmanVertexUpdator< 5 >(), const VertexTrackCompatibilityEstimator< 5 > &estor=KalmanVertexTrackCompatibilityEstimator< 5 >(), const VertexSmoother< 5 > &smoother=DummyVertexSmoother< 5 >(), const AbstractLTSFactory< 5 > &ltsf=LinearizedTrackStateFactory())
tuple tracks
Definition: testEve_cfg.py:39
virtual CachingVertex< N > smooth(const CachingVertex< N > &vertex) const =0
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
int cont
GlobalPoint position() const
virtual GlobalPoint getLinearizationPoint(const std::vector< reco::TransientTrack > &) const =0
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual LinearizationPointFinder * clone() const =0
virtual VertexUpdator * clone() const =0
bool isValid() const
Definition: CachingVertex.h:96
virtual void anneal()=0
virtual void resetAnnealing()=0
GlobalError error() const
Definition: VertexState.h:55
std::vector< RefCountedVertexTrack > linearizeTracks(const std::vector< reco::TransientTrack > &, const VertexState &) const
volatile std::atomic< bool > shutdown_flag false
int weight
Definition: histoStyle.py:50
std::vector< RefCountedVertexTrack > weightTracks(const std::vector< RefCountedLinearizedTrackState > &, const VertexState &seed) const
virtual double weight(double chi2) const =0
const AbstractLTSFactory< 5 > * theLinTrkFactory
VertexTrackCompatibilityEstimator< 5 > * theComp