CMS 3D CMS Logo

LagrangeMultipliersFitter.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_ImpactParameter_LagrangeMultipliersFitter_h
2 #define RecoTauTag_ImpactParameter_LagrangeMultipliersFitter_h
3 
4 /* From SimpleFits Package
5  * Designed an written by
6  * author: Ian M. Nugent
7  * Humboldt Foundations
8  */
9 
11 #include "TMatrixT.h"
12 #include "TVectorT.h"
13 #include "TMatrixTSym.h"
14 #include <vector>
15 
16 namespace tauImpactParameter {
17 
19  public:
20  enum Position { pos_x = 0, pos_y, pos_z, nposdim };
23 
26 
27  virtual void setWeight(double weight) { weight_ = weight; }
28  virtual void setMaxDelta(double MaxDelta) { maxDelta_ = MaxDelta; }
29  virtual void setNIterMax(int Nitermax) { nitermax_ = Nitermax; }
30 
31  virtual bool fit();
32  virtual bool isConverged();
33  virtual bool isConfigured() { return isConfigured_; }
34  virtual double chiSquare() { return chi2_; }
35  virtual double cSum() { return delta_; };
36  virtual double nIter() { return niter_; };
37  virtual double nConstraints() = 0;
38  virtual double ndf() = 0;
39  virtual int nDaughters() = 0;
40 
41  virtual std::vector<LorentzVectorParticle> getRefitDaughters() = 0;
42  virtual LorentzVectorParticle getMother() = 0;
43 
44  protected:
45  virtual TVectorD value(const TVectorD& v) = 0;
46 
47  TVectorD par_0_; // parameter values for linearization point
48  TVectorD par_; // current parameter values
49  TMatrixTSym<double> cov_0_; //covariance matrix for linearization point (corresponding to par_0)
50  TMatrixTSym<double> cov_; // current covariance matrix (corresponding to par)
52  bool isFit_;
53 
54  private:
56  TMatrixT<double> derivative();
57  double chiSquare(const TVectorT<double>& delta_alpha,
58  const TVectorT<double>& lambda,
59  const TMatrixT<double>& D,
60  const TVectorT<double>& d);
61  double chiSquareUsingInitalPoint(const TVectorT<double>& alpha, const TVectorT<double>& lambda);
62  double constraintDelta(const TVectorT<double>& par);
63  TMatrixT<double> computeVariance();
64 
65  // Configuration parameters
67 
68  // Fit variables
70 
71  // covariances and derivatives info
72  TMatrixTSym<double> V_alpha0_inv_;
73  TMatrixT<double> D_;
74  TMatrixTSym<double> V_D_;
75  double ScaleFactor_;
76  TMatrixT<double> V_corr_prev_;
77  };
78 
79 } // namespace tauImpactParameter
80 #endif
virtual LorentzVectorParticle getMother()=0
float alpha
Definition: AMPTWrapper.h:105
virtual TVectorD value(const TVectorD &v)=0
Definition: weight.py:1
d
Definition: ztail.py:151
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
virtual std::vector< LorentzVectorParticle > getRefitDaughters()=0
double chiSquareUsingInitalPoint(const TVectorT< double > &alpha, const TVectorT< double > &lambda)
double constraintDelta(const TVectorT< double > &par)