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