/* Copyright 2008-2010, Technische Universitaet Muenchen, Authors: Christian Hoeppner & Sebastian Neubert This file is part of GENFIT. GENFIT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. GENFIT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GENFIT. If not, see . */ /** @addtogroup genfit * @{ */ #ifndef GFKALMAN_H #define GFKALMAN_H #include #include #include "TMatrixT.h" class GFAbsRecoHit; class GFAbsTrackRep; class GFTrack; /** @brief Generic Kalman Filter implementation * * @author Christian Höppner (Technische Universität München, original author) * @author Sebastian Neubert (Technische Universität München, original author) * * The Kalman Filter operates on genfit GFTrack objects. It is an implementation * of the Kalman Filter algebra that uses the genfit interface classes * GFAbsRecoHit and GFAbsTrackRep in order to be independent from the specific * detector geometry and the details of the track parameterization / * track extraoplation engine. * * The Kalman Filter can use hits from several detectors in a single fit * to estimate the parameters of several track representations in parallel. */ class GFKalman { public: //friend class KalmanTester; // gives the Tester access to private methods // Constructors/Destructors --------- GFKalman(); ~GFKalman(); // Operators /** @brief Operator for use with STL. * * This operator allows to use the std::foreach algorithm with an * STL container o GFTrack* objects. */ inline void operator()(GFTrack* track){processTrack(track);} /** @brief Operator for use with STL. * * This operator allows to use the std::foreach algorithm with an * STL container o GFTrack* objects. */ inline void operator()(std::pair tr){processTrack(tr.second);} // Operations ---------------------- /** @brief Switch lazy error handling. * * This is a historically left-over method and shall be deleted some time */ void setLazy(Int_t flag){std::cerr<<"Using outdates setLazy method of class GFKalman:"< calcGain(const TMatrixT& cov, const TMatrixT& HitCov, const TMatrixT& H); /** @brief this returns the reduced chi2 increment for a hit */ double chi2Increment(const TMatrixT& r,const TMatrixT& H, const TMatrixT& cov,const TMatrixT& V); /** @brief this is needed to blow up the covariance matrix before a fitting pass * drops off-diagonal elements and blows up diagonal by blowUpFactor */ void blowUpCovs(GFTrack* trk); int fInitialDirection; Int_t fNumIt; double fBlowUpFactor; bool fSmooth; }; #endif /** @} */