ATLAS Offline Software
Classes | Functions
MeasurementSelector.h File Reference
#include "Acts/Utilities/Result.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/EventData/SourceLink.hpp"
#include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Geometry/GeometryHierarchyMap.hpp"
#include "Acts/EventData/Types.hpp"
#include "Acts/EventData/TrackStatePropMask.hpp"
#include "boost/container/small_vector.hpp"
#include "Acts/EventData/TrackStateProxy.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
#include <utility>
#include <type_traits>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MeasurementSelectorTraits< derived_t >
 
struct  MeasurementSelectorTraits< derived_t >::MeasurementContainerTraits< T_Container >
 
struct  MeasurementSelectorMatrixTraits
 
struct  ParameterMapping
 
struct  TopCollection< N, PayloadType >
 
struct  AtlasMeasurementSelectorCuts
 
struct  MeasurementSelectorBase< NMeasMax, DIMMAX, derived_t >
 
struct  MeasurementSelectorBase< NMeasMax, DIMMAX, derived_t >::ProjectorBitSetMaker
 
struct  MeasurementSelectorBase< NMeasMax, DIMMAX, derived_t >::MatchingMeasurement< DIM, T_SourceLink >
 
struct  MeasurementSelectorBase< NMeasMax, DIMMAX, derived_t >::MeasurementRange< T >
 
struct  MeasurementSelectorWithDispatch< NMeasMax, derived_t, measurement_container_variant_t >
 
struct  MeasurementSelectorBaseImpl< NMeasMax, derived_t, measurement_container_variant_t >
 

Functions

template<std::size_t N, class T_ResultType , class T_Matrix >
T_ResultType project (ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
 
template<typename measurement_vector_t , typename measurement_cov_matrix_t , typename predicted_vector_t , typename predicted_cov_matrix_t >
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)
 

Function Documentation

◆ computeChi2()

template<typename measurement_vector_t , typename measurement_cov_matrix_t , typename predicted_vector_t , typename predicted_cov_matrix_t >
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 at line 181 of file MeasurementSelector.h.

184  {
185 
186  // just sum sanity checks that a and b have the correct dimensions and that
187  // the chi2 can actually be computed.
188  static_assert( MeasurementSelectorMatrixTraits::matrixColumns<measurement_vector_t>() == 1); // a is vector
189  static_assert( MeasurementSelectorMatrixTraits::matrixColumns<predicted_vector_t>() == 1); // b is vector
190  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
191  == MeasurementSelectorMatrixTraits::matrixColumns<measurement_cov_matrix_t>() ); // a is square matrix
192  static_assert( MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>()
193  == MeasurementSelectorMatrixTraits::matrixColumns<predicted_cov_matrix_t>() ); // b is square matrix
194  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
195  == MeasurementSelectorMatrixTraits::matrixRows<measurement_vector_t>() ); // a vector matches matrix
196  static_assert( MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>()
197  == MeasurementSelectorMatrixTraits::matrixRows<predicted_vector_t>() ); // b vector matches matrix
198  static_assert( MeasurementSelectorMatrixTraits::matrixRows<measurement_cov_matrix_t>()
199  == MeasurementSelectorMatrixTraits::matrixRows<predicted_cov_matrix_t>() ); // a and b match
200 
201  // @TODO remove abstraction i.e. assume matrix has the interface of an eigen matrix
202  auto inv_ab_cov( MeasurementSelectorMatrixTraits::invert(a_cov+b_cov) );
203  auto diff( a-b);
204  return (MeasurementSelectorMatrixTraits::transpose(diff) * inv_ab_cov * diff)(0,0);
205 }

◆ project()

template<std::size_t N, class T_ResultType , class T_Matrix >
T_ResultType project ( ParameterMapping::type< N >  parameter_map,
const T_Matrix &  matrix 
)

Definition at line 142 of file MeasurementSelector.h.

143 {
144  using MatrixIndexMapType = unsigned char; // "char" to reduce the size of the map, and if not wide enough this entire
145  // concept is likely inefficient.
146  using MatrixIndexType = unsigned int; // @TODO or std::size_t ? does not matter
147 
148  // ensure that index types are wide enough
149  static_assert( MeasurementSelectorMatrixTraits::matrixRows<T_Matrix>() < std::numeric_limits<MatrixIndexMapType>::max());
150  static_assert( N*MeasurementSelectorMatrixTraits::matrixRows<T_Matrix>() < std::numeric_limits<MatrixIndexType>::max());
151 
152  T_ResultType ret;
153  if constexpr(MeasurementSelectorMatrixTraits::matrixColumns<T_Matrix>() == 1) {
154  // handle projection of paramteter vector
155  for (MatrixIndexType meas_i=0; meas_i<N; ++meas_i) {
156  assert( meas_i < parameter_map.size() );
157  ret(meas_i,0) = matrix( parameter_map[meas_i], 0);
158  }
159  }
160  else {
161  // handle projection of covariance matrix
162  // "project" matrix
163  for (MatrixIndexType meas_i=0; meas_i<N; ++meas_i) {
164  assert( meas_i < parameter_map.size());
165  MatrixIndexType param_i = parameter_map[meas_i];
166  for (MatrixIndexType meas_j=0; meas_j<N; ++meas_j) {
167  assert( meas_j < parameter_map.size());
168  ret(meas_i,meas_j) = matrix(param_i, parameter_map[meas_j]);
169  }
170  }
171  }
172  return ret;
173 }
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
MeasurementSelectorMatrixTraits::invert
static auto invert(const T_Matrix &matrix)
Definition: MeasurementSelector.h:113
MeasurementSelectorMatrixTraits::transpose
static auto transpose(const T_Matrix &matrix)
Definition: MeasurementSelector.h:110
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
a
TList * a
Definition: liststreamerinfos.cxx:10