PandaRoot
DAF.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2013, Ludwig-Maximilians Universität München,
14  Authors: Tobias Schlüter & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
35 #ifndef genfit_DAF_h
36 #define genfit_DAF_h
37 
38 #include "AbsKalmanFitter.h"
39 
40 #include <vector>
41 #include <map>
42 
43 namespace genfit {
44 
59 class DAF : public AbsKalmanFitter {
60 
61  private:
62  DAF(const DAF &);
63  DAF &operator=(genfit::DAF const &);
64 
65  public:
71  DAF(bool useRefKalman = true, double deltaWeight = 1e-3, double deltaPval = 1e-3);
75  DAF(AbsKalmanFitter *kalman, double deltaWeight = 1e-3, double deltaPval = 1e-3);
76  ~DAF(){};
77 
79  void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits = false);
80 
87  void setProbCut(const double prob_cut);
88 
90  void addProbCut(const double prob_cut, const int measDim);
91 
98  void setBetas(double b1, double b2 = -1, double b3 = -1., double b4 = -1., double b5 = -1., double b6 = -1., double b7 = -1., double b8 = -1., double b9 = -1., double b10 = -1.);
99 
100  const std::vector<double> &getBetas() { return betas_; }
101 
107  void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps);
108 
109  void setMaxIterations(unsigned int n)
110  {
111  maxIterations_ = n;
112  betas_.resize(maxIterations_, betas_.back());
113  }
114 
116  void setConvergenceDeltaWeight(double delta) { deltaWeight_ = delta; }
117 
118  AbsKalmanFitter *getKalman() const { return kalman_.get(); }
119 
120  virtual void setMaxFailedHits(int val) { getKalman()->setMaxFailedHits(val); }
121 
122  virtual void setDebugLvl(unsigned int lvl = 1)
123  {
125  if (lvl > 1)
126  getKalman()->setDebugLvl(lvl - 1);
127  }
128 
129  private:
134  bool calcWeights(Track *trk, const AbsTrackRep *rep, double beta);
135 
136  double deltaWeight_; // convergence criterium
137  std::vector<double> betas_; // Temperatures, NOT inverse temperatures.
138  double chi2Cuts_[7]; // '7' assumes tracks are helices with one
139  // parameter, i.e. we're living in 3D space,
140  // where time may be used in the fit. Zeroth
141  // entry is not used.
142 #ifndef __CINT__
143  boost::scoped_ptr<AbsKalmanFitter> kalman_;
144 #else
145  AbsKalmanFitter *kalman_;
146 #endif
147 
148  public:
149  ClassDef(DAF, 2)
150 };
151 
152 } /* End of namespace genfit */
155 #endif // genfit_DAF_h
void setMaxIterations(unsigned int n)
Set the maximum number of iterations.
Definition: DAF.h:109
virtual void setDebugLvl(unsigned int lvl=1)
Definition: AbsFitter.h:61
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:79
Abstract base class for a track representation.
Definition: AbsTrackRep.h:74
void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps)
Configure the annealing scheme.
Determinstic Annealing Filter (DAF) implementation.
Definition: DAF.h:59
Abstract base class for Kalman fitter and derived fitting algorithms.
AbsKalmanFitter * getKalman() const
Definition: DAF.h:118
virtual void setMaxFailedHits(int val)
void setConvergenceDeltaWeight(double delta)
If all weights change less than delta between two iterations, the fit is regarded as converged...
Definition: DAF.h:116
void addProbCut(const double prob_cut, const int measDim)
Set the probability cut for the weight calculation for the hits for a specific measurement dimensiona...
virtual void setDebugLvl(unsigned int lvl=1)
Definition: DAF.h:122
virtual void setMaxFailedHits(int val)
Definition: DAF.h:120
void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits=false)
Process a track using the DAF.
void setProbCut(const double prob_cut)
Set the probability cut for the weight calculation for the hits.
const std::vector< double > & getBetas()
Definition: DAF.h:100
~DAF()
Definition: DAF.h:76
unsigned int maxIterations_
Maximum number of iterations to attempt. Forward and backward are counted as one iteration.
void setBetas(double b1, double b2=-1, double b3=-1., double b4=-1., double b5=-1., double b6=-1., double b7=-1., double b8=-1., double b9=-1., double b10=-1.)
Configure the annealing scheme.
Matrix inversion tools.
Definition: AbsBField.h:40