Commit 44cba0d8 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (TrkMeasurementUpdator_xk-01-00-06)

parent acd7664e
################################################################################
# Package: TrkMeasurementUpdator_xk
################################################################################
# Declare the package name:
atlas_subdir( TrkMeasurementUpdator_xk )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
Tracking/TrkTools/TrkToolInterfaces
PRIVATE
GaudiKernel
Tracking/TrkEvent/TrkEventPrimitives
Tracking/TrkEvent/TrkParameters
Tracking/TrkEvent/TrkPatternParameters )
# Component(s) in the package:
atlas_add_component( TrkMeasurementUpdator_xk
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps TrkToolInterfaces GaudiKernel TrkEventPrimitives TrkParameters TrkPatternParameters )
# Install files from the package:
atlas_install_headers( TrkMeasurementUpdator_xk )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
// KalmanUpdator_xk.h
// Header file for Kalman Fitter Updator
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
/////////////////////////////////////////////////////////////////////////////////
// Version 1.0 7/6/2005 I.Gavrilenko
/////////////////////////////////////////////////////////////////////////////////
#ifndef TRK_KALMANUPDATOR_XK_H
#define TRK_KALMANUPDATOR_XK_H
#include "TrkToolInterfaces/IUpdator.h"
#include "TrkToolInterfaces/IPatternParametersUpdator.h"
#include "AthenaBaseComps/AthAlgTool.h"
namespace Trk {
/**
@class KalmanUpdator_xk
Trk::KalmanUpdator_xk is a set of tools for adding and removing
measurements to/from the state vector using xKalman algorithms
@author Igor.Gavrilenko@cern.ch
*/
class LocalParameters ;
class PatternTrackParameters;
class KalmanUpdator_xk : virtual public IUpdator,
virtual public IPatternParametersUpdator,
public AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
///////////////////////////////////////////////////////////////////
// Standard Athena tool methods
///////////////////////////////////////////////////////////////////
KalmanUpdator_xk
(const std::string&,const std::string&,const IInterface*);
virtual ~KalmanUpdator_xk ();
virtual StatusCode initialize();
virtual StatusCode finalize ();
// /////////////////////////////////////////////////////////////////
// Main public methods for kalman filter updator tool
// /////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////
// Add and remove without Xi2 calculation
// /////////////////////////////////////////////////////////////////
//! add without chi2 calculation, PRD-level, EDM track parameters
virtual const TrackParameters* addToState
(const TrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&) const;
//! add without chi2 calculation, ROT-level, EDM track parameters
virtual const TrackParameters* addToState
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&) const;
//! add without chi2 calculation, PRD-level, pattern track parameters
virtual bool addToState
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&) const;
//! add without chi2 calculation, ROT-level, pattern track parameters
virtual bool addToState
(PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,
PatternTrackParameters&) const;
//! add without chi2 calculation, PRD-level, pattern track parameters, specifically 1D
virtual bool addToStateOneDimension
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Remove without Xi2 calculation
///////////////////////////////////////////////////////////////////
virtual const TrackParameters* removeFromState
(const TrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&) const;
virtual const TrackParameters* removeFromState
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&) const;
virtual bool removeFromState
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&) const;
virtual bool removeFromState
(PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,
PatternTrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Add with Xi2 calculation
///////////////////////////////////////////////////////////////////
virtual const TrackParameters* addToState
(const TrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
FitQualityOnSurface*&) const;
virtual const TrackParameters* addToState
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&,
FitQualityOnSurface*&) const;
virtual std::pair<AmgVector(5),AmgSymMatrix(5)>* updateParameterDifference
(const AmgVector(5)&,const AmgSymMatrix(5)&, const Amg::VectorX&, const Amg::MatrixX&,
const int&,Trk::FitQualityOnSurface*&,bool) const;
virtual bool addToState
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&,double&,int&) const;
virtual bool addToState
(PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,
PatternTrackParameters&,double&,int&) const;
virtual bool addToStateOneDimension
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&,double&,int&) const;
///////////////////////////////////////////////////////////////////
// Remove with Xi2 calculation
///////////////////////////////////////////////////////////////////
virtual const TrackParameters* removeFromState
(const TrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
FitQualityOnSurface*&) const;
virtual const TrackParameters* removeFromState
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&,
FitQualityOnSurface*&) const;
virtual bool removeFromState
(PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,
PatternTrackParameters&,double&,int&) const;
virtual bool removeFromState
(PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,
PatternTrackParameters&,double&,int&) const;
///////////////////////////////////////////////////////////////////
// Combine two state with or without Xi2 calculation
///////////////////////////////////////////////////////////////////
virtual const TrackParameters* combineStates
(const TrackParameters&, const TrackParameters&) const;
virtual const TrackParameters* combineStates
(const TrackParameters&, const TrackParameters&,
FitQualityOnSurface*&) const;
virtual bool combineStates
(PatternTrackParameters&,PatternTrackParameters&,PatternTrackParameters&) const;
virtual bool combineStates
(PatternTrackParameters&,PatternTrackParameters&,PatternTrackParameters&,
double&) const;
///////////////////////////////////////////////////////////////////
// Xi2 calculation
///////////////////////////////////////////////////////////////////
virtual const FitQualityOnSurface* predictedStateFitQuality
(const TrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&) const;
virtual const FitQualityOnSurface* predictedStateFitQuality
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&) const;
virtual const FitQualityOnSurface* fullStateFitQuality
(const TrackParameters&,const Amg::Vector2D&, const Amg::MatrixX&) const;
virtual const FitQualityOnSurface* fullStateFitQuality
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&) const;
virtual const FitQualityOnSurface* predictedStateFitQuality
(const TrackParameters&,const TrackParameters&) const;
virtual bool predictedStateFitQuality
(const PatternTrackParameters&,const Amg::Vector2D& ,const Amg::MatrixX&,int&,double&)
const;
virtual bool predictedStateFitQuality
(const PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,int&,double&)
const;
virtual bool fullStateFitQuality
(const PatternTrackParameters&,const Amg::Vector2D&, const Amg::MatrixX&,int&,double&)
const;
virtual bool fullStateFitQuality
(const PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,int&,double&)
const;
virtual bool predictedStateFitQuality
(const PatternTrackParameters&,const PatternTrackParameters&,double&) const;
///////////////////////////////////////////////////////////////////
// let the client tools know how the assumptions on the initial
// precision for non-measured track parameters are configured
///////////////////////////////////////////////////////////////////
virtual const std::vector<double> initialErrors() const;
protected:
///////////////////////////////////////////////////////////////////
// Protected methods
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Updators
///////////////////////////////////////////////////////////////////
const TrackParameters* update
(const TrackParameters&,const Amg::Vector2D&,const Amg::MatrixX&,
FitQualityOnSurface*&,int,bool) const;
const TrackParameters* update
(const TrackParameters&,const LocalParameters&,const Amg::MatrixX&,
FitQualityOnSurface*&,int,bool) const;
bool update
(PatternTrackParameters&,const Amg::Vector2D&,const Amg::MatrixX&,
int,bool,PatternTrackParameters&,double&,int&) const;
bool updateOneDimension
(PatternTrackParameters&,const Amg::Vector2D&,const Amg::MatrixX&,
int,bool,PatternTrackParameters&,double&) const;
bool update
(PatternTrackParameters&,const LocalParameters&,const Amg::MatrixX&,
int,bool,PatternTrackParameters&,double&,int&) const;
///////////////////////////////////////////////////////////////////
// Xi2 calculation
///////////////////////////////////////////////////////////////////
bool predictedStateFitQuality
(const double*,const Amg::Vector2D&,const Amg::MatrixX&,int&,double&) const;
bool fullStateFitQuality
(const double*,const Amg::Vector2D&,const Amg::MatrixX&,int&,double&) const;
///////////////////////////////////////////////////////////////////
// Converters
///////////////////////////////////////////////////////////////////
bool trackParametersToUpdator
(const TrackParameters&,double*,double*) const;
bool trackParametersToUpdator
(const PatternTrackParameters&,double*,double*) const;
bool localParametersToUpdator
(const LocalParameters&,const Amg::MatrixX&,int&,int&,double*,double*) const;
const TrackParameters* updatorToTrackParameters
(const TrackParameters&,double*,double*) const;
///////////////////////////////////////////////////////////////////
// Update no measured track parameters
///////////////////////////////////////////////////////////////////
bool updateNoMeasuredWithOneDim
(double*,double*,double*,double*) const;
bool updateNoMeasuredWithTwoDim
(double*,double*,double*,double*) const;
bool updateNoMeasuredWithAnyDim
(double*,double*,double*,double*,int) const;
///////////////////////////////////////////////////////////////////
// Update measured track parameters
///////////////////////////////////////////////////////////////////
bool updateWithOneDim
(int,bool,double*,double*,double*,double*,double&) const;
bool updateWithTwoDim
(int,bool,double*,double*,double*,double*,double&) const;
bool updateWithTwoDimParameters
(int,bool,double*,double*,double*,double*,double&) const;
bool updateWithFiveDim
( bool,double*,double*,double*,double*,double&) const;
bool updateWithAnyDim
(int,bool,double*,double*,double*,double*,double&,
int,int) const;
bool updateWithOneDimWithBoundary
(int,bool,double*,double*,double*,double*,double&) const;
bool updateWithTwoDimWithBoundary
(int,bool,double*,double*,double*,double*,double&) const;
bool invert (int,double*,double*) const;
bool invert2( double*,double*) const;
bool invert3( double*,double*) const;
bool invert4( double*,double*) const;
bool invert5( double*,double*) const;
double Xi2 (int,double*,double*) const;
double Xi2for1( double*,double*) const;
double Xi2for2( double*,double*) const;
double Xi2for3( double*,double*) const;
double Xi2for4( double*,double*) const;
double Xi2for5( double*,double*) const;
int differenceParLoc(int,double*,double*,double*) const;
void differenceLocPar(int,double*,double*,double*) const;
void testAngles(double*,double*) const;
void mapKeyProduction();
///////////////////////////////////////////////////////////////////
// Protected data members
///////////////////////////////////////////////////////////////////
std::vector<double> m_cov0;
unsigned int m_key[ 33];
unsigned int m_map[160];
double m_covBoundary;
};
/////////////////////////////////////////////////////////////////////////////////
// Inline methods
/////////////////////////////////////////////////////////////////////////////////
} // end of namespace
#endif // TRK_KALMANUPDATOR_XK_H
package TrkMeasurementUpdator_xk
author Igor Gavrilenko <Igor.Gavrilenko@cern.ch>
private
use GaudiInterface GaudiInterface-* External
use TrkPatternParameters TrkPatternParameters-* Tracking/TrkEvent
use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
use TrkParameters TrkParameters-* Tracking/TrkEvent
public
use AtlasPolicy AtlasPolicy-*
use AthenaBaseComps AthenaBaseComps-* Control
use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools
library TrkMeasurementUpdator_xk *.cxx components/*.cxx
apply_pattern component_library
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
i/**
@mainpage The TrkMeasurementUpdator_xk package
@section introTrkMeasurementUpdatorXK Overview
The TrkMeasurementUpdator_xk package implements the core mathematics
for Kalman filter-based track fitters. It provides the calculations
to add or remove a measurement to/from the state vector of a track
using fast mathematic routines and a simple internal data model.
It inherits from two abstract interfaces, Trk::IUpdator and Trk::IPatternParametersUpdator,
and implements the following operations:
- addition of a measurement to a (predicted) track states in local coordinates (i.e. the Kalman filter step)
- removal of a measurement from a track state (inverse filter)
- calculation of Chi2/ndf together with the above operation as well as in separate methods
- operates on Trk::LocalParameters of any dimension (1-5) and definition
- operates also on Trk::LocalPosition
If retrieved under the Trk::IUpdator interface, the Trk::KalmanUpdator_xk provides a set of
updating-tools for EDM Trk::TrackParameters.<br>
If retrieved under the Trk::IPatternParametersUpdator interface, the
Trk::KalmanUpdator_xk provides a set of methods for manipulating
Trk::PatternTrackParameters.<br>
The code has been migrated from the xKalman package to this module.
@author Igor Gavrilenko
@section RefsTrkMeasurementUpdatorXK References
R. Fruehwirth, <i>Application of Kalman filtering</i>, NIM A262, 446<br>
R. Fruehwirth, et al., <i>Data Analysis Techniques for High-Energy Physics</i>, 2nd ed.
@section ExtrasTrkMeasurementUpdatorXK Extra Pages
- @ref UsedTrkMeasurementUpdatorXK
- @ref requirementsTrkMeasurementUpdatorXK
*/
/**
@page UsedTrkMeasurementUpdatorXK Used Packages
@htmlinclude used_packages.html
*/
/**
@page requirementsTrkMeasurementUpdatorXK Requirements
@include requirements
*/
#include "TrkMeasurementUpdator_xk/KalmanUpdator_xk.h"
#include "GaudiKernel/DeclareFactoryEntries.h"
using namespace Trk;
DECLARE_TOOL_FACTORY( KalmanUpdator_xk )
DECLARE_FACTORY_ENTRIES( TrkMeasurementUpdator_xk )
{
DECLARE_TOOL( KalmanUpdator_xk )
}
#include "GaudiKernel/LoadFactoryEntries.h"
LOAD_FACTORY_ENTRIES(TrkMeasurementUpdator_xk)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment