CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
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, const TVectorT<double>& lambda, const TMatrixT<double>& D, const TVectorT<double>& d);
58  double chiSquareUsingInitalPoint(const TVectorT<double>& alpha,const TVectorT<double>& lambda);
59  double constraintDelta(const TVectorT<double>& par);
60  TMatrixT<double> computeVariance();
61 
62  // Configuration parameters
64 
65  // Fit variables
67 
68  // covariances and derivatives info
69  TMatrixTSym<double> V_alpha0_inv_;
70  TMatrixT<double> D_;
71  TMatrixTSym<double> V_D_;
72  double ScaleFactor_;
73  TMatrixT<double> V_corr_prev_;
74 };
75 
76 }
77 #endif
virtual LorentzVectorParticle getMother()=0
float alpha
Definition: AMPTWrapper.h:95
virtual TVectorD value(const TVectorD &v)=0
tuple d
Definition: ztail.py:151
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
virtual std::vector< LorentzVectorParticle > getRefitDaughters()=0
double chiSquareUsingInitalPoint(const TVectorT< double > &alpha, const TVectorT< double > &lambda)
double constraintDelta(const TVectorT< double > &par)
int weight
Definition: histoStyle.py:50