ATLAS Offline Software
AdaptiveVertexFitterTestAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
3  */
13 #undef NDEBUG
15 #include "xAODTracking/Vertex.h"
17 #include "TrkTrack/Track.h"
21 #include "TestTools/FLOATassert.h"
22 #include "GaudiKernel/SystemOfUnits.h"
23 #include <cassert>
24 #include <cmath>
25 
26 #include "CLHEP/Vector/LorentzVector.h"
27 
28 using Gaudi::Units::mm;
29 using Gaudi::Units::MeV;
30 using Gaudi::Units::GeV;
31 
32 
33 namespace {
34 
35 
36 template <class T>
37 std::vector<const T*> asVec (const std::vector<std::unique_ptr<T> >& v)
38 {
39  std::vector<const T*> ret;
40  ret.reserve(v.size());
41 
42  for (const std::unique_ptr<T>& p : v) {
43  ret.push_back (p.get());
44  }
45  return ret;
46 }
47 
48 
49 std::vector<const Trk::TrackParameters*>
50 asVec (const std::vector<std::unique_ptr<Trk::Perigee> >& v)
51 {
52  std::vector<const Trk::TrackParameters*> ret;
53  ret.reserve(v.size());
54 
55  for (const std::unique_ptr<Trk::Perigee>& p : v) {
56  ret.push_back (p.get());
57  }
58  return ret;
59 }
60 
61 
62 std::vector<const Trk::NeutralParameters*>
63 asVec (const std::vector<std::unique_ptr<Trk::NeutralPerigee> >& v)
64 {
65  std::vector<const Trk::NeutralParameters*> ret;
66  ret.reserve(v.size());
67 
68 for (const std::unique_ptr<Trk::NeutralPerigee>& p : v) {
69  ret.push_back (p.get());
70  }
71  return ret;
72 }
73 
74 
75 AmgSymMatrix(5) cov5()
76 {
77  AmgSymMatrix(5) m;
78  m.setIdentity();
79  return m;
80 }
81 
82 
83 using PerigeeUVec_t = std::vector<std::unique_ptr<Trk::Perigee> >;
84 PerigeeUVec_t makePerigees1()
85 {
86  Amg::Vector3D pos0 { 0, 0, 0 };
87 
88  Amg::Vector3D pos1a { 2*mm, 1*mm, -10*mm };
89  Amg::Vector3D mom1a { 400*MeV, 600*MeV, 200*MeV };
90  Amg::Vector3D pos1b { 1*mm, 2*mm, -3*mm };
91  Amg::Vector3D mom1b { 600*MeV, 400*MeV, -200*MeV };
92  Amg::Vector3D pos1c { 1.2*mm, 1.3*mm, -7*mm };
93  Amg::Vector3D mom1c { 300*MeV, 1000*MeV, 100*MeV };
94 
95  PerigeeUVec_t ret;
96 
97  ret.emplace_back (std::make_unique<Trk::Perigee>(pos1a, mom1a, 1, pos1a, cov5()).release());
98  ret.emplace_back (std::make_unique<Trk::Perigee>(pos1b, mom1b, -1, pos1b, cov5()).release());
99  ret.emplace_back (std::make_unique<Trk::Perigee>(pos1c, mom1c, -1, pos1c, cov5()).release());
100 
101  return ret;
102 }
103 
104 
105 using NeutralUVec_t = std::vector<std::unique_ptr<Trk::NeutralPerigee> >;
106 NeutralUVec_t makeNeutrals1()
107 {
108  Amg::Vector3D pos0 { 0, 0, 0 };
109 
110  Amg::Vector3D pos1a { 3*mm, 0.5*mm, -7*mm };
111  Amg::Vector3D mom1a { 1000*MeV, 900*MeV, 2000*MeV };
112  Amg::Vector3D pos1b { -1*mm, 2.5*mm, 1*mm };
113  Amg::Vector3D mom1b { 800*MeV, 1000*MeV, 300*MeV };
114  Amg::Vector3D pos1c { -1.5*mm, 1*mm, -3*mm };
115  Amg::Vector3D mom1c { 500*MeV, 4000*MeV, 800*MeV };
116 
117  NeutralUVec_t ret;
118 
119  ret.emplace_back (std::make_unique<Trk::NeutralPerigee>(pos1a, mom1a, 1, pos1a, cov5()).release());
120  ret.emplace_back (std::make_unique<Trk::NeutralPerigee>(pos1b, mom1b, 1, pos1b, cov5()).release());
121  ret.emplace_back (std::make_unique<Trk::NeutralPerigee>(pos1c, mom1c, 1, pos1c, cov5()).release());
122 
123  return ret;
124 }
125 
126 
127 using TrackUVec_t = std::vector<std::unique_ptr<Trk::Track> >;
128 TrackUVec_t makeTracks (PerigeeUVec_t&& perigees)
129 {
130  TrackUVec_t tracks;
131 
132  for (std::unique_ptr<Trk::Perigee>& p : perigees) {
134  auto fqual = std::make_unique<Trk::FitQuality> (0, 0);
135  auto tsos = std::make_unique<Trk::TrackStates>();
136  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
137  typePattern.set(Trk::TrackStateOnSurface::Perigee);
138  tsos->push_back(std::make_unique<Trk::TrackStateOnSurface>(
139  nullptr, std::move(p), nullptr, typePattern));
140  tracks.push_back(
141  std::make_unique<Trk::Track>(info, std::move(tsos), std::move(fqual)));
142  }
143 
144  return tracks;
145 }
146 
147 
148 
149 // Copied from TrackParticleCreatorTool.
150 void setDefiningParameters( xAOD::TrackParticle& tp,
151  const Trk::Perigee& perigee )
152 {
153  tp.setDefiningParameters(perigee.parameters()[Trk::d0],
154  perigee.parameters()[Trk::z0],
155  perigee.parameters()[Trk::phi0],
156  perigee.parameters()[Trk::theta],
157  perigee.parameters()[Trk::qOverP]);
158  const AmgSymMatrix(5)* covMatrix = perigee.covariance();
159  // see https://its.cern.ch/jira/browse/ATLASRECTS-645 for justification to comment out the following line
160  // assert(covMatrix && covMatrix->rows()==5&& covMatrix->cols()==5);
161  std::vector<float> covMatrixVec;
162  if( !covMatrix ) ;//ATH_MSG_WARNING("Setting Defining parameters without error matrix");
163  else Amg::compress(*covMatrix,covMatrixVec);
164  tp.setDefiningParametersCovMatrixVec(covMatrixVec);
165  const Amg::Vector3D& surfaceCenter = perigee.associatedSurface().center();
166  tp.setParametersOrigin(surfaceCenter.x(), surfaceCenter.y(), surfaceCenter.z() );
167 }
168 void setDefiningParameters( xAOD::NeutralParticle& tp,
169  const Trk::NeutralPerigee& perigee )
170 {
171  tp.setDefiningParameters(perigee.parameters()[Trk::d0],
172  perigee.parameters()[Trk::z0],
173  perigee.parameters()[Trk::phi0],
174  perigee.parameters()[Trk::theta],
175  perigee.parameters()[Trk::qOverP]);
176  const AmgSymMatrix(5)* covMatrix = perigee.covariance();
177  // see https://its.cern.ch/jira/browse/ATLASRECTS-645 for justification to comment out the following line
178  // assert(covMatrix && covMatrix->rows()==5&& covMatrix->cols()==5);
179  std::vector<float> covMatrixVec;
180  if( !covMatrix ) ;//ATH_MSG_WARNING("Setting Defining parameters without error matrix");
181  else Amg::compress(*covMatrix,covMatrixVec);
182  tp.setDefiningParametersCovMatrixVec(covMatrixVec);
183  const Amg::Vector3D& surfaceCenter = perigee.associatedSurface().center();
184  tp.setParametersOrigin(surfaceCenter.x(), surfaceCenter.y(), surfaceCenter.z() );
185 }
186 
187 
188 using xAODTPUVec_t = std::vector<std::unique_ptr<xAOD::TrackParticle> >;
189 xAODTPUVec_t makexAODTP (PerigeeUVec_t&& perigees)
190 {
191  xAODTPUVec_t tracks;
192 
193  for (std::unique_ptr<Trk::Perigee>& p : perigees) {
194  auto tp = std::make_unique<xAOD::TrackParticle>();
195  tp->makePrivateStore();
196  setDefiningParameters (*tp, *p);
197  tracks.push_back (std::move (tp));
198  }
199 
200  return tracks;
201 }
202 
203 
204 using xAODNPUVec_t = std::vector<std::unique_ptr<xAOD::NeutralParticle> >;
205 xAODNPUVec_t makexAODNP (NeutralUVec_t&& perigees)
206 {
207  xAODNPUVec_t tracks;
208 
209  for (std::unique_ptr<Trk::NeutralPerigee>& p : perigees) {
210  auto tp = std::make_unique<xAOD::NeutralParticle>();
211  tp->makePrivateStore();
212  setDefiningParameters (*tp, *p);
213  tracks.push_back (std::move (tp));
214  }
215 
216  return tracks;
217 }
218 
219 
220 void dumpCovariance (const AmgSymMatrix(5)& m)
221 {
222  for (int i=0; i < 5; i++) {
223  for (int j=0; j < 5; j++) {
224  std::cout << m(i,j) << ", ";
225  }
226  }
227 }
228 
229 
230 [[maybe_unused]]
231 void dumpVertex (const xAOD::Vertex& v)
232 {
233  std::cout << "vvv\n";
234  std::cout << v.x() << ", " << v.y() << ", " << v.z() << "\n";
235  static const SG::ConstAccessor<short> vertexTypeAcc ("vertexType");
236  if (vertexTypeAcc.isAvailable (v)) {
237  std::cout << "vertexType " << v.vertexType() << "\n";
238  }
239  std::cout << "chi2/ndof " << v.chiSquared() << ", " << v.numberDoF() << "\n";
240 
241  std::cout << "cov ";
242  for (float f : v.covariance()) {
243  std::cout << f << ", ";
244  }
245  std::cout << "\n";
246 
247  static const SG::ConstAccessor<std::vector<ElementLink<xAOD::TrackParticleContainer> > > trackParticleLinksAcc ("trackParticleLinks");
248  if (trackParticleLinksAcc.isAvailable(v)) {
249  std::cout << "tplinks ";
250  for (const ElementLink< xAOD::TrackParticleContainer >& l : v.trackParticleLinks()) {
251  std::cout << l.dataID() << "/" << l.index() << " ";
252  }
253  std::cout << "\n";
254  }
255 
256  static const SG::ConstAccessor<float> trackWeightsAcc ("trackWeights");
257  if (trackWeightsAcc.isAvailable(v)) {
258  std::cout << "wt ";
259  for (float f : v.trackWeights()) {
260  std::cout << f << " ";
261  }
262  std::cout << "\n";
263  }
264 
265  static const SG::ConstAccessor<std::vector<ElementLink<xAOD::NeutralParticleContainer> > > neutralParticleLinksAcc ("neutralParticleLinks");
266  if (neutralParticleLinksAcc.isAvailable(v)) {
267  std::cout << "nplinks ";
268  for (const ElementLink< xAOD::NeutralParticleContainer >& l : v.neutralParticleLinks()) {
269  std::cout << l.dataID() << "/" << l.index() << " ";
270  }
271  std::cout << "\n";
272  }
273 
274  static const SG::ConstAccessor<float> neutralWeightsAcc ("neutralWeights");
275  if (neutralWeightsAcc.isAvailable(v)) {
276  std::cout << "wt ";
277  for (float f : v.neutralWeights()) {
278  std::cout << f << " ";
279  }
280  std::cout << "\n";
281  }
282 
283  std::cout << v.vxTrackAtVertexAvailable() << "\n";
284  for (const Trk::VxTrackAtVertex& vv : v.vxTrackAtVertex()) {
285  vv.dump (std::cout);
286  std::cout << "cov ";
287  if (vv.perigeeAtVertex()) {
288  dumpCovariance (*vv.perigeeAtVertex()->covariance());
289  }
290  else {
291  std::cout << "(null)";
292  }
293  std::cout << "\n";
294  }
295 }
296 
297 
298 void assertVec3D (const char* which,
299  const Amg::Vector3D& a,
300  const Amg::Vector3D& b)
301 {
302  if ( ! Athena_test::isEqual (a.x(), b.x(), 2e-5) ||
303  ! Athena_test::isEqual (a.y(), b.y(), 2e-5) ||
304  ! Athena_test::isEqual (a.z(), b.z(), 2e-5) )
305  {
306  std::cerr << "TrkVKalVrtFitterTestAlg::assertVec3D mismatch " << which
307  << ": ["
308  << a.x() << ", "
309  << a.y() << ", "
310  << a.z() << "] / ["
311  << b.x() << ", "
312  << b.y() << ", "
313  << b.z() << "]\n";
314  std::abort();
315  }
316 }
317 
318 
319 void comparePerigee (const Trk::TrackParameters* a,
320  const Trk::TrackParameters* b)
321 {
322  if (!a && !b) return;
323  if (!a || !b) std::abort();
324  assertVec3D ("perigee pos", a->position(), b->position());
325  assertVec3D ("perigee mom", a->momentum(), b->momentum());
326  assert (a->charge() == b->charge());
327  assertVec3D ("perigee surf",
328  a->associatedSurface().center(),
329  b->associatedSurface().center());
330 }
331 
332 
333 void compareVertex (const xAOD::Vertex& a, const xAOD::Vertex& b)
334 {
335  assertVec3D ("vertex pos", a.position(), b.position());
336  assert (Athena_test::isEqual (a.chiSquared(), b.chiSquared(), 5e-5) );
337  assert (Athena_test::isEqual (a.numberDoF(), b.numberDoF(), 1e-5) );
338 
339  assert (a.covariance().size() == b.covariance().size());
340  for (unsigned int i = 0; i < a.covariance().size(); i++) {
341  if (std::isinf(a.covariance()[i]) && std::isinf(b.covariance()[i])) continue;
342  assert (Athena_test::isEqual (a.covariance()[i], b.covariance()[i], 2e-2) );
343  }
344 
345  assert (a.vxTrackAtVertexAvailable() == b.vxTrackAtVertexAvailable());
346  if (a.vxTrackAtVertexAvailable()) {
347  const std::vector< Trk::VxTrackAtVertex >& avec = a.vxTrackAtVertex();
348  const std::vector< Trk::VxTrackAtVertex >& bvec = b.vxTrackAtVertex();
349  assert (avec.size() == bvec.size());
350  for (unsigned int i = 0; i < avec.size(); i++) {
351  comparePerigee (avec[i].initialPerigee(), bvec[i].initialPerigee());
352  comparePerigee (avec[i].perigeeAtVertex(), bvec[i].perigeeAtVertex());
353  assert (Athena_test::isEqual (avec[i].trackQuality().chiSquared(),
354  bvec[i].trackQuality().chiSquared(),
355  3e-2));
356  assert (avec[i].trackQuality().numberDoF() ==
357  bvec[i].trackQuality().numberDoF());
358  }
359  }
360 }
361 
362 
363 void setInitialPerigee (xAOD::Vertex& v, unsigned i, const Trk::Perigee* p)
364 {
365  std::vector< Trk::VxTrackAtVertex >& vec = v.vxTrackAtVertex();
366  if (vec.size() <= i) vec.resize(i+1);
367  vec[i].setInitialPerigee (p);
368 }
369 
370 
371 void setInitialPerigees (xAOD::Vertex& v, const TrackUVec_t& tracks)
372 {
373  int i = 0;
374  for (const std::unique_ptr<Trk::Track>& t : tracks) {
375  setInitialPerigee (v, i, t->perigeeParameters());
376  ++i;
377  }
378 }
379 
380 
381 void clearInitialPerigees (xAOD::Vertex& v)
382 {
383  for (Trk::VxTrackAtVertex& v : v.vxTrackAtVertex()) {
384  v.setInitialPerigee (static_cast<const Trk::Perigee*>(nullptr));
385  }
386 }
387 
388 
389 void setRefittedPerigee (xAOD::Vertex& v, unsigned i,
390  float charge,
391  const Amg::Vector3D& pos,
392  const Amg::Vector3D& mom,
393  const std::vector<float>& c)
394 {
395  std::vector< Trk::VxTrackAtVertex >& vec = v.vxTrackAtVertex();
396  if (vec.size() <= i) vec.resize(i+1);
397 
398  AmgSymMatrix(5) cov = cov5();
399  for (int i=0; i < 5; i++) {
400  for (int j=0; j < 5; j++) {
401  unsigned ipos = i*5 + j;
402  (cov)(i,j) = ipos < c.size() ? c[ipos] : 0;
403  }
404  }
405 
406  const Amg::Vector3D& vpos = v.position();
407  auto p = std::make_unique<Trk::Perigee> (pos, mom, charge, vpos,
408  cov);
409  vec[i].setPerigeeAtVertex (p.release());
410 }
411 
412 
413 void setFitQuality (xAOD::Vertex& v, unsigned i, float chi2, int ndof)
414 {
415  std::vector< Trk::VxTrackAtVertex >& vec = v.vxTrackAtVertex();
416  if (vec.size() <= i) vec.resize(i+1);
417  vec[i].setTrackQuality (Trk::FitQuality (chi2, ndof));
418 }
419 
420 
421 } // anonymous namespace
422 
423 
424 namespace Trk {
425 
426 
431 {
432  ATH_CHECK( m_fitter.retrieve() );
433  return StatusCode::SUCCESS;
434 }
439 {
440  ATH_MSG_VERBOSE ("execute");
441 
442  ATH_CHECK( test1() );
443  ATH_CHECK( test2() );
444  ATH_CHECK( test3() );
445  return StatusCode::SUCCESS;
446 }
447 
448 // Neutral, no constraint.
450 {
451  xAOD::Vertex exp_v0;
452  exp_v0.makePrivateStore();
453  exp_v0.setPosition ({4.27611, 4.35683, 1.62467});
454  exp_v0.setFitQuality (1.69878, 0.79376);
455  exp_v0.setCovariance (std::vector<float>
456  {28.318, 26.913, 37.8531, 17.3323, 17.3041, 23.6152});
457  setFitQuality (exp_v0, 0, 0.936, 1);
458  setFitQuality (exp_v0, 1, 0.000, 2);
459  setFitQuality (exp_v0, 2, 0.000, 2);
460 
461  NeutralUVec_t neutrals = makeNeutrals1();
462  std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (std::vector<const Trk::TrackParameters*>(),
463  asVec (neutrals)));
464  compareVertex (*v1, exp_v0);
465 
466  return StatusCode::SUCCESS;
467 }
468 
469 // Charged + Neutral + Vector3D constraint
471 {
472  xAOD::Vertex exp_v0;
473  exp_v0.makePrivateStore();
474  exp_v0.setPosition ({-0.666051, 1.88126, -4.2844});
475  exp_v0.setFitQuality (1.36804, 6.60783);
476  exp_v0.setCovariance (std::vector<float>
477  {25.8826, 26.6122, 91.0458, 6.34189, 14.6174, 13.9884});
478  setRefittedPerigee(
479  exp_v0,
480  0,
481  1,
482  { 1.58753, 0.380882, -10.2063 },
483  { 399.6301520, 600.2463141, 200.0002601 },
484  { 1.58278, -0.618193, -0.821391, 0.00010879, -0.171884, -0.618193,
485  2.32566, 0.908938, 0.800925, 0.346876, -0.821391, 0.908938,
486  1.20816, -0.000294073, 0.461137, 0.00010879, 0.800925, -0.000294073,
487  1, -0.000269915, -0.171884, 0.346876, 0.461137, -0.000269915,
488  1 });
489  setFitQuality (exp_v0, 0, 0.000, 2);
490  setRefittedPerigee(
491  exp_v0,
492  1,
493  -1,
494  { -0.209537, 1.1947, -2.59698 },
495  { 600.4814296, 399.2766328, -200.0005578 },
496  { 3.53014, 0.466334, -2.04043, 0.000621337, -0.653413, 0.466334,
497  3.53405, -0.415368, 1.56192, -0.206492, -2.04043, -0.415368,
498  1.81448, -0.000856625, 0.901728, 0.000621337, 1.56192, -0.000856625,
499  1, -0.000578862, -0.653413, -0.206492, 0.901728, -0.000578862,
500  1 });
501  setFitQuality (exp_v0, 1, 0.017, 2);
502  setRefittedPerigee(exp_v0,
503  2,
504  -1,
505  { 1.20591, 1.3197, -6.99803 },
506  { 299.9873170, 1000.0038041, 100.0000072 },
507  { 1.00049,
508  0.00413671,
509  0.0221412,
510  -2.7918e-08,
511  -0.000147081,
512  0.00413671,
513  1.03551,
514  0.18734,
515  -0.0223173,
516  -0.00248881,
517  0.0221412,
518  0.18734,
519  1.00242,
520  -1.91988e-06,
521  -0.0133167,
522  -2.7918e-08,
523  -0.0223173,
524  -1.91988e-06,
525  1,
526  7.24261e-06,
527  -0.000147081,
528  -0.00248881,
529  -0.0133167,
530  7.24261e-06,
531  1 });
532  setFitQuality (exp_v0, 2, 0.020, 2);
533  setFitQuality (exp_v0, 3, 0.136, 2);
534  setFitQuality (exp_v0, 4, 0.000, 2);
535  setFitQuality (exp_v0, 5, 0.000, 2);
536 
537  Amg::Vector3D pnt1 (5, 6, -3);
538 
539  TrackUVec_t tracks = makeTracks (makePerigees1());
540  setInitialPerigees (exp_v0, tracks);
541 
542  PerigeeUVec_t perigees = makePerigees1();
543  NeutralUVec_t neutrals = makeNeutrals1();
544  std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (asVec (perigees),
545  asVec (neutrals),
546  pnt1));
547  compareVertex (*v1, exp_v0);
548 
549  xAODTPUVec_t xtps = makexAODTP (makePerigees1());
550  xAODNPUVec_t xaodnp = makexAODNP (makeNeutrals1());
551  std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (asVec (xtps),
552  asVec (xaodnp),
553  pnt1));
554  clearInitialPerigees (exp_v0);
555  compareVertex (*v2, exp_v0);
556 
557  return StatusCode::SUCCESS;
558 }
559 
560 
561 // Charged+Neutral + Vertex constraint
563 {
564  xAOD::Vertex exp_v0;
565  exp_v0.makePrivateStore();
566  exp_v0.setPosition ({4.85208, 5.949, -3.1349});
567  exp_v0.setFitQuality (2.38503, 8.54327);
568  exp_v0.setCovariance (std::vector<float>
569  {1.183, 0.0323074, 1.21271,
570  0.00903037, 0.0167373, 1.12584});
571  setRefittedPerigee(
572  exp_v0,
573  0,
574  1,
575  { 5.1719083, 5.7335618, -8.4196568 },
576  { 402.8346276, 598.1012479, 199.9979000 },
577  { 135.368, 4.54292, 41.4349, -0.0182748, -10.0936,
578  4.54292, 38.8427, 1.48244, -6.13913, -0.389733,
579  41.4349, 1.48244, 13.5349, -0.00640884, -3.54057,
580  -0.0182748, -6.13913, -0.00640884, 1, 0.00218082,
581  -10.0936, -0.389733, -3.54057, 0.00218082, 1 });
582  setFitQuality (exp_v0, 0, 0.682, 2);
583 
584  setRefittedPerigee(exp_v0,
585  1,
586  -1,
587  { 5.4869777, 5.0058724, -4.4978936 },
588  { 598.2006961, 402.6869274, -199.9979142 },
589  { 111.922, -11.1715, 35.7532, -0.0162277, -9.04482,
590  -11.1715, 35.9577, -3.83303, -5.80842, 1.04702,
591  35.7532, -3.83303, 12.2632, -0.0060222, -3.35579,
592  -0.0162277, -5.80842, -0.0060222, 1, 0.00216502,
593  -9.04482, 1.04702, -3.35579, 0.00216502, 1 });
594  setFitQuality (exp_v0, 1, 0.061, 2);
595 
596  setRefittedPerigee(
597  exp_v0,
598  2,
599  -1,
600  { 2.7708142, 6.5661849, -6.4736255 },
601  { 296.8467752, 1000.9403742, 100.0017963 },
602  { 114.181, -7.37341, 35.593, -0.0172367, -9.10529,
603  -7.37341, 32.345, -2.46816, -5.55155, 0.684107,
604  35.593, -2.46816, 11.9239, -0.00626001, -3.30551,
605  -0.0172367, -5.55155, -0.00626001, 1, 0.00180269,
606  -9.10529, 0.684107, -3.30551, 0.00180269, 1 });
607  setFitQuality (exp_v0, 2, 0.352, 2);
608  setFitQuality (exp_v0, 3, 1.119, 1);
609  setFitQuality (exp_v0, 4, 0.000, 2);
610  setFitQuality (exp_v0, 5, 0.000, 2);
611 
612  Amg::Vector3D pnt1 (5, 6, -3);
613  xAOD::Vertex pnt2;
614  pnt2.makePrivateStore();
615  pnt2.setPosition (pnt1);
616  AmgSymMatrix(3) pnt2covar;
617  pnt2covar.setIdentity();
618  pnt2.setCovariancePosition (pnt2covar);
619 
620  TrackUVec_t tracks = makeTracks (makePerigees1());
621  setInitialPerigees (exp_v0, tracks);
622 
623  PerigeeUVec_t perigees = makePerigees1();
624  NeutralUVec_t neutrals = makeNeutrals1();
625  std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (asVec (perigees),
626  asVec (neutrals),
627  pnt2));
628  compareVertex (*v1, exp_v0);
629 
630  xAODTPUVec_t xtps = makexAODTP (makePerigees1());
631  xAODNPUVec_t xaodnp = makexAODNP (makeNeutrals1());
632  std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (asVec (xtps),
633  asVec (xaodnp),
634  pnt2));
635  clearInitialPerigees (exp_v0);
636  compareVertex (*v2, exp_v0);
637 
638  return StatusCode::SUCCESS;
639 }
640 
641 
642 } // namespace Trk
grepfile.info
info
Definition: grepfile.py:38
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:132
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
xAOD::Vertex_v1::setFitQuality
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Definition: Vertex_v1.cxx:150
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Amg::compress
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
Definition: EventPrimitivesHelpers.h:56
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
Trk::AdaptiveVertexFitterTestAlg::test1
StatusCode test1()
Definition: AdaptiveVertexFitterTestAlg.cxx:449
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
TrackParticleBase.h
EventPrimitivesHelpers.h
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
TrkObjectCounter.h
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Trk::z0
@ z0
Definition: ParamDefs.h:64
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
Trk::undefined
@ undefined
Definition: ParticleHypothesis.h:38
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAOD::Vertex_v1::setCovariance
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Track.h
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::ParametersT::associatedSurface
virtual const S & associatedSurface() const override final
Access to the Surface method.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
Athena_test::isEqual
bool isEqual(double x1, double x2, double thresh=1e-6)
Definition: FLOATassert.h:26
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AdaptiveVertexFitterTestAlg.h
Algorithm for testing AdaptiveVertexFitter.
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::ParametersBase
Definition: ParametersBase.h:55
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
Vertex.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
Trk::d0
@ d0
Definition: ParamDefs.h:63
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
charge
double charge(const T &p)
Definition: AtlasPID.h:538
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
IDTPM::chiSquared
float chiSquared(const U &p)
Definition: TrackParametersHelper.h:126
Trk::AdaptiveVertexFitterTestAlg::test2
StatusCode test2()
Definition: AdaptiveVertexFitterTestAlg.cxx:470
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
TrackParticle.h
python.PyAthena.v
v
Definition: PyAthena.py:154
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::AdaptiveVertexFitterTestAlg::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition: AdaptiveVertexFitterTestAlg.cxx:430
FLOATassert.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::AdaptiveVertexFitterTestAlg::execute
virtual StatusCode execute() override
Execute the algorithm.
Definition: AdaptiveVertexFitterTestAlg.cxx:438
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
Trk::AdaptiveVertexFitterTestAlg::test3
StatusCode test3()
Definition: AdaptiveVertexFitterTestAlg.cxx:562
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Trk::AdaptiveVertexFitterTestAlg::m_fitter
ToolHandle< Trk::IVertexFitter > m_fitter
Definition: AdaptiveVertexFitterTestAlg.h:50
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
xAOD::NeutralParticle_v1
Class describing a NeutralParticle.
Definition: NeutralParticle_v1.h:40
PlotCalibFromCool.vv
vv
Definition: PlotCalibFromCool.py:716
python.compressB64.c
def c
Definition: compressB64.py:93
xAOD::Vertex_v1::setCovariancePosition
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
Trk::TrackInfo::Unknown
@ Unknown
Track fitter not defined.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:41