PandaRoot
DAF.h
Go to the documentation of this file.
1 /* Copyright 2013, Ludwig-Maximilians Universität München,
2  Authors: Tobias Schlüter & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
23 #ifndef genfit_DAF_h
24 #define genfit_DAF_h
25 
26 #include "AbsKalmanFitter.h"
27 
28 #include <vector>
29 #include <map>
30 
31 namespace genfit {
32 
47 class DAF : public AbsKalmanFitter {
48 
49  private:
50  DAF(const DAF &);
51  DAF &operator=(genfit::DAF const &);
52 
53  public:
59  DAF(bool useRefKalman = true, double deltaWeight = 1e-3, double deltaPval = 1e-3);
63  DAF(AbsKalmanFitter *kalman, double deltaWeight = 1e-3, double deltaPval = 1e-3);
64  ~DAF(){};
65 
67  void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits = false);
68 
75  void setProbCut(const double prob_cut);
76 
78  void addProbCut(const double prob_cut, const int measDim);
79 
86  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.);
87 
88  const std::vector<double> &getBetas() { return betas_; }
89 
95  void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps);
96 
97  void setMaxIterations(unsigned int n)
98  {
99  maxIterations_ = n;
100  betas_.resize(maxIterations_, betas_.back());
101  }
102 
104  void setConvergenceDeltaWeight(double delta) { deltaWeight_ = delta; }
105 
106  AbsKalmanFitter *getKalman() const { return kalman_.get(); }
107 
108  virtual void setMaxFailedHits(int val) { getKalman()->setMaxFailedHits(val); }
109 
110  virtual void setDebugLvl(unsigned int lvl = 1)
111  {
113  if (lvl > 1)
114  getKalman()->setDebugLvl(lvl - 1);
115  }
116 
117  private:
122  bool calcWeights(Track *trk, const AbsTrackRep *rep, double beta);
123 
124  double deltaWeight_; // convergence criterium
125  std::vector<double> betas_; // Temperatures, NOT inverse temperatures.
126  double chi2Cuts_[7]; // '7' assumes tracks are helices with one
127  // parameter, i.e. we're living in 3D space,
128  // where time may be used in the fit. Zeroth
129  // entry is not used.
130 #ifndef __CINT__
131  boost::scoped_ptr<AbsKalmanFitter> kalman_;
132 #else
133  AbsKalmanFitter *kalman_;
134 #endif
135 
136  public:
137  ClassDef(DAF, 2)
138 };
139 
140 } /* End of namespace genfit */
143 #endif // genfit_DAF_h
void setMaxIterations(unsigned int n)
Set the maximum number of iterations.
Definition: DAF.h:97
virtual void setDebugLvl(unsigned int lvl=1)
Definition: AbsFitter.h:49
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:67
Abstract base class for a track representation.
Definition: AbsTrackRep.h:62
void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps)
Configure the annealing scheme.
Determinstic Annealing Filter (DAF) implementation.
Definition: DAF.h:47
Abstract base class for Kalman fitter and derived fitting algorithms.
AbsKalmanFitter * getKalman() const
Definition: DAF.h:106
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:104
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:110
virtual void setMaxFailedHits(int val)
Definition: DAF.h:108
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:88
~DAF()
Definition: DAF.h:64
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:28