Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MeasurementSelector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 #pragma once
5 
6 // Alternative measurement selector
7 //
8 // This measurement selector is assuming the following
9 // - the number of selected measurements is small (~<10)
10 // - the number of measurement candidates is typically >> the
11 // number of selected measuremebts
12 // - the total number of candidate measurements can be large
13 // - there is a simple one-to-one relation between bound state
14 // parameters and measurement coordinates.
15 
16 #include "Acts/Utilities/Result.hpp"
17 #include "Acts/Utilities/Delegate.hpp"
18 #include "Acts/EventData/SourceLink.hpp"
19 #include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
20 #include "Acts/Surfaces/Surface.hpp"
21 #include "Acts/Geometry/GeometryHierarchyMap.hpp"
22 #include "Acts/EventData/Types.hpp"
23 #include "Acts/EventData/TrackStatePropMask.hpp"
24 #include "boost/container/small_vector.hpp"
25 
26 // for BaseTypes
27 #include "Acts/EventData/TrackStateProxy.hpp"
28 #include "Acts/Utilities/CalibrationContext.hpp"
29 #include "Acts/EventData/TrackParameters.hpp"
30 
31 // for MeasurementSizeMax
32 #include "Acts/EventData/MultiTrajectory.hpp"
33 
34 #include <utility>
35 #include <type_traits>
36 
37 // Types to be used during measurement selection for the prediction and the
38 // measurement for calibrated measurements after selection if the actual calibration is
39 // executed after the calibration, and the trajectory, track state, bound parameter
40 // types.
41 template <typename derived_t>
43 {
44  // the measurement type after the selection e.g. a Matrix<N,1>
45  template <std::size_t N>
46  using CalibratedMeasurement = typename Acts::detail_lt::FixedSizeTypes<N>::Coefficients;
47 
48  // the measurement covariance type after the selection e.g. a Matrix<N,N>
49  template <std::size_t N>
51 
52  // the measurement type before the selection e.g. an Eigen::Map< Matrix<N,1> > if
53  // the calibration is performed after the selection
54  template <std::size_t N>
55  using PreSelectionMeasurement = typename Acts::detail_lt::FixedSizeTypes<N>::Coefficients;
56 
57  // the measurement covariance type before the selection e.g. an Eigen::Map<Matrix<N,N> > if
58  // the calibration is performed after the selection
59  template <std::size_t N>
61 
62  // e.g. the same as CalibratedMeasurement
63  template <std::size_t N>
64  using Predicted = typename Acts::detail_lt::FixedSizeTypes<N>::Coefficients;
65 
66  // e.g. the same as CalibratedMeasurementCovariance
67  template <std::size_t N>
69 
70  // e.g. helper template to get the value_type from the container type
71  // e.g. helper template to get the value_type from the measurement range iterator type
72 
73  template <typename T_MeasurementRangeIterator>
75  using value_type = typename T_MeasurementRangeIterator::value_type;
76  };
77 
78  // abstract measurement range
79  // implements empty()
80  // and can be converted by the derived_t into an iterable range
81  // over measurements of concrete measurement container_type.
82  using abstract_measurement_range_t = std::ranges::iota_view<unsigned int, unsigned int>;
83 
84  // the trajectory type to which states for selected measurements are to be added
85  using trajectory_t = typename derived_t::traj_t;
86  // the track state type for new track states
87  using TrackStateProxy = trajectory_t::TrackStateProxy;
88 
89  // the value type usd for matrices
91  using BoundTrackParameters = Acts::BoundTrackParameters;
92  using BoundMatrix = Acts::BoundMatrix;
93 
94  using BoundState = std::tuple<BoundTrackParameters, BoundMatrix, double>;
95 
96  // maximum dimension of measurements
97  static const std::size_t s_dimMax = 3;
98 
99  // must be the same as what is used for the CKF
100  // @TODO how to get rid of this ?
101  static constexpr std::size_t s_maxBranchesPerSurface = 10;
102 };
103 
104 //
108  template <class T_Matrix>
109  static constexpr std::size_t matrixColumns() { return T_Matrix::ColsAtCompileTime;}
110  template <class T_Matrix>
111  static constexpr std::size_t matrixRows() { return T_Matrix::RowsAtCompileTime;}
112 
113  template <typename T_Float, class T_Matrix>
114  static auto matrixTypeCast(const T_Matrix &matrix) { return matrix.template cast<T_Float>(); }
115 
116  template <class T_Matrix>
117  static auto transpose(const T_Matrix &matrix) { return matrix.transpose(); }
118 
119  template <class T_Matrix>
120  static auto invert(const T_Matrix &matrix) { return matrix.inverse(); }
121 };
122 
123 
124 // Map from the measurement to bound state domain
125 // it is assumed that there is a simple unambiguous association
126 // between coordinates of the measurement domain and the bound state domain
127 // e.g. measurement coordinate 1 maps to loc0 of the bound state.
128 // @TODO use FixedSizeSubspace ? currently does not provide methods to directly
129 // create the a sub-space covariance matrix from a full covariance matrix,
130 // and to create the projector bitset, which is stored in the TrackState.
132 
133  template <std::size_t N>
134  using type = std::array<unsigned char, N>;
135 
136  template <std::size_t N>
137  static constexpr type<N> identity() {
138  type<N> ret;
139  for(int i=0; i<N; ++i) {
140  ret[i]=i;
141  }
142  return ret;
143  }
144 };
145 
146 // utility to "project" a bound state parameter vector or covariance matrix onto the 1,2, ... N dimensional measurement domain
147 // @TODO allow to influence resulting matrix type ?
148 template <std::size_t N,class T_ResultType,class T_Matrix>
149 T_ResultType project(ParameterMapping::type<N> parameter_map, const T_Matrix &matrix)
150 {
151  using MatrixIndexMapType = unsigned char; // "char" to reduce the size of the map, and if not wide enough this entire
152  // concept is likely inefficient.
153  using MatrixIndexType = unsigned int; // @TODO or std::size_t ? does not matter
154 
155  // ensure that index types are wide enough
156  static_assert( MeasurementSelectorMatrixTraits::matrixRows<T_Matrix>() < std::numeric_limits<MatrixIndexMapType>::max());
157  static_assert( N*MeasurementSelectorMatrixTraits::matrixRows<T_Matrix>() < std::numeric_limits<MatrixIndexType>::max());
158 
159  T_ResultType ret;
160  if constexpr(MeasurementSelectorMatrixTraits::matrixColumns<T_Matrix>() == 1) {
161  // handle projection of paramteter vector
162  for (MatrixIndexType meas_i=0; meas_i<N; ++meas_i) {
163  assert( meas_i < parameter_map.size() );
164  ret(meas_i,0) = matrix( parameter_map[meas_i], 0);
165  }
166  }
167  else {
168  // handle projection of covariance matrix
169  // "project" matrix
170  for (MatrixIndexType meas_i=0; meas_i<N; ++meas_i) {
171  assert( meas_i < parameter_map.size());
172  MatrixIndexType param_i = parameter_map[meas_i];
173  for (MatrixIndexType meas_j=0; meas_j<N; ++meas_j) {
174  assert( meas_j < parameter_map.size());
175  ret(meas_i,meas_j) = matrix(param_i, parameter_map[meas_j]);
176  }
177  }
178  }
179  return ret;
180 }
181 
182 
183 
184 
185 // helper method to compute a chi2 for the difference of two "measurement" and covariance pairs
186 template <typename measurement_vector_t, typename measurement_cov_matrix_t,
187  typename predicted_vector_t, typename predicted_cov_matrix_t>
188 double computeChi2(const measurement_vector_t &a,
189  const measurement_cov_matrix_t &a_cov,
190  const predicted_vector_t &b,
191  const predicted_cov_matrix_t &b_cov) {
192 
193  // just sum sanity checks that a and b have the correct dimensions and that
194  // the chi2 can actually be computed.
195  static_assert( MeasurementSelectorMatrixTraits::matrixColumns<measurement_vector_t>() == 1); // a is vector
196  static_assert( MeasurementSelectorMatrixTraits::matrixColumns<predicted_vector_t>() == 1); // b is vector
197  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
198  == MeasurementSelectorMatrixTraits::matrixColumns<measurement_cov_matrix_t>() ); // a is square matrix
199  static_assert( MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>()
200  == MeasurementSelectorMatrixTraits::matrixColumns<predicted_cov_matrix_t>() ); // b is square matrix
201  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
202  == MeasurementSelectorMatrixTraits::matrixRows<measurement_vector_t>() ); // a vector matches matrix
203  static_assert( MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>()
204  == MeasurementSelectorMatrixTraits::matrixRows<predicted_vector_t>() ); // b vector matches matrix
205  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
206  == MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>() ); // a and b match
207 
208  // @TODO remove abstraction i.e. assume matrix has the interface of an eigen matrix
209  auto inv_ab_cov( MeasurementSelectorMatrixTraits::invert(a_cov+b_cov) );
210  auto diff( a-b);
211  return (MeasurementSelectorMatrixTraits::transpose(diff) * inv_ab_cov * diff)(0,0);
212 }
213 
214 // Collection to hold the n-"best" candidates
215 // The objects of type PayloadType must support assignment operation, and must
216 // be default constructible. Moreover it must be possible to provide a
217 // "comparison" operator to order the payload objects.
218 template <std::size_t N, class PayloadType >
220  using IndexType = unsigned short; // @TODO or char ? If N>>10 this concept is likely
221  // inefficient
222  // using PayloadType = Payload<DIM>;
223  TopCollection(std::size_t max_n) {
224  init(max_n);
225  }
226 
227  // @param max_n the maximum number of top-candidates is fixed by the template parameter
228  // N but can be reduced further to this number
229  void init(std::size_t max_n) {
230  assert( max_n < N);
231  m_nextSlot=0;
232  m_maxSlots=max_n;
233  m_order[0]=0;
234  }
235  // @param get a slot to hold a new candidate which is not necessarily accepted in the list
236  // of the n-top candidates
237  PayloadType &slot() {
238  return m_slots[m_order[m_nextSlot] ];
239  }
240  // @param idx get the specified filled slot (read only) indicated by the index, where the index does not
241  // indicate the order in the top-candidate list
242  const PayloadType &getSlot(IndexType idx) const {
243  return m_slots[idx];
244  }
245  // @param idx get the specified filled slot indicated by the index, where the index does not
246  // indicate the order in the top-candidate list
247  PayloadType &getSlot(IndexType idx) {
248  return m_slots[idx];
249  }
250  // @param test whether the given index points to one of the accepted top candidates
251  bool isValid(IndexType idx) const {
252  return idx < m_nextSlot;
253  }
254  // Accept the element of the latest slot provided there is still a free slot or it is better than
255  // the worst element.
256  // @param comparison operator to compute e.g. a<b where "smaller" means "better"
257  void acceptAndSort(std::function<bool(const PayloadType &a, const PayloadType &b)> comparison) {
258  // bubble best element to top
259  for (unsigned int slot_i = m_nextSlot;
260  slot_i-- > 0
261  && !comparison(m_slots[ m_order[slot_i] ],m_slots[ m_order[slot_i+1] ]);) {
262  std::swap(m_order[slot_i],m_order[slot_i+1]);
263  }
264  // if there are still free slot increase the number of used slots
265  if (m_nextSlot < m_maxSlots) {
266  ++m_nextSlot;
268  }
269  }
270 
271  bool empty() const {
272  return m_nextSlot==0;
273  }
274 
275  IndexType size() const { return m_nextSlot; }
276 
277  // helper to iterate over the slot indices in sorting order from best to worst
278  typename std::array<IndexType, N+1>::const_iterator begin() { return m_order.begin(); }
279  typename std::array<IndexType, N+1>::const_iterator end() { return m_order.begin()+m_nextSlot; }
280 
281  std::array<PayloadType, N+1> m_slots; // storage for the slots
282  std::array<IndexType, N+1> m_order; // order of the filled slots
283  IndexType m_nextSlot = 0; // the index of the next free slot
284  IndexType m_maxSlots = 0; // maximum number of top-slots
285 };
286 
287 
288 
291  std::vector<float> etaBins{};
293  std::vector<std::pair<float, float> > chi2CutOff{ {15,25} };
295  std::vector<std::size_t> numMeasurementsCutOff{1};
296 };
297 
298 // Measurement type specific measirement selector
299 // Assumptions:
300 // - begin and end source_link_iterator point to a contiguous range of measurements in a single container
301 // - all measurements in this range have the same dimensionality.
302 // - the mapping of the bound parameters to the measurement domain for each measurement in this range
303 // is identical
304 template <std::size_t NMeasMax,
305  std::size_t DIMMAX,
306  typename derived_t >
308 
309  using Config = Acts::GeometryHierarchyMap<AtlasMeasurementSelectorCuts>;
311 
313 
314 protected:
319 
320  const derived_t &derived() const { return *static_cast<const derived_t *>(this); }
321 
322  // helper to create a projector bitset from a map from bound parameters to coordinates
324  template <std::size_t N>
325  static
326  Acts::ProjectorBitset create(const ParameterMapping::type<N> &parameter_map) {
327  constexpr std::size_t nrows = Acts::MultiTrajectoryTraits::MeasurementSizeMax;
328  constexpr std::size_t ncols = Acts::eBoundSize;
329 
330  std::bitset<nrows * ncols> proj_bitset {};
331 
332  for (unsigned int col_i=0; col_i<N; ++col_i) {
333  unsigned int row_i = parameter_map[col_i];
334  unsigned int idx = col_i *nrows + row_i; // @TODO handle row major and column major correctly
335  proj_bitset[ (nrows * ncols - 1) - idx ] = 1;
336  }
337  return proj_bitset.to_ullong();
338  }
339  };
340 
341  // helper to create states without the calibrated measurement, covariance, and sourcelink
342  // if more than one state is created the states after the first will share
343  // the jacobi and the prediction, if outlier_states is true no storage is created
344  // for filtered.
345  // @TODO should there be the possibility to have multiple states which mix outlier and non-outlier states ?
346  static void createStates(std::size_t n_new_states,
347  const T_BoundState& boundState,
348  std::size_t prevTip,
349  trajectory_t& trajectory,
350  const Acts::BoundSubspaceIndices& subspaceIndices,
351  boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> &track_states,
352  const Acts::Logger& logger,
353  bool outlier_states) {
354  // create track states for all compatible measurement candidates
355  const auto &boundParams = derived_t::boundParams(boundState);
356  const auto &pathLength = derived_t::pathLength(boundState);
357 
358  using PM = Acts::TrackStatePropMask;
359 
360  track_states.reserve( n_new_states );
361  std::optional<TrackStateProxy> firstTrackState{
362  std::nullopt};
363  for (unsigned int state_i=0; state_i<n_new_states; ++state_i) {
364  PM mask = PM::Predicted | PM::Filtered | PM::Jacobian | PM::Calibrated;
365 
366  if (firstTrackState.has_value()) {
367  // subsequent track states don't need storage for these as they will
368  // be shared
369  mask &= ~PM::Predicted & ~PM::Jacobian;
370  }
371 
372  if (outlier_states) {
373  // outlier won't have separate filtered parameters
374  mask &= ~PM::Filtered;
375  }
376 
377  TrackStateProxy trackState = trajectory.makeTrackState(mask, prevTip);
378  ACTS_VERBOSE("Create SourceLink output track state #"
379  << trackState.index() << " with mask: " << mask);
380 
381  if (firstTrackState.has_value()) {
382  trackState.shareFrom(*firstTrackState, PM::Predicted);
383  trackState.shareFrom(*firstTrackState, PM::Jacobian);
384  }
385  else {
386  // only set these for first
387  trackState.predicted() = boundParams.parameters();
388  if (boundParams.covariance()) {
389  trackState.predictedCovariance() = *boundParams.covariance();
390  }
391  trackState.jacobian() = derived_t::boundJacobiMatrix(boundState);
392  firstTrackState = trackState;
393  }
394  trackState.pathLength() = pathLength;
395 
396  trackState.setReferenceSurface(boundParams.referenceSurface().getSharedPtr());
397 
398  trackState.setProjectorSubspaceIndices(subspaceIndices);
399 
400  Acts::TrackStateType typeFlags = trackState.typeFlags();
401  if (trackState.referenceSurface().surfaceMaterial() != nullptr) {
402  typeFlags.set(Acts::TrackStateFlag::MaterialFlag);
403  }
404  typeFlags.set(Acts::TrackStateFlag::ParameterFlag);
405 
406  // @TODO these track states still need some additional processing. Should there be a special
407  // flag for this ?
408  track_states.push_back( trackState.index());
409  }
410  }
411 
412 
413  // utility struct to temporarily store data about the best measurements
414  template <std::size_t DIM, typename T_SourceLink>
417  typename MeasurementSelectorTraits<derived_t>::template PreSelectionMeasurementCovariance<DIM> >;
419  std::optional<T_SourceLink> m_sourceLink;
420  float m_chi2;
422  };
423 
424  // type and dimension specific function to select measurements from the range defined by the source link iterators.
425  // will iterate over the contiguous measurement range defined by the source link iterators where the measurements
426  // are contained in the given container. The selection lopp will get the measurement and covariance with the
427  // help of a preCalibrator. select measurements based on smallest chi2 wrt. the prediction, then optionally
428  // apply a full calibrator after the selection and finally create track states.
429  template <std::size_t DIM, typename T_MeasurementRange>
430  Acts::Result<boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> >
431  selectMeasurementsCreateTrackStates(const Acts::GeometryContext& geometryContext,
432  const Acts::CalibrationContext& calibrationContext,
433  const Acts::Surface& surface,
434  const T_BoundState& boundState,
435  T_MeasurementRange &&measurement_range,
436  std::size_t prevTip,
437  trajectory_t& trajectory,
438  const Acts::Logger& logger,
439  const std::size_t numMeasurementsCut,
440  const std::pair<float,float>& maxChi2Cut) const {
441  Acts::Result<boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> >
442  result = boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface>{};
443 
444  using iterator_t = decltype(measurement_range.begin());
445  using container_value_t = typename MeasurementSelectorTraits<derived_t>::template MeasurementContainerTraits<iterator_t>::value_type;
446  using BaseElementType = std::remove_cv_t<std::remove_pointer_t< container_value_t > >;
447  // get calibrator
448  using TheMatchingMeasurement = MatchingMeasurement<DIM, container_value_t >;
449  using MeasCovPair = TheMatchingMeasurement::MeasCovPair;
450 
451  using Predicted = typename MeasurementSelectorTraits<derived_t>::template Predicted<DIM>;
452  using PredictedCovariance = typename MeasurementSelectorTraits<derived_t>::template PredictedCovariance<DIM>;
453 
454 
455 
456  // get prediction in the measurement domain
457  Acts::SubspaceIndices<DIM> parameter_map = derived().template parameterMap<DIM>(geometryContext,
458  calibrationContext,
459  surface);
460  auto predicted
461  = std::make_pair( project<DIM, Predicted>(parameter_map,
462  derived().boundParams(boundState).parameters()),
463  project<DIM, PredictedCovariance>(parameter_map,
464  derived().boundParams(boundState).covariance().value()));
465 
466  // select n measurents with the smallest chi2.
467  auto preCalibrator = derived().template preCalibrator<DIM, BaseElementType>();
468  TopCollection<NMeasMax, TheMatchingMeasurement > selected_measurements(numMeasurementsCut);
469  {
470  for ( const auto &measurement : measurement_range ) {
471  TheMatchingMeasurement &matching_measurement=selected_measurements.slot();
472  matching_measurement.m_measurement = preCalibrator(geometryContext,
473  calibrationContext,
474  derived().forwardToCalibrator(measurement),
475  derived().boundParams(boundState));
476  matching_measurement.m_chi2 = computeChi2(matching_measurement.m_measurement.first,
477  matching_measurement.m_measurement.second,
478  predicted.first,
479  predicted.second);
480  // only consider measurements which pass the outlier chi2 cut
481  if (matching_measurement.m_chi2<maxChi2Cut.second) {
482  matching_measurement.m_sourceLink=measurement;
483  selected_measurements.acceptAndSort([](const TheMatchingMeasurement &a,
484  const TheMatchingMeasurement &b) {
485  return a.m_chi2 < b.m_chi2;
486  });
487  }
488  }
489  }
490 
491  // apply final calibration to n-best measurements
492  auto postCalibrator = derived().template postCalibrator<DIM, BaseElementType>();
493  using post_calib_meas_cov_pair_t
495  typename MeasurementSelectorTraits<derived_t>::template CalibratedMeasurementCovariance<DIM> >;
496 
497  // need extra temporary buffer if the types to store "measurements" during measurement selection
498  // and calibrated measurements after the measurement selection are not identical
499  static constexpr bool pre_and_post_calib_types_agree
501  typename MeasurementSelectorTraits<derived_t>::template PreSelectionMeasurement<DIM> >::value
502  && std::is_same< typename MeasurementSelectorTraits<derived_t>::template CalibratedMeasurementCovariance<DIM>,
503  typename MeasurementSelectorTraits<derived_t>::template PreSelectionMeasurementCovariance<DIM> >::value;
504 
505  using Empty = struct {};
506  typename std::conditional< !pre_and_post_calib_types_agree,
507  std::array< post_calib_meas_cov_pair_t, NMeasMax>, // @TODO could use boost static_vector instead
508  Empty>::type calibrated;
509  if (postCalibrator) {
511 
512  // apply final calibration, recompute chi2
514  idx: selected_measurements) {
515  TheMatchingMeasurement &a_selected_measurement = selected_measurements.getSlot(idx);
516 
517  // helper to select the destination storage which is the extra temporary buffer
518  // if the measurement storage types during and after selection are different.
519  post_calib_meas_cov_pair_t &calibrated_measurement
520  = [&calibrated, &a_selected_measurement, calibrated_meas_cov_i]() -> post_calib_meas_cov_pair_t & {
521  if constexpr(pre_and_post_calib_types_agree) {
522  (void) calibrated;
523  (void) calibrated_meas_cov_i;
524  return a_selected_measurement.m_measurement;
525  }
526  else {
527  (void) a_selected_measurement;
528  assert(calibrated_meas_cov_i < calibrated.size());
529  return calibrated[calibrated_meas_cov_i];
530  }
531  }();
532 
533  // apply the calibration
534  calibrated_measurement = postCalibrator(geometryContext,
535  calibrationContext,
536  derived().forwardToCalibrator(a_selected_measurement.m_sourceLink.value()),
537  derived().boundParams(boundState));
538  // update chi2 using calibrated measurement
539  a_selected_measurement.m_chi2 = computeChi2(calibrated_measurement.first,
540  calibrated_measurement.second,
541  predicted.first,
542  predicted.second);
543  // ... and set outlier flag
544  a_selected_measurement.m_isOutLier = (a_selected_measurement.m_chi2 >= maxChi2Cut.first);
545  if constexpr(!pre_and_post_calib_types_agree) {
546  ++calibrated_meas_cov_i;
547  }
548  }
549  }
550  else {
551  // if no final calibration is performed only the outlier flag still needs to be set
553  idx: selected_measurements) {
554  TheMatchingMeasurement &a_selected_measurement = selected_measurements.getSlot(idx);
555  a_selected_measurement.m_isOutLier = (a_selected_measurement.m_chi2 >= maxChi2Cut.first);
556  }
557  }
558 
559  // First Create states without setting information about the calibrated measurement for the selected measurements
560  // @TODO first create state then copy measurements, or crete state by state and set measurements ?
561  // the lastter has the "advantage" that the outlier flag can be set individually
562  // the former has the advantage that part of the state creation code is independent of the
563  // the measurement.
564 
565  Acts::BoundSubspaceIndices boundSubspaceIndices;
566  std::copy(parameter_map.begin(), parameter_map.end(), boundSubspaceIndices.begin());
567  createStates( selected_measurements.size(),
568  boundState,
569  prevTip,
570  trajectory,
571  boundSubspaceIndices,
572  *result,
573  logger,
574  (!selected_measurements.empty()
575  ? selected_measurements.getSlot( *(selected_measurements.begin())).m_isOutLier
576  : false) );
577  assert( result->size() == selected_measurements.size() );
578 
579  // helper to determine whether calibrated storeage is to be used
580  auto use_calibrated_storage = [&postCalibrator]() -> bool {
581  if constexpr(pre_and_post_calib_types_agree) {
582  (void) postCalibrator;
583  return false;
584  }
585  else {
586  // this is only known during runtime
587  // but it should not be tested if the types agree.
588  return postCalibrator;
589  }
590  };
591 
592  // copy selected measurements to pre-created states
593  unsigned int state_i=0;
595  idx: selected_measurements) {
596  assert( state_i < result->size());
597  TrackStateProxy trackState( trajectory.getTrackState( (*result)[state_i] ) );
598  TheMatchingMeasurement &a_selected_measurement = selected_measurements.getSlot(idx);
599  trackState.setUncalibratedSourceLink(derived().makeSourceLink(std::move(a_selected_measurement.m_sourceLink.value())));
600  // flag outliers accordingly, so that they are handled correctly by the post processing
601  trackState.typeFlags().set( a_selected_measurement.m_isOutLier
602  ? Acts::TrackStateFlag::OutlierFlag
603  : Acts::TrackStateFlag::MeasurementFlag );
604  trackState.allocateCalibrated(DIM);
605  if (use_calibrated_storage()) {
606  // if the final clibration is performed after the selection then
607  // copy these measurements and covariances to the track states
608  assert( use_calibrated_storage() == !pre_and_post_calib_types_agree);
609  if constexpr(!pre_and_post_calib_types_agree) {
610  assert( state_i < calibrated.size());
611  trackState.template calibrated<DIM>()
612  = MeasurementSelectorMatrixTraits::matrixTypeCast<typename MeasurementSelectorTraits<derived_t>::MatrixFloatType>(calibrated[state_i].first);
613  trackState.template calibratedCovariance<DIM>()
614  = MeasurementSelectorMatrixTraits::matrixTypeCast<typename MeasurementSelectorTraits<derived_t>::MatrixFloatType>(calibrated[state_i].second);
615  trackState.chi2() = a_selected_measurement.m_chi2;
616  }
617  }
618  else {
619  trackState.template calibrated<DIM>()
620  = MeasurementSelectorMatrixTraits::matrixTypeCast<typename MeasurementSelectorTraits<derived_t>::MatrixFloatType>(a_selected_measurement.m_measurement.first);
621  trackState.template calibratedCovariance<DIM>()
622  = MeasurementSelectorMatrixTraits::matrixTypeCast<typename MeasurementSelectorTraits<derived_t>::MatrixFloatType>(a_selected_measurement.m_measurement.second);
623  trackState.chi2() = a_selected_measurement.m_chi2;
624  }
625  ++state_i;
626  }
627  return result;
628  }
629 
630  template <typename parameters_t>
631  static std::size_t getEtaBin(const parameters_t& boundParameters,
632  const std::vector<float> &etaBins) {
633  if (etaBins.empty()) {
634  return 0u; // shortcut if no etaBins
635  }
636  const float eta = std::abs(std::atanh(std::cos(boundParameters.parameters()[Acts::eBoundTheta])));
637  std::size_t bin = 0;
638  for (auto etaBin : etaBins) {
639  if (etaBin >= eta) {
640  break;
641  }
642  bin++;
643  }
644  return bin;
645  }
646 
647 public:
648  // get numMeasurement and maxChi2 cuts for the given surface
649  // @TODO should the cuts just depend on the surface or really on the bound parameters (i.e. bound eta)
650  std::tuple< std::size_t, std::pair<float,float> > getCuts(const Acts::Surface& surface,
651  const T_BoundState& boundState,
652  const Acts::Logger& logger) const {
653  std::tuple< std::size_t, std::pair<float,float> > result;
654  std::size_t &numMeasurementsCut = std::get<0>(result);
655  std::pair<float,float> &maxChi2Cut = std::get<1>(result);
656  // Get geoID of this surface
657  auto geoID = surface.geometryId();
658  // Find the appropriate cuts
659  auto cuts = m_config.find(geoID);
660  if (cuts == m_config.end()) {
661  // indicats failure
662  numMeasurementsCut = 0;
663  }
664  else {
665  // num measurement Cut
666  // getchi2 cut
667  std::size_t eta_bin = getEtaBin(derived().boundParams(boundState), cuts->etaBins);
668  numMeasurementsCut = (!cuts->numMeasurementsCutOff.empty()
669  ? cuts->numMeasurementsCutOff[ std::min(cuts->numMeasurementsCutOff.size()-1, eta_bin) ]
670  : NMeasMax);
671  maxChi2Cut = ! cuts->chi2CutOff.empty()
672  ? cuts->chi2CutOff[ std::min(cuts->chi2CutOff.size()-1, eta_bin) ]
673  : std::make_pair<float,float>(std::numeric_limits<float>::max(),
675  ACTS_VERBOSE("Get cut for eta-bin="
676  << (eta_bin < cuts->etaBins.size() ? cuts->etaBins[eta_bin] : std::numeric_limits<float>::max())
677  << ": chi2 (max,max-outlier) " << maxChi2Cut.first << ", " << maxChi2Cut.second
678  << " max.meas." << numMeasurementsCut);
679  }
680  return result;
681  }
682 };
683 
684 // Measurement selector which calls a type specific selection method
685 // the measurement selector expects a list of measurement containers to be provided
686 // by the source link iterators as well as the index of the container to be used for the
687 // given measurement range, which is defined by the source link iterators.
688 // the measurement range must refer to a contiguous range of measurements contained
689 // within a single measurement container.
690 // The "container" itself is a variant of particular measurement containers with associated
691 // dimension i.e. number of coordinates per measurement. A member funcion specific to one of
692 // the alternatives of the variant will be called to perform the selection and track state
693 // creation.
694 template <std::size_t NMeasMax,
695  typename derived_t,
696  typename measurement_container_variant_t >
697 struct MeasurementSelectorWithDispatch : public MeasurementSelectorBase< NMeasMax, MeasurementSelectorTraits<derived_t>::s_dimMax, derived_t> {
698 
704 
705  // helper to get the maximum number of measurement diemsions.
706  static constexpr std::size_t dimMax() {
708  }
709 
710  Acts::Result<boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> >
711  createTrackStates(const Acts::GeometryContext& geometryContext,
712  const Acts::CalibrationContext& calibrationContext,
713  const Acts::Surface& surface,
714  const T_BoundState& boundState,
715  typename TrackStateProxy::IndexType prevTip,
716  [[maybe_unused]] std::vector<TrackStateProxy>& trackStateCandidates,
717  trajectory_t& trajectory,
718  const Acts::Logger& logger) const {
719 
720  Acts::Result<boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> >
721  result = Acts::CombinatorialKalmanFilterError::MeasurementSelectionFailed;
722  // get associated measurement container and the relevant measurement range for the given surface.
723  auto [a_measurement_container_variant_ptr, range] = this->derived().containerAndRange(surface);
724  if (!range.empty()) {
725  auto [numMeasurementsCut, maxChi2Cut] = this->getCuts(surface,boundState, logger);
726  // numMeasurementsCut is == 0 in case getCuts failed
727  // anyway cannot select anything if numMeasurementsCut==0;
728  if (numMeasurementsCut>0) {
729 
730  result = std::visit( [this,
731  &geometryContext,
732  &calibrationContext,
733  &surface,
734  &boundState,
735  &range,
736  prevTip,
737  &trajectory,
738  &logger,
739  numMeasurementsCut,
740  &maxChi2Cut] (const auto &measurement_container_with_dimension) {
741  using ArgType = std::remove_cv_t<std::remove_reference_t< decltype(measurement_container_with_dimension) > >;
742  constexpr std::size_t DIM = ArgType::dimension();
743  auto measurement_range = this->derived().rangeForContainer(measurement_container_with_dimension,range);
744  return
745  this->template
746  selectMeasurementsCreateTrackStates<DIM, decltype(measurement_range)>(geometryContext,
747  calibrationContext,
748  surface,
749  boundState,
750  std::move(measurement_range),
751  prevTip,
752  trajectory,
753  logger,
754  numMeasurementsCut,
755  maxChi2Cut);
756  },
757  *a_measurement_container_variant_ptr);
758  }
759  }
760  else {
761  result = Acts::Result<boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface> >::success({});
762  }
763  return result;
764  }
765 };
766 
767 template <std::size_t NMeasMax,
768  typename derived_t,
769  typename measurement_container_variant_t>
770 struct MeasurementSelectorBaseImpl : public MeasurementSelectorWithDispatch<NMeasMax, derived_t, measurement_container_variant_t> {
773 
774  // get the bound parameters and covariance of the bound state
776  return std::get<0>(boundState);
777  }
778 
779  // get the jacobi matrix of the bound state
781  return std::get<1>(boundState);
782  }
783  // get the accumulated path length of the bound state
784  static double pathLength(const T_BoundState &boundState) {
785  return std::get<2>(boundState);
786  }
787 
788  // create a source link from the measurement
789  template <typename T_Value>
790  static Acts::SourceLink makeSourceLink(T_Value &&value) {
791  return Acts::SourceLink{value};
792  }
793 
794  // perform simple transformation to cerate the type
795  // that is passed to the calibrator.
796  // by default pass the measurement by reference not pointer
797  template <typename T>
798  static const auto &forwardToCalibrator(const T &a) {
799  if constexpr( std::is_same<T, std::remove_pointer_t<T> >::value ) {
800  return a;
801  }
802  else {
803  return *a;
804  }
805  }
806 
807 
808  // get mapping between bound state parameters and coordinates in the measurement domain
809  // in most cases this is just the identity operation e.g. loc0 -> coord0 and loc1 -> coord1
810  // i.e. map[0]=0; map[1]=1;
811  // @TODO should this be measurement type specific, or is dimension and the surface good enough ?
812  template <std::size_t DIM>
814  parameterMap(const Acts::GeometryContext&,
815  const Acts::CalibrationContext&,
816  const Acts::Surface&) {
817  return ParameterMapping::identity<DIM>();
818  }
819 
820  // By default the methods postCalibrator and preCalibrator return delegates:
821  template <std::size_t DIM, typename measurement_t>
822  using PreCalibrator = Acts::Delegate<
824  typename MeasurementSelectorTraits<derived_t>::template PreSelectionMeasurementCovariance<DIM> >
825  (const Acts::GeometryContext&,
826  const Acts::CalibrationContext&,
827  const measurement_t &,
829 
830  // Since the measurement types used during measurement selection and after measurement selection
831  // might be different so are the types of the calibrator delegates
832  template <std::size_t DIM, typename measurement_t>
833  using PostCalibrator = Acts::Delegate<
835  typename MeasurementSelectorTraits<derived_t>::template CalibratedMeasurementCovariance<DIM> >
836  (const Acts::GeometryContext&,
837  const Acts::CalibrationContext&,
838  const measurement_t &,
840 
844  template <std::size_t DIM, typename measurement_t>
846  postCalibrator() const; // not implemented
847 
848  // the "calibrator" which is used during the measuremnt selection
850  // this delegate must be connected or be a valid functor. If not this likely will lead to an
851  // exception or seg fault.
852  template <std::size_t DIM, typename measurement_t>
854  preCalibrator() const; // not implemented
855 
856 
861  std::tuple<const measurement_container_variant_t &, abstract_measurement_range_t>
862  containerAndRange(const Acts::Surface &surface) const; // not implemented
863 
868  template <typename measurement_container_t>
869  static auto
870  rangeForContainer(const measurement_container_t &concrete_container, const abstract_measurement_range_t &abstract_range);
871 };
MeasurementSelectorBase::ProjectorBitSetMaker
Definition: MeasurementSelector.h:323
MeasurementSelectorTraits::abstract_measurement_range_t
std::ranges::iota_view< unsigned int, unsigned int > abstract_measurement_range_t
Definition: MeasurementSelector.h:82
TopCollection::m_slots
std::array< PayloadType, N+1 > m_slots
Definition: MeasurementSelector.h:281
MeasurementSelectorBase< NMeasMax, MeasurementSelectorTraits< derived_t >::s_dimMax, derived_t >::TrackStateProxy
typename MeasurementSelectorTraits< derived_t >::TrackStateProxy TrackStateProxy
Definition: MeasurementSelector.h:317
ParameterMapping::type
std::array< unsigned char, N > type
Definition: MeasurementSelector.h:134
MeasurementSelectorTraits::BoundState
std::tuple< BoundTrackParameters, BoundMatrix, double > BoundState
Definition: MeasurementSelector.h:94
get_generator_info.result
result
Definition: get_generator_info.py:21
MeasurementSelectorWithDispatch::createTrackStates
Acts::Result< boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface > > createTrackStates(const Acts::GeometryContext &geometryContext, const Acts::CalibrationContext &calibrationContext, const Acts::Surface &surface, const T_BoundState &boundState, typename TrackStateProxy::IndexType prevTip, [[maybe_unused]] std::vector< TrackStateProxy > &trackStateCandidates, trajectory_t &trajectory, const Acts::Logger &logger) const
Definition: MeasurementSelector.h:711
MeasurementSelectorTraits::s_dimMax
static const std::size_t s_dimMax
Definition: MeasurementSelector.h:97
MeasurementSelectorBaseImpl::parameterMap
ParameterMapping::type< DIM > parameterMap(const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::Surface &)
Definition: MeasurementSelector.h:814
MeasurementSelectorTraits::MeasurementContainerTraits
Definition: MeasurementSelector.h:74
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAOD::short
short
Definition: Vertex_v1.cxx:165
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MeasurementSelectorWithDispatch::trajectory_t
typename Base::trajectory_t trajectory_t
Definition: MeasurementSelector.h:701
MeasurementSelectorTraits::MatrixFloatType
double MatrixFloatType
Definition: MeasurementSelector.h:90
MeasurementSelectorBase::MatchingMeasurement
Definition: MeasurementSelector.h:415
MeasurementSelectorBaseImpl::PreCalibrator
Acts::Delegate< std::pair< typename MeasurementSelectorTraits< derived_t >::template PreSelectionMeasurement< DIM >, typename MeasurementSelectorTraits< derived_t >::template PreSelectionMeasurementCovariance< DIM > >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const measurement_t &, const typename MeasurementSelectorTraits< derived_t >::BoundTrackParameters &)> PreCalibrator
Definition: MeasurementSelector.h:828
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MeasurementSelectorBaseImpl::boundJacobiMatrix
static const MeasurementSelectorTraits< derived_t >::BoundMatrix & boundJacobiMatrix(const T_BoundState &boundState)
Definition: MeasurementSelector.h:780
ConvertOldUJHistosToNewHistos.etaBins
list etaBins
Definition: ConvertOldUJHistosToNewHistos.py:145
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
MeasurementSelectorBase::s_maxBranchesPerSurface
static constexpr std::size_t s_maxBranchesPerSurface
Definition: MeasurementSelector.h:318
taskman.template
dictionary template
Definition: taskman.py:317
bin
Definition: BinsDiffFromStripMedian.h:43
MeasurementSelectorBase::getCuts
std::tuple< std::size_t, std::pair< float, float > > getCuts(const Acts::Surface &surface, const T_BoundState &boundState, const Acts::Logger &logger) const
Definition: MeasurementSelector.h:650
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
athena.value
value
Definition: athena.py:124
MeasurementSelectorTraits::CalibratedMeasurementCovariance
typename Acts::detail_lt::FixedSizeTypes< N >::Covariance CalibratedMeasurementCovariance
Definition: MeasurementSelector.h:50
MeasurementSelectorBaseImpl::containerAndRange
std::tuple< const measurement_container_variant_t &, abstract_measurement_range_t > containerAndRange(const Acts::Surface &surface) const
Get container and index range for measurements on the given surface.
TopCollection::slot
PayloadType & slot()
Definition: MeasurementSelector.h:237
MeasurementSelectorWithDispatch::T_BoundState
typename Base::T_BoundState T_BoundState
Definition: MeasurementSelector.h:700
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
TopCollection::IndexType
unsigned short IndexType
Definition: MeasurementSelector.h:220
MeasurementSelectorTraits::BoundMatrix
Acts::BoundMatrix BoundMatrix
Definition: MeasurementSelector.h:92
MeasurementSelectorTraits::PreSelectionMeasurement
typename Acts::detail_lt::FixedSizeTypes< N >::Coefficients PreSelectionMeasurement
Definition: MeasurementSelector.h:55
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TopCollection::m_order
std::array< IndexType, N+1 > m_order
Definition: MeasurementSelector.h:282
MeasurementSelectorMatrixTraits
Definition: MeasurementSelector.h:105
MeasurementSelectorWithDispatch
Definition: MeasurementSelector.h:697
MeasurementSelectorBaseImpl::PostCalibrator
Acts::Delegate< std::pair< typename MeasurementSelectorTraits< derived_t >::template CalibratedMeasurement< DIM >, typename MeasurementSelectorTraits< derived_t >::template CalibratedMeasurementCovariance< DIM > >(const Acts::GeometryContext &, const Acts::CalibrationContext &, const measurement_t &, const typename MeasurementSelectorTraits< derived_t >::BoundTrackParameters &)> PostCalibrator
Definition: MeasurementSelector.h:839
MeasurementSelectorBaseImpl::postCalibrator
const PostCalibrator< DIM, measurement_t > & postCalibrator() const
the calibrator used after the measurement selection which does not have to be "connected"
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MeasurementSelectorWithDispatch::TrackStateProxy
typename Base::TrackStateProxy TrackStateProxy
Definition: MeasurementSelector.h:702
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
MeasurementSelectorWithDispatch::s_maxBranchesPerSurface
static constexpr std::size_t s_maxBranchesPerSurface
Definition: MeasurementSelector.h:703
MeasurementSelectorBase::MatchingMeasurement::m_chi2
float m_chi2
Definition: MeasurementSelector.h:420
MeasurementSelectorMatrixTraits::invert
static auto invert(const T_Matrix &matrix)
Definition: MeasurementSelector.h:120
MeasurementSelectorBase::derived
const derived_t & derived() const
Definition: MeasurementSelector.h:320
ParameterMapping
Definition: MeasurementSelector.h:131
TopCollection::m_maxSlots
IndexType m_maxSlots
Definition: MeasurementSelector.h:284
MeasurementSelectorBase
Definition: MeasurementSelector.h:307
MeasurementSelectorWithDispatch::dimMax
static constexpr std::size_t dimMax()
Definition: MeasurementSelector.h:706
MeasurementSelectorBase< NMeasMax, MeasurementSelectorTraits< derived_t >::s_dimMax, derived_t >::T_BoundState
typename MeasurementSelectorTraits< derived_t >::BoundState T_BoundState
Definition: MeasurementSelector.h:315
MeasurementSelectorTraits::trajectory_t
typename derived_t::traj_t trajectory_t
Definition: MeasurementSelector.h:85
MeasurementSelectorTraits::PreSelectionMeasurementCovariance
typename Acts::detail_lt::FixedSizeTypes< N >::Covariance PreSelectionMeasurementCovariance
Definition: MeasurementSelector.h:60
MeasurementSelectorMatrixTraits::matrixTypeCast
static auto matrixTypeCast(const T_Matrix &matrix)
Definition: MeasurementSelector.h:114
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TopCollection::getSlot
PayloadType & getSlot(IndexType idx)
Definition: MeasurementSelector.h:247
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
ActsTrk::IndexType
std::uint32_t IndexType
Definition: Decoration.h:14
TopCollection::m_nextSlot
IndexType m_nextSlot
Definition: MeasurementSelector.h:283
MeasurementSelectorTraits::CalibratedMeasurement
typename Acts::detail_lt::FixedSizeTypes< N >::Coefficients CalibratedMeasurement
Definition: MeasurementSelector.h:46
MeasurementSelectorTraits::BoundTrackParameters
Acts::BoundTrackParameters BoundTrackParameters
Definition: MeasurementSelector.h:91
MeasurementSelectorBase::MatchingMeasurement::m_sourceLink
std::optional< T_SourceLink > m_sourceLink
Definition: MeasurementSelector.h:419
MeasurementSelectorBaseImpl::forwardToCalibrator
static const auto & forwardToCalibrator(const T &a)
Definition: MeasurementSelector.h:798
MeasurementSelectorBase::createStates
static void createStates(std::size_t n_new_states, const T_BoundState &boundState, std::size_t prevTip, trajectory_t &trajectory, const Acts::BoundSubspaceIndices &subspaceIndices, boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface > &track_states, const Acts::Logger &logger, bool outlier_states)
Definition: MeasurementSelector.h:346
lumiFormat.i
int i
Definition: lumiFormat.py:85
TopCollection::acceptAndSort
void acceptAndSort(std::function< bool(const PayloadType &a, const PayloadType &b)> comparison)
Definition: MeasurementSelector.h:257
MeasurementSelectorBase::ProjectorBitSetMaker::create
static Acts::ProjectorBitset create(const ParameterMapping::type< N > &parameter_map)
Definition: MeasurementSelector.h:326
MeasurementSelectorBaseImpl::pathLength
static double pathLength(const T_BoundState &boundState)
Definition: MeasurementSelector.h:784
AtlasMeasurementSelectorCuts
Definition: MeasurementSelector.h:289
MeasurementSelectorMatrixTraits::transpose
static auto transpose(const T_Matrix &matrix)
Definition: MeasurementSelector.h:117
MeasurementSelectorMatrixTraits::matrixRows
static constexpr std::size_t matrixRows()
Definition: MeasurementSelector.h:111
TopCollection::end
std::array< IndexType, N+1 >::const_iterator end()
Definition: MeasurementSelector.h:279
MeasurementSelectorTraits::Predicted
typename Acts::detail_lt::FixedSizeTypes< N >::Coefficients Predicted
Definition: MeasurementSelector.h:64
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
MeasurementSelectorBase< NMeasMax, MeasurementSelectorTraits< derived_t >::s_dimMax, derived_t >::trajectory_t
typename MeasurementSelectorTraits< derived_t >::trajectory_t trajectory_t
Definition: MeasurementSelector.h:316
MeasurementSelectorTraits::s_maxBranchesPerSurface
static constexpr std::size_t s_maxBranchesPerSurface
Definition: MeasurementSelector.h:101
plotBeamSpotVert.cuts
string cuts
Definition: plotBeamSpotVert.py:93
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
MeasurementSelectorBaseImpl::abstract_measurement_range_t
MeasurementSelectorTraits< derived_t >::abstract_measurement_range_t abstract_measurement_range_t
Definition: MeasurementSelector.h:772
TopCollection::begin
std::array< IndexType, N+1 >::const_iterator begin()
Definition: MeasurementSelector.h:278
AtlasMeasurementSelectorCuts::chi2CutOff
std::vector< std::pair< float, float > > chi2CutOff
Maximum local chi2 contribution.
Definition: MeasurementSelector.h:293
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
TopCollection::getSlot
const PayloadType & getSlot(IndexType idx) const
Definition: MeasurementSelector.h:242
AtlasMeasurementSelectorCuts::numMeasurementsCutOff
std::vector< std::size_t > numMeasurementsCutOff
Maximum number of associated measurements on a single surface.
Definition: MeasurementSelector.h:295
MeasurementSelectorBaseImpl::makeSourceLink
static Acts::SourceLink makeSourceLink(T_Value &&value)
Definition: MeasurementSelector.h:790
MeasurementSelectorBase::MatchingMeasurement::m_isOutLier
bool m_isOutLier
Definition: MeasurementSelector.h:421
Config
Definition: dumpNPs.cxx:47
MeasurementSelectorBase::selectMeasurementsCreateTrackStates
Acts::Result< boost::container::small_vector< typename TrackStateProxy::IndexType, s_maxBranchesPerSurface > > selectMeasurementsCreateTrackStates(const Acts::GeometryContext &geometryContext, const Acts::CalibrationContext &calibrationContext, const Acts::Surface &surface, const T_BoundState &boundState, T_MeasurementRange &&measurement_range, std::size_t prevTip, trajectory_t &trajectory, const Acts::Logger &logger, const std::size_t numMeasurementsCut, const std::pair< float, float > &maxChi2Cut) const
Definition: MeasurementSelector.h:431
doL1CaloHVCorrections.eta_bin
eta_bin
Definition: doL1CaloHVCorrections.py:368
TopCollection::size
IndexType size() const
Definition: MeasurementSelector.h:275
TopCollection::TopCollection
TopCollection(std::size_t max_n)
Definition: MeasurementSelector.h:223
MeasurementSelectorBaseImpl::rangeForContainer
static auto rangeForContainer(const measurement_container_t &concrete_container, const abstract_measurement_range_t &abstract_range)
Create a range over elements of the given container from an abstract range.
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
MeasurementSelectorBaseImpl::preCalibrator
const PreCalibrator< DIM, measurement_t > & preCalibrator() const
ParameterMapping::identity
static constexpr type< N > identity()
Definition: MeasurementSelector.h:137
MeasurementSelectorBase::getEtaBin
static std::size_t getEtaBin(const parameters_t &boundParameters, const std::vector< float > &etaBins)
Definition: MeasurementSelector.h:631
project
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
Definition: MeasurementSelector.h:149
MeasurementSelectorBaseImpl::boundParams
static const MeasurementSelectorTraits< derived_t >::BoundTrackParameters & boundParams(const T_BoundState &boundState)
Definition: MeasurementSelector.h:775
MeasurementSelectorTraits
Definition: MeasurementSelector.h:43
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
MuonR4::SegmentFit::Covariance
AmgSymMatrix(toInt(ParamDefs::nPars)) Covariance
Definition: MuonHoughDefs.h:49
MeasurementSelectorTraits::TrackStateProxy
trajectory_t::TrackStateProxy TrackStateProxy
Definition: MeasurementSelector.h:87
a
TList * a
Definition: liststreamerinfos.cxx:10
MeasurementSelectorBase::MatchingMeasurement::m_measurement
MeasCovPair m_measurement
Definition: MeasurementSelector.h:418
MeasurementSelectorBaseImpl
Definition: MeasurementSelector.h:770
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MeasurementSelectorBase::MatchingMeasurement::MeasCovPair
std::pair< typename MeasurementSelectorTraits< derived_t >::template PreSelectionMeasurement< DIM >, typename MeasurementSelectorTraits< derived_t >::template PreSelectionMeasurementCovariance< DIM > > MeasCovPair
Definition: MeasurementSelector.h:417
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
calibdata.copy
bool copy
Definition: calibdata.py:27
computeChi2
double computeChi2(const measurement_vector_t &a, const measurement_cov_matrix_t &a_cov, const predicted_vector_t &b, const predicted_cov_matrix_t &b_cov)
Definition: MeasurementSelector.h:188
TopCollection::init
void init(std::size_t max_n)
Definition: MeasurementSelector.h:229
MeasurementSelectorTraits::PredictedCovariance
typename Acts::detail_lt::FixedSizeTypes< N >::Covariance PredictedCovariance
Definition: MeasurementSelector.h:68
TopCollection
Definition: MeasurementSelector.h:219
MeasurementSelectorMatrixTraits::matrixColumns
static constexpr std::size_t matrixColumns()
matrix adapter for Eigen additionally need +,- and *
Definition: MeasurementSelector.h:109
value_type
Definition: EDM_MasterSearch.h:11
AtlasMeasurementSelectorCuts::etaBins
std::vector< float > etaBins
bins in |eta| to specify variable selections
Definition: MeasurementSelector.h:291
Trk::TrackState::TrackStateType
TrackStateType
enum describing the role of track states during cleaning and outlier removal.
Definition: TrackStateDefs.h:51
MeasurementSelectorBase::m_config
Config m_config
Definition: MeasurementSelector.h:312
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TopCollection::empty
bool empty() const
Definition: MeasurementSelector.h:271
TopCollection::isValid
bool isValid(IndexType idx) const
Definition: MeasurementSelector.h:251