GENFIT  Rev:NoNumberAvailable
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 
32 namespace genfit {
33 
48 class DAF : public AbsKalmanFitter {
49 
50  private:
51 
52  DAF(const DAF&);
53  DAF& operator=(genfit::DAF const&);
54 
55  public:
56 
62  DAF(bool useRefKalman = true, double deltaWeight = 1e-3, double deltaPval = 1e-3);
66  DAF(AbsKalmanFitter* kalman, double deltaWeight = 1e-3, double deltaPval = 1e-3);
67  ~DAF() {};
68 
70  void processTrackWithRep(Track* tr, const AbsTrackRep* rep, bool resortHits = false);
71 
78  void setProbCut(const double prob_cut);
79 
81  void addProbCut(const double prob_cut, const int measDim);
82 
89  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.);
90 
91  const std::vector<double>& getBetas() {return betas_;}
92 
98  void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps);
99 
100  void setMaxIterations(unsigned int n) {maxIterations_ = n; betas_.resize(maxIterations_,betas_.back());}
101 
103  void setConvergenceDeltaWeight(double delta) {deltaWeight_ = delta;}
104 
105  AbsKalmanFitter* getKalman() const {return kalman_.get();}
106 
107  virtual void setMaxFailedHits(int val) {getKalman()->setMaxFailedHits(val);}
108 
109  virtual void setDebugLvl(unsigned int lvl = 1) {AbsFitter::setDebugLvl(lvl); if (lvl > 1) getKalman()->setDebugLvl(lvl-1);}
110 
111  private:
112 
117  bool calcWeights(Track* trk, const AbsTrackRep* rep, double beta);
118 
119 
120  double deltaWeight_; // convergence criterium
121  std::vector<double> betas_; // Temperatures, NOT inverse temperatures.
122  double chi2Cuts_[7]; // '7' assumes tracks are helices with one
123  // parameter, i.e. we're living in 3D space,
124  // where time may be used in the fit. Zeroth
125  // entry is not used.
126 #ifndef __CINT__
127  boost::scoped_ptr<AbsKalmanFitter> kalman_;
128 #else
130 #endif
131 
132  public:
133 
134  ClassDef(DAF,2)
135 
136 };
137 
138 } /* End of namespace genfit */
141 #endif //genfit_DAF_h
genfit::Track
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:71
genfit::DAF::getBetas
const std::vector< double > & getBetas()
Definition: DAF.h:91
genfit::DAF::setAnnealingScheme
void setAnnealingScheme(double bStart, double bFinal, unsigned int nSteps)
Configure the annealing scheme.
Definition: DAF.cc:231
genfit::DAF::DAF
DAF(const DAF &)
genfit::DAF::setDebugLvl
virtual void setDebugLvl(unsigned int lvl=1)
Definition: DAF.h:109
genfit::DAF::setConvergenceDeltaWeight
void setConvergenceDeltaWeight(double delta)
If all weights change less than delta between two iterations, the fit is regarded as converged.
Definition: DAF.h:103
genfit::DAF::deltaWeight_
double deltaWeight_
Definition: DAF.h:120
genfit::DAF::setBetas
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.
Definition: DAF.cc:195
genfit::DAF::addProbCut
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...
Definition: DAF.cc:180
genfit::DAF::operator=
DAF & operator=(genfit::DAF const &)
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::DAF::setMaxFailedHits
virtual void setMaxFailedHits(int val)
Definition: DAF.h:107
genfit::DAF::chi2Cuts_
double chi2Cuts_[7]
Definition: DAF.h:122
genfit::DAF::setProbCut
void setProbCut(const double prob_cut)
Set the probability cut for the weight calculation for the hits.
Definition: DAF.cc:174
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
AbsKalmanFitter.h
genfit::DAF::~DAF
~DAF()
Definition: DAF.h:67
genfit::AbsFitter::setDebugLvl
virtual void setDebugLvl(unsigned int lvl=1)
Definition: AbsFitter.h:50
genfit::DAF::getKalman
AbsKalmanFitter * getKalman() const
Definition: DAF.h:105
genfit::AbsKalmanFitter
Abstract base class for Kalman fitter and derived fitting algorithms.
Definition: AbsKalmanFitter.h:51
genfit::DAF::betas_
std::vector< double > betas_
Definition: DAF.h:121
genfit::DAF::calcWeights
bool calcWeights(Track *trk, const AbsTrackRep *rep, double beta)
Calculate and set the weights for the next fitting pass. Return if convergence is met....
Definition: DAF.cc:255
genfit::AbsKalmanFitter::maxIterations_
unsigned int maxIterations_
Maximum number of iterations to attempt. Forward and backward are counted as one iteration.
Definition: AbsKalmanFitter.h:141
genfit::DAF::setMaxIterations
void setMaxIterations(unsigned int n)
Set the maximum number of iterations.
Definition: DAF.h:100
genfit::DAF
Determinstic Annealing Filter (DAF) implementation.
Definition: DAF.h:48
genfit::DAF::processTrackWithRep
void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits=false)
Process a track using the DAF.
Definition: DAF.cc:76
genfit::AbsKalmanFitter::setMaxFailedHits
virtual void setMaxFailedHits(int val)
Definition: AbsKalmanFitter.h:124
genfit::DAF::kalman_
boost::scoped_ptr< AbsKalmanFitter > kalman_
Definition: DAF.h:127