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));
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  // The covariance from already fitted track are too small and would result an
279  // incorrect smoothing. We scale up the input covariance to avoid this.
280  Acts::BoundSquareMatrix scaledCov = Acts::BoundSquareMatrix::Identity();
281  for (int i = 0; i < 6; ++i) {
283  (scaledCov)(i, i) = scale * initialParams.covariance().value()(i, i);
284  }
285 
286  // @TODO: Synchronize with prtHypothesis
288 
289  const Acts::BoundTrackParameters scaledInitialParams(
290  initialParams.referenceSurface().getSharedPtr(),
291  initialParams.parameters(), scaledCov, hypothesis);
292 
294 
295  // Perform the fit
296  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
297  scaledInitialParams, gx2fOptions, tracks);
298  if (result.ok()) {
299  track = makeTrack(ctx, tgContext, tracks, result);
300  }
301  return track;
302 }
303 
304 // fit a set of MeasurementBase objects
305 // --------------------------------
306 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
307  const EventContext& ctx, const Trk::MeasurementSet& inputMeasSet,
308  const Trk::TrackParameters& estimatedStartParameters,
309  const Trk::RunOutlierRemoval /*runOutlier*/,
310  const Trk::ParticleHypothesis /*matEffects*/) const {
311  std::unique_ptr<Trk::Track> track = nullptr;
312 
313  // protection against not having measurements on the input track
314  if (inputMeasSet.size() < 2) {
316  "called to refit empty measurement set or a measurement set with too "
317  "little information, reject fit");
318  return nullptr;
319  }
320 
321  // Construct a perigee surface as the target surface
322  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
323  Acts::Vector3{0., 0., 0.});
324 
325  Acts::GeometryContext tgContext =
326  m_trackingGeometryTool->getGeometryContext(ctx).context();
327  Acts::MagneticFieldContext mfContext =
328  m_extrapolationTool->getMagneticFieldContext(ctx);
329  // CalibrationContext converter not implemented yet.
330  Acts::CalibrationContext calContext = Acts::CalibrationContext();
331 
332  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
333  gx2fExtensions = m_gx2fExtensions;
334 
335  ATLASSourceLinkSurfaceAccessor surfaceAccessor{&(*m_ATLASConverterTool)};
336  gx2fExtensions.surfaceAccessor
337  .connect<&ATLASSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
338 
339  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
340  propagationOption.maxSteps = m_option_maxPropagationStep;
341  // Set the Gx2Fitter options
342  Acts::Experimental::Gx2FitterOptions gx2fOptions(
343  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
344  &(*pSurface));
345 
346  std::vector<Acts::SourceLink> trackSourceLinks;
347  trackSourceLinks.reserve(inputMeasSet.size());
348 
349  for (auto it = inputMeasSet.begin(); it != inputMeasSet.end(); ++it) {
350  trackSourceLinks.push_back(
351  m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
352  }
353  // protection against error in the conversion from Atlas measurement to ACTS
354  // source link
355  if (trackSourceLinks.empty()) {
357  "input contain measurement but no source link created, probable issue "
358  "with the converter, reject fit ");
359  return track;
360  }
361 
362  const auto& initialParams =
363  m_ATLASConverterTool->trkTrackParametersToActsParameters(
364  estimatedStartParameters, tgContext);
365 
367 
368  // Perform the fit
369  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
370  initialParams, gx2fOptions, tracks);
371  if (result.ok()) {
372  track = makeTrack(ctx, tgContext, tracks, result);
373  }
374  return track;
375 }
376 
377 // fit a set of PrepRawData objects
378 // --------------------------------
379 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
380  const EventContext& ctx, const Trk::PrepRawDataSet& inputPRDColl,
381  const Trk::TrackParameters& estimatedStartParameters,
382  const Trk::RunOutlierRemoval /*runOutlier*/,
383  const Trk::ParticleHypothesis /*prtHypothesis*/) const {
384  ATH_MSG_DEBUG("--> entering GlobalChiSquareFitterTool::fit(PRDS,TP,)");
385 
386  std::unique_ptr<Trk::Track> track = nullptr;
387 
388  // Construct a perigee surface as the target surface
389  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
390  Acts::Vector3{0., 0., 0.});
391 
392  Acts::GeometryContext tgContext =
393  m_trackingGeometryTool->getGeometryContext(ctx).context();
394  Acts::MagneticFieldContext mfContext =
395  m_extrapolationTool->getMagneticFieldContext(ctx);
396  // CalibrationContext converter not implemented yet.
397  Acts::CalibrationContext calContext = Acts::CalibrationContext();
398 
399  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
400  gx2fExtensions = m_gx2fExtensions;
401 
402  PRDSourceLinkCalibratorGX2F calibrator{}; // @TODO: Set tool pointers
403  calibrator.rotCreator = m_ROTcreator.get();
404  calibrator.broadRotCreator = m_broadROTcreator.get();
405  calibrator.converterTool = m_ATLASConverterTool.get();
406  gx2fExtensions.calibrator.connect<&PRDSourceLinkCalibratorGX2F::calibrate<
407  ActsTrk::MutableTrackStateBackend>>(&calibrator);
408 
410  gx2fExtensions.surfaceAccessor
411  .connect<&PRDSourceLinkSurfaceAccessorGX2F::operator()>(&surfaceAccessor);
412 
413  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
414  propagationOption.maxSteps = m_option_maxPropagationStep;
415  // Set the Gx2Fitter options
416  Acts::Experimental::Gx2FitterOptions gx2fOptions(
417  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
418  &(*pSurface));
419 
420  std::vector<Acts::SourceLink> trackSourceLinks;
421  trackSourceLinks.reserve(inputPRDColl.size());
422 
423  for (const Trk::PrepRawData* prd : inputPRDColl) {
424  trackSourceLinks.push_back(Acts::SourceLink{PRDSourceLinkGX2F{prd}});
425  }
426  // protection against error in the conversion from Atlas measurement to ACTS
427  // source link
428  if (trackSourceLinks.empty()) {
430  "input contain measurement but no source link created, probable issue "
431  "with the converter, reject fit ");
432  return track;
433  }
434 
435  const auto& initialParams =
436  m_ATLASConverterTool->trkTrackParametersToActsParameters(
437  estimatedStartParameters, tgContext);
438 
440  // Perform the fit
441  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
442  initialParams, gx2fOptions, tracks);
443  if (result.ok()) {
444  track = makeTrack(ctx, tgContext, tracks, result, true);
445  }
446  return track;
447 }
448 
449 // fit a set of PrepRawData objects
450 // --------------------------------
451 std::unique_ptr<ActsTrk::MutableTrackContainer> GlobalChiSquareFitterTool::fit(
452  const EventContext& /*eventContext*/,
453  const std::vector<ActsTrk::ATLASUncalibSourceLink>& /*clusterList*/,
454  const Acts::BoundTrackParameters& /*initialParams*/,
455  const Acts::GeometryContext& /*tgContext*/,
456  const Acts::MagneticFieldContext& /*mfContext*/,
457  const Acts::CalibrationContext& /*calContext*/,
458  const DetectorElementToActsGeometryIdMap& /*detectorElementToGeometryIdMap*/,
459  const Acts::Surface* /*targetSurface*/) const {
460  ATH_MSG_ERROR("The ACTS Global Chi Square Fitter has no direct fitter.");
461  return nullptr;
462 }
463 
464 // extend a track fit to include an additional set of MeasurementBase objects
465 // re-implements the TrkFitterUtils/TrackFitter.cxx general code in a more
466 // mem efficient and stable way
467 // --------------------------------
468 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
469  const EventContext& ctx, const Trk::Track& inputTrack,
470  const Trk::MeasurementSet& addMeasColl,
471  const Trk::RunOutlierRemoval /*runOutlier*/,
472  const Trk::ParticleHypothesis /*matEffects*/) const {
474  "--> enter GlobalChiSquareFitterTool::fit(Track,Meas'BaseSet,,)");
476  " with Track from author = " << inputTrack.info().dumpInfo());
477 
478  // protection, if empty MeasurementSet
479  if (addMeasColl.empty()) {
481  "client tries to add an empty MeasurementSet to the track fit.");
482  return fit(ctx, inputTrack);
483  }
484 
485  // protection against not having measurements on the input track
486  if (!inputTrack.measurementsOnTrack() ||
487  (inputTrack.measurementsOnTrack()->size() < 2 && addMeasColl.empty())) {
489  "called to refit empty track or track with too little information, "
490  "reject fit");
491  return nullptr;
492  }
493 
494  // protection against not having track parameters on the input track
495  if (!inputTrack.trackParameters() || inputTrack.trackParameters()->empty()) {
497  "input fails to provide track parameters for seeding the GX2F, reject "
498  "fit");
499  return nullptr;
500  }
501 
502  std::unique_ptr<Trk::Track> track = nullptr;
503 
504  // Construct a perigee surface as the target surface
505  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
506  Acts::Vector3{0., 0., 0.});
507 
508  Acts::GeometryContext tgContext =
509  m_trackingGeometryTool->getGeometryContext(ctx).context();
510  Acts::MagneticFieldContext mfContext =
511  m_extrapolationTool->getMagneticFieldContext(ctx);
512  // CalibrationContext converter not implemented yet.
513  Acts::CalibrationContext calContext = Acts::CalibrationContext();
514 
515  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
516  gx2fExtensions = m_gx2fExtensions;
517 
518  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
519  propagationOption.maxSteps = m_option_maxPropagationStep;
520  // Set the Gx2Fitter options
521  Acts::Experimental::Gx2FitterOptions gx2fOptions(
522  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
523  &(*pSurface));
524 
525  std::vector<Acts::SourceLink> trackSourceLinks =
526  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, inputTrack);
527  const auto& initialParams =
528  m_ATLASConverterTool->trkTrackParametersToActsParameters(
529  *(inputTrack.perigeeParameters()), tgContext);
530 
531  for (auto it = addMeasColl.begin(); it != addMeasColl.end(); ++it) {
532  trackSourceLinks.push_back(
533  m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
534  }
535  // protection against error in the conversion from Atlas measurement to ACTS
536  // source link
537  if (trackSourceLinks.empty()) {
539  "input contain measurement but no source link created, probable issue "
540  "with the converter, reject fit ");
541  return track;
542  }
543 
545  // Perform the fit
546  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
547  initialParams, gx2fOptions, tracks);
548  if (result.ok()) {
549  track = makeTrack(ctx, tgContext, tracks, result);
550  }
551  return track;
552 }
553 
554 // extend a track fit to include an additional set of PrepRawData objects
555 // --------------------------------
556 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
557  const EventContext& /*ctx*/, const Trk::Track& /*inputTrack*/,
558  const Trk::PrepRawDataSet& /*addPrdColl*/,
559  const Trk::RunOutlierRemoval /*runOutlier*/,
560  const Trk::ParticleHypothesis /*matEffects*/) const {
562  "Fit of Track with additional PrepRawDataSet not yet implemented");
563  return nullptr;
564 }
565 
566 // combined fit of two tracks
567 // --------------------------------
568 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::fit(
569  const EventContext& ctx, const Trk::Track& intrk1, const Trk::Track& intrk2,
570  const Trk::RunOutlierRemoval /*runOutlier*/,
571  const Trk::ParticleHypothesis /*matEffects*/) const {
572  ATH_MSG_VERBOSE("--> enter GlobalChiSquareFitterTool::fit(Track,Track,)");
573  ATH_MSG_VERBOSE(" with Tracks from #1 = " << intrk1.info().dumpInfo()
574  << " and #2 = "
575  << intrk2.info().dumpInfo());
576 
577  // protection, if empty track2
578  if (!intrk2.measurementsOnTrack()) {
579  ATH_MSG_DEBUG("input #2 is empty try to fit track 1 alone");
580  return fit(ctx, intrk1);
581  }
582 
583  // protection, if empty track1
584  if (!intrk1.measurementsOnTrack()) {
585  ATH_MSG_DEBUG("input #1 is empty try to fit track 2 alone");
586  return fit(ctx, intrk2);
587  }
588 
589  // protection against not having track parameters on the input track
590  if (!intrk1.trackParameters() || intrk1.trackParameters()->empty()) {
592  "input #1 fails to provide track parameters for seeding the GX2F, "
593  "reject fit");
594  return nullptr;
595  }
596 
597  std::unique_ptr<Trk::Track> track = nullptr;
598 
599  // Construct a perigee surface as the target surface
600  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
601  Acts::Vector3{0., 0., 0.});
602 
603  Acts::GeometryContext tgContext =
604  m_trackingGeometryTool->getGeometryContext(ctx).context();
605  Acts::MagneticFieldContext mfContext =
606  m_extrapolationTool->getMagneticFieldContext(ctx);
607  // CalibrationContext converter not implemented yet.
608  Acts::CalibrationContext calContext = Acts::CalibrationContext();
609 
610  Acts::Experimental::Gx2FitterExtensions<ActsTrk::MutableTrackStateBackend>
611  gx2fExtensions = m_gx2fExtensions;
612 
613  Acts::PropagatorPlainOptions propagationOption(tgContext, mfContext);
614  propagationOption.maxSteps = m_option_maxPropagationStep;
615  // Set the Gx2Fitter options
616  Acts::Experimental::Gx2FitterOptions gx2fOptions(
617  tgContext, mfContext, calContext, gx2fExtensions, propagationOption,
618  &(*pSurface));
619 
620  std::vector<Acts::SourceLink> trackSourceLinks =
621  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk1);
622  std::vector<Acts::SourceLink> trackSourceLinks2 =
623  m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk2);
624  trackSourceLinks.insert(trackSourceLinks.end(), trackSourceLinks2.begin(),
625  trackSourceLinks2.end());
626  // protection against error in the conversion from Atlas measurement to ACTS
627  // source link
628  if (trackSourceLinks.empty()) {
630  "input contain measurement but no source link created, probable issue "
631  "with the converter, reject fit ");
632  return track;
633  }
634 
635  const auto& initialParams =
636  m_ATLASConverterTool->trkTrackParametersToActsParameters(
637  *(intrk1.perigeeParameters()), tgContext);
638 
639  // The covariance from already fitted track are too small and would result an
640  // incorrect smoothing. We scale up the input covariance to avoid this.
641  Acts::BoundSquareMatrix scaledCov = Acts::BoundSquareMatrix::Identity();
642  for (int i = 0; i < 6; ++i) {
644  (scaledCov)(i, i) = scale * initialParams.covariance().value()(i, i);
645  }
646 
647  const Acts::BoundTrackParameters scaledInitialParams(
648  initialParams.referenceSurface().getSharedPtr(),
649  initialParams.parameters(), scaledCov, Acts::ParticleHypothesis::pion());
650 
652  // Perform the fit
653  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
654  scaledInitialParams, gx2fOptions, tracks);
655  if (result.ok()) {
656  track = makeTrack(ctx, tgContext, tracks, result);
657  }
658  return track;
659 }
660 
661 std::unique_ptr<Trk::Track> GlobalChiSquareFitterTool::makeTrack(
662  const EventContext& ctx, Acts::GeometryContext& tgContext,
664  Acts::Result<ActsTrk::MutableTrackContainer::TrackProxy, std::error_code>&
665  fitResult,
666  bool SourceLinkType) const {
667 
668  if (not fitResult.ok()) {
669  return nullptr;
670  }
671 
672  std::unique_ptr<Trk::Track> newtrack = nullptr;
673 
674  // Get the fit output object
675  const auto& acts_track = fitResult.value();
676  auto finalTrajectory = std::make_unique<Trk::TrackStates>();
677 
678  // initialise the number of dead Pixel and ACTS strip
679  int numberOfDeadPixel = 0;
680  int numberOfDeadSCT = 0;
681 
682  std::vector<std::unique_ptr<const Acts::BoundTrackParameters>>
683  actsSmoothedParam;
684  // Loop over all the output state to create track state
685  tracks.trackStateContainer().visitBackwards(
686  acts_track.tipIndex(), [&](const auto& state) -> void {
687  // First only consider states with an associated detector element not in
688  // the TRT
689  auto flag = state.typeFlags();
690  const auto* associatedDetEl =
691  state.referenceSurface().associatedDetectorElement();
692  if (not associatedDetEl) {
693  return;
694  }
695 
696  const auto* actsElement =
697  dynamic_cast<const ActsDetectorElement*>(associatedDetEl);
698  if (not actsElement) {
699  return;
700  }
701 
702  const auto* upstreamDetEl = actsElement->upstreamDetectorElement();
703  if (not upstreamDetEl) {
704  return;
705  }
706 
707  // ATH_MSG_VERBOSE("Try casting to TRT for if");
708  // if (dynamic_cast<const
709  // InDetDD::TRT_BaseElement*>(upstreamDetEl)) { return; }
710 
711  const auto* trkDetElem =
712  dynamic_cast<const Trk::TrkDetElementBase*>(upstreamDetEl);
713  if (not trkDetElem) {
714  return;
715  }
716 
718  "trkDetElem type: "
719  << static_cast<std::underlying_type_t<Trk::DetectorElemType>>(
720  trkDetElem->detectorType()));
721 
722  ATH_MSG_VERBOSE("Try casting to SiDetectorElement");
723  const auto* detElem =
724  dynamic_cast<const InDetDD::SiDetectorElement*>(upstreamDetEl);
725  if (not detElem) {
726  return;
727  }
728  ATH_MSG_VERBOSE("detElem = " << detElem);
729 
730  // We need to determine the type of state
731  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
732  typePattern;
733  std::unique_ptr<Trk::TrackParameters> parm;
734 
735  // State is a hole (no associated measurement), use predicted parameters
736  if (flag.test(Acts::TrackStateFlag::HoleFlag)) {
737  ATH_MSG_VERBOSE("State is a hole (no associated measurement)");
738  const Acts::BoundTrackParameters actsParam(
739  state.referenceSurface().getSharedPtr(), state.smoothed(),
740  state.smoothedCovariance(), acts_track.particleHypothesis());
741  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
742  actsParam, tgContext);
743  auto boundaryCheck = m_boundaryCheckTool->boundaryCheck(*parm);
744  // Check if this is a hole, a dead sensors or a state outside the
745  // sensor boundary
747  "Check if this is a hole, a dead sensors or a state outside the "
748  "sensor boundary");
749  if (boundaryCheck == Trk::BoundaryCheckResult::DeadElement) {
750  if (detElem->isPixel()) {
751  ++numberOfDeadPixel;
752  } else if (detElem->isSCT()) {
753  ++numberOfDeadSCT;
754  }
755  // Dead sensors states are not stored
756  return;
757  } else if (boundaryCheck != Trk::BoundaryCheckResult::Candidate) {
758  // States outside the sensor boundary are ignored
759  return;
760  }
761  typePattern.set(Trk::TrackStateOnSurface::Hole);
762  } else if (flag.test(Acts::TrackStateFlag::OutlierFlag)) {
763  ATH_MSG_VERBOSE("The state was tagged as an outlier");
764  const Acts::BoundTrackParameters actsParam(
765  state.referenceSurface().getSharedPtr(), state.smoothed(),
766  state.smoothedCovariance(), acts_track.particleHypothesis());
767  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
768  actsParam, tgContext);
769  typePattern.set(Trk::TrackStateOnSurface::Outlier);
770  } else {
771  ATH_MSG_VERBOSE("The state is a measurement state");
772 
773  const Acts::BoundTrackParameters actsParam(
774  state.referenceSurface().getSharedPtr(), state.smoothed(),
775  state.smoothedCovariance(), acts_track.particleHypothesis());
776 
777  actsSmoothedParam.push_back(
778  std::make_unique<const Acts::BoundTrackParameters>(
779  Acts::BoundTrackParameters(actsParam)));
780  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(
781  actsParam, tgContext);
782  typePattern.set(Trk::TrackStateOnSurface::Measurement);
783  }
784 
785  std::unique_ptr<Trk::MeasurementBase> measState;
786  if (state.hasUncalibratedSourceLink() && !SourceLinkType) {
787  auto sl =
788  state.getUncalibratedSourceLink().template get<ATLASSourceLink>();
789  assert(sl);
790  measState = sl->uniqueClone();
791  } else if (state.hasUncalibratedSourceLink() && SourceLinkType) {
792  // If the SourceLink is of type PRDSourceLinkGX2F, we need to create
793  // the RIO_OnTrack here.
794  auto sl = state.getUncalibratedSourceLink()
795  .template get<PRDSourceLinkGX2F>()
796  .prd;
797 
798  // ROT creation
799  const IdentifierHash idHash = sl->detectorElement()->identifyHash();
800  int dim = state.calibratedSize();
801  std::unique_ptr<Trk::RIO_OnTrack> rot;
802  if (dim == 1) {
803  const InDet::SCT_Cluster* sct_Cluster =
804  dynamic_cast<const InDet::SCT_Cluster*>(sl);
805  if (!sct_Cluster) {
806  ATH_MSG_ERROR("ERROR could not cast PRD to SCT_Cluster");
807  return;
808  }
809  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(
810  sct_Cluster,
812  state.template calibrated<1>()[0], Trk::loc1)),
813  state.template calibratedCovariance<1>(), idHash);
814  } else if (dim == 2) {
816  dynamic_cast<const InDet::PixelCluster*>(sl);
817  if (!pixelCluster) {
818  // sometimes even with dim=2, only the SCT_Cluster implementation
819  // work for RIO_OnTrack creation
821  "Dimension is 2 but we need SCT_Cluster for this "
822  "measurement");
823  const InDet::SCT_Cluster* sct_Cluster =
824  dynamic_cast<const InDet::SCT_Cluster*>(sl);
825  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(
826  sct_Cluster,
828  state.template calibrated<1>()[0], Trk::loc1)),
829  state.template calibratedCovariance<1>(), idHash);
830  } else {
831  rot = std::make_unique<InDet::PixelClusterOnTrack>(
832  pixelCluster,
833  Trk::LocalParameters(state.template calibrated<2>()),
834  state.template calibratedCovariance<2>(), idHash);
835  }
836  } else {
837  throw std::domain_error("Cannot handle measurement dim>2");
838  }
839  measState = rot->uniqueClone();
840  }
841 
842  double nDoF = state.calibratedSize();
843  auto quality = Trk::FitQualityOnSurface(state.chi2(), nDoF);
844  const Trk::TrackStateOnSurface* perState =
845  new Trk::TrackStateOnSurface(quality, std::move(measState),
846  std::move(parm), nullptr, typePattern);
847  // If a state was successfully created add it to the trajectory
848  if (perState) {
850  "State successfully created, adding it to the trajectory");
851  finalTrajectory->insert(finalTrajectory->begin(), perState);
852  }
853  });
854 
855  // Convert the perigee state and add it to the trajectory
856  const Acts::BoundTrackParameters actsPer(
857  acts_track.referenceSurface().getSharedPtr(), acts_track.parameters(),
858  acts_track.covariance(), acts_track.particleHypothesis());
859  std::unique_ptr<Trk::TrackParameters> per =
860  m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsPer,
861  tgContext);
862  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
863  typePattern;
864  typePattern.set(Trk::TrackStateOnSurface::Perigee);
866  nullptr, std::move(per), nullptr, typePattern);
867  if (perState) {
868  finalTrajectory->insert(finalTrajectory->begin(), perState);
869  }
870 
871  // Create the track using the states
874  // Mark the fitter as GlobalChi2Fitter
875  newInfo.setTrackFitter(Trk::TrackInfo::TrackFitter::GlobalChi2Fitter);
876  newtrack = std::make_unique<Trk::Track>(newInfo, std::move(finalTrajectory),
877  nullptr);
878  if (newtrack) {
879  // Create the track summary and update the holes information
880  if (!newtrack->trackSummary()) {
881  newtrack->setTrackSummary(std::make_unique<Trk::TrackSummary>());
882  newtrack->trackSummary()->update(Trk::numberOfPixelHoles, 0);
883  newtrack->trackSummary()->update(Trk::numberOfSCTHoles, 0);
884  newtrack->trackSummary()->update(Trk::numberOfTRTHoles, 0);
885  newtrack->trackSummary()->update(Trk::numberOfPixelDeadSensors,
886  numberOfDeadPixel);
887  newtrack->trackSummary()->update(Trk::numberOfSCTDeadSensors,
888  numberOfDeadSCT);
889  }
890  m_trkSummaryTool->updateTrackSummary(ctx, *newtrack, true);
891  }
892  return newtrack;
893 }
894 
895 std::unique_ptr<ActsTrk::MutableTrackContainer> GlobalChiSquareFitterTool::fit(
896  const EventContext& ctx, const ActsTrk::Seed& seed,
897  const Acts::BoundTrackParameters& initialParams,
898  const Acts::GeometryContext& tgContext,
899  const Acts::MagneticFieldContext& mfContext,
900  const Acts::CalibrationContext& calContext,
901  const DetectorElementToActsGeometryIdMap& detectorElementToGeometryIdMap)
902  const {
903  const Acts::TrackingGeometry* actsTrackingGeometry =
904  m_trackingGeometryTool->trackingGeometry().get();
905  if (!actsTrackingGeometry) {
906  throw std::runtime_error("No Acts tracking geometry.");
907  }
908 
909  std::vector<ActsTrk::ATLASUncalibSourceLink> sourceLinks;
910  sourceLinks.reserve(6);
911 
912  std::vector<const Acts::Surface*> surfaces;
913  surfaces.reserve(6);
914 
915  const auto& sps = seed.sp();
916  for (const xAOD::SpacePoint* sp : sps) {
917  const auto& measurements = sp->measurements();
918  for (const xAOD::UncalibratedMeasurement* umeas : measurements) {
920  sourceLinks.emplace_back(el);
921  surfaces.push_back(ActsTrk::getSurfaceOfMeasurement(
922  *actsTrackingGeometry, detectorElementToGeometryIdMap, *umeas));
923  }
924  }
925  return fit(ctx, sourceLinks, initialParams, tgContext, mfContext, calContext,
926  detectorElementToGeometryIdMap, surfaces.front());
927 }
928 
929 } // 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:216
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:170
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:396
ActsTrk::GlobalChiSquareFitterTool::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: GlobalChiSquareFitterTool.h:210
ATLASMagneticFieldWrapper.h
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:196
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:207
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:51
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
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
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:183
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:81
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:178
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:85
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:172
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:192
master.flag
bool flag
Definition: master.py:29
ActsTrk::GlobalChiSquareFitterTool::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: GlobalChiSquareFitterTool.h:174
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:661
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:202
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:214
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:228
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:192
ActsTrk::GlobalChiSquareFitterTool::m_option_seedCovarianceScale
Gaudi::Property< double > m_option_seedCovarianceScale
Definition: GlobalChiSquareFitterTool.h:188
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:212
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
ActsTrk::GlobalChiSquareFitterTool::m_fitter
std::unique_ptr< Fitter > m_fitter
Definition: GlobalChiSquareFitterTool.h:199
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:176
Trk::SurfaceType::Plane
@ Plane
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
Trk::phi
@ phi
Definition: ParamDefs.h:75
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
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:204
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:185
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...