ATLAS Offline Software
KalmanFitter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "KalmanFitter.h"
6 
7 // ATHENA
8 #include "GaudiKernel/ListItem.h"
13 #include "GaudiKernel/EventContext.h"
16 #include "TrkTrack/Track.h"
17 
18 // ACTS
19 #include "Acts/Definitions/TrackParametrization.hpp"
20 #include "Acts/Definitions/Units.hpp"
21 #include "Acts/Propagator/EigenStepper.hpp"
22 #include "Acts/Propagator/Navigator.hpp"
23 #include "Acts/Propagator/Propagator.hpp"
24 #include "Acts/Surfaces/PerigeeSurface.hpp"
25 #include "Acts/Surfaces/Surface.hpp"
26 #include "Acts/TrackFitting/KalmanFitter.hpp"
27 #include "Acts/Utilities/Helpers.hpp"
28 #include "Acts/Utilities/Logger.hpp"
29 #include "Acts/Utilities/CalibrationContext.hpp"
30 #include "Acts/EventData/VectorTrackContainer.hpp"
31 
36 
38 // PACKAGE
43 #include "ActsInterop/Logger.h"
44 
45 #include "Acts/Propagator/DirectNavigator.hpp"
46 
47 // STL
48 #include <vector>
49 
50 namespace ActsTrk {
51 
52 /*
53 The following is the implementation of the PRDSourceLinkCalibrator.
54 To use this implementation, the flag for a refitting from PRD measurment has to be turned on in the appropriate Acts config.
55 */
56 template <typename trajectory_t>
57 void PRDSourceLinkCalibrator::calibrate(const Acts::GeometryContext& gctx,
58  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<PRDSourceLink>().prd;
63  trackState.setUncalibratedSourceLink(sl);
64 
65  const Acts::BoundTrackParameters actsParam(trackState.referenceSurface().getSharedPtr(),
66  trackState.predicted(),
67  trackState.predictedCovariance(),
69  std::unique_ptr<const Trk::TrackParameters> trkParam = converterTool->actsTrackParametersToTrkParameters(actsParam, gctx);
70 
71  //RIO_OnTrack creation from the PrepRawData
72  const Trk::Surface & prdsurf = prd->detectorElement()->surface(prd->identify());
73  const Trk::RIO_OnTrack *rot = nullptr;
74  const Trk::PlaneSurface *plsurf = nullptr;
75  if (prdsurf.type() == Trk::SurfaceType::Plane)
76  plsurf = static_cast < const Trk::PlaneSurface *>(&prdsurf);
77 
78  const Trk::StraightLineSurface *slsurf = nullptr;
79 
80  if (prdsurf.type() == Trk::SurfaceType::Line)
81  slsurf = static_cast < const Trk::StraightLineSurface *>(&prdsurf);
82 
83  //@TODO, there is no way to put a MSG in this framework yet. So the next 3 lines are commented
84  //if ((slsurf == nullptr) && (plsurf == nullptr)) {
85  //msg(MSG::ERROR) << "Surface is neither PlaneSurface nor StraightLineSurface!" << endmsg; //ATH_MSG_ERROR doesn't work here because (ActsTrk::PRDSourceLinkCalibrator' has no member named 'msg')
86  // }
87  if (slsurf != nullptr) {
89  slsurf->center(),
90  trackState.predicted()[Trk::phi],
91  trackState.predicted()[Trk::theta],
92  trackState.predicted()[Trk::qOverP],
93  *slsurf
94  );
95  if(broadRotCreator){
96  rot = broadRotCreator->correct(*prd, atasl);
97  }
98  else{
99  rot = rotCreator->correct(*prd, atasl);
100  }
101  } else if (plsurf != nullptr) {
102  if ((trkParam.get())->covariance() != nullptr) {
103  Trk::AtaPlane atapl(
104  plsurf->center(),
105  trackState.predicted()[Trk::phi],
106  trackState.predicted()[Trk::theta],
107  trackState.predicted()[Trk::qOverP],
108  *plsurf,
109  AmgSymMatrix(5)(*trkParam.get()->covariance())
110  );
111  rot = rotCreator->correct(*prd, atapl);
112  } else {
113  Trk::AtaPlane atapl(
114  plsurf->center(),
115  trackState.predicted()[Trk::phi],
116  trackState.predicted()[Trk::theta],
117  trackState.predicted()[Trk::qOverP],
118  *plsurf
119  );
120  rot = rotCreator->correct(*prd, atapl);
121  }
122  } // End of RIO_OnTrack creation from the PrepRawData
123 
124  int dim = (*rot).localParameters().dimension();
125  trackState.allocateCalibrated(dim);
126 
127  //Writting the calibrated ROT measurment into the trackState
128  if (dim == 0)
129  {
130  throw std::runtime_error("Cannot create dim 0 measurement");
131  } else if (dim == 1) {
132  trackState.template calibrated<1>() = (*rot).localParameters().template head<1>();
133  trackState.template calibratedCovariance<1>() = (*rot).localCovariance().template topLeftCorner<1, 1>();
134  // Create a projection matrix onto 1D measurement
135  Acts::ActsMatrix<Acts::MultiTrajectoryTraits::MeasurementSizeMax, 2> proj;
136  proj.setZero();
137  if ((*rot).associatedSurface().bounds().type() == Trk::SurfaceBounds::Annulus) {
138  proj(Acts::eBoundLoc0, Acts::eBoundLoc1) = 1; // transforms predicted[1] -> calibrated[0] in Acts::MeasurementSelector::calculateChi2()
139  } else {
140  proj(Acts::eBoundLoc0, Acts::eBoundLoc0) = 1;
141  }
142  trackState.setProjector(proj);
143  }
144  else if (dim == 2)
145  {
146  trackState.template calibrated<2>() = (*rot).localParameters().template head<2>();
147  trackState.template calibratedCovariance<2>() = (*rot).localCovariance().template topLeftCorner<2, 2>();
148  // Create a 2D projection matrix
149  Acts::ActsMatrix<Acts::MultiTrajectoryTraits::MeasurementSizeMax, 2> proj;
150  proj.setZero();
151  proj(Acts::eBoundLoc0, Acts::eBoundLoc0) = 1;
152  proj(Acts::eBoundLoc1, Acts::eBoundLoc1) = 1;
153  trackState.setProjector(proj);
154  }
155  else
156  {
157  throw std::runtime_error("Dim " + std::to_string(dim) +
158  " currently not supported.");
159  }
160  delete rot; //Delete rot as a precaution
161 
162 }
163 
164 const Acts::Surface* PRDSourceLinkSurfaceAccessor::operator()(const Acts::SourceLink& sourceLink) const {
165  const auto& sl = sourceLink.get<PRDSourceLink>();
166  const auto& trkSrf = sl.prd->detectorElement()->surface(sl.prd->identify());
167  const auto& actsSrf = converterTool->trkSurfaceToActsSurface(trkSrf);
168  return &actsSrf;
169 }
170 
171 KalmanFitter::KalmanFitter(const std::string& t,const std::string& n,
172  const IInterface* p) :
173  base_class(t,n,p)
174 {}
175 
177 
178  ATH_MSG_DEBUG(name() << "::" << __FUNCTION__);
179  ATH_CHECK(m_trackingGeometryTool.retrieve());
180  ATH_CHECK(m_extrapolationTool.retrieve());
181  ATH_CHECK(m_ATLASConverterTool.retrieve());
182  ATH_CHECK(m_trkSummaryTool.retrieve());
183  if(m_doReFitFromPRD){
184  ATH_CHECK(m_ROTcreator.retrieve());
185  ATH_CHECK(m_broadROTcreator.retrieve());
186  }
187 
188  m_logger = makeActsAthenaLogger(this, "KalmanRefit");
189 
190  auto field = std::make_shared<ATLASMagneticFieldWrapper>();
191 
192  // Fitter
193  Acts::EigenStepper<> stepper(field, m_overstepLimit);
194  Acts::Navigator navigator( Acts::Navigator::Config{ m_trackingGeometryTool->trackingGeometry() },
195  logger().cloneWithSuffix("Navigator"));
196  Acts::Propagator<Acts::EigenStepper<>, Acts::Navigator> propagator(stepper,
197  std::move(navigator),
198  logger().cloneWithSuffix("Prop"));
199 
200  m_fitter = std::make_unique<Fitter>(std::move(propagator),
201  logger().cloneWithSuffix("KalmanFitter"));
202 
203  // Direct Fitter
204  Acts::DirectNavigator directNavigator( logger().cloneWithSuffix("DirectNavigator") );
205  Acts::Propagator<Acts::EigenStepper<>, Acts::DirectNavigator> directPropagator(std::move(stepper),
206  std::move(directNavigator),
207  logger().cloneWithSuffix("DirectPropagator"));
208 
209  m_directFitter = std::make_unique<DirectFitter>(std::move(directPropagator),
210  logger().cloneWithSuffix("DirectKalmanFitter"));
211 
213  m_calibrator = std::make_unique<TrkMeasurementCalibrator>(*m_ATLASConverterTool);
216 
217  m_kfExtensions.outlierFinder.connect<&ActsTrk::FitterHelperFunctions::ATLASOutlierFinder::operator()<ActsTrk::MutableTrackStateBackend>>(&m_outlierFinder);
218  m_kfExtensions.reverseFilteringLogic.connect<&ActsTrk::FitterHelperFunctions::ReverseFilteringLogic::operator()<ActsTrk::MutableTrackStateBackend>>(&m_reverseFilteringLogic);
219  m_kfExtensions.updater.connect<&ActsTrk::FitterHelperFunctions::gainMatrixUpdate<ActsTrk::MutableTrackStateBackend>>();
220  m_kfExtensions.smoother.connect<&ActsTrk::FitterHelperFunctions::gainMatrixSmoother<ActsTrk::MutableTrackStateBackend>>();
221  m_kfExtensions.calibrator.connect<&TrkMeasurementCalibrator::calibrate<ActsTrk::MutableTrackStateBackend>>(m_calibrator.get());
222 
223  return StatusCode::SUCCESS;
224 }
225 
226 // refit a track
227 // -------------------------------------------------------
228 std::unique_ptr<Trk::Track>
229 KalmanFitter::fit(const EventContext& ctx,
230  const Trk::Track& inputTrack,
231  const Trk::RunOutlierRemoval /*runOutlier*/,
232  const Trk::ParticleHypothesis /*prtHypothesis*/) const
233 {
234  std::unique_ptr<Trk::Track> track = nullptr;
235  ATH_MSG_VERBOSE ("--> enter KalmanFitter::fit(Track,,) with Track from author = "
236  << inputTrack.info().dumpInfo());
237 
238  // protection against not having measurements on the input track
239  if (!inputTrack.measurementsOnTrack() || inputTrack.measurementsOnTrack()->size() < 2) {
240  ATH_MSG_DEBUG("called to refit empty track or track with too little information, reject fit");
241  return nullptr;
242  }
243 
244  // protection against not having track parameters on the input track
245  if (!inputTrack.trackParameters() || inputTrack.trackParameters()->empty()) {
246  ATH_MSG_DEBUG("input fails to provide track parameters for seeding the KF, reject fit");
247  return nullptr;
248  }
249 
250  // Construct a perigee surface as the target surface
251  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
252  Acts::Vector3{0., 0., 0.});
253 
254  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
255  Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
256  // CalibrationContext converter not implemented yet.
257  Acts::CalibrationContext calContext = Acts::CalibrationContext();
258 
259  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
260 
261  ATLASSourceLinkSurfaceAccessor surfaceAccessor{&(*m_ATLASConverterTool)};
262  kfExtensions.surfaceAccessor.connect<&ATLASSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
263 
264  Acts::PropagatorPlainOptions propagationOption;
265  propagationOption.maxSteps = m_option_maxPropagationStep;
266  // Set the KalmanFitter options
267  Acts::KalmanFitterOptions
268  kfOptions(tgContext, mfContext, calContext,
269  kfExtensions,
270  propagationOption,
271  &(*pSurface));
272 
273  std::vector<Acts::SourceLink> trackSourceLinks = m_ATLASConverterTool->trkTrackToSourceLinks(tgContext,inputTrack);
274  // protection against error in the conversion from Atlas masurement to Acts source link
275  if (trackSourceLinks.empty()) {
276  ATH_MSG_DEBUG("input contain measurement but no source link created, probable issue with the converter, reject fit ");
277  return track;
278  }
279 
280  const auto& initialParams = m_ATLASConverterTool->trkTrackParametersToActsParameters((*inputTrack.perigeeParameters()), tgContext);
281 
282  // The covariance from already fitted track are too small and would result an incorect smoothing.
283  // We scale up the input covaraiance to avoid this.
284  Acts::BoundSquareMatrix scaledCov = Acts::BoundSquareMatrix::Identity();
285  for (int i=0; i<6; ++i) {
287  (scaledCov)(i,i) = scale * initialParams.covariance().value()(i,i);
288  }
289 
290  // @TODO: Synchronize with prtHypothesis
292 
293  const Acts::BoundTrackParameters scaledInitialParams(initialParams.referenceSurface().getSharedPtr(),
294  initialParams.parameters(),
295  scaledCov,
296  hypothesis);
297 
299 
300  // Perform the fit
301  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
302  scaledInitialParams, kfOptions, tracks);
303  if (result.ok()) {
304  track = makeTrack(ctx, tgContext, tracks, result);
305  }
306  return track;
307 }
308 
309 // fit a set of MeasurementBase objects
310 // --------------------------------
311 std::unique_ptr<Trk::Track>
312 KalmanFitter::fit(const EventContext& ctx,
313  const Trk::MeasurementSet& inputMeasSet,
314  const Trk::TrackParameters& estimatedStartParameters,
315  const Trk::RunOutlierRemoval /*runOutlier*/,
316  const Trk::ParticleHypothesis /*matEffects*/) const
317 {
318  std::unique_ptr<Trk::Track> track = nullptr;
319 
320  // protection against not having measurements on the input track
321  if (inputMeasSet.size() < 2) {
322  ATH_MSG_DEBUG("called to refit empty measurement set or a measurement set with too little information, reject fit");
323  return nullptr;
324  }
325 
326  // Construct a perigee surface as the target surface
327  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
328  Acts::Vector3{0., 0., 0.});
329 
330  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
331  Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
332  // CalibrationContext converter not implemented yet.
333  Acts::CalibrationContext calContext = Acts::CalibrationContext();
334 
335  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
336 
337  ATLASSourceLinkSurfaceAccessor surfaceAccessor{&(*m_ATLASConverterTool)};
338  kfExtensions.surfaceAccessor.connect<&ATLASSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
339 
340  Acts::PropagatorPlainOptions propagationOption;
341  propagationOption.maxSteps = m_option_maxPropagationStep;
342  // Set the KalmanFitter options
343  Acts::KalmanFitterOptions
344  kfOptions(tgContext, mfContext, calContext,
345  kfExtensions,
346  propagationOption,
347  &(*pSurface));
348 
349  std::vector<Acts::SourceLink> trackSourceLinks;
350  trackSourceLinks.reserve(inputMeasSet.size());
351 
352  for (auto it = inputMeasSet.begin(); it != inputMeasSet.end(); ++it){
353  trackSourceLinks.push_back(m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
354  }
355  // protection against error in the conversion from Atlas masurement to Acts source link
356  if (trackSourceLinks.empty()) {
357  ATH_MSG_DEBUG("input contain measurement but no source link created, probable issue with the converter, reject fit ");
358  return track;
359  }
360 
361  const auto& initialParams = m_ATLASConverterTool->trkTrackParametersToActsParameters(estimatedStartParameters, tgContext);
362 
364 
365  // Perform the fit
366  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
367  initialParams, kfOptions, tracks);
368  if (result.ok()) {
369  track = makeTrack(ctx, tgContext, tracks, result);
370  }
371  return track;
372 }
373 
374 // fit a set of PrepRawData objects
375 // --------------------------------
376 std::unique_ptr<Trk::Track>
377 KalmanFitter::fit(const EventContext& ctx,
378  const Trk::PrepRawDataSet& inputPRDColl,
379  const Trk::TrackParameters& estimatedStartParameters,
380  const Trk::RunOutlierRemoval /*runOutlier*/,
381  const Trk::ParticleHypothesis /*prtHypothesis*/) const
382 {
383  ATH_MSG_DEBUG("--> entering KalmanFitter::fit(PRDS,TP,)");
384 
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 = m_trackingGeometryTool->getGeometryContext(ctx).context();
393  Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
394  // CalibrationContext converter not implemented yet.
395  Acts::CalibrationContext calContext = Acts::CalibrationContext();
396 
397  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
398 
399  PRDSourceLinkCalibrator calibrator{}; // @TODO: Set tool pointers
400  calibrator.rotCreator =m_ROTcreator.get();
401  calibrator.broadRotCreator = m_broadROTcreator.get();
402  calibrator.converterTool = m_ATLASConverterTool.get();
403  kfExtensions.calibrator.connect<&PRDSourceLinkCalibrator::calibrate<ActsTrk::MutableTrackStateBackend>>(&calibrator);
404 
405  PRDSourceLinkSurfaceAccessor surfaceAccessor{m_ATLASConverterTool.get()};
406  kfExtensions.surfaceAccessor.connect<&PRDSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
407 
408  Acts::PropagatorPlainOptions propagationOption;
409  propagationOption.maxSteps = m_option_maxPropagationStep;
410  // Set the KalmanFitter options
411  Acts::KalmanFitterOptions
412  kfOptions(tgContext, mfContext, calContext,
413  kfExtensions,
414  propagationOption,
415  &(*pSurface));
416 
417 
418  std::vector<Acts::SourceLink> trackSourceLinks;
419  trackSourceLinks.reserve(inputPRDColl.size());
420 
421  for(const Trk::PrepRawData* prd : inputPRDColl) {
422  trackSourceLinks.push_back(Acts::SourceLink{PRDSourceLink{prd}});
423  }
424  // protection against error in the conversion from Atlas masurement to Acts source link
425  if (trackSourceLinks.empty()) {
426  ATH_MSG_WARNING("input contain measurement but no source link created, probable issue with the converter, reject fit ");
427  return track;
428  }
429  //
430 
431  const auto& initialParams = m_ATLASConverterTool->trkTrackParametersToActsParameters(estimatedStartParameters, tgContext);
432 
433 
435  // Perform the fit
436  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
437  initialParams, kfOptions, tracks);
438  if (result.ok()) {
439  track = makeTrack(ctx, tgContext, tracks, result, true);
440  }
441  return track;
442 }
443 
444 // fit a set of PrepRawData objects
445 // --------------------------------
446 std::unique_ptr< ActsTrk::MutableTrackContainer >
447 KalmanFitter::fit(const EventContext& ,
448  const std::vector< ActsTrk::ATLASUncalibSourceLink> & clusterList,
449  const Acts::BoundTrackParameters& initialParams,
450  const Acts::GeometryContext& tgContext,
451  const Acts::MagneticFieldContext& mfContext,
452  const Acts::CalibrationContext& calContext,
453  const TrackingSurfaceHelper &tracking_surface_helper,
454  const Acts::Surface* targetSurface) const{
455  ATH_MSG_DEBUG("--> entering KalmanFitter::fit(xAODMeasure...things,TP,)");
456 
457  std::vector<Acts::SourceLink> sourceLinks;
458  sourceLinks.reserve(clusterList.size());
459 
460  std::vector<const Acts::Surface*> surfaces;
461  surfaces.reserve(clusterList.size());
462 
463  for (const ActsTrk::ATLASUncalibSourceLink& el : clusterList) {
464  sourceLinks.emplace_back( el );
465  surfaces.push_back(&tracking_surface_helper.associatedActsSurface( getUncalibratedMeasurement(el) ));
466  }
467 
468  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
469 
470  ActsTrk::ATLASUncalibSourceLinkSurfaceAccessor surfaceAccessor{ &(*m_ATLASConverterTool), &tracking_surface_helper };
471  kfExtensions.surfaceAccessor.connect<&ActsTrk::ATLASUncalibSourceLinkSurfaceAccessor::operator()>(&surfaceAccessor);
472 
474  ::NoCalibration(*m_ATLASConverterTool, tracking_surface_helper);
475 
476  kfExtensions.calibrator.connect<&OnTrackCalibrator<ActsTrk::MutableTrackStateBackend>::calibrate>(&calibrator);
477 
478  Acts::PropagatorPlainOptions propagationOption;
479  propagationOption.maxSteps = m_option_maxPropagationStep;
480 
481  // Construct a perigee surface as the target surface if none is provided
482  std::shared_ptr<Acts::Surface> pSurface{nullptr};
483  if (!targetSurface){
484  pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3{0., 0., 0.});
485  targetSurface = pSurface.get();
486  }
487 
488  // Set the KalmanFitter options
489  Acts::KalmanFitterOptions<ActsTrk::MutableTrackStateBackend>
490  kfOptions(tgContext, mfContext, calContext,
491  kfExtensions,
492  propagationOption,
493  targetSurface);
494 
495  std::unique_ptr< ActsTrk::MutableTrackContainer > tracks = std::make_unique< ActsTrk::MutableTrackContainer >();
496 
497 
498  auto result = m_directFitter->fit(sourceLinks.begin(),
499  sourceLinks.end(),
500  initialParams,
501  kfOptions,
502  surfaces,
503  *tracks.get());
504 
505  if (not result.ok()) {
506  ATH_MSG_VERBOSE("Kalman Fitter on Seed has failed");
507  return nullptr;
508  }
509  return tracks;
510 }
511 
512 // extend a track fit to include an additional set of MeasurementBase objects
513 // re-implements the TrkFitterUtils/TrackFitter.cxx general code in a more
514 // mem efficient and stable way
515 // --------------------------------
516 std::unique_ptr<Trk::Track>
517 KalmanFitter::fit(const EventContext& ctx,
518  const Trk::Track& inputTrack,
519  const Trk::MeasurementSet& addMeasColl,
520  const Trk::RunOutlierRemoval /*runOutlier*/,
521  const Trk::ParticleHypothesis /*matEffects*/) const
522 {
523  ATH_MSG_VERBOSE ("--> enter KalmanFitter::fit(Track,Meas'BaseSet,,)");
524  ATH_MSG_VERBOSE (" with Track from author = " << inputTrack.info().dumpInfo());
525 
526  // protection, if empty MeasurementSet
527  if (addMeasColl.empty()) {
528  ATH_MSG_DEBUG( "client tries to add an empty MeasurementSet to the track fit." );
529  return fit(ctx,inputTrack);
530  }
531 
532  // protection against not having measurements on the input track
533  if (!inputTrack.measurementsOnTrack() || (inputTrack.measurementsOnTrack()->size() < 2 && addMeasColl.empty())) {
534  ATH_MSG_DEBUG("called to refit empty track or track with too little information, reject fit");
535  return nullptr;
536  }
537 
538  // protection against not having track parameters on the input track
539  if (!inputTrack.trackParameters() || inputTrack.trackParameters()->empty()) {
540  ATH_MSG_DEBUG("input fails to provide track parameters for seeding the KF, reject fit");
541  return nullptr;
542  }
543 
544  std::unique_ptr<Trk::Track> track = nullptr;
545 
546  // Construct a perigee surface as the target surface
547  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
548  Acts::Vector3{0., 0., 0.});
549 
550  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
551  Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
552  // CalibrationContext converter not implemented yet.
553  Acts::CalibrationContext calContext = Acts::CalibrationContext();
554 
555  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
556 
557  Acts::PropagatorPlainOptions propagationOption;
558  propagationOption.maxSteps = m_option_maxPropagationStep;
559  // Set the KalmanFitter options
560  Acts::KalmanFitterOptions
561  kfOptions(tgContext, mfContext, calContext,
562  kfExtensions,
563  propagationOption,
564  &(*pSurface));
565 
566  std::vector<Acts::SourceLink> trackSourceLinks = m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, inputTrack);
567  const auto& initialParams = m_ATLASConverterTool->trkTrackParametersToActsParameters(*(inputTrack.perigeeParameters()), tgContext);
568 
569  for (auto it = addMeasColl.begin(); it != addMeasColl.end(); ++it)
570  {
571  trackSourceLinks.push_back(m_ATLASConverterTool->trkMeasurementToSourceLink(tgContext, **it));
572  }
573  // protection against error in the conversion from Atlas masurement to Acts source link
574  if (trackSourceLinks.empty()) {
575  ATH_MSG_DEBUG("input contain measurement but no source link created, probable issue with the converter, reject fit ");
576  return track;
577  }
578 
580  // Perform the fit
581  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
582  initialParams, kfOptions, tracks);
583  if (result.ok()) {
584  track = makeTrack(ctx, tgContext, tracks, result);
585  }
586  return track;
587 }
588 
589 // extend a track fit to include an additional set of PrepRawData objects
590 // --------------------------------
591 std::unique_ptr<Trk::Track>
592 KalmanFitter::fit(const EventContext& /*ctx*/,
593  const Trk::Track& /*inputTrack*/,
594  const Trk::PrepRawDataSet& /*addPrdColl*/,
595  const Trk::RunOutlierRemoval /*runOutlier*/,
596  const Trk::ParticleHypothesis /*matEffects*/) const
597 {
598  ATH_MSG_DEBUG("Fit of Track with additional PrepRawDataSet not yet implemented");
599  return nullptr;
600 }
601 
602 // combined fit of two tracks
603 // --------------------------------
604 std::unique_ptr<Trk::Track>
605 KalmanFitter::fit(const EventContext& ctx,
606  const Trk::Track& intrk1,
607  const Trk::Track& intrk2,
608  const Trk::RunOutlierRemoval /*runOutlier*/,
609  const Trk::ParticleHypothesis /*matEffects*/) const
610 {
611  ATH_MSG_VERBOSE ("--> enter KalmanFitter::fit(Track,Track,)");
612  ATH_MSG_VERBOSE (" with Tracks from #1 = " << intrk1.info().dumpInfo()
613  << " and #2 = " << intrk2.info().dumpInfo());
614 
615  // protection, if empty track2
616  if (!intrk2.measurementsOnTrack()) {
617  ATH_MSG_DEBUG( "input #2 is empty try to fit track 1 alone" );
618  return fit(ctx,intrk1);
619  }
620 
621  // protection, if empty track1
622  if (!intrk1.measurementsOnTrack()) {
623  ATH_MSG_DEBUG( "input #1 is empty try to fit track 2 alone" );
624  return fit(ctx,intrk2);
625  }
626 
627  // protection against not having track parameters on the input track
628  if (!intrk1.trackParameters() || intrk1.trackParameters()->empty()) {
629  ATH_MSG_DEBUG("input #1 fails to provide track parameters for seeding the KF, reject fit");
630  return nullptr;
631  }
632 
633  std::unique_ptr<Trk::Track> track = nullptr;
634 
635  // Construct a perigee surface as the target surface
636  auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
637  Acts::Vector3{0., 0., 0.});
638 
639  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
640  Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
641  // CalibrationContext converter not implemented yet.
642  Acts::CalibrationContext calContext = Acts::CalibrationContext();
643 
644  Acts::KalmanFitterExtensions<ActsTrk::MutableTrackStateBackend> kfExtensions = m_kfExtensions;
645 
646  Acts::PropagatorPlainOptions propagationOption;
647  propagationOption.maxSteps = m_option_maxPropagationStep;
648  // Set the KalmanFitter options
649  Acts::KalmanFitterOptions
650  kfOptions(tgContext, mfContext, calContext,
651  kfExtensions,
652  propagationOption,
653  &(*pSurface));
654 
655  std::vector<Acts::SourceLink> trackSourceLinks = m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk1);
656  std::vector<Acts::SourceLink> trackSourceLinks2 = m_ATLASConverterTool->trkTrackToSourceLinks(tgContext, intrk2);
657  trackSourceLinks.insert(trackSourceLinks.end(), trackSourceLinks2.begin(), trackSourceLinks2.end());
658  // protection against error in the conversion from Atlas masurement to Acts source link
659  if (trackSourceLinks.empty()) {
660  ATH_MSG_DEBUG("input contain measurement but no source link created, probable issue with the converter, reject fit ");
661  return track;
662  }
663 
664  const auto &initialParams = m_ATLASConverterTool->trkTrackParametersToActsParameters(*(intrk1.perigeeParameters()), tgContext);
665 
666  // The covariance from already fitted track are too small and would result an incorect smoothing.
667  // We scale up the input covaraiance to avoid this.
668  Acts::BoundSquareMatrix scaledCov = Acts::BoundSquareMatrix::Identity();
669  for (int i=0; i<6; ++i) {
671  (scaledCov)(i,i) = scale * initialParams.covariance().value()(i,i);
672  }
673 
674  const Acts::BoundTrackParameters scaledInitialParams(initialParams.referenceSurface().getSharedPtr(),
675  initialParams.parameters(),
676  scaledCov,
678 
679 
681  // Perform the fit
682  auto result = m_fitter->fit(trackSourceLinks.begin(), trackSourceLinks.end(),
683  scaledInitialParams, kfOptions, tracks);
684  if (result.ok()) {
685  track = makeTrack(ctx, tgContext, tracks, result);
686  }
687  return track;
688 }
689 
690 std::unique_ptr<Trk::Track>
691 KalmanFitter::makeTrack(const EventContext& ctx,
692  Acts::GeometryContext& tgContext,
694  Acts::Result<ActsTrk::MutableTrackContainer::TrackProxy, std::error_code>& fitResult, bool SourceLinkType) const {
695 
696  if (not fitResult.ok())
697  return nullptr;
698 
699  std::unique_ptr<Trk::Track> newtrack = nullptr;
700  // Get the fit output object
701  const auto& acts_track = fitResult.value();
702  auto finalTrajectory = std::make_unique<Trk::TrackStates>();
703  // initialise the number of dead Pixel and Acts strip
704  int numberOfDeadPixel = 0;
705  int numberOfDeadSCT = 0;
706 
707  std::vector<std::unique_ptr<const Acts::BoundTrackParameters>> actsSmoothedParam;
708  // Loop over all the output state to create track state
709  tracks.trackStateContainer().visitBackwards(acts_track.tipIndex(),
710  [&] (const auto &state) -> void
711  {
712  // First only concider state with an associated detector element not in the TRT
713  auto flag = state.typeFlags();
714  const auto* associatedDetEl = state.referenceSurface().associatedDetectorElement();
715  if (not associatedDetEl)
716  return;
717 
718  const auto* actsElement = dynamic_cast<const ActsDetectorElement*>(associatedDetEl);
719  if (not actsElement)
720  return;
721 
722  const auto* upstreamDetEl = actsElement->upstreamDetectorElement();
723  if (not upstreamDetEl)
724  return;
725 
726  ATH_MSG_VERBOSE("Try casting to TRT for if");
727  if (dynamic_cast<const InDetDD::TRT_BaseElement*>(upstreamDetEl))
728  return;
729 
730  const auto* trkDetElem = dynamic_cast<const Trk::TrkDetElementBase*>(upstreamDetEl);
731  if (not trkDetElem)
732  return;
733 
734  ATH_MSG_VERBOSE("trkDetElem type: " << static_cast<std::underlying_type_t<Trk::DetectorElemType>>(trkDetElem->detectorType()));
735 
736  ATH_MSG_VERBOSE("Try casting to SiDetectorElement");
737  const auto* detElem = dynamic_cast<const InDetDD::SiDetectorElement*>(upstreamDetEl);
738  if (not detElem)
739  return;
740  ATH_MSG_VERBOSE("detElem = " << detElem);
741 
742  // We need to determine the type of state
743  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
744  std::unique_ptr<Trk::TrackParameters> parm;
745 
746  // State is a hole (no associated measurement), use predicted parameters
747  if (flag.test(Acts::TrackStateFlag::HoleFlag)){
748  ATH_MSG_VERBOSE("State is a hole (no associated measurement), use predicted parameters");
749  const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
750  state.predicted(),
751  state.predictedCovariance(),
752  acts_track.particleHypothesis());
753  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsParam, tgContext);
754  auto boundaryCheck = m_boundaryCheckTool->boundaryCheck(*parm);
755 
756  // Check if this is a hole, a dead sensors or a state outside the sensor boundary
757  ATH_MSG_VERBOSE("Check if this is a hole, a dead sensors or a state outside the sensor boundary");
758  if(boundaryCheck == Trk::BoundaryCheckResult::DeadElement){
759  if (detElem->isPixel()) {
760  ++numberOfDeadPixel;
761  }
762  else if (detElem->isSCT()) {
763  ++numberOfDeadSCT;
764  }
765  // Dead sensors states are not stored
766  return;
767  } else if (boundaryCheck != Trk::BoundaryCheckResult::Candidate){
768  // States outside the sensor boundary are ignored
769  return;
770  }
771  typePattern.set(Trk::TrackStateOnSurface::Hole);
772  }
773  // The state was tagged as an outlier or was missed in the reverse filtering, use filtered parameters
774  else if (flag.test(Acts::TrackStateFlag::OutlierFlag) or !state.hasSmoothed()) {
775  ATH_MSG_VERBOSE("The state was tagged as an outlier or was missed in the reverse filtering, use filtered parameters");
776  const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
777  state.filtered(),
778  state.filteredCovariance(),
779  acts_track.particleHypothesis());
780  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsParam, tgContext);
781  typePattern.set(Trk::TrackStateOnSurface::Outlier);
782  }
783  // The state is a measurement state, use smoothed parameters
784  else{
785  ATH_MSG_VERBOSE("The state is a measurement state, use smoothed parameters");
786 
787  const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
788  state.smoothed(),
789  state.smoothedCovariance(),
790  acts_track.particleHypothesis());
791 
792  actsSmoothedParam.push_back(std::make_unique<const Acts::BoundTrackParameters>(Acts::BoundTrackParameters(actsParam)));
793  parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsParam, tgContext);
794  typePattern.set(Trk::TrackStateOnSurface::Measurement);
795  }
796  std::unique_ptr<Trk::MeasurementBase> measState;
797  if (state.hasUncalibratedSourceLink() && !SourceLinkType){
798  auto sl = state.getUncalibratedSourceLink().template get<ATLASSourceLink>();
799  assert(sl);
800  measState = sl->uniqueClone();
801  }
802  else if (state.hasUncalibratedSourceLink() && SourceLinkType){ //If the SourceLink is of type PRDSourceLink, we need to create the RIO_OnTrack here.
803  auto sl = state.getUncalibratedSourceLink().template get<PRDSourceLink>().prd;
804 
805  //ROT creation
806  const IdentifierHash idHash = sl->detectorElement()->identifyHash();
807  int dim = state.calibratedSize();
808  std::unique_ptr<Trk::RIO_OnTrack> rot;
809  if (dim == 1) {
810  const InDet::SCT_Cluster* sct_Cluster = dynamic_cast<const InDet::SCT_Cluster*>(sl);
811  if(!sct_Cluster){
812  ATH_MSG_ERROR("ERROR could not cast PRD to SCT_Cluster");
813  return;
814  }
815  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(sct_Cluster,Trk::LocalParameters(Trk::DefinedParameter(state.template calibrated<1>()[0], Trk::loc1)), state.template calibratedCovariance<1>(),idHash);
816  }
817  else if (dim == 2) {
818  const InDet::PixelCluster* pixelCluster = dynamic_cast<const InDet::PixelCluster*>(sl);
819  if(!pixelCluster){
820  //sometimes even with dim=2, only the SCT_Cluster implementation work for RIO_OnTrack creation
821  ATH_MSG_VERBOSE("Dimension is 2 but we need SCT_Cluster for this measurment");
822  const InDet::SCT_Cluster* sct_Cluster = dynamic_cast<const InDet::SCT_Cluster*>(sl);
823  rot = std::make_unique<InDet::SCT_ClusterOnTrack>(sct_Cluster,Trk::LocalParameters(Trk::DefinedParameter(state.template calibrated<1>()[0], Trk::loc1)), state.template calibratedCovariance<1>(),idHash);
824  }
825  else{
826  rot = std::make_unique<InDet::PixelClusterOnTrack>(pixelCluster,Trk::LocalParameters(state.template calibrated<2>()),state.template calibratedCovariance<2>(),idHash);
827  }
828  }
829  else {
830  throw std::domain_error("Cannot handle measurement dim>2");
831  }
832  measState = rot->uniqueClone();
833  }
834  double nDoF = state.calibratedSize();
835  auto quality =Trk::FitQualityOnSurface(state.chi2(), nDoF);
836  const Trk::TrackStateOnSurface *perState = new Trk::TrackStateOnSurface(quality, std::move(measState), std::move(parm), nullptr, typePattern);
837  // If a state was succesfully created add it to the trajectory
838  if (perState) {
839  ATH_MSG_VERBOSE("State succesfully creates, adding it to the trajectory");
840  finalTrajectory->insert(finalTrajectory->begin(), perState);
841  }
842  });
843  // Convert the perigee state and add it to the trajectory
844  const Acts::BoundTrackParameters actsPer(acts_track.referenceSurface().getSharedPtr(),
845  acts_track.parameters(),
846  acts_track.covariance(),
847  acts_track.particleHypothesis());
848  std::unique_ptr<Trk::TrackParameters> per = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsPer, tgContext);
849  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
850  typePattern.set(Trk::TrackStateOnSurface::Perigee);
851  const Trk::TrackStateOnSurface *perState = new Trk::TrackStateOnSurface(nullptr, std::move(per), nullptr, typePattern);
852  if (perState) finalTrajectory->insert(finalTrajectory->begin(), perState);
853 
854  // Create the track using the states
856  newInfo.setTrackFitter(Trk::TrackInfo::TrackFitter::KalmanFitter); //Mark the fitter as KalmanFitter
857  newtrack = std::make_unique<Trk::Track>(newInfo, std::move(finalTrajectory), nullptr);
858  if (newtrack) {
859  // Create the track summary and update the holes information
860  if (!newtrack->trackSummary()) {
861  newtrack->setTrackSummary(std::make_unique<Trk::TrackSummary>());
862  newtrack->trackSummary()->update(Trk::numberOfPixelHoles, 0);
863  newtrack->trackSummary()->update(Trk::numberOfSCTHoles, 0);
864  newtrack->trackSummary()->update(Trk::numberOfTRTHoles, 0);
865  newtrack->trackSummary()->update(Trk::numberOfPixelDeadSensors, numberOfDeadPixel);
866  newtrack->trackSummary()->update(Trk::numberOfSCTDeadSensors, numberOfDeadSCT);
867  }
868  m_trkSummaryTool->updateTrackSummary(ctx, *newtrack, true);
869  }
870  return newtrack;
871 }
872 
873 std::unique_ptr< ActsTrk::MutableTrackContainer >
874 KalmanFitter::fit(const EventContext& ctx,
875  const ActsTrk::Seed &seed,
876  const Acts::BoundTrackParameters& initialParams,
877  const Acts::GeometryContext& tgContext,
878  const Acts::MagneticFieldContext& mfContext,
879  const Acts::CalibrationContext& calContext,
880  const TrackingSurfaceHelper &tracking_surface_helper) const
881 {
882  std::vector<ActsTrk::ATLASUncalibSourceLink> sourceLinks;
883  sourceLinks.reserve(6);
884 
885  std::vector<const Acts::Surface*> surfaces;
886  surfaces.reserve(6);
887 
888  const auto& sps = seed.sp();
889  for (const xAOD::SpacePoint* sp : sps) {
890  const auto& measurements = sp->measurements();
891  for (const xAOD::UncalibratedMeasurement *umeas : measurements) {
893  sourceLinks.emplace_back( el );
894  surfaces.push_back(&tracking_surface_helper.associatedActsSurface(*umeas));
895  }
896  }
897  return fit(ctx, sourceLinks, initialParams, tgContext, mfContext, calContext, tracking_surface_helper, surfaces.front());
898 }
899 
900 }
Trk::noHypothesis
@ noHypothesis
Definition: ParticleHypothesis.h:37
TrackingSurfaceHelper
Simple helper class which allows to access the tracking surface associated to a certain (Si-)measurem...
Definition: TrackingSurfaceHelper.h:17
ActsTrk::KalmanFitter::initialize
virtual StatusCode initialize() override
Definition: KalmanFitter.cxx:176
Trk::LocalParameters
Definition: LocalParameters.h:98
SCT_ClusterOnTrack.h
ActsTrk::PRDSourceLinkSurfaceAccessor::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: KalmanFitter.h:83
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::KalmanFitter::m_option_seedCovarianceScale
Gaudi::Property< double > m_option_seedCovarianceScale
Definition: KalmanFitter.h:198
ActsTrk::KalmanFitter::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: KalmanFitter.h:183
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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ActsTrk::OnTrackCalibrator::NoCalibration
static OnTrackCalibrator NoCalibration(const ActsTrk::IActsToTrkConverterTool &converter_tool, const TrackingSurfaceHelper &surface_helper)
TrackParameters.h
ActsTrk::KalmanFitter::m_outlierFinder
ActsTrk::FitterHelperFunctions::ATLASOutlierFinder m_outlierFinder
Definition: KalmanFitter.h:215
MeasurementBase.h
PerigeeSurface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
ActsTrk::PRDSourceLinkCalibrator::rotCreator
const Trk::IRIO_OnTrackCreator * rotCreator
Definition: KalmanFitter.h:77
ActsGeometryContext.h
ActsTrk::PRDSourceLinkCalibrator::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: KalmanFitter.h:79
PixelCluster.h
ActsTrk::KalmanFitter::m_directFitter
std::unique_ptr< DirectFitter > m_directFitter
Definition: KalmanFitter.h:211
ActsTrk::KalmanFitter::m_option_maxPropagationStep
Gaudi::Property< int > m_option_maxPropagationStep
Definition: KalmanFitter.h:196
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.
ActsTrk::KalmanFitter::m_broadROTcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_broadROTcreator
Definition: KalmanFitter.h:226
ActsTrk::ATLASUncalibSourceLinkSurfaceAccessor
Definition: ATLASSourceLinkSurfaceAccessor.h:24
ActsTrk::Seed
Acts::Seed< xAOD::SpacePoint > Seed
Definition: Seed.h:13
skel.it
it
Definition: skel.GENtoEVGEN.py:423
ActsTrk::KalmanFitter::m_reverseFilteringLogic
ActsTrk::FitterHelperFunctions::ReverseFilteringLogic m_reverseFilteringLogic
Definition: KalmanFitter.h:216
ATLASMagneticFieldWrapper.h
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:196
Trk::SurfaceBounds::Annulus
@ Annulus
Definition: SurfaceBounds.h:70
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ActsTrk::PRDSourceLinkCalibrator::broadRotCreator
const Trk::IRIO_OnTrackCreator * broadRotCreator
Definition: KalmanFitter.h:78
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.
Trk::IRIO_OnTrackCreator::correct
virtual RIO_OnTrack * correct(const PrepRawData &hit, const TrackParameters &trk) const =0
abstract base method for the creation of RIO_OnTrack it takes a RIO (PrepRawData) and the given Track...
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
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
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
PrepRawData.h
ActsTrk::KalmanFitter::m_extrapolationTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Definition: KalmanFitter.h:182
ActsTrk::FitterHelperFunctions::ATLASOutlierFinder::StateChiSquaredPerNumberDoFCut
double StateChiSquaredPerNumberDoFCut
Definition: FitterHelperFunctions.h:40
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
Track.h
Rec::nDoF
double nDoF(const Trk::Track &track)
Definition: OutwardsCombinedMuonTrackBuilder.cxx:31
ActsTrk::KalmanFitter::KalmanFitter
KalmanFitter(const std::string &, const std::string &, const IInterface *)
Definition: KalmanFitter.cxx:171
ActsTrk::FitterHelperFunctions::ReverseFilteringLogic::momentumMax
double momentumMax
Definition: FitterHelperFunctions.h:80
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
KalmanFitter.h
ActsTrk::KalmanFitter::m_doReFitFromPRD
Gaudi::Property< bool > m_doReFitFromPRD
Definition: KalmanFitter.h:229
ActsTrk::KalmanFitter::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: KalmanFitter.h:224
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:31
lumiFormat.i
int i
Definition: lumiFormat.py:92
ActsTrk::KalmanFitter::m_calibrator
std::unique_ptr< TrkMeasurementCalibrator > m_calibrator
Definition: KalmanFitter.h:204
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:72
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
master.flag
bool flag
Definition: master.py:29
ActsTrk::KalmanFitter::m_ROTcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator
Definition: KalmanFitter.h:227
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::PRDSourceLinkCalibrator
Definition: KalmanFitter.h:70
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
ActsTrk::KalmanFitter::m_option_ReverseFilteringPt
Gaudi::Property< double > m_option_ReverseFilteringPt
Definition: KalmanFitter.h:194
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
ActsTrk::KalmanFitter::m_kfExtensions
Acts::KalmanFitterExtensions< ActsTrk::MutableTrackStateBackend > m_kfExtensions
Definition: KalmanFitter.h:213
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
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
xAOD::KalmanFitter
@ KalmanFitter
tracks produced by the Kalman Fitter
Definition: TrackingPrimitives.h:47
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:195
RIO_OnTrack.h
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ActsTrk::KalmanFitter::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: KalmanFitter.h:184
ActsTrk::KalmanFitter::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Definition: KalmanFitter.h:185
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:27
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
ActsTrk::KalmanFitter::m_fitter
std::unique_ptr< Fitter > m_fitter
Definition: KalmanFitter.h:208
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:192
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:18
TrackingSurfaceHelper::associatedActsSurface
const Acts::Surface & associatedActsSurface(const xAOD::UncalibratedMeasurement &measurement) const
Definition: TrackingSurfaceHelper.h:33
ActsTrk::KalmanFitter::m_option_outlierChi2Cut
Gaudi::Property< double > m_option_outlierChi2Cut
Definition: KalmanFitter.h:192
ActsTrk::KalmanFitter::m_overstepLimit
Gaudi::Property< double > m_overstepLimit
Definition: KalmanFitter.h:201
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::PlaneSurface
Definition: PlaneSurface.h:64
ActsTrk::PRDSourceLinkCalibrator::calibrate
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, typename trajectory_t::TrackStateProxy trackState) const
Definition: KalmanFitter.cxx:57
ActsTrk::PRDSourceLinkSurfaceAccessor::operator()
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Definition: KalmanFitter.cxx:164
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
ActsTrk::PRDSourceLinkSurfaceAccessor
Definition: KalmanFitter.h:82
ATLASSourceLinkSurfaceAccessor.h
Trk::SurfaceType::Plane
@ Plane
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
Trk::phi
@ phi
Definition: ParamDefs.h:81
ActsTrk::KalmanFitter::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: KalmanFitter.h:219
ActsTrk::OnTrackCalibrator
Definition: IOnTrackCalibratorTool.h:13
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::SurfaceType::Line
@ Line
Logger.h
PixelClusterOnTrack.h
Trk::loc1
@ loc1
Definition: ParamDefs.h:40
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
ActsTrk::MutableTrackContainer
Definition: TrackContainer.h:122
ActsTrk::KalmanFitter::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: KalmanFitter.cxx:691
TrackContainer.h
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
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...
ActsTrk::KalmanFitter::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: KalmanFitter.cxx:229