MINT2
Public Member Functions | Private Attributes | List of all members
GaussianConstraintChi2 Class Reference

#include <GaussianConstraintChi2.h>

Inheritance diagram for GaussianConstraintChi2:
MINT::Minimisable MINT::IMinimisable

Public Member Functions

 GaussianConstraintChi2 (MINT::MinuitParameterSet *)
 
virtual ~GaussianConstraintChi2 ()
 
virtual double getVal () override
 
- Public Member Functions inherited from MINT::Minimisable
 Minimisable (MinuitParameterSet *mps=0)
 
 Minimisable (const Minimisable &other)
 
virtual ~Minimisable ()
 
void setPset (MinuitParameterSet *mps)
 
MinuitParameterSetgetParSet ()
 
virtual void beginFit ()
 
virtual void parametersChanged ()
 
virtual void endFit ()
 
double getNewVal ()
 
- Public Member Functions inherited from MINT::IMinimisable
virtual void Gradient (std::vector< double > &grad)
 
virtual bool useAnalyticGradient ()
 
virtual void setUseAnalyticGradient (bool useAnalyticGradient)
 
virtual ~IMinimisable ()
 

Private Attributes

MINT::MinuitParameterSet::CovMatrix m_covMatrixInv
 

Detailed Description

Definition at line 6 of file GaussianConstraintChi2.h.

Constructor & Destructor Documentation

◆ GaussianConstraintChi2()

GaussianConstraintChi2::GaussianConstraintChi2 ( MINT::MinuitParameterSet parset)

Definition at line 5 of file GaussianConstraintChi2.cpp.

5  :
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 }
MINT::MinuitParameterSet::CovMatrix m_covMatrixInv
IMinuitParameter * getParPtr(unsigned int i)
unsigned int size() const
Minimisable(MinuitParameterSet *mps=0)
Definition: Minimisable.cpp:6
virtual double stepInit() const =0
const CovMatrix & covMatrix() const
Get the covariance matrix.

◆ ~GaussianConstraintChi2()

virtual GaussianConstraintChi2::~GaussianConstraintChi2 ( )
inlinevirtual

Definition at line 11 of file GaussianConstraintChi2.h.

11 {} ;

Member Function Documentation

◆ getVal()

double GaussianConstraintChi2::getVal ( )
overridevirtual

Implements MINT::Minimisable.

Definition at line 19 of file GaussianConstraintChi2.cpp.

19  {
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
virtual double mean() const =0
MinuitParameterSet * getParSet()
Definition: Minimisable.cpp:25

Member Data Documentation

◆ m_covMatrixInv

MINT::MinuitParameterSet::CovMatrix GaussianConstraintChi2::m_covMatrixInv
private

Definition at line 8 of file GaussianConstraintChi2.h.


The documentation for this class was generated from the following files: