ATLAS Offline Software
GlobalChiSquareFitterTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // ATHENA
8 #include "Acts/EventData/Types.hpp"
9 #include "GaudiKernel/EventContext.h"
10 #include "GaudiKernel/TypeNameString.h"
16 #include "TrkTrack/Track.h"
18 
19 // ACTS
20 #include "Acts/Definitions/TrackParametrization.hpp"
21 #include "Acts/Definitions/Units.hpp"
22 #include "Acts/EventData/Types.hpp"
23 #include "Acts/EventData/VectorTrackContainer.hpp"
24 #include "Acts/Propagator/Navigator.hpp"
25 #include "Acts/Propagator/Propagator.hpp"
26 #include "Acts/Propagator/SympyStepper.hpp"
27 #include "Acts/Surfaces/PerigeeSurface.hpp"
28 #include "Acts/Surfaces/Surface.hpp"
29 #include "Acts/TrackFitting/GlobalChiSquareFitter.hpp"
30 #include "Acts/Utilities/CalibrationContext.hpp"
31 #include "Acts/Utilities/Helpers.hpp"
32 #include "Acts/Utilities/Logger.hpp"
38 
39 // PACKAGE
44 #include "ActsInterop/Logger.h"
45 
46 // STL
47 #include <vector>
48 
49 namespace ActsTrk {
50 
56 template <typename trajectory_t>
58  const Acts::GeometryContext& gctx, const Acts::CalibrationContext& /*cctx*/,
59  const Acts::SourceLink& sl,
60  typename trajectory_t::TrackStateProxy trackState) const {
61 
62  const Trk::PrepRawData* prd = sl.template get<PRDSourceLinkGX2F>().prd;
63  trackState.setUncalibratedSourceLink(Acts::SourceLink{sl});
64 
65  const Acts::BoundTrackParameters actsParam(
66  trackState.referenceSurface().getSharedPtr(), trackState.predicted(),
67  trackState.predictedCovariance(), Acts::ParticleHypothesis::pion());
68  std::unique_ptr<const Trk::TrackParameters> trkParam =
70 
71  // RIO_OnTrack creation from the PrepRawData
72  const Trk::Surface& prdsurf =
73  prd->detectorElement()->surface(prd->identify());
74  const Trk::RIO_OnTrack* rot = nullptr;
75  const Trk::PlaneSurface* plsurf = nullptr;
76  if (prdsurf.type() == Trk::SurfaceType::Plane)
77  plsurf = static_cast<const Trk::PlaneSurface*>(&prdsurf);
78 
79  const Trk::StraightLineSurface* slsurf = nullptr;
80 
81  if (prdsurf.type() == Trk::SurfaceType::Line)
82  slsurf = static_cast<const Trk::StraightLineSurface*>(&prdsurf);
83 
84  //@TODO, there is no way to put a MSG in this framework yet. So the next 5
85  // lines are commented
86  // if ((slsurf == nullptr) && (plsurf == nullptr)) {
87  // msg(MSG::ERROR) << "Surface is neither PlaneSurface nor
88  // StraightLineSurface!" << endmsg;
89  // // ATH_MSG_ERROR doesn't work here because
90  // // (ActsTrk::PRDSourceLinkCalibratorGX2F' has no member named 'msg')
91  // }
92  if (slsurf != nullptr) {
93  Trk::AtaStraightLine atasl(slsurf->center(),
94  trackState.predicted()[Trk::phi],
95  trackState.predicted()[Trk::theta],
96  trackState.predicted()[Trk::qOverP], *slsurf);
97  if (broadRotCreator) {
98  rot =
99  broadRotCreator->correct(*prd, atasl, Gaudi::Hive::currentContext());
100  } else {
101  rot = rotCreator->correct(*prd, atasl, Gaudi::Hive::currentContext());
102  }
103  } else if (plsurf != nullptr) {
104  if ((trkParam.get())->covariance() != nullptr) {
105  Trk::AtaPlane atapl(plsurf->center(), trackState.predicted()[Trk::phi],
106  trackState.predicted()[Trk::theta],
107  trackState.predicted()[Trk::qOverP], *plsurf,
108  AmgSymMatrix(5)(*trkParam.get()->covariance()));
109  rot = rotCreator->correct(*prd, atapl, Gaudi::Hive::currentContext());
110  } else {
111  Trk::AtaPlane atapl(plsurf->center(), trackState.predicted()[Trk::phi],
112  trackState.predicted()[Trk::theta],
113  trackState.predicted()[Trk::qOverP], *plsurf);
114  rot = rotCreator->correct(*prd, atapl, Gaudi::Hive::currentContext());
115  }
116  } // End of RIO_OnTrack creation from the PrepRawData
117 
118  int dim = (*rot).localParameters().dimension();
119  trackState.allocateCalibrated(dim);
120 
121  // Writing the calibrated ROT measurement into the trackState
122  if (dim == 0) {
123  throw std::runtime_error("Cannot create dim 0 measurement");
124  } else if (dim == 1) {
125  trackState.template calibrated<1>() =
126  (*rot).localParameters().template head<1>();
127  trackState.template calibratedCovariance<1>() =
128  (*rot).localCovariance().template topLeftCorner<1, 1>();
129  Acts::BoundSubspaceIndices subspaceIndices;
130  if ((*rot).associatedSurface().bounds().type() ==
132  subspaceIndices = {Acts::eBoundLoc1}; // y coordinate is l0
133  } else {
134  subspaceIndices = {Acts::eBoundLoc0}; // x coordinate is l0
135  }
136  trackState.setProjectorSubspaceIndices(subspaceIndices);
137  } else if (dim == 2) {
138  trackState.template calibrated<2>() =
139  (*rot).localParameters().template head<2>();
140  trackState.template calibratedCovariance<2>() =
141  (*rot).localCovariance().template topLeftCorner<2, 2>();
142  Acts::BoundSubspaceIndices subspaceIndices = {Acts::eBoundLoc0,
143  Acts::eBoundLoc1};
144  trackState.setProjectorSubspaceIndices(subspaceIndices);
145  } else {
146  throw std::runtime_error("Dim " + std::to_string(dim) +
147  " currently not supported.");
148  }
149  delete rot; // Delete rot as a precaution
150 }
151 
153  const Acts::SourceLink& sourceLink) const {
154  const auto& sl = sourceLink.get<PRDSourceLinkGX2F>();
155  const auto& trkSrf = sl.prd->detectorElement()->surface(sl.prd->identify());
156  const auto& actsSrf = converterTool->trkSurfaceToActsSurface(trkSrf);
157  return &actsSrf;
158 }
159 
161  const std::string& n,
162  const IInterface* p)
163  : base_class(t, n, p) {}
164 
166 
167  ATH_MSG_DEBUG(name() << "::" << __FUNCTION__);
168  ATH_CHECK(m_trackingGeometryTool.retrieve());
169  ATH_CHECK(m_extrapolationTool.retrieve());
170  ATH_CHECK(m_ATLASConverterTool.retrieve());
171  ATH_CHECK(m_trkSummaryTool.retrieve());
172  if (m_doReFitFromPRD) {
173  ATH_CHECK(m_ROTcreator.retrieve());
174  ATH_CHECK(m_broadROTcreator.retrieve());
175  }
176 
177  m_logger = makeActsAthenaLogger(this, "Gx2fRefit");
178 
179  auto field = std::make_shared<ATLASMagneticFieldWrapper>();
180 
181  // Fitter
182  Acts::SympyStepper stepper(field);
183  Acts::Navigator navigator(
184  Acts::Navigator::Config{m_trackingGeometryTool->trackingGeometry()},
185  logger().cloneWithSuffix("Navigator"));
186  Acts::Propagator<Acts::SympyStepper, Acts::Navigator> propagator(
187  stepper, std::move(navigator), logger().cloneWithSuffix("Prop"));
188 
189  m_fitter = std::make_unique<Fitter>(
190  std::move(propagator), logger().cloneWithSuffix("GlobalChiSquareFitter"));
191 
192  m_calibrator = std::make_unique<ActsTrk::detail::TrkMeasurementCalibrator>(
195 
196  m_gx2fExtensions.outlierFinder
197  .connect<&ActsTrk::detail::FitterHelperFunctions::ATLASOutlierFinder::
199  m_gx2fExtensions.updater
202  m_gx2fExtensions.calibrator
205 
206  return StatusCode::SUCCESS;
207 }
208 
209 // refit a track
210 // -------------------------------------------------------
211 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
212  const EventContext& ctx, const Trk::Track& inputTrack,
213  const Trk::RunOutlierRemoval /*runOutlier*/,
214  const Trk::ParticleHypothesis /*prtHypothesis*/) const {
215  std::unique_ptr<Trk::Track> track = nullptr;
217  "--> enter GlobalChiSquareFitterTool::fit(Track,,) with Track from "
218  "author = "
219  << inputTrack.info().dumpInfo());
220 
221  // protection against not having measurements on the input track
222  if (!inputTrack.measurementsOnTrack() ||
223  inputTrack.measurementsOnTrack()->size() < 2) {
225  "called to refit empty track or track with too little information, "
226  "reject fit");
227  return nullptr;
228  }
229 
230  // protection against not having track parameters on the input track
231  if (!inputTrack.trackParameters() || inputTrack.trackParameters()->empty()) {
233  "input fails to provide track parameters for seeding the GX2F, reject "
234  "fit");
235  return nullptr;
236  }
237 
238  // Construct a perigee surface as the target surface
239  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
240  Acts::Vector3{0., 0., 0.});
241 
242  Acts::GeometryContext tgContext =
243  m_trackingGeometryTool->getGeometryContext(ctx).context();
244  Acts::MagneticFieldContext mfContext =
245  m_extrapolationTool->getMagneticFieldContext(ctx);
246  // CalibrationContext converter not implemented yet.
247  Acts::CalibrationContext calContext = Acts::CalibrationContext();
248 
249  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
250  gx2fExtensions = m_gx2fExtensions;
251 
252  ATLASSourceLinkSurfaceAccessor surfaceAccessor{&(*m_ATLASConverterTool)};
253  gx2fExtensions.surfaceAccessor
254  .connect<&ATLASSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
255 
256  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
257  propagationOption.maxSteps = m_option_maxPropagationStep;
258  // Set the Gx2Fitter options
259  Acts::Experimental::Gx2FitterOptions gx2fOptions(
260  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
261  &(*pSurface), true, true);
262 
263  std::vector<Acts::SourceLink> trackSourceLinks =
264  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, inputTrack);
265  // protection against error in the conversion from Atlas measurement to ACTS
266  // source link
267  if (trackSourceLinks.empty()) {
269  "input contain measurement but no source link created, probable issue "
270  "with the converter, reject fit ");
271  return track;
272  }
273 
274  const auto& initialParams =
275  m_ATLASConverterTool->trkTrackParametersToActsParameters(
276  (*inputTrack.perigeeParameters()), tgContext);
277 
278  // @TODO: Synchronize with prtHypothesis
280 
281  const Acts::BoundTrackParameters initialParamsWithHypothesis(
282  initialParams.referenceSurface().getSharedPtr(),
283  initialParams.parameters(), initialParams.covariance(), hypothesis);
284 
286 
287  // Perform the fit
288  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
289  initialParamsWithHypothesis, gx2fOptions, tracks);
290  if (result.ok()) {
291  track = makeTrack(ctx, tgContext, tracks, result);
292  }
293  return track;
294 }
295 
296 // fit a set of MeasurementBase objects
297 // --------------------------------
298 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
299  const EventContext& ctx, const Trk::MeasurementSet& inputMeasSet,
300  const Trk::TrackParameters& estimatedStartParameters,
301  const Trk::RunOutlierRemoval /*runOutlier*/,
302  const Trk::ParticleHypothesis /*matEffects*/) const {
303  std::unique_ptr<Trk::Track> track = nullptr;
304 
305  // protection against not having measurements on the input track
306  if (inputMeasSet.size() < 2) {
308  "called to refit empty measurement set or a measurement set with too "
309  "little information, reject fit");
310  return nullptr;
311  }
312 
313  // Construct a perigee surface as the target surface
314  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
315  Acts::Vector3{0., 0., 0.});
316 
317  Acts::GeometryContext tgContext =
318  m_trackingGeometryTool->getGeometryContext(ctx).context();
319  Acts::MagneticFieldContext mfContext =
320  m_extrapolationTool->getMagneticFieldContext(ctx);
321  // CalibrationContext converter not implemented yet.
322  Acts::CalibrationContext calContext = Acts::CalibrationContext();
323 
324  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
325  gx2fExtensions = m_gx2fExtensions;
326 
327  ATLASSourceLinkSurfaceAccessor surfaceAccessor{&(*m_ATLASConverterTool)};
328  gx2fExtensions.surfaceAccessor
329  .connect<&ATLASSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
330 
331  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
332  propagationOption.maxSteps = m_option_maxPropagationStep;
333  // Set the Gx2Fitter options
334  Acts::Experimental::Gx2FitterOptions gx2fOptions(
335  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
336  &(*pSurface), true, true);
337 
338  std::vector<Acts::SourceLink> trackSourceLinks;
339  trackSourceLinks.reserve(inputMeasSet.size());
340 
341  for (auto it = inputMeasSet.begin(); it != inputMeasSet.end(); ++it) {
342  trackSourceLinks.push_back(
343  m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
344  }
345  // protection against error in the conversion from Atlas measurement to ACTS
346  // source link
347  if (trackSourceLinks.empty()) {
349  "input contain measurement but no source link created, probable issue "
350  "with the converter, reject fit ");
351  return track;
352  }
353 
354  const auto& initialParams =
355  m_ATLASConverterTool->trkTrackParametersToActsParameters(
356  estimatedStartParameters, tgContext);
357 
359 
360  // Perform the fit
361  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
362  initialParams, gx2fOptions, tracks);
363  if (result.ok()) {
364  track = makeTrack(ctx, tgContext, tracks, result);
365  }
366  return track;
367 }
368 
369 // fit a set of PrepRawData objects
370 // --------------------------------
371 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
372  const EventContext& ctx, const Trk::PrepRawDataSet& inputPRDColl,
373  const Trk::TrackParameters& estimatedStartParameters,
374  const Trk::RunOutlierRemoval /*runOutlier*/,
375  const Trk::ParticleHypothesis /*prtHypothesis*/) const {
376  ATH_MSG_DEBUG("--> entering GlobalChiSquareFitterTool::fit(PRDS,TP,)");
377 
378  std::unique_ptr<Trk::Track> track = nullptr;
379 
380  // Construct a perigee surface as the target surface
381  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
382  Acts::Vector3{0., 0., 0.});
383 
384  Acts::GeometryContext tgContext =
385  m_trackingGeometryTool->getGeometryContext(ctx).context();
386  Acts::MagneticFieldContext mfContext =
387  m_extrapolationTool->getMagneticFieldContext(ctx);
388  // CalibrationContext converter not implemented yet.
389  Acts::CalibrationContext calContext = Acts::CalibrationContext();
390 
391  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
392  gx2fExtensions = m_gx2fExtensions;
393 
394  PRDSourceLinkCalibratorGX2F calibrator{}; // @TODO: Set tool pointers
395  calibrator.rotCreator = m_ROTcreator.get();
396  calibrator.broadRotCreator = m_broadROTcreator.get();
397  calibrator.converterTool = m_ATLASConverterTool.get();
398  gx2fExtensions.calibrator.connect<&PRDSourceLinkCalibratorGX2F::calibrate<
399  ActsTrk::MutableTrackStateBackend>>(&calibrator);
400 
402  gx2fExtensions.surfaceAccessor
403  .connect<&PRDSourceLinkSurfaceAccessorGX2F::operator()>(&surfaceAccessor);
404 
405  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
406  propagationOption.maxSteps = m_option_maxPropagationStep;
407  // Set the Gx2Fitter options
408  Acts::Experimental::Gx2FitterOptions gx2fOptions(
409  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
410  &(*pSurface), true, true);
411 
412  std::vector<Acts::SourceLink> trackSourceLinks;
413  trackSourceLinks.reserve(inputPRDColl.size());
414 
415  for (const Trk::PrepRawData* prd : inputPRDColl) {
416  trackSourceLinks.push_back(Acts::SourceLink{PRDSourceLinkGX2F{prd}});
417  }
418  // protection against error in the conversion from Atlas measurement to ACTS
419  // source link
420  if (trackSourceLinks.empty()) {
422  "input contain measurement but no source link created, probable issue "
423  "with the converter, reject fit ");
424  return track;
425  }
426 
427  const auto& initialParams =
428  m_ATLASConverterTool->trkTrackParametersToActsParameters(
429  estimatedStartParameters, tgContext);
430 
432  // Perform the fit
433  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
434  initialParams, gx2fOptions, tracks);
435  if (result.ok()) {
436  track = makeTrack(ctx, tgContext, tracks, result, true);
437  }
438  return track;
439 }
440 
441 // fit a set of PrepRawData objects
442 // --------------------------------
443 std::unique_ptr<ActsTrk::MutableTrackContainer> GlobalChiSquareFitterTool::fit(
444  const EventContext& /*eventContext*/,
445  const std::vector<ActsTrk::ATLASUncalibSourceLink>& /*clusterList*/,
446  const Acts::BoundTrackParameters& /*initialParams*/,
447  const Acts::GeometryContext& /*tgContext*/,
448  const Acts::MagneticFieldContext& /*mfContext*/,
449  const Acts::CalibrationContext& /*calContext*/,
450  const DetectorElementToActsGeometryIdMap& /*detectorElementToGeometryIdMap*/,
451  const Acts::Surface* /*targetSurface*/) const {
452  ATH_MSG_ERROR("The ACTS Global Chi Square Fitter has no direct fitter.");
453  return nullptr;
454 }
455 
456 // extend a track fit to include an additional set of MeasurementBase objects
457 // re-implements the TrkFitterUtils/TrackFitter.cxx general code in a more
458 // mem efficient and stable way
459 // --------------------------------
460 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
461  const EventContext& ctx, const Trk::Track& inputTrack,
462  const Trk::MeasurementSet& addMeasColl,
463  const Trk::RunOutlierRemoval /*runOutlier*/,
464  const Trk::ParticleHypothesis /*matEffects*/) const {
466  "--> enter GlobalChiSquareFitterTool::fit(Track,Meas'BaseSet,,)");
468  " with Track from author = " << inputTrack.info().dumpInfo());
469 
470  // protection, if empty MeasurementSet
471  if (addMeasColl.empty()) {
473  "client tries to add an empty MeasurementSet to the track fit.");
474  return fit(ctx, inputTrack);
475  }
476 
477  // protection against not having measurements on the input track
478  if (!inputTrack.measurementsOnTrack() ||
479  (inputTrack.measurementsOnTrack()->size() < 2 && addMeasColl.empty())) {
481  "called to refit empty track or track with too little information, "
482  "reject fit");
483  return nullptr;
484  }
485 
486  // protection against not having track parameters on the input track
487  if (!inputTrack.trackParameters() || inputTrack.trackParameters()->empty()) {
489  "input fails to provide track parameters for seeding the GX2F, reject "
490  "fit");
491  return nullptr;
492  }
493 
494  std::unique_ptr<Trk::Track> track = nullptr;
495 
496  // Construct a perigee surface as the target surface
497  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
498  Acts::Vector3{0., 0., 0.});
499 
500  Acts::GeometryContext tgContext =
501  m_trackingGeometryTool->getGeometryContext(ctx).context();
502  Acts::MagneticFieldContext mfContext =
503  m_extrapolationTool->getMagneticFieldContext(ctx);
504  // CalibrationContext converter not implemented yet.
505  Acts::CalibrationContext calContext = Acts::CalibrationContext();
506 
507  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
508  gx2fExtensions = m_gx2fExtensions;
509 
510  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
511  propagationOption.maxSteps = m_option_maxPropagationStep;
512  // Set the Gx2Fitter options
513  Acts::Experimental::Gx2FitterOptions gx2fOptions(
514  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
515  &(*pSurface), true, true);
516 
517  std::vector<Acts::SourceLink> trackSourceLinks =
518  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, inputTrack);
519  const auto& initialParams =
520  m_ATLASConverterTool->trkTrackParametersToActsParameters(
521  *(inputTrack.perigeeParameters()), tgContext);
522 
523  for (auto it = addMeasColl.begin(); it != addMeasColl.end(); ++it) {
524  trackSourceLinks.push_back(
525  m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
526  }
527  // protection against error in the conversion from Atlas measurement to ACTS
528  // source link
529  if (trackSourceLinks.empty()) {
531  "input contain measurement but no source link created, probable issue "
532  "with the converter, reject fit ");
533  return track;
534  }
535 
537  // Perform the fit
538  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
539  initialParams, gx2fOptions, tracks);
540  if (result.ok()) {
541  track = makeTrack(ctx, tgContext, tracks, result);
542  }
543  return track;
544 }
545 
546 // extend a track fit to include an additional set of PrepRawData objects
547 // --------------------------------
548 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
549  const EventContext& /*ctx*/, const Trk::Track& /*inputTrack*/,
550  const Trk::PrepRawDataSet& /*addPrdColl*/,
551  const Trk::RunOutlierRemoval /*runOutlier*/,
552  const Trk::ParticleHypothesis /*matEffects*/) const {
554  "Fit of Track with additional PrepRawDataSet not yet implemented");
555  return nullptr;
556 }
557 
558 // combined fit of two tracks
559 // --------------------------------
560 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
561  const EventContext& ctx, const Trk::Track& intrk1, const Trk::Track& intrk2,
562  const Trk::RunOutlierRemoval /*runOutlier*/,
563  const Trk::ParticleHypothesis /*matEffects*/) const {
564  ATH_MSG_VERBOSE("--> enter GlobalChiSquareFitterTool::fit(Track,Track,)");
565  ATH_MSG_VERBOSE(" with Tracks from #1 = " << intrk1.info().dumpInfo()
566  << " and #2 = "
567  << intrk2.info().dumpInfo());
568 
569  // protection, if empty track2
570  if (!intrk2.measurementsOnTrack()) {
571  ATH_MSG_DEBUG("input #2 is empty try to fit track 1 alone");
572  return fit(ctx, intrk1);
573  }
574 
575  // protection, if empty track1
576  if (!intrk1.measurementsOnTrack()) {
577  ATH_MSG_DEBUG("input #1 is empty try to fit track 2 alone");
578  return fit(ctx, intrk2);
579  }
580 
581  // protection against not having track parameters on the input track
582  if (!intrk1.trackParameters() || intrk1.trackParameters()->empty()) {
584  "input #1 fails to provide track parameters for seeding the GX2F, "
585  "reject fit");
586  return nullptr;
587  }
588 
589  std::unique_ptr<Trk::Track> track = nullptr;
590 
591  // Construct a perigee surface as the target surface
592  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
593  Acts::Vector3{0., 0., 0.});
594 
595  Acts::GeometryContext tgContext =
596  m_trackingGeometryTool->getGeometryContext(ctx).context();
597  Acts::MagneticFieldContext mfContext =
598  m_extrapolationTool->getMagneticFieldContext(ctx);
599  // CalibrationContext converter not implemented yet.
600  Acts::CalibrationContext calContext = Acts::CalibrationContext();
601 
602  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
603  gx2fExtensions = m_gx2fExtensions;
604 
605  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
606  propagationOption.maxSteps = m_option_maxPropagationStep;
607  // Set the Gx2Fitter options
608  Acts::Experimental::Gx2FitterOptions gx2fOptions(
609  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
610  &(*pSurface), true, true);
611 
612  std::vector<Acts::SourceLink> trackSourceLinks =
613  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk1);
614  std::vector<Acts::SourceLink> trackSourceLinks2 =
615  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk2);
616  trackSourceLinks.insert(trackSourceLinks.end(), trackSourceLinks2.begin(),
617  trackSourceLinks2.end());
618  // protection against error in the conversion from Atlas measurement to ACTS
619  // source link
620  if (trackSourceLinks.empty()) {
622  "input contain measurement but no source link created, probable issue "
623  "with the converter, reject fit ");
624  return track;
625  }
626 
627  const auto& initialParams =
628  m_ATLASConverterTool->trkTrackParametersToActsParameters(
629  *(intrk1.perigeeParameters()), tgContext);
630 
632 
633  const Acts::BoundTrackParameters initialParamsWithHypothesis(
634  initialParams.referenceSurface().getSharedPtr(),
635  initialParams.parameters(), initialParams.covariance(), hypothesis);
636 
638  // Perform the fit
639  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
640  initialParamsWithHypothesis, gx2fOptions, tracks);
641  if (result.ok()) {
642  track = makeTrack(ctx, tgContext, tracks, result);
643  }
644  return track;
645 }
646 
647 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::makeTrack(
648  const EventContext& ctx, Acts::GeometryContext& tgContext,
650  Acts::Result<ActsTrk::MutableTrackContainer::TrackProxy, std::error_code>&
651  fitResult,
652  bool SourceLinkType) const {
653 
654  if (not fitResult.ok()) {
655  return nullptr;
656  }
657 
658  std::unique_ptr<Trk::Track> newtrack = nullptr;
659 
660  // Get the fit output object
661  const auto& acts_track = fitResult.value();
662  auto finalTrajectory = std::make_unique<Trk::TrackStates>();
663 
664  // initialise the number of dead Pixel and ACTS strip
665  int numberOfDeadPixel = 0;
666  int numberOfDeadSCT = 0;
667 
668  std::vector<std::unique_ptr<const Acts::BoundTrackParameters>>
669  actsSmoothedParam;
670  // Loop over all the output state to create track state
671  tracks.trackStateContainer().visitBackwards(
672  acts_track.tipIndex(), [&](const auto& state) -> void {
673  // First only consider states with an associated detector element not in
674  // the TRT
675  auto flag = state.typeFlags();
676  const auto* associatedDetEl =
677  state.referenceSurface().associatedDetectorElement();
678  if (not associatedDetEl) {
679  return;
680  }
681 
682  const auto* actsElement =
683  dynamic_cast<const ActsDetectorElement*>(associatedDetEl);
684  if (not actsElement) {
685  return;
686  }
687 
688  const auto* upstreamDetEl = actsElement->upstreamDetectorElement();
689  if (not upstreamDetEl) {
690  return;
691  }
692 
693  // ATH_MSG_VERBOSE("Try casting to TRT for if");
694  // if (dynamic_cast<const
695  // InDetDD::TRT_BaseElement*>(upstreamDetEl)) { return; }
696 
697  const auto* trkDetElem =
698  dynamic_cast<const Trk::TrkDetElementBase*>(upstreamDetEl);
699  if (not trkDetElem) {
700  return;
701  }
702 
704  "trkDetElem type: "
705  << static_cast<std::underlying_type_t<Trk::DetectorElemType>>(
706  trkDetElem->detectorType()));
707 
708  ATH_MSG_VERBOSE("Try casting to SiDetectorElement");
709  const auto* detElem =
710  dynamic_cast<const InDetDD::SiDetectorElement*>(upstreamDetEl);
711  if (not detElem) {
712  return;
713  }
714  ATH_MSG_VERBOSE("detElem = " << detElem);
715 
716  // We need to determine the type of state
717  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
718  typePattern;
719  std::unique_ptr<Trk::TrackParameters> parm;
720 
721  // State is a hole (no associated measurement), use predicted parameters
722  if (flag.test(Acts::TrackStateFlag::HoleFlag)) {
723  ATH_MSG_VERBOSE("State is a hole (no associated measurement)");
724  const Acts::BoundTrackParameters actsParam(
725  state.referenceSurface().getSharedPtr(), state.smoothed(),
726  state.smoothedCovariance(), acts_track.particleHypothesis());
727  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
728  actsParam, tgContext);
729  auto boundaryCheck = m_boundaryCheckTool->boundaryCheck(*parm);
730  // Check if this is a hole, a dead sensors or a state outside the
731  // sensor boundary
733  "Check if this is a hole, a dead sensors or a state outside the "
734  "sensor boundary");
735  if (boundaryCheck == Trk::BoundaryCheckResult::DeadElement) {
736  if (detElem->isPixel()) {
737  ++numberOfDeadPixel;
738  } else if (detElem->isSCT()) {
739  ++numberOfDeadSCT;
740  }
741  // Dead sensors states are not stored
742  return;
743  } else if (boundaryCheck != Trk::BoundaryCheckResult::Candidate) {
744  // States outside the sensor boundary are ignored
745  return;
746  }
747  typePattern.set(Trk::TrackStateOnSurface::Hole);
748  } else if (flag.test(Acts::TrackStateFlag::OutlierFlag)) {
749  ATH_MSG_VERBOSE("The state was tagged as an outlier");
750  const Acts::BoundTrackParameters actsParam(
751  state.referenceSurface().getSharedPtr(), state.smoothed(),
752  state.smoothedCovariance(), acts_track.particleHypothesis());
753  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
754  actsParam, tgContext);
755  typePattern.set(Trk::TrackStateOnSurface::Outlier);
756  } else {
757  ATH_MSG_VERBOSE("The state is a measurement state");
758 
759  const Acts::BoundTrackParameters actsParam(
760  state.referenceSurface().getSharedPtr(), state.smoothed(),
761  state.smoothedCovariance(), acts_track.particleHypothesis());
762 
763  actsSmoothedParam.push_back(
764  std::make_unique<const Acts::BoundTrackParameters>(
765  Acts::BoundTrackParameters(actsParam)));
766  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
767  actsParam, tgContext);
768  typePattern.set(Trk::TrackStateOnSurface::Measurement);
769  }
770 
771  std::unique_ptr<Trk::MeasurementBase> measState;
772  if (state.hasUncalibratedSourceLink() && !SourceLinkType) {
773  auto sl =
774  state.getUncalibratedSourceLink().template get<ATLASSourceLink>();
775  assert(sl);
776  measState = sl->uniqueClone();
777  } else if (state.hasUncalibratedSourceLink() && SourceLinkType) {
778  // If the SourceLink is of type PRDSourceLinkGX2F, we need to create
779  // the RIO_OnTrack here.
780  auto sl = state.getUncalibratedSourceLink()
781  .template get<PRDSourceLinkGX2F>()
782  .prd;
783 
784  // ROT creation
785  const IdentifierHash idHash = sl->detectorElement()->identifyHash();
786  int dim = state.calibratedSize();
787  std::unique_ptr<Trk::RIO_OnTrack> rot;
788  if (dim == 1) {
789  const InDet::SCT_Cluster* sct_Cluster =
790  dynamic_cast<const InDet::SCT_Cluster*>(sl);
791  if (!sct_Cluster) {
792  ATH_MSG_ERROR("ERROR could not cast PRD to SCT_Cluster");
793  return;
794  }
795  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(
796  sct_Cluster,
798  state.template calibrated<1>()[0], Trk::loc1)),
799  state.template calibratedCovariance<1>(), idHash);
800  } else if (dim == 2) {
802  dynamic_cast<const InDet::PixelCluster*>(sl);
803  if (!pixelCluster) {
804  // sometimes even with dim=2, only the SCT_Cluster implementation
805  // work for RIO_OnTrack creation
807  "Dimension is 2 but we need SCT_Cluster for this "
808  "measurement");
809  const InDet::SCT_Cluster* sct_Cluster =
810  dynamic_cast<const InDet::SCT_Cluster*>(sl);
811  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(
812  sct_Cluster,
814  state.template calibrated<1>()[0], Trk::loc1)),
815  state.template calibratedCovariance<1>(), idHash);
816  } else {
817  rot = std::make_unique<InDet::PixelClusterOnTrack>(
818  pixelCluster,
819  Trk::LocalParameters(state.template calibrated<2>()),
820  state.template calibratedCovariance<2>(), idHash);
821  }
822  } else {
823  throw std::domain_error("Cannot handle measurement dim>2");
824  }
825  measState = rot->uniqueClone();
826  }
827 
828  double nDoF = state.calibratedSize();
829  auto quality = Trk::FitQualityOnSurface(state.chi2(), nDoF);
830  const Trk::TrackStateOnSurface* perState =
831  new Trk::TrackStateOnSurface(quality, std::move(measState),
832  std::move(parm), nullptr, typePattern);
833  // If a state was successfully created add it to the trajectory
834  if (perState) {
836  "State successfully created, adding it to the trajectory");
837  finalTrajectory->insert(finalTrajectory->begin(), perState);
838  }
839  });
840 
841  // Convert the perigee state and add it to the trajectory
842  const Acts::BoundTrackParameters actsPer(
843  acts_track.referenceSurface().getSharedPtr(), acts_track.parameters(),
844  acts_track.covariance(), acts_track.particleHypothesis());
845  std::unique_ptr<Trk::TrackParameters> per =
846  m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsPer,
847  tgContext);
848  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
849  typePattern;
850  typePattern.set(Trk::TrackStateOnSurface::Perigee);
852  nullptr, std::move(per), nullptr, typePattern);
853  if (perState) {
854  finalTrajectory->insert(finalTrajectory->begin(), perState);
855  }
856 
857  // Create the track using the states
860  // Mark the fitter as GlobalChi2Fitter
861  newInfo.setTrackFitter(Trk::TrackInfo::TrackFitter::GlobalChi2Fitter);
862  newtrack = std::make_unique<Trk::Track>(newInfo, std::move(finalTrajectory),
863  nullptr);
864  if (newtrack) {
865  // Create the track summary and update the holes information
866  if (!newtrack->trackSummary()) {
867  newtrack->setTrackSummary(std::make_unique<Trk::TrackSummary>());
868  newtrack->trackSummary()->update(Trk::numberOfPixelHoles, 0);
869  newtrack->trackSummary()->update(Trk::numberOfSCTHoles, 0);
870  newtrack->trackSummary()->update(Trk::numberOfTRTHoles, 0);
871  newtrack->trackSummary()->update(Trk::numberOfPixelDeadSensors,
872  numberOfDeadPixel);
873  newtrack->trackSummary()->update(Trk::numberOfSCTDeadSensors,
874  numberOfDeadSCT);
875  }
876  m_trkSummaryTool->updateTrackSummary(ctx, *newtrack, true);
877  }
878  return newtrack;
879 }
880 
881 std::unique_ptr<ActsTrk::MutableTrackContainer> GlobalChiSquareFitterTool::fit(
882  const EventContext& ctx, const ActsTrk::Seed& seed,
883  const Acts::BoundTrackParameters& initialParams,
884  const Acts::GeometryContext& tgContext,
885  const Acts::MagneticFieldContext& mfContext,
886  const Acts::CalibrationContext& calContext,
887  const DetectorElementToActsGeometryIdMap& detectorElementToGeometryIdMap)
888  const {
889  const Acts::TrackingGeometry* actsTrackingGeometry =
890  m_trackingGeometryTool->trackingGeometry().get();
891  if (!actsTrackingGeometry) {
892  throw std::runtime_error("No Acts tracking geometry.");
893  }
894 
895  std::vector<ActsTrk::ATLASUncalibSourceLink> sourceLinks;
896  sourceLinks.reserve(6);
897 
898  std::vector<const Acts::Surface*> surfaces;
899  surfaces.reserve(6);
900 
901  const auto& sps = seed.sp();
902  for (const xAOD::SpacePoint* sp : sps) {
903  const auto& measurements = sp->measurements();
904  for (const xAOD::UncalibratedMeasurement* umeas : measurements) {
906  sourceLinks.emplace_back(el);
907  surfaces.push_back(ActsTrk::getSurfaceOfMeasurement(
908  *actsTrackingGeometry, detectorElementToGeometryIdMap, *umeas));
909  }
910  }
911  return fit(ctx, sourceLinks, initialParams, tgContext, mfContext, calContext,
912  detectorElementToGeometryIdMap, surfaces.front());
913 }
914 
915 
917  const EventContext& /*ctx*/,
918  const ActsTrk::TrackContainer::ConstTrackProxy& /*track*/,
919  ActsTrk::MutableTrackContainer& /*trackContainer*/) const
920 {
921  ATH_MSG_ERROR("Track refit method not implemented in GlobalChiSquareFitterTool yet");
922  return StatusCode::FAILURE;
923 }
924 } // namespace ActsTrk
Trk::RIO_OnTrack::uniqueClone
std::unique_ptr< RIO_OnTrack > uniqueClone() const
NVI clone returning unique_ptr.
Definition: RIO_OnTrack.h:97
Trk::noHypothesis
@ noHypothesis
Definition: ParticleHypothesis.h:37
Trk::LocalParameters
Definition: LocalParameters.h:98
SCT_ClusterOnTrack.h
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
ActsTrk::GlobalChiSquareFitterTool::m_doReFitFromPRD
Gaudi::Property< bool > m_doReFitFromPRD
Definition: GlobalChiSquareFitterTool.h:222
Trk::IRIO_OnTrackCreator::correct
virtual RIO_OnTrack * correct(const PrepRawData &hit, const TrackParameters &trk, const EventContext &ctx) const =0
abstract base method for the creation of RIO_OnTrack it takes a RIO (PrepRawData) and the given Track...
ActsTrk::PRDSourceLinkCalibratorGX2F::calibrate
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, typename trajectory_t::TrackStateProxy trackState) const
The following is the implementation of the PRDSourceLinkCalibratorGX2F.
Definition: GlobalChiSquareFitterTool.cxx:57
Trk::PrepRawDataSet
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Definition: FitterTypes.h:26
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
get_generator_info.result
result
Definition: get_generator_info.py:21
TrackParameters.h
Trk::BoundaryCheckResult::DeadElement
@ DeadElement
outside the element
MeasurementBase.h
PerigeeSurface.h
ActsTrk::detail::FitterHelperFunctions::gainMatrixUpdate
Acts::Result< void > gainMatrixUpdate(const Acts::GeometryContext &gctx, typename trajectory_t::TrackStateProxy trackState, const Acts::Logger &logger)
Definition: FitterHelperFunctions.h:23
ActsTrk::DetectorElementToActsGeometryIdMap
Definition: DetectorElementToActsGeometryIdMap.h:31
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
ActsGeometryContext.h
PixelCluster.h
ActsTrk::GlobalChiSquareFitterTool::m_extrapolationTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Definition: GlobalChiSquareFitterTool.h:176
ActsTrk::detail::Navigator
Acts::Navigator Navigator
Definition: Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h:31
Trk::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of TRT hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:76
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
Trk::BoundaryCheckResult::Candidate
@ Candidate
skel.it
it
Definition: skel.GENtoEVGEN.py:407
ActsTrk::GlobalChiSquareFitterTool::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: GlobalChiSquareFitterTool.h:216
ATLASMagneticFieldWrapper.h
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:197
Trk::SurfaceBounds::Annulus
@ Annulus
Definition: SurfaceBounds.h:70
ActsTrk::PRDSourceLinkCalibratorGX2F
Definition: GlobalChiSquareFitterTool.h:59
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
ActsTrk::GlobalChiSquareFitterTool::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: GlobalChiSquareFitterTool.h:213
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::GlobalChi2Fitter
@ GlobalChi2Fitter
Track's from Thijs' global chi^2 fitter or the ACTS implementation.
Definition: TrackingPrimitives.h:52
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
ActsTrk::GlobalChiSquareFitterTool::GlobalChiSquareFitterTool
GlobalChiSquareFitterTool(const std::string &, const std::string &, const IInterface *)
Definition: GlobalChiSquareFitterTool.cxx:160
ActsTrk::GlobalChiSquareFitterTool::fit
virtual std::unique_ptr< Trk::Track > fit(const EventContext &ctx, const Trk::Track &, const Trk::RunOutlierRemoval runOutlier=false, const Trk::ParticleHypothesis matEffects=Trk::nonInteracting) const override
refit a track
Definition: GlobalChiSquareFitterTool.cxx:211
SCT_Cluster.h
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
Trk::numberOfTRTHoles
@ numberOfTRTHoles
number of TRT hits which pass the high threshold (only xenon counted) total number of TRT hits which ...
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:83
ActsTrk::GlobalChiSquareFitterTool::m_option_outlierChi2Cut
Gaudi::Property< double > m_option_outlierChi2Cut
Definition: GlobalChiSquareFitterTool.h:189
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
PrepRawData.h
Trk::RunOutlierRemoval
bool RunOutlierRemoval
switch to toggle quality processing after fit
Definition: FitterTypes.h:22
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
ActsTrk::getSurfaceOfMeasurement
const Acts::Surface * getSurfaceOfMeasurement(const Acts::TrackingGeometry &tracking_geometry, const DetectorElementToActsGeometryIdMap &detector_element_to_geoid, const xAOD::UncalibratedMeasurement &measurement)
Definition: SurfaceOfMeasurementUtil.h:13
ActsTrk::detail::TrkMeasurementCalibrator::calibrate
void calibrate([[maybe_unused]] const Acts::GeometryContext &gctx, [[maybe_unused]] const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, typename Acts::MultiTrajectory< trajectory_t >::TrackStateProxy trackState) const
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
Track.h
ActsTrk::PRDSourceLinkCalibratorGX2F::rotCreator
const Trk::IRIO_OnTrackCreator * rotCreator
Definition: GlobalChiSquareFitterTool.h:66
makeActsAthenaLogger
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition: Tracking/Acts/ActsInterop/src/Logger.cxx:64
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
ActsTrk::MutableMultiTrajectory
Athena implementation of ACTS::MultiTrajectory (ReadWrite version) The data is stored in 4 external b...
Definition: MultiTrajectory.h:78
ActsTrk::IActsToTrkConverterTool::trkSurfaceToActsSurface
virtual const Acts::Surface & trkSurfaceToActsSurface(const Trk::Surface &atlasSurface) const =0
ActsTrk::PRDSourceLinkSurfaceAccessorGX2F::operator()
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Definition: GlobalChiSquareFitterTool.cxx:152
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ActsTrk::makeATLASUncalibSourceLink
ATLASUncalibSourceLink makeATLASUncalibSourceLink(const xAOD::UncalibratedMeasurementContainer *container, std::size_t index, [[maybe_unused]] const EventContext &ctx)
Definition: ATLASSourceLink.h:30
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ActsTrk::GlobalChiSquareFitterTool::m_boundaryCheckTool
ToolHandle< Trk::IBoundaryCheckTool > m_boundaryCheckTool
Definition: GlobalChiSquareFitterTool.h:184
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
ActsTrk::GlobalChiSquareFitterTool::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: GlobalChiSquareFitterTool.h:178
Trk::MeasurementBase::uniqueClone
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
Definition: MeasurementBase.h:77
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:65
ActsTrk::GlobalChiSquareFitterTool::m_calibrator
std::unique_ptr< ActsTrk::detail::TrkMeasurementCalibrator > m_calibrator
Definition: GlobalChiSquareFitterTool.h:198
master.flag
bool flag
Definition: master.py:29
ActsTrk::GlobalChiSquareFitterTool::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: GlobalChiSquareFitterTool.h:180
ActsTrk::PRDSourceLinkCalibratorGX2F::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: GlobalChiSquareFitterTool.h:68
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::Seed
Acts::Seed< xAOD::SpacePoint, 3ul > Seed
Definition: Seed.h:12
GlobalChiSquareFitterTool.h
ActsDetectorElement
Definition: ActsDetectorElement.h:42
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
ActsTrk::GlobalChiSquareFitterTool::makeTrack
std::unique_ptr< Trk::Track > makeTrack(const EventContext &ctx, Acts::GeometryContext &tgContext, ActsTrk::MutableTrackContainer &tracks, Acts::Result< ActsTrk::MutableTrackContainer::TrackProxy, std::error_code > &fitResult, bool SourceLinkType=false) const
Definition: GlobalChiSquareFitterTool.cxx:647
ActsTrk::PRDSourceLinkSurfaceAccessorGX2F
Definition: GlobalChiSquareFitterTool.h:71
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
ActsTrk::GlobalChiSquareFitterTool::m_gx2fExtensions
Acts::Experimental::Gx2FitterExtensions< ActsTrk::MutableTrackStateBackend > m_gx2fExtensions
Definition: GlobalChiSquareFitterTool.h:208
MuonValidation_CreateResolutionProfiles.fit
def fit(h, emin, emax)
Definition: MuonValidation_CreateResolutionProfiles.py:69
Trk::numberOfPixelHoles
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:59
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
Trk::PrepRawData
Definition: PrepRawData.h:62
ActsTrk::IActsToTrkConverterTool::actsTrackParametersToTrkParameters
virtual std::unique_ptr< Trk::TrackParameters > actsTrackParametersToTrkParameters(const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext &gctx) const =0
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
ActsTrk::GlobalChiSquareFitterTool::initialize
virtual StatusCode initialize() override
Definition: GlobalChiSquareFitterTool.cxx:165
ActsTrk::GlobalChiSquareFitterTool::m_ROTcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator
Definition: GlobalChiSquareFitterTool.h:220
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
RIO_OnTrack.h
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Trk::TrackInfo::dumpInfo
std::string dumpInfo() const
Returns a string with the name of the fitter of this track (i.e.
Definition: Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx:45
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:193
ActsTrk::PRDSourceLinkGX2F::prd
const Trk::PrepRawData * prd
Definition: GlobalChiSquareFitterTool.h:56
ActsTrk::PRDSourceLinkGX2F
Definition: GlobalChiSquareFitterTool.h:55
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
Trk::Track::measurementsOnTrack
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:178
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
ActsTrk::ATLASSourceLinkSurfaceAccessor
Definition: ATLASSourceLinkSurfaceAccessor.h:20
ActsTrk::GlobalChiSquareFitterTool::m_broadROTcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_broadROTcreator
Definition: GlobalChiSquareFitterTool.h:218
ActsTrk::PRDSourceLinkSurfaceAccessorGX2F::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: GlobalChiSquareFitterTool.h:72
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::PlaneSurface
Definition: PlaneSurface.h:64
ActsTrk::detail::FitterHelperFunctions::ATLASOutlierFinder::StateChiSquaredPerNumberDoFCut
double StateChiSquaredPerNumberDoFCut
Definition: FitterHelperFunctions.h:50
python.TrackLeptonConfig.quality
quality
Definition: TrackLeptonConfig.py:16
ActsTrk::GlobalChiSquareFitterTool::m_fitter
std::unique_ptr< Fitter > m_fitter
Definition: GlobalChiSquareFitterTool.h:205
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
ATLASSourceLinkSurfaceAccessor.h
ActsTrk::PRDSourceLinkCalibratorGX2F::broadRotCreator
const Trk::IRIO_OnTrackCreator * broadRotCreator
Definition: GlobalChiSquareFitterTool.h:67
ActsTrk::GlobalChiSquareFitterTool::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Definition: GlobalChiSquareFitterTool.h:182
Trk::SurfaceType::Plane
@ Plane
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:55
Trk::phi
@ phi
Definition: ParamDefs.h:75
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Trk::SurfaceType::Line
@ Line
Logger.h
PixelClusterOnTrack.h
ActsTrk::GlobalChiSquareFitterTool::m_outlierFinder
ActsTrk::detail::FitterHelperFunctions::ATLASOutlierFinder m_outlierFinder
Definition: GlobalChiSquareFitterTool.h:210
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
ActsTrk::MutableTrackContainer
Definition: TrackContainer.h:122
TrackContainer.h
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
ActsTrk::GlobalChiSquareFitterTool::m_option_maxPropagationStep
Gaudi::Property< int > m_option_maxPropagationStep
Definition: GlobalChiSquareFitterTool.h:191
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
Trk::PrepRawData::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...