/* Copyright 2011, Technische Universitaet Muenchen,
Authors: Karl Bicker, Christian Hoeppner
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 GFDAF_H
#define GFDAF_H
#include
#include
#include
#include
#include
#include
#include
#include
/** @brief Determinstic Annealing Filter (DAF) implementation.
*
* @author Christian Höppner (Technische Universität München, original author)
* @author Karl Bicker (Technische Universität München)
*
* The DAF is an iterative Kalman filter with annealing. It is capable of
* fitting tracks which are contaminated with noise hits. The algorithm is
* taken from the references R. Fruehwirth & A. Strandlie, Computer Physics
* Communications 120 (1999) 197-214 and CERN thesis: Dissertation by Matthias
* Winkler.
*/
class GFDaf: GFKalman {
public:
GFDaf();
~GFDaf() { };
/** @brief Process a track using the DAF.
*/
void processTrack(GFTrack* trk);
/** @brief Return the weights present after the track was processed.
*
* The DAF uses special effective hits defined in the class GFDafHit. A
* GFDafHit is a wrappe class and contains all the real hits from one plane.
* The structure of the return vector of getWeights allows to reconstruct in
* what way the hits were grouped: the outermost vector represents the track
* representation, there is one entry per track representation. The middle
* vector represents the effective hits, and the innermost vector contains
* the real hits contained in the corresponding effective hit.
*/
const std::vector > > getWeights() { return fWeights; };
/** @brief Set the probabilty cut for the weight calculation for the hits.
*
* Currently supported are the values 0.01 0.005, and 0.001. The
* corresponding chi2 cuts for different hits dimensionalities are hardcoded
* in the implementation because I did not yet figure out how to calculate
* them. Please feel very welcome to change the implementtion if you know how
* to do it.
*/
void setProbCut(double prob_cut);
/** @brief Configure the annealing scheme.
*
* In the current implementation you need to provide at least two temperatures.
* The maximum would ten tempertatures.
*/
void setBetas(double b1,double b2,double b3=-1.,double b4=-1.,double b5=-1.,double b6=-1.,double b7=-1.,double b8=-1.,double b9=-1.,double b10=-1.);
private:
/** @brief Initialize the GFDafHit and their weights before the fit.
*/
std::vector initHitsWeights(GFTrack* trk);
/** @brief Calculate the weights for the next fitting pass.
*/
std::vector > calcWeights(GFTrack* trk, double beta);
/** @brief Copy the smoothing matrices from the source track to the target.
*/
void copySmoothing(GFTrack* source, GFTrack* target, int target_ire);
std::vector > > fWeights;
std::vector fBeta;
std::map fchi2Cuts;
};
#endif
/** @} */