MINT2
GaussianConstraintChi2.cpp
Go to the documentation of this file.
2 #include <TVectorT.h>
3 
6  Minimisable(parset),
7  m_covMatrixInv(parset->size())
8 {
9  if(parset->covMatrix().GetNcols() > 0){
10  m_covMatrixInv = parset->covMatrix() ;
11  }
12  else {
13  for(unsigned i = 0 ; i < parset->size() ; ++i)
14  m_covMatrixInv[i][i] = pow(parset->getParPtr(i)->stepInit(), 2) ;
15  }
16  m_covMatrixInv.Invert() ;
17 }
18 
20  TVectorT<double> diffs(getParSet()->size()) ;
21  for(unsigned i = 0 ; i < getParSet()->size() ; ++i){
22  auto* par = getParSet()->getParPtr(i) ;
23  diffs[i] = par->mean() - par->meanInit() ;
24  }
25  return m_covMatrixInv.Similarity(diffs) ;
26 }
MINT::MinuitParameterSet::CovMatrix m_covMatrixInv
IMinuitParameter * getParPtr(unsigned int i)
unsigned int size() const
MinuitParameterSet * getParSet()
Definition: Minimisable.cpp:25
virtual double stepInit() const =0
GaussianConstraintChi2(MINT::MinuitParameterSet *)
const CovMatrix & covMatrix() const
Get the covariance matrix.
virtual double getVal() override