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
tauImpactParameter::LagrangeMultipliersFitter::pos_z
Definition: LagrangeMultipliersFitter.h:20
tauImpactParameter::LagrangeMultipliersFitter::chiSquare
virtual double chiSquare()
Definition: LagrangeMultipliersFitter.h:34
tauImpactParameter::LagrangeMultipliersFitter::chi2_
double chi2_
Definition: LagrangeMultipliersFitter.h:69
tauImpactParameter::LagrangeMultipliersFitter::getRefitDaughters
virtual std::vector< LorentzVectorParticle > getRefitDaughters()=0
tauImpactParameter::LagrangeMultipliersFitter::par_
TVectorD par_
Definition: LagrangeMultipliersFitter.h:48
tauImpactParameter::LorentzVectorParticle
Definition: LorentzVectorParticle.h:17
tauImpactParameter::LagrangeMultipliersFitter::ConstraintMin
Definition: LagrangeMultipliersFitter.h:22
tauImpactParameter::LagrangeMultipliersFitter::par_vy
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::pos_y
Definition: LagrangeMultipliersFitter.h:20
tauImpactParameter::LagrangeMultipliersFitter::setMaxDelta
virtual void setMaxDelta(double MaxDelta)
Definition: LagrangeMultipliersFitter.h:28
tauImpactParameter::LagrangeMultipliersFitter::maxDelta_
double maxDelta_
Definition: LagrangeMultipliersFitter.h:66
tauImpactParameter::LagrangeMultipliersFitter::cov_
TMatrixTSym< double > cov_
Definition: LagrangeMultipliersFitter.h:50
mps_merge.weight
weight
Definition: mps_merge.py:88
tauImpactParameter::LagrangeMultipliersFitter::derivative
TMatrixT< double > derivative()
Definition: LagrangeMultipliersFitter.cc:135
tauImpactParameter::LagrangeMultipliersFitter::par_px
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::Chi2Min
Definition: LagrangeMultipliersFitter.h:22
tauImpactParameter::LagrangeMultipliersFitter::par_pz
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::LagrangeMultipliersFitter
LagrangeMultipliersFitter()
Definition: LagrangeMultipliersFitter.cc:13
tauImpactParameter
Definition: Chi2VertexFitter.h:14
tauImpactParameter::LagrangeMultipliersFitter::Parameters
Parameters
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::chiSquareUsingInitalPoint
double chiSquareUsingInitalPoint(const TVectorT< double > &alpha, const TVectorT< double > &lambda)
Definition: LagrangeMultipliersFitter.cc:170
alpha
float alpha
Definition: AMPTWrapper.h:105
tauImpactParameter::LagrangeMultipliersFitter::V_corr_prev_
TMatrixT< double > V_corr_prev_
Definition: LagrangeMultipliersFitter.h:76
findQualityFiles.v
v
Definition: findQualityFiles.py:179
tauImpactParameter::LagrangeMultipliersFitter::chi2prev_
double chi2prev_
Definition: LagrangeMultipliersFitter.h:69
tauImpactParameter::LagrangeMultipliersFitter::weight_
double weight_
Definition: LagrangeMultipliersFitter.h:66
tauImpactParameter::LagrangeMultipliersFitter::applyLagrangianConstraints
bool applyLagrangianConstraints()
Definition: LagrangeMultipliersFitter.cc:50
tauImpactParameter::LagrangeMultipliersFitter::par_py
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::epsilon_
double epsilon_
Definition: LagrangeMultipliersFitter.h:66
tauImpactParameter::LagrangeMultipliersFitter::nIter
virtual double nIter()
Definition: LagrangeMultipliersFitter.h:36
tauImpactParameter::LagrangeMultipliersFitter::nitermax_
double nitermax_
Definition: LagrangeMultipliersFitter.h:66
tauImpactParameter::LagrangeMultipliersFitter::ConvergeProc
ConvergeProc
Definition: LagrangeMultipliersFitter.h:22
tauImpactParameter::LagrangeMultipliersFitter::par_vx
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::constraintDelta
double constraintDelta(const TVectorT< double > &par)
Definition: LagrangeMultipliersFitter.cc:202
tauImpactParameter::LagrangeMultipliersFitter::fit
virtual bool fit()
Definition: LagrangeMultipliersFitter.cc:24
LorentzVectorParticle.h
tauImpactParameter::LagrangeMultipliersFitter::isFit_
bool isFit_
Definition: LagrangeMultipliersFitter.h:52
tauImpactParameter::LagrangeMultipliersFitter::isConverged
virtual bool isConverged()
Definition: LagrangeMultipliersFitter.cc:155
tauImpactParameter::LagrangeMultipliersFitter::ndf
virtual double ndf()=0
tauImpactParameter::LagrangeMultipliersFitter::ScaleFactor_
double ScaleFactor_
Definition: LagrangeMultipliersFitter.h:75
tauImpactParameter::LagrangeMultipliersFitter::isConfigured
virtual bool isConfigured()
Definition: LagrangeMultipliersFitter.h:33
tauImpactParameter::LagrangeMultipliersFitter::setNIterMax
virtual void setNIterMax(int Nitermax)
Definition: LagrangeMultipliersFitter.h:29
tauImpactParameter::LagrangeMultipliersFitter::V_D_
TMatrixTSym< double > V_D_
Definition: LagrangeMultipliersFitter.h:74
tauImpactParameter::LagrangeMultipliersFitter::delta_
double delta_
Definition: LagrangeMultipliersFitter.h:69
tauImpactParameter::LagrangeMultipliersFitter::value
virtual TVectorD value(const TVectorD &v)=0
tauImpactParameter::LagrangeMultipliersFitter::Position
Position
Definition: LagrangeMultipliersFitter.h:20
tauImpactParameter::LagrangeMultipliersFitter::par_vz
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::nposdim
Definition: LagrangeMultipliersFitter.h:20
tauImpactParameter::LagrangeMultipliersFitter::getMother
virtual LorentzVectorParticle getMother()=0
tauImpactParameter::LagrangeMultipliersFitter::isConfigured_
bool isConfigured_
Definition: LagrangeMultipliersFitter.h:51
tauImpactParameter::LagrangeMultipliersFitter::cSum
virtual double cSum()
Definition: LagrangeMultipliersFitter.h:35
tauImpactParameter::LagrangeMultipliersFitter::pos_x
Definition: LagrangeMultipliersFitter.h:20
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
tauImpactParameter::LagrangeMultipliersFitter::~LagrangeMultipliersFitter
virtual ~LagrangeMultipliersFitter()
Definition: LagrangeMultipliersFitter.h:25
tauImpactParameter::LagrangeMultipliersFitter
Definition: LagrangeMultipliersFitter.h:18
tauImpactParameter::LagrangeMultipliersFitter::nConstraints
virtual double nConstraints()=0
tauImpactParameter::LagrangeMultipliersFitter::D_
TMatrixT< double > D_
Definition: LagrangeMultipliersFitter.h:73
tauImpactParameter::LagrangeMultipliersFitter::computeVariance
TMatrixT< double > computeVariance()
Definition: LagrangeMultipliersFitter.cc:211
tauImpactParameter::LagrangeMultipliersFitter::nDaughters
virtual int nDaughters()=0
tauImpactParameter::LagrangeMultipliersFitter::V_alpha0_inv_
TMatrixTSym< double > V_alpha0_inv_
Definition: LagrangeMultipliersFitter.h:72
tauImpactParameter::LagrangeMultipliersFitter::npardim
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::setWeight
virtual void setWeight(double weight)
Definition: LagrangeMultipliersFitter.h:27
ztail.d
d
Definition: ztail.py:151
tauImpactParameter::LagrangeMultipliersFitter::niter_
double niter_
Definition: LagrangeMultipliersFitter.h:69
tauImpactParameter::LagrangeMultipliersFitter::Chi2AndConstaintMin
Definition: LagrangeMultipliersFitter.h:22
tauImpactParameter::LagrangeMultipliersFitter::par_0_
TVectorD par_0_
Definition: LagrangeMultipliersFitter.h:47
tauImpactParameter::LagrangeMultipliersFitter::par_m
Definition: LagrangeMultipliersFitter.h:21
tauImpactParameter::LagrangeMultipliersFitter::cov_0_
TMatrixTSym< double > cov_0_
Definition: LagrangeMultipliersFitter.h:49
weight
Definition: weight.py:1